diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 966115b..36ea46d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,7 +1,8 @@ 0.8 (02/11/2019) Added: Actual launch code for PC-98 games (How did I forget that). -Added: Drag/Drop support for game configuration. +Added: Drag/Drop support for game configuration Changed: Launching PC-98 games now simply replaces the hdi directory instead of the entire ini file. +Changed: Invalid textboxes turn red instead of giving you a message box/not doing anything. Fixed: PC-98 games not saving their status immediately. Fixed: Manually adding banners now checks if the image is valid/openable. diff --git a/Touhou Launcher/ConfigForm.Designer.cs b/Touhou Launcher/ConfigForm.Designer.cs index 55648b8..e1bb4ff 100644 --- a/Touhou Launcher/ConfigForm.Designer.cs +++ b/Touhou Launcher/ConfigForm.Designer.cs @@ -105,9 +105,9 @@ private void InitializeComponent() this.jpDir.Name = "jpDir"; this.jpDir.Size = new System.Drawing.Size(181, 20); this.jpDir.TabIndex = 2; - this.jpDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); - this.jpDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); this.jpDir.DragDrop += new System.Windows.Forms.DragEventHandler(this.Dir_DragDrop); + this.jpDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); + this.jpDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); // // enDir // @@ -116,9 +116,9 @@ private void InitializeComponent() this.enDir.Name = "enDir"; this.enDir.Size = new System.Drawing.Size(181, 20); this.enDir.TabIndex = 3; - this.enDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); - this.enDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); this.enDir.DragDrop += new System.Windows.Forms.DragEventHandler(this.Dir_DragDrop); + this.enDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); + this.enDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); // // customDir // @@ -127,9 +127,9 @@ private void InitializeComponent() this.customDir.Name = "customDir"; this.customDir.Size = new System.Drawing.Size(181, 20); this.customDir.TabIndex = 4; - this.customDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); - this.customDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); this.customDir.DragDrop += new System.Windows.Forms.DragEventHandler(this.Dir_DragDrop); + this.customDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); + this.customDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); // // browseJP // @@ -308,9 +308,9 @@ private void InitializeComponent() this.crapDir.Name = "crapDir"; this.crapDir.Size = new System.Drawing.Size(181, 20); this.crapDir.TabIndex = 20; - this.crapDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); - this.crapDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); this.crapDir.DragDrop += new System.Windows.Forms.DragEventHandler(this.Dir_DragDrop); + this.crapDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); + this.crapDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); // // customApplocale // @@ -393,9 +393,9 @@ private void InitializeComponent() this.bannerOnDir.Name = "bannerOnDir"; this.bannerOnDir.Size = new System.Drawing.Size(161, 20); this.bannerOnDir.TabIndex = 29; - this.bannerOnDir.LostFocus += new System.EventHandler(this.bannerDir_LostFocus); - this.bannerOnDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); this.bannerOnDir.DragDrop += new System.Windows.Forms.DragEventHandler(this.Dir_DragDrop); + this.bannerOnDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); + this.bannerOnDir.LostFocus += new System.EventHandler(this.bannerDir_LostFocus); // // bannerOffLabel // @@ -424,9 +424,9 @@ private void InitializeComponent() this.bannerOffDir.Name = "bannerOffDir"; this.bannerOffDir.Size = new System.Drawing.Size(161, 20); this.bannerOffDir.TabIndex = 32; - this.bannerOffDir.LostFocus += new System.EventHandler(this.bannerDir_LostFocus); - this.bannerOffDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); this.bannerOffDir.DragDrop += new System.Windows.Forms.DragEventHandler(this.Dir_DragDrop); + this.bannerOffDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); + this.bannerOffDir.LostFocus += new System.EventHandler(this.bannerDir_LostFocus); // // pc98Settings // @@ -491,9 +491,9 @@ private void InitializeComponent() this.hdiDir.Name = "hdiDir"; this.hdiDir.Size = new System.Drawing.Size(229, 20); this.hdiDir.TabIndex = 20; - this.hdiDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); - this.hdiDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); this.hdiDir.DragDrop += new System.Windows.Forms.DragEventHandler(this.Dir_DragDrop); + this.hdiDir.DragEnter += new System.Windows.Forms.DragEventHandler(this.Dir_DragEnter); + this.hdiDir.LostFocus += new System.EventHandler(this.Dir_LostFocus); // // bannerSettings // diff --git a/Touhou Launcher/ConfigForm.cs b/Touhou Launcher/ConfigForm.cs index 271911a..d119df0 100644 --- a/Touhou Launcher/ConfigForm.cs +++ b/Touhou Launcher/ConfigForm.cs @@ -108,9 +108,14 @@ private void Dir_LostFocus(object sender, EventArgs e) { if (File.Exists(((TextBox)sender).Text) || ((TextBox)sender).Text == "") { + ((TextBox)sender).BackColor = SystemColors.Window; int dirID = game > 4 ? MainForm.dirToNumber[((TextBox)sender).Name.Replace("Dir", "")] : 0; MainForm.curCfg.gameCFG[game].GameDir[dirID] = ((TextBox)sender).Text; } + else + { + ((TextBox)sender).BackColor = Color.Red; + } } private void Dir_DragEnter(object sender, DragEventArgs e) @@ -208,7 +213,7 @@ private void launch_Click(object sender, EventArgs e) } else { - MessageBox.Show(MainForm.rm.GetString("errorFileNotFound")); + MessageBox.Show(MainForm.rm.GetString("errorGameNotFound")); } } @@ -266,13 +271,16 @@ private void bannerDir_LostFocus(object sender, EventArgs e) } catch (OutOfMemoryException ex) { + MessageBox.Show(MainForm.rm.GetString("errorOpenImage") + ex); } catch (FileNotFoundException ex) { - MessageBox.Show(MainForm.rm.GetString("errorFileNotFound")); + ((TextBox)sender).BackColor = Color.Red; } } + else + ((TextBox)sender).BackColor = SystemColors.Window; } private void browseHDI_Click(object sender, EventArgs e) diff --git a/Touhou Launcher/MainForm.Designer.cs b/Touhou Launcher/MainForm.Designer.cs index 358c2ba..5aa9574 100644 --- a/Touhou Launcher/MainForm.Designer.cs +++ b/Touhou Launcher/MainForm.Designer.cs @@ -2158,7 +2158,6 @@ private void InitializeComponent() private System.Windows.Forms.ContextMenuStrip gameContextMenu; private System.Windows.Forms.ToolStripMenuItem configureToolStripMenuItem; - private System.Windows.Forms.ToolTip toolTip; private System.Windows.Forms.ContextMenuStrip customFolderContextMenu; private System.Windows.Forms.ToolStripMenuItem newCategoryToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem deleteCategoryToolStripMenuItem; @@ -2314,6 +2313,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem26; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem27; private System.Windows.Forms.Label label4; + public System.Windows.Forms.ToolTip toolTip; } } diff --git a/Touhou Launcher/MainForm.cs b/Touhou Launcher/MainForm.cs index 6fb7836..da9fd13 100644 --- a/Touhou Launcher/MainForm.cs +++ b/Touhou Launcher/MainForm.cs @@ -374,7 +374,7 @@ private void btn_Click(object sender, EventArgs e) Application.Exit(); } else - MessageBox.Show("Cannot find game."); + MessageBox.Show(rm.GetString("errorGameNotFound")); } private void customAdd_Click(object sender, EventArgs e) @@ -609,6 +609,7 @@ private void browseNP2_Click(object sender, EventArgs e) { foreach (string file in MainForm.FileBrowser(MainForm.rm.GetString("np2SelectTitle"), MainForm.rm.GetString("executableFilter") + " (*.exe, *.bat, *.lnk)|*.exe;*.bat;*.lnk|" + MainForm.rm.GetString("allFilter") + " (*.*)|*.*")) { + np2Dir.BackColor = SystemColors.Window; np2Dir.Text = file; MainForm.curCfg.np2Dir = file; } @@ -618,8 +619,11 @@ private void np2Dir_LostFocus(object sender, EventArgs e) { if (File.Exists(np2Dir.Text) || np2Dir.Text == "") { + ((TextBox)sender).BackColor = SystemColors.Window; MainForm.curCfg.np2Dir = np2Dir.Text; } + else + ((TextBox)sender).BackColor = Color.Red; } private void autoClose_CheckedChanged(object sender, EventArgs e) diff --git a/Touhou Launcher/Resources_en.Designer.cs b/Touhou Launcher/Resources_en.Designer.cs index 49a22c4..73a0b44 100644 --- a/Touhou Launcher/Resources_en.Designer.cs +++ b/Touhou Launcher/Resources_en.Designer.cs @@ -393,6 +393,15 @@ public static string errorFileNotFound { } } + /// + /// Looks up a localized string similar to Cannot find game. + /// + public static string errorGameNotFound { + get { + return ResourceManager.GetString("errorGameNotFound", resourceCulture); + } + } + /// /// Looks up a localized string similar to Neko Project II's configuration ini is not valid.. /// @@ -412,7 +421,7 @@ public static string errorNP2NotFound { } /// - /// Looks up a localized string similar to Cannot openfile as image:\n. + /// Looks up a localized string similar to Cannot open file as image:\n. /// public static string errorOpenImage { get { diff --git a/Touhou Launcher/Resources_en.resx b/Touhou Launcher/Resources_en.resx index 721bd68..911e17b 100644 --- a/Touhou Launcher/Resources_en.resx +++ b/Touhou Launcher/Resources_en.resx @@ -527,7 +527,7 @@ random game option Please set Neko Project 2's location - Cannot openfile as image:\n + Cannot open file as image:\n Cannot find Replays folder @@ -589,4 +589,7 @@ random game option Neko Project II's configuration ini is not valid. + + Cannot find game + \ No newline at end of file diff --git a/Touhou Launcher/Resources_jp.Designer.cs b/Touhou Launcher/Resources_jp.Designer.cs index a2cc603..278ee57 100644 --- a/Touhou Launcher/Resources_jp.Designer.cs +++ b/Touhou Launcher/Resources_jp.Designer.cs @@ -393,6 +393,15 @@ public static string errorFileNotFound { } } + /// + /// Looks up a localized string similar to Cannot find game. + /// + public static string errorGameNotFound { + get { + return ResourceManager.GetString("errorGameNotFound", resourceCulture); + } + } + /// /// Looks up a localized string similar to Neko Project II's configuration ini is not valid.. /// @@ -412,7 +421,7 @@ public static string errorNP2NotFound { } /// - /// Looks up a localized string similar to Cannot openfile as image:\n. + /// Looks up a localized string similar to Cannot open file as image:\n. /// public static string errorOpenImage { get { diff --git a/Touhou Launcher/Resources_jp.resx b/Touhou Launcher/Resources_jp.resx index cf232b9..1fb2079 100644 --- a/Touhou Launcher/Resources_jp.resx +++ b/Touhou Launcher/Resources_jp.resx @@ -527,7 +527,7 @@ random game option Please set Neko Project 2's location - Cannot openfile as image:\n + Cannot open file as image:\n Cannot find Replays folder @@ -589,4 +589,7 @@ random game option Neko Project II's configuration ini is not valid. + + Cannot find game + \ No newline at end of file