From 278cecbc879248284d528954966df019b8e96d84 Mon Sep 17 00:00:00 2001 From: derplayer Date: Tue, 4 Sep 2018 22:16:48 +0200 Subject: [PATCH] * crash & other minor fixes --- Project/About.Designer.cs | 24 ++++++++++++++++++++++-- Project/About.cs | 5 +++++ Project/Form1.Designer.cs | 4 +--- Project/Form1.cs | 3 +++ Project/Loading.Designer.cs | 4 +++- Project/Loading.cs | 8 ++++++++ Project/Main/Core.cs | 27 +++++++++++++++++++++------ Project/Main/DataLogic.cs | 7 +++++-- 8 files changed, 68 insertions(+), 14 deletions(-) diff --git a/Project/About.Designer.cs b/Project/About.Designer.cs index 0498fe4..61e68d4 100644 --- a/Project/About.Designer.cs +++ b/Project/About.Designer.cs @@ -31,6 +31,7 @@ private void InitializeComponent() this.labelAbout = new System.Windows.Forms.Label(); this.aboutLabel = new System.Windows.Forms.Label(); this.vmuBox = new System.Windows.Forms.PictureBox(); + this.urlLink = new System.Windows.Forms.LinkLabel(); ((System.ComponentModel.ISupportInitialize)(this.vmuBox)).BeginInit(); this.SuspendLayout(); // @@ -50,9 +51,9 @@ private void InitializeComponent() this.aboutLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.aboutLabel.Location = new System.Drawing.Point(13, 47); this.aboutLabel.Name = "aboutLabel"; - this.aboutLabel.Size = new System.Drawing.Size(155, 20); + this.aboutLabel.Size = new System.Drawing.Size(277, 20); this.aboutLabel.TabIndex = 1; - this.aboutLabel.Text = "Created by derplayer"; + this.aboutLabel.Text = "Created by Derplayer and PhilYeahz - "; // // vmuBox // @@ -64,17 +65,35 @@ private void InitializeComponent() this.vmuBox.TabStop = false; this.vmuBox.Click += new System.EventHandler(this.vmuBox_Click); // + // urlLink + // + this.urlLink.AutoSize = true; + this.urlLink.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); + this.urlLink.Location = new System.Drawing.Point(286, 48); + this.urlLink.Name = "urlLink"; + this.urlLink.Size = new System.Drawing.Size(38, 20); + this.urlLink.TabIndex = 3; + this.urlLink.TabStop = true; + this.urlLink.Text = "Link"; + this.urlLink.VisitedLinkColor = System.Drawing.Color.Blue; + this.urlLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.urlLink_LinkClicked); + // // About // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.HighlightText; this.ClientSize = new System.Drawing.Size(415, 76); + this.Controls.Add(this.urlLink); this.Controls.Add(this.vmuBox); this.Controls.Add(this.aboutLabel); this.Controls.Add(this.labelAbout); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "About"; + this.ShowIcon = false; + this.ShowInTaskbar = false; this.Text = "About"; this.Load += new System.EventHandler(this.About_Load); ((System.ComponentModel.ISupportInitialize)(this.vmuBox)).EndInit(); @@ -87,5 +106,6 @@ private void InitializeComponent() private System.Windows.Forms.Label aboutLabel; public System.Windows.Forms.Label labelAbout; private System.Windows.Forms.PictureBox vmuBox; + private System.Windows.Forms.LinkLabel urlLink; } } \ No newline at end of file diff --git a/Project/About.cs b/Project/About.cs index 0ca0258..a6b2197 100644 --- a/Project/About.cs +++ b/Project/About.cs @@ -116,5 +116,10 @@ private void vmuBox_Click(object sender, EventArgs e) this.vmuBox.Image = null; this.vmuBox.Image = Resources.gfx[random.Next(0, Resources.gfx.Count)]; } + + private void urlLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start("https://github.com/derplayer/ShenmueHDTools"); + } } } diff --git a/Project/Form1.Designer.cs b/Project/Form1.Designer.cs index 21b965d..b67c328 100644 --- a/Project/Form1.Designer.cs +++ b/Project/Form1.Designer.cs @@ -355,8 +355,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.dataCollectorBindingSource)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); - - listViewColumnSorter = new ListViewColumnSorterExt(listViewMain); } #endregion @@ -392,7 +390,7 @@ private void InitializeComponent() private System.Windows.Forms.Button refreshButton; public System.Windows.Forms.ColumnHeader modifiedFlag; public System.Windows.Forms.ColumnHeader fileExt; - private ListViewColumnSorterExt listViewColumnSorter; + public ListViewColumnSorterExt listViewColumnSorter; } } diff --git a/Project/Form1.cs b/Project/Form1.cs index faeb4c8..846ea5e 100644 --- a/Project/Form1.cs +++ b/Project/Form1.cs @@ -199,6 +199,7 @@ private void MainWindow_Load(object sender, EventArgs e) listViewMain.AllowDrop = true; listViewMain.DragDrop += new DragEventHandler(listViewMain_DragDrop); listViewMain.DragEnter += new DragEventHandler(listViewMain_DragEnter); + listViewColumnSorter = new ListViewColumnSorterExt(listViewMain); } void listViewMain_DragEnter(object sender, DragEventArgs e) @@ -374,6 +375,8 @@ public int Compare(object x, object y) listviewX = (ListViewItem)x; listviewY = (ListViewItem)y; + if (listviewY.Text == "") return 0; //dirty bugfix for an bigfix + // Compare the two items compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text); diff --git a/Project/Loading.Designer.cs b/Project/Loading.Designer.cs index 0257601..16bf609 100644 --- a/Project/Loading.Designer.cs +++ b/Project/Loading.Designer.cs @@ -42,14 +42,16 @@ private void InitializeComponent() this.loadLabel.Size = new System.Drawing.Size(175, 39); this.loadLabel.TabIndex = 0; this.loadLabel.Text = "Working..."; + this.loadLabel.UseWaitCursor = true; // // vmuBox // - this.vmuBox.Location = new System.Drawing.Point(193, 12); + this.vmuBox.Location = new System.Drawing.Point(188, 12); this.vmuBox.Name = "vmuBox"; this.vmuBox.Size = new System.Drawing.Size(32, 32); this.vmuBox.TabIndex = 1; this.vmuBox.TabStop = false; + this.vmuBox.UseWaitCursor = true; // // Loading // diff --git a/Project/Loading.cs b/Project/Loading.cs index 93dc552..56c684a 100644 --- a/Project/Loading.cs +++ b/Project/Loading.cs @@ -17,6 +17,14 @@ public partial class Loading : Form public Loading() { InitializeComponent(); + try + { + ShowDialog(); + } + catch (Exception e) + { + + } } private void Loading_Load(object sender, EventArgs e) diff --git a/Project/Main/Core.cs b/Project/Main/Core.cs index 9db6e44..6d23feb 100644 --- a/Project/Main/Core.cs +++ b/Project/Main/Core.cs @@ -144,8 +144,8 @@ public void Export() { LockGUI(); data.Export(newSavePathDlg.FileName); - Program.MainWindowCore.toolStripStatusLabel1.Text = "Export executed!"; UnlockGUI(); + Program.MainWindowCore.toolStripStatusLabel1.Text = "Export executed!"; } } else @@ -173,15 +173,30 @@ public void UpdateGUI() public void LockGUI() { - loadingThread = new Thread(() => new Loading().ShowDialog()); - Program.MainWindowCore.Hide(); - loadingThread.Start(); + try + { + loadingThread = new Thread(() => new Loading()); + Program.MainWindowCore.Hide(); + loadingThread.Start(); + } + catch (Exception) + { + Program.MainWindowCore.Hide(); + } } public void UnlockGUI() { - loadingThread.Abort(); - Program.MainWindowCore.Show(); + try + { + loadingThread.Abort(); + Program.MainWindowCore.Show(); + } + catch (Exception) + { + Program.MainWindowCore.Show(); + } + } } } diff --git a/Project/Main/DataLogic.cs b/Project/Main/DataLogic.cs index da5dc88..b5d30bb 100644 --- a/Project/Main/DataLogic.cs +++ b/Project/Main/DataLogic.cs @@ -179,7 +179,10 @@ public List LoadCache(string path, string directory) catch (Exception e) { System.Diagnostics.Debug.WriteLine("Something broke..." + e); - MessageBox.Show("The shdcahe was created with an older verison that in incompatible! Please create a new project and try again!"); + MessageBox.Show("The loaded shdcahe was created with an older verison of ModTools, that is incompatible now!\n\n" + + "Please copy your modified files, create a new project and copy those over and try again!\n\n" + + "Remember: The fileextensions are also now changed (fewer unknowns)\n" + ); } UpdateGUI(); @@ -347,7 +350,7 @@ public void Export(string path) if (newFiles.Count <= 0) { MessageBox.Show("No files were modified! Export stopped!"); - + UpdateGUI(); return; }