diff --git a/ModAPI Installers/GameVersion.cs b/ModAPI Installers/GameVersion.cs index ae18961..a04a358 100644 --- a/ModAPI Installers/GameVersion.cs +++ b/ModAPI Installers/GameVersion.cs @@ -9,7 +9,7 @@ namespace ModAPI_Installers public enum GameVersionType { /// 3.0.0.2818 (July 2009) installed from disc, with patch 5.1 - Disc, + Disk, /// 3.0.0.2818 (July 2009) installed from Origin, with patch 5.1, requires ModAPI Fix Origin, /// 3.1.0.22 (March 2017) installed from Origin, requires ModAPI Fix @@ -33,7 +33,7 @@ public static class GameVersion public static int[] ExecutableSizes = { - /* DISC*/ 24909584, + /* DISK*/ 24909584, /* ORIGIN */ 31347984, /* ORIGIN_P */ 24898224, /* EA_OCT24 */ 24906040, @@ -95,7 +95,7 @@ public static GameVersionType DetectVersion(string path) public static string GetNewDLLName(GameVersionType type) { - if (type == GameVersionType.Disc) + if (type == GameVersionType.Disk) return "SporeModAPI.disk.dll"; else if ((type == GameVersionType.Origin) || (type == GameVersionType.Origin_Patched) || diff --git a/Spore ModAPI Launcher/GameVersionSelector.Designer.cs b/Spore ModAPI Launcher/GameVersionSelector.Designer.cs index 61368bf..d2ea869 100644 --- a/Spore ModAPI Launcher/GameVersionSelector.Designer.cs +++ b/Spore ModAPI Launcher/GameVersionSelector.Designer.cs @@ -29,84 +29,68 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GameVersionSelector)); - this.labelDetectionError = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); this.btnSteam = new System.Windows.Forms.Button(); - this.btnEAApp = new System.Windows.Forms.Button(); - this.btnDisc = new System.Windows.Forms.Button(); + this.btnOrigin = new System.Windows.Forms.Button(); + this.btnDisk = new System.Windows.Forms.Button(); this.SuspendLayout(); // - // labelDetectionError + // label1 // - this.labelDetectionError.AutoSize = true; - this.labelDetectionError.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.labelDetectionError.Location = new System.Drawing.Point(12, 9); - this.labelDetectionError.Name = "labelDetectionError"; - this.labelDetectionError.Size = new System.Drawing.Size(399, 60); - this.labelDetectionError.TabIndex = 0; - this.labelDetectionError.Text = "Your game version could not be detected automatically.\r\n\r\nPlease choose your vers" + - "ion:"; + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(13, 13); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(503, 20); + this.label1.TabIndex = 0; + this.label1.Text = Strings.ChooseGameVersion; // // btnSteam // + this.btnSteam.BackgroundImage = global::SporeModAPI_Launcher.Properties.Resources.VersionButton_Steam_GoG1; this.btnSteam.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.btnSteam.Font = new System.Drawing.Font("Segoe UI", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnSteam.Image = global::SporeModAPI_Launcher.Properties.Resources.VersionButton_Steam_GOG_Icon; - this.btnSteam.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnSteam.Location = new System.Drawing.Point(12, 167); + this.btnSteam.Location = new System.Drawing.Point(13, 133); this.btnSteam.Name = "btnSteam"; - this.btnSteam.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0); - this.btnSteam.Size = new System.Drawing.Size(539, 80); + this.btnSteam.Size = new System.Drawing.Size(538, 80); this.btnSteam.TabIndex = 3; - this.btnSteam.Text = "Steam / GOG"; - this.btnSteam.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnSteam.UseVisualStyleBackColor = true; this.btnSteam.Click += new System.EventHandler(this.btnSteam_Click); // - // btnEAApp + // btnOrigin // - this.btnEAApp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.btnEAApp.Font = new System.Drawing.Font("Segoe UI", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btnEAApp.Image = global::SporeModAPI_Launcher.Properties.Resources.VersionButton_EAApp_Icon; - this.btnEAApp.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnEAApp.Location = new System.Drawing.Point(12, 253); - this.btnEAApp.Name = "btnEAApp"; - this.btnEAApp.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0); - this.btnEAApp.Size = new System.Drawing.Size(539, 80); - this.btnEAApp.TabIndex = 2; - this.btnEAApp.Text = "EA App"; - this.btnEAApp.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - this.btnEAApp.UseVisualStyleBackColor = true; - this.btnEAApp.Click += new System.EventHandler(this.btnEAApp_Click); + this.btnOrigin.BackgroundImage = global::SporeModAPI_Launcher.Properties.Resources.VersionButton_Origin1; + this.btnOrigin.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.btnOrigin.Location = new System.Drawing.Point(13, 219); + this.btnOrigin.Name = "btnOrigin"; + this.btnOrigin.Size = new System.Drawing.Size(538, 80); + this.btnOrigin.TabIndex = 2; + this.btnOrigin.UseVisualStyleBackColor = true; + this.btnOrigin.Click += new System.EventHandler(this.btnOrigin_Click); // - // btnDisc + // btnDisk // - this.btnDisc.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; - this.btnDisc.Font = new System.Drawing.Font("Segoe UI", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.btnDisc.Image = global::SporeModAPI_Launcher.Properties.Resources.VersionButton_Disc_Icon; - this.btnDisc.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.btnDisc.Location = new System.Drawing.Point(12, 81); - this.btnDisc.Name = "btnDisc"; - this.btnDisc.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0); - this.btnDisc.Size = new System.Drawing.Size(539, 80); - this.btnDisc.TabIndex = 1; - this.btnDisc.Text = "Disc"; - this.btnDisc.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; - this.btnDisc.UseVisualStyleBackColor = true; - this.btnDisc.Click += new System.EventHandler(this.btnDisc_Click); + this.btnDisk.BackgroundImage = global::SporeModAPI_Launcher.Properties.Resources.VersionButton_Disk3; + this.btnDisk.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.btnDisk.Location = new System.Drawing.Point(13, 47); + this.btnDisk.Name = "btnDisk"; + this.btnDisk.Size = new System.Drawing.Size(538, 80); + this.btnDisk.TabIndex = 1; + this.btnDisk.UseVisualStyleBackColor = true; + this.btnDisk.Click += new System.EventHandler(this.btnDisk_Click); // // GameVersionSelector // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(563, 345); + this.ClientSize = new System.Drawing.Size(563, 313); this.Controls.Add(this.btnSteam); - this.Controls.Add(this.btnEAApp); - this.Controls.Add(this.btnDisc); - this.Controls.Add(this.labelDetectionError); + this.Controls.Add(this.btnOrigin); + this.Controls.Add(this.btnDisk); + this.Controls.Add(this.label1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "GameVersionSelector"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Select your game version"; + this.Text = Strings.ChooseGameVersionTitle; this.ResumeLayout(false); this.PerformLayout(); @@ -114,9 +98,9 @@ private void InitializeComponent() #endregion - private System.Windows.Forms.Label labelDetectionError; - private System.Windows.Forms.Button btnDisc; - private System.Windows.Forms.Button btnEAApp; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnDisk; + private System.Windows.Forms.Button btnOrigin; private System.Windows.Forms.Button btnSteam; } } \ No newline at end of file diff --git a/Spore ModAPI Launcher/GameVersionSelector.cs b/Spore ModAPI Launcher/GameVersionSelector.cs index 2621531..0905b03 100644 --- a/Spore ModAPI Launcher/GameVersionSelector.cs +++ b/Spore ModAPI Launcher/GameVersionSelector.cs @@ -21,9 +21,15 @@ public GameVersionSelector() InitializeComponent(); } - private void btnDisc_Click(object sender, EventArgs e) + private void btnDisk_Click(object sender, EventArgs e) { - SelectedVersion = GameVersionType.Disc; + SelectedVersion = GameVersionType.Disk; + this.Close(); + } + + private void btnOrigin_Click(object sender, EventArgs e) + { + SelectedVersion = GameVersionType.Origin; this.Close(); } @@ -36,11 +42,5 @@ private void btnSteam_Click(object sender, EventArgs e) this.Close(); } - - private void btnEAApp_Click(object sender, EventArgs e) - { - SelectedVersion = GameVersionType.Origin; - this.Close(); - } } } diff --git a/Spore ModAPI Launcher/Injector.cs b/Spore ModAPI Launcher/Injector.cs index 7a6cd9c..e691965 100644 --- a/Spore ModAPI Launcher/Injector.cs +++ b/Spore ModAPI Launcher/Injector.cs @@ -113,7 +113,7 @@ public static IntPtr InjectDLL(PROCESS_INFORMATION pi, string dllPath) return new IntPtr((Int64)thread_result); } - public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorHandle, bool is_disc_spore, List dlls) + public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorHandle, bool is_disk_spore, List dlls) { IntPtr hLocalDLLInjectorHandle = NativeMethods.LoadLibraryEx("ModAPI.DLLInjector.dll", IntPtr.Zero, LoadLibraryFlags.DONT_RESOLVE_DLL_REFERENCES); IntPtr SetInjectDataPtr = GetProcAddress(hLocalDLLInjectorHandle, "SetInjectionData"); @@ -134,7 +134,7 @@ public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorH IntPtr hProc = NativeMethods.OpenProcess(NativeMethods.AccessRequired, false, pi.dwProcessId); //Open the process with all access - int total_alloc_size = 1 + 4; //1 byte for if we are disc spore, 4 bytes for number of strings + int total_alloc_size = 1 + 4; //1 byte for if we are disk spore, 4 bytes for number of strings foreach (string dll in dlls) { total_alloc_size += 4 + Encoding.Unicode.GetByteCount(dll); //4 bytes for string length + string @@ -151,7 +151,7 @@ public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorH //write injection data var bytes = new byte[total_alloc_size]; int byte_offset = 0; - bytes[byte_offset++] = (byte)(is_disc_spore ? 1 : 0); + bytes[byte_offset++] = (byte)(is_disk_spore ? 1 : 0); foreach (byte b in BitConverter.GetBytes((uint)dlls.Count)) bytes[byte_offset++] = b; diff --git a/Spore ModAPI Launcher/Properties/Resources.Designer.cs b/Spore ModAPI Launcher/Properties/Resources.Designer.cs index dac4d32..7ba6e2b 100644 --- a/Spore ModAPI Launcher/Properties/Resources.Designer.cs +++ b/Spore ModAPI Launcher/Properties/Resources.Designer.cs @@ -73,9 +73,9 @@ internal static byte[] Spore_ModAPI_Launcher { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap VersionButton_Disc_Icon { + internal static System.Drawing.Bitmap VersionButton_Disk3 { get { - object obj = ResourceManager.GetObject("VersionButton_Disc_Icon", resourceCulture); + object obj = ResourceManager.GetObject("VersionButton_Disk3", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -83,9 +83,9 @@ internal static System.Drawing.Bitmap VersionButton_Disc_Icon { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap VersionButton_EAApp_Icon { + internal static System.Drawing.Bitmap VersionButton_Origin1 { get { - object obj = ResourceManager.GetObject("VersionButton_EAApp_Icon", resourceCulture); + object obj = ResourceManager.GetObject("VersionButton_Origin1", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -93,9 +93,9 @@ internal static System.Drawing.Bitmap VersionButton_EAApp_Icon { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap VersionButton_Steam_GOG_Icon { + internal static System.Drawing.Bitmap VersionButton_Steam_GoG1 { get { - object obj = ResourceManager.GetObject("VersionButton_Steam_GOG_Icon", resourceCulture); + object obj = ResourceManager.GetObject("VersionButton_Steam_GoG1", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } diff --git a/Spore ModAPI Launcher/Properties/Resources.resx b/Spore ModAPI Launcher/Properties/Resources.resx index 5442eae..bb509b4 100644 --- a/Spore ModAPI Launcher/Properties/Resources.resx +++ b/Spore ModAPI Launcher/Properties/Resources.resx @@ -118,16 +118,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\VersionButton_Disc_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\VersionButton_Origin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\VersionButton_Steam_GOG_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\VersionButton_Steam_GoG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\VersionButton_Disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Spore ModAPI Launcher.manifest;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\VersionButton_EAApp_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - \ No newline at end of file diff --git a/Spore ModAPI Launcher/Spore ModAPI Launcher.csproj b/Spore ModAPI Launcher/Spore ModAPI Launcher.csproj index 14d0389..30bca3c 100644 --- a/Spore ModAPI Launcher/Spore ModAPI Launcher.csproj +++ b/Spore ModAPI Launcher/Spore ModAPI Launcher.csproj @@ -129,9 +129,6 @@ - - -