Skip to content

Commit

Permalink
* crash & other minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
derplayer committed Sep 4, 2018
1 parent 1f0a020 commit 278cecb
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 14 deletions.
24 changes: 22 additions & 2 deletions Project/About.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Project/About.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}
4 changes: 1 addition & 3 deletions Project/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Project/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 3 additions & 1 deletion Project/Loading.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Project/Loading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
27 changes: 21 additions & 6 deletions Project/Main/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}

}
}
}
7 changes: 5 additions & 2 deletions Project/Main/DataLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ public List<FileStructure> 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();
Expand Down Expand Up @@ -347,7 +350,7 @@ public void Export(string path)
if (newFiles.Count <= 0)
{
MessageBox.Show("No files were modified! Export stopped!");

UpdateGUI();
return;
}

Expand Down

0 comments on commit 278cecb

Please sign in to comment.