Skip to content

Commit

Permalink
Merge pull request #15 from David-JonesDVN/dev
Browse files Browse the repository at this point in the history
1.02 Release
  • Loading branch information
David-JonesDVN authored Sep 14, 2022
2 parents a6a983c + 58b4ada commit b0e6b32
Show file tree
Hide file tree
Showing 15 changed files with 2,210 additions and 888 deletions.
1,179 changes: 668 additions & 511 deletions Touhou Launcher/MainForm.Designer.cs

Large diffs are not rendered by default.

53 changes: 35 additions & 18 deletions Touhou Launcher/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class Configs : AppSettings<Configs>
public int language = 0;
public string np2Dir = "";
public string crapDir = "";
public string StartingRepo = @"https://mirrors.thpatch.net/nmlgc/";
public string StartingRepo = @"https://srv.thpatch.net/";
public Configs()
{
for (int i = 0; i < gameCFG.Length ; i++)
Expand All @@ -109,7 +109,7 @@ public Configs()
private FormWindowState lastState = FormWindowState.Normal;
private const int mainGameCount = 18;
private const int fightingGameCount = 6;
private const int otherGameCount = 5;
private const int otherGameCount = 7;
private const int totalGameCount = mainGameCount + fightingGameCount + otherGameCount;
public static Configs curCfg = Configs.Load();
public static System.Resources.ResourceManager rm;
Expand All @@ -122,7 +122,7 @@ public Configs()
};
public static List<int> idToNumber = new List<int>
{
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 75, 105, 123, 135, 145, 155, 95, 125, 128, 143, 165
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 75, 105, 123, 135, 145, 155, 95, 125, 128, 143, 165, 175, 185
};
public static Dictionary<string, int> nameToID = new Dictionary<string, int>
{
Expand Down Expand Up @@ -154,7 +154,9 @@ public Configs()
{"DS", 25},
{"GFW", 26},
{"ISC", 27},
{"VD", 28}
{"VD", 28},
{"GI", 29},
{"HBM", 30}
};

public static IEnumerable<Control> GetAll(Control control, Type type)
Expand Down Expand Up @@ -375,15 +377,19 @@ private void InitializeLanguage()
languageBox.SelectedIndex = 0;
break;
}
foreach (ToolStripMenuItem tMenu in trayPC98.DropDownItems)
{
tMenu.Text = rm.GetString(tMenu.Name.Substring(4));
}
foreach (ToolStripMenuItem tMenu in trayMain.DropDownItems)
{
tMenu.Text = rm.GetString(tMenu.Name.Substring(4));
}
foreach (ToolStripMenuItem tMenu in trayFighting.DropDownItems)
foreach (ToolStripMenuItem tMenu in traySpinoff.DropDownItems)
{
tMenu.Text = rm.GetString(tMenu.Name.Substring(4));
}
foreach (ToolStripMenuItem tMenu in trayOther.DropDownItems)
foreach (ToolStripMenuItem tMenu in trayTasofro.DropDownItems)
{
tMenu.Text = rm.GetString(tMenu.Name.Substring(4));
}
Expand Down Expand Up @@ -414,16 +420,18 @@ private void InitializeLanguage()
{
tab.Text = rm.GetString(tab.Name);
}
trayPC98.Text = rm.GetString("pc98Group");
trayMain.Text = rm.GetString("mainGroup");
trayFighting.Text = rm.GetString("fightingGroup");
trayOther.Text = rm.GetString("otherGroup");
traySpinoff.Text = rm.GetString("spinoffGroup");
trayTasofro.Text = rm.GetString("tasofroGroup");
trayCustom.Text = rm.GetString("customGames");
trayRandom.Text = rm.GetString("trayRandom");
trayOpen.Text = rm.GetString("trayOpen");
trayExit.Text = rm.GetString("trayExit");
pc98Group.Text = rm.GetString("pc98Group");
mainGroup.Text = rm.GetString("mainGroup");
fightingGroup.Text = rm.GetString("fightingGroup");
otherGroup.Text = rm.GetString("otherGroup");
spinoffGroup.Text = rm.GetString("spinoffGroup");
tasofroGroup.Text = rm.GetString("tasofroGroup");
configureToolStripMenuItem.Text = rm.GetString("configureToolStripMenuItem");
buttonToolStripMenuItem.Text = rm.GetString("buttonToolStripMenuItem");
bannerToolStripMenuItem.Text = rm.GetString("bannerToolStripMenuItem");
Expand Down Expand Up @@ -451,9 +459,10 @@ private void InitializeLanguage()
randomLabel.Text = rm.GetString("randomLabel");
randomAll.Text = rm.GetString("randomAll");
randomNone.Text = rm.GetString("randomNone");
pc98Random.Text = rm.GetString("pc98Group");
mainRandom.Text = rm.GetString("mainGroup");
fightingRandom.Text = rm.GetString("fightingGroup");
otherRandom.Text = rm.GetString("otherGroup");
spinoffRandom.Text = rm.GetString("spinoffGroup");
tasofroRandom.Text = rm.GetString("tasofroGroup");
this.Text = rm.GetString("Title");
}

Expand Down Expand Up @@ -518,6 +527,8 @@ private void RefreshList(ref ListView list, Dictionary<string, string> files)

public MainForm()
{
System.Net.ServicePointManager.Expect100Continue = true;
System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072;
InitializeComponent();
if (totalGameCount > curCfg.gameCFG.Length)
{
Expand Down Expand Up @@ -667,6 +678,10 @@ private void customAdd_Click(object sender, EventArgs e)
{
customAddItem(FileBrowser(rm.GetString("gameSelectTitle"), rm.GetString("executableFilter") + " (*.exe, *.bat, *.lnk)|*.exe;*.bat;*.lnk|" + rm.GetString("allFilter") + " (*.*)|*.*", true));
}
else
{
MessageBox.Show(rm.GetString("errorNoCategorySelected"));
}
}

private void customTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
Expand Down Expand Up @@ -885,8 +900,7 @@ private void linkReplays_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
gensokyoReplays.Checked = false;
royalflareReplays.Checked = false;
maribelReplays.Checked = false;
appspotReplays.Checked = false;
Replays_CheckedChanged(sender, new EventArgs());
}
Expand Down Expand Up @@ -1001,7 +1015,8 @@ private void browse_Click(object sender, EventArgs e)
txtbox.BackColor = SystemColors.Window;
txtbox.Text = file;
curCfg.np2Dir = np2Dir.Text;
curCfg.crapDir = Path.GetDirectoryName(crapDir.Text).TrimEnd("\\bin".ToCharArray());
string crapPath = Path.GetDirectoryName(crapDir.Text);
curCfg.crapDir = (Directory.Exists(crapPath + "\\bin") || !crapPath.EndsWith("\\bin")) ? crapPath : crapPath.Substring(0, crapPath.LastIndexOf("\\bin"));
}
}

Expand All @@ -1011,8 +1026,8 @@ private void Dir_LostFocus(object sender, EventArgs e)
{
((TextBox)sender).BackColor = SystemColors.Window;
curCfg.np2Dir = np2Dir.Text;
string crapPath = crapDir.Text == "" ? "" : Path.GetDirectoryName(crapDir.Text);
curCfg.crapDir = Directory.Exists(crapPath + "\\bin") ? crapPath : crapPath.TrimEnd("\\bin".ToCharArray());
string crapPath = Path.GetDirectoryName(crapDir.Text);
curCfg.crapDir = (Directory.Exists(crapPath + "\\bin") || !crapPath.EndsWith("\\bin")) ? crapPath : crapPath.Substring(0, crapPath.LastIndexOf("\\bin"));
curCfg.StartingRepo = crapStartingRepo.Text;
}
else
Expand All @@ -1030,7 +1045,9 @@ private void crapConfigure_Click(object sender, EventArgs e)
if (curCfg.crapDir != "")
{
string procDir = curCfg.crapDir + "\\bin\\thcrap_configure.exe";
if (File.Exists(procDir))
if (!File.Exists(procDir))
MessageBox.Show(rm.GetString("errorcrapNotFound"));
else
startProcess(procDir);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Touhou Launcher/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
60 changes: 60 additions & 0 deletions Touhou Launcher/Properties/Resources.Designer.cs

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

Loading

0 comments on commit b0e6b32

Please sign in to comment.