Separate file for localisation, remove validate button, exe detect fix

This commit is contained in:
Norbi Peti 2021-05-16 01:43:51 +02:00
parent a27f3449be
commit e36dcb8477
7 changed files with 226 additions and 113 deletions

View file

@ -38,6 +38,18 @@
<Compile Update="SettingsForm.cs"> <Compile Update="SettingsForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Update="Localization.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Localization.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Localization.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup> </ItemGroup>
</Project> </Project>

130
GCMM/Localization.Designer.cs generated Normal file
View file

@ -0,0 +1,130 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace GCMM {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Localization {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Localization() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GCMM.Localization", typeof(Localization).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Launcher settings updated..
/// </summary>
internal static string Change_launch_settings_done {
get {
return ResourceManager.GetString("Change_launch_settings_done", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Failed to update launcher settings! You can still run TBMM manually or retry in settings..
/// </summary>
internal static string Change_launch_settings_error {
get {
return ResourceManager.GetString("Change_launch_settings_error", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Do you want TBMM to change the game&apos;s launch settings so it can ensure the game is patched?
///
///If you say yes, TBMM will do a quick check before the game is launched and patches if necessary. This way you (hopefully) won&apos;t see crashes after a Techblox update.
///
///Note that this also means that if you (re)move TBMM without disabling this in the settings then you won&apos;t be able to launch Techblox until you reinstall TBMM or fix the launcher configuration..
/// </summary>
internal static string Change_launch_settings_question {
get {
return ResourceManager.GetString("Change_launch_settings_question", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to TBMM auto-patching.
/// </summary>
internal static string Change_launch_settings_title {
get {
return ResourceManager.GetString("Change_launch_settings_title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Found game at {0}.
/// </summary>
internal static string Found_game_at {
get {
return ResourceManager.GetString("Found_game_at", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Game not found. Is it installed correctly? Anyway, please locate the game..
/// </summary>
internal static string Game_not_found {
get {
return ResourceManager.GetString("Game_not_found", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Status: Game not found.
/// </summary>
internal static string Status_Game_not_found {
get {
return ResourceManager.GetString("Status_Game_not_found", resourceCulture);
}
}
}
}

45
GCMM/Localization.resx Normal file
View file

@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Found_game_at" xml:space="preserve">
<value>Found game at {0}</value>
</data>
<data name="Game_not_found" xml:space="preserve">
<value>Game not found. Is it installed correctly? Anyway, please locate the game.</value>
</data>
<data name="Status_Game_not_found" xml:space="preserve">
<value>Status: Game not found</value>
</data>
<data name="Change_launch_settings_question" xml:space="preserve">
<value>Do you want TBMM to change the game's launch settings so it can ensure the game is patched?
If you say yes, TBMM will do a quick check before the game is launched and patches if necessary. This way you (hopefully) won't see crashes after a Techblox update.
Note that this also means that if you (re)move TBMM without disabling this in the settings then you won't be able to launch Techblox until you reinstall TBMM or fix the launcher configuration.</value>
</data>
<data name="Change_launch_settings_title" xml:space="preserve">
<value>TBMM auto-patching</value>
</data>
<data name="Change_launch_settings_done" xml:space="preserve">
<value>Launcher settings updated.</value>
</data>
<data name="Change_launch_settings_error" xml:space="preserve">
<value>Failed to update launcher settings! You can still run TBMM manually or retry in settings.</value>
</data>
</root>

View file

@ -30,17 +30,13 @@
{ {
System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Installed", System.Windows.Forms.HorizontalAlignment.Center); System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Installed", System.Windows.Forms.HorizontalAlignment.Center);
System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Available", System.Windows.Forms.HorizontalAlignment.Center); System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Available", System.Windows.Forms.HorizontalAlignment.Center);
System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] { System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {"Mod", "modtainers", "1.0", "2020.06.15. 2:01:43"}, -1);
"Mod",
"modtainers",
"1.0",
"2020.06.15. 2:01:43"}, -1);
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.modlist = new System.Windows.Forms.ListView(); this.modlist = new System.Windows.Forms.ListView();
this.modName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.modName = new System.Windows.Forms.ColumnHeader();
this.modAuthor = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.modAuthor = new System.Windows.Forms.ColumnHeader();
this.modVersion = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.modVersion = new System.Windows.Forms.ColumnHeader();
this.modTimestamp = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.modTimestamp = new System.Windows.Forms.ColumnHeader();
this.status = new System.Windows.Forms.Label(); this.status = new System.Windows.Forms.Label();
this.installbtn = new System.Windows.Forms.Button(); this.installbtn = new System.Windows.Forms.Button();
this.uninstallbtn = new System.Windows.Forms.Button(); this.uninstallbtn = new System.Windows.Forms.Button();
@ -50,21 +46,14 @@
this.unpatched = new System.Windows.Forms.CheckBox(); this.unpatched = new System.Windows.Forms.CheckBox();
this.modinfobox = new System.Windows.Forms.RichTextBox(); this.modinfobox = new System.Windows.Forms.RichTextBox();
this.refreshbtn = new System.Windows.Forms.Button(); this.refreshbtn = new System.Windows.Forms.Button();
this.validatebtn = new System.Windows.Forms.Button();
this.SuspendLayout(); this.SuspendLayout();
// //
// modlist // modlist
// //
this.modlist.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.modlist.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
| System.Windows.Forms.AnchorStyles.Left) this.modlist.BackColor = System.Drawing.Color.FromArgb(((int) (((byte) (216)))), ((int) (((byte) (240)))), ((int) (((byte) (216)))));
| System.Windows.Forms.AnchorStyles.Right)));
this.modlist.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(216)))), ((int)(((byte)(240)))), ((int)(((byte)(216)))));
this.modlist.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.modlist.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.modlist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.modlist.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {this.modName, this.modAuthor, this.modVersion, this.modTimestamp});
this.modName,
this.modAuthor,
this.modVersion,
this.modTimestamp});
this.modlist.ForeColor = System.Drawing.Color.Green; this.modlist.ForeColor = System.Drawing.Color.Green;
this.modlist.FullRowSelect = true; this.modlist.FullRowSelect = true;
listViewGroup1.Header = "Installed"; listViewGroup1.Header = "Installed";
@ -73,14 +62,11 @@
listViewGroup2.Header = "Available"; listViewGroup2.Header = "Available";
listViewGroup2.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center; listViewGroup2.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Center;
listViewGroup2.Name = "available"; listViewGroup2.Name = "available";
this.modlist.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { this.modlist.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {listViewGroup1, listViewGroup2});
listViewGroup1,
listViewGroup2});
this.modlist.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; this.modlist.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
this.modlist.HideSelection = false; this.modlist.HideSelection = false;
listViewItem1.Group = listViewGroup1; listViewItem1.Group = listViewGroup1;
this.modlist.Items.AddRange(new System.Windows.Forms.ListViewItem[] { this.modlist.Items.AddRange(new System.Windows.Forms.ListViewItem[] {listViewItem1});
listViewItem1});
this.modlist.Location = new System.Drawing.Point(12, 47); this.modlist.Location = new System.Drawing.Point(12, 47);
this.modlist.Name = "modlist"; this.modlist.Name = "modlist";
this.modlist.Size = new System.Drawing.Size(491, 433); this.modlist.Size = new System.Drawing.Size(491, 433);
@ -112,10 +98,10 @@
// //
// status // status
// //
this.status.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.status.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.status.AutoSize = true; this.status.AutoSize = true;
this.status.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.status.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.status.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.status.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238)));
this.status.ForeColor = System.Drawing.Color.Lime; this.status.ForeColor = System.Drawing.Color.Lime;
this.status.Location = new System.Drawing.Point(8, 487); this.status.Location = new System.Drawing.Point(8, 487);
this.status.Name = "status"; this.status.Name = "status";
@ -125,11 +111,11 @@
// //
// installbtn // installbtn
// //
this.installbtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.installbtn.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.installbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green; this.installbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.installbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0))))); this.installbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int) (((byte) (0)))), ((int) (((byte) (40)))), ((int) (((byte) (0)))));
this.installbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.installbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.installbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.installbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238)));
this.installbtn.Location = new System.Drawing.Point(509, 12); this.installbtn.Location = new System.Drawing.Point(509, 12);
this.installbtn.Name = "installbtn"; this.installbtn.Name = "installbtn";
this.installbtn.Size = new System.Drawing.Size(263, 49); this.installbtn.Size = new System.Drawing.Size(263, 49);
@ -140,11 +126,11 @@
// //
// uninstallbtn // uninstallbtn
// //
this.uninstallbtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.uninstallbtn.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.uninstallbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Black; this.uninstallbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Black;
this.uninstallbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Black; this.uninstallbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Black;
this.uninstallbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.uninstallbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.uninstallbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.uninstallbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238)));
this.uninstallbtn.ForeColor = System.Drawing.Color.Green; this.uninstallbtn.ForeColor = System.Drawing.Color.Green;
this.uninstallbtn.Location = new System.Drawing.Point(509, 67); this.uninstallbtn.Location = new System.Drawing.Point(509, 67);
this.uninstallbtn.Name = "uninstallbtn"; this.uninstallbtn.Name = "uninstallbtn";
@ -158,9 +144,9 @@
// //
this.playbtn.Anchor = System.Windows.Forms.AnchorStyles.Bottom; this.playbtn.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.playbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green; this.playbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.playbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0))))); this.playbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int) (((byte) (0)))), ((int) (((byte) (40)))), ((int) (((byte) (0)))));
this.playbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.playbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.playbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.playbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238)));
this.playbtn.Location = new System.Drawing.Point(250, 487); this.playbtn.Location = new System.Drawing.Point(250, 487);
this.playbtn.Name = "playbtn"; this.playbtn.Name = "playbtn";
this.playbtn.Size = new System.Drawing.Size(300, 62); this.playbtn.Size = new System.Drawing.Size(300, 62);
@ -171,9 +157,9 @@
// //
// settingsbtn // settingsbtn
// //
this.settingsbtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.settingsbtn.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.settingsbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green; this.settingsbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.settingsbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0))))); this.settingsbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int) (((byte) (0)))), ((int) (((byte) (40)))), ((int) (((byte) (0)))));
this.settingsbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.settingsbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.settingsbtn.Location = new System.Drawing.Point(667, 487); this.settingsbtn.Location = new System.Drawing.Point(667, 487);
this.settingsbtn.Name = "settingsbtn"; this.settingsbtn.Name = "settingsbtn";
@ -185,9 +171,9 @@
// //
// findlog // findlog
// //
this.findlog.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.findlog.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.findlog.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green; this.findlog.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.findlog.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0))))); this.findlog.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int) (((byte) (0)))), ((int) (((byte) (40)))), ((int) (((byte) (0)))));
this.findlog.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.findlog.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.findlog.Location = new System.Drawing.Point(666, 522); this.findlog.Location = new System.Drawing.Point(666, 522);
this.findlog.Name = "findlog"; this.findlog.Name = "findlog";
@ -199,7 +185,7 @@
// //
// unpatched // unpatched
// //
this.unpatched.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.unpatched.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.unpatched.AutoSize = true; this.unpatched.AutoSize = true;
this.unpatched.Location = new System.Drawing.Point(12, 534); this.unpatched.Location = new System.Drawing.Point(12, 534);
this.unpatched.Name = "unpatched"; this.unpatched.Name = "unpatched";
@ -211,8 +197,7 @@
// //
// modinfobox // modinfobox
// //
this.modinfobox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.modinfobox.Anchor = ((System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right)));
| System.Windows.Forms.AnchorStyles.Right)));
this.modinfobox.BackColor = System.Drawing.Color.Black; this.modinfobox.BackColor = System.Drawing.Color.Black;
this.modinfobox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.modinfobox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.modinfobox.ForeColor = System.Drawing.Color.Lime; this.modinfobox.ForeColor = System.Drawing.Color.Lime;
@ -226,9 +211,9 @@
// refreshbtn // refreshbtn
// //
this.refreshbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green; this.refreshbtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.refreshbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0))))); this.refreshbtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int) (((byte) (0)))), ((int) (((byte) (40)))), ((int) (((byte) (0)))));
this.refreshbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.refreshbtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.refreshbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.refreshbtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238)));
this.refreshbtn.Location = new System.Drawing.Point(12, 12); this.refreshbtn.Location = new System.Drawing.Point(12, 12);
this.refreshbtn.Name = "refreshbtn"; this.refreshbtn.Name = "refreshbtn";
this.refreshbtn.Size = new System.Drawing.Size(105, 29); this.refreshbtn.Size = new System.Drawing.Size(105, 29);
@ -237,27 +222,12 @@
this.refreshbtn.UseVisualStyleBackColor = true; this.refreshbtn.UseVisualStyleBackColor = true;
this.refreshbtn.Click += new System.EventHandler(this.refreshbtn_Click); this.refreshbtn.Click += new System.EventHandler(this.refreshbtn_Click);
// //
// validatebtn
//
this.validatebtn.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Green;
this.validatebtn.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(40)))), ((int)(((byte)(0)))));
this.validatebtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.validatebtn.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.validatebtn.Location = new System.Drawing.Point(398, 12);
this.validatebtn.Name = "validatebtn";
this.validatebtn.Size = new System.Drawing.Size(105, 29);
this.validatebtn.TabIndex = 11;
this.validatebtn.Text = "Validate game";
this.validatebtn.UseVisualStyleBackColor = true;
this.validatebtn.Click += new System.EventHandler(this.validatebtn_Click);
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.Black; this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(784, 561); this.ClientSize = new System.Drawing.Size(784, 561);
this.Controls.Add(this.validatebtn);
this.Controls.Add(this.refreshbtn); this.Controls.Add(this.refreshbtn);
this.Controls.Add(this.modinfobox); this.Controls.Add(this.modinfobox);
this.Controls.Add(this.unpatched); this.Controls.Add(this.unpatched);
@ -269,14 +239,13 @@
this.Controls.Add(this.status); this.Controls.Add(this.status);
this.Controls.Add(this.modlist); this.Controls.Add(this.modlist);
this.ForeColor = System.Drawing.Color.Lime; this.ForeColor = System.Drawing.Color.Lime;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon) (resources.GetObject("$this.Icon")));
this.Name = "MainForm"; this.Name = "MainForm";
this.Text = "Techblox Mod Manager"; this.Text = "Techblox Mod Manager";
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
this.Shown += new System.EventHandler(this.MainForm_Shown); this.Shown += new System.EventHandler(this.MainForm_Shown);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
#endregion #endregion
@ -295,7 +264,6 @@
private System.Windows.Forms.CheckBox unpatched; private System.Windows.Forms.CheckBox unpatched;
private System.Windows.Forms.RichTextBox modinfobox; private System.Windows.Forms.RichTextBox modinfobox;
private System.Windows.Forms.Button refreshbtn; private System.Windows.Forms.Button refreshbtn;
private System.Windows.Forms.Button validatebtn;
} }
} }

View file

@ -1,10 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Resources;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
@ -15,13 +16,13 @@ namespace GCMM
public MainForm() public MainForm()
{ {
InitializeComponent(); InitializeComponent();
resources = new ComponentResourceManager(typeof(MainForm)); resources = new ResourceManager("GCMM.Localization", Assembly.GetExecutingAssembly());
Configuration = Configuration.Load(); Configuration = Configuration.Load();
} }
public Configuration Configuration { get; } public Configuration Configuration { get; }
private readonly ComponentResourceManager resources; private readonly ResourceManager resources;
private readonly Dictionary<string, ModInfo> mods = new Dictionary<string, ModInfo>(); private readonly Dictionary<string, ModInfo> mods = new Dictionary<string, ModInfo>();
private readonly ModInfo gcipa = new ModInfo { Author = "modtainers", Name = "GCIPA" }; private readonly ModInfo gcipa = new ModInfo { Author = "modtainers", Name = "GCIPA" };
private readonly ModInfo gcmm = new ModInfo { Author = "NorbiPeti", Name = "GCMM" }; private readonly ModInfo gcmm = new ModInfo { Author = "NorbiPeti", Name = "GCMM" };
@ -269,26 +270,6 @@ You may also want to verify the game's files in the launcher.
CheckIfPatched(); //Check after getting the available mods to show GCIPA updates CheckIfPatched(); //Check after getting the available mods to show GCIPA updates
} }
private void validatebtn_Click(object sender, EventArgs e)
{
if (CheckNoExe())
return;
if (MessageBox.Show("Validating the game's files is useful if the game doesn't start even without mods." +
" Make sure to click Refresh once Steam finished verifying the game." +
" The Steam window that shows the progress might open in the background." +
" Note that if auto-patching isn't enabled then you will need to patch the game again using the Play button in order to use mods." +
"\n\nContinue?", "Verify game files", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
return;
string exe = GetExe();
File.Delete(GamePath($@"\{exe.Replace(".exe", "")}_Data\Managed\IllusionInjector.dll")); //Used to check if game is patched
#if USING_STEAM
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
Process.Start("steam://validate/1078000/");
else
Process.Start("xdg-open", "steam://validate/1078000/");
#endif
}
private void MainForm_Shown(object sender, EventArgs e) private void MainForm_Shown(object sender, EventArgs e)
{ {
Focus(); Focus();

View file

@ -1867,29 +1867,4 @@
APAIAADhCAAAw48AAMf/AAD//wAA//8AAA== APAIAADhCAAAw48AAMf/AAD//wAA//8AAA==
</value> </value>
</data> </data>
<data name="Found_game_at" xml:space="preserve">
<value>Found game at {0}</value>
</data>
<data name="Game_not_found" xml:space="preserve">
<value>Game not found. Is it installed correctly? Anyway, please locate the game.</value>
</data>
<data name="Status_Game_not_found" xml:space="preserve">
<value>Status: Game not found</value>
</data>
<data name="Change_launch_settings_question" xml:space="preserve">
<value>Do you want TBMM to change the game's launch settings so it can ensure the game is patched?
If you say yes, TBMM will do a quick check before the game is launched and patches if necessary. This way you (hopefully) won't see crashes after a Techblox update.
Note that this also means that if you (re)move TBMM without disabling this in the settings then you won't be able to launch Techblox until you reinstall TBMM or fix the launcher configuration.</value>
</data>
<data name="Change_launch_settings_title" xml:space="preserve">
<value>TBMM auto-patching</value>
</data>
<data name="Change_launch_settings_done" xml:space="preserve">
<value>Launcher settings updated.</value>
</data>
<data name="Change_launch_settings_error" xml:space="preserve">
<value>Failed to update launcher settings! You can still run TBMM manually or retry in settings.</value>
</data>
</root> </root>

View file

@ -70,9 +70,11 @@ namespace GCMM
string launcherConfig = string launcherConfig =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Techblox Launcher", "launcher_settings.ini"); "Techblox Launcher", "launcher_settings.ini");
if (File.Exists(launcherConfig)) if (!File.Exists(launcherConfig)) return null;
return File.ReadLines(launcherConfig).FirstOrDefault(line => line.StartsWith("133062..GAME_PATH=")) string path = File.ReadLines(launcherConfig)
.FirstOrDefault(line => line.StartsWith("133062..GAME_PATH="))
?.Substring("133062..GAME_PATH=".Length); ?.Substring("133062..GAME_PATH=".Length);
if (path != null && GetExe(path) != null) return path;
return null; return null;
} }