Skip to content

Commit f85b8ec

Browse files
committed
Update GameVersionSelector form, replace "Disk" with "Disc" in most places
1 parent 5f23435 commit f85b8ec

File tree

7 files changed

+86
-67
lines changed

7 files changed

+86
-67
lines changed

ModAPI Installers/GameVersion.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace ModAPI_Installers
99
public enum GameVersionType
1010
{
1111
/// <summary>3.0.0.2818 (July 2009) installed from disc, with patch 5.1</summary>
12-
Disk,
12+
Disc,
1313
/// <summary>3.0.0.2818 (July 2009) installed from Origin, with patch 5.1, requires ModAPI Fix</summary>
1414
Origin,
1515
/// <summary>3.1.0.22 (March 2017) installed from Origin, requires ModAPI Fix</summary>
@@ -33,7 +33,7 @@ public static class GameVersion
3333

3434

3535
public static int[] ExecutableSizes = {
36-
/* DISK*/ 24909584,
36+
/* DISC*/ 24909584,
3737
/* ORIGIN */ 31347984,
3838
/* ORIGIN_P */ 24898224,
3939
/* EA_OCT24 */ 24906040,
@@ -95,7 +95,7 @@ public static GameVersionType DetectVersion(string path)
9595

9696
public static string GetNewDLLName(GameVersionType type)
9797
{
98-
if (type == GameVersionType.Disk)
98+
if (type == GameVersionType.Disc)
9999
return "SporeModAPI.disk.dll";
100100
else if ((type == GameVersionType.Origin) ||
101101
(type == GameVersionType.Origin_Patched) ||

Spore ModAPI Launcher/GameVersionSelector.Designer.cs

Lines changed: 56 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Spore ModAPI Launcher/GameVersionSelector.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@ public GameVersionSelector()
2121
InitializeComponent();
2222
}
2323

24-
private void btnDisk_Click(object sender, EventArgs e)
24+
private void btnDisc_Click(object sender, EventArgs e)
2525
{
26-
SelectedVersion = GameVersionType.Disk;
27-
this.Close();
28-
}
29-
30-
private void btnOrigin_Click(object sender, EventArgs e)
31-
{
32-
SelectedVersion = GameVersionType.Origin;
26+
SelectedVersion = GameVersionType.Disc;
3327
this.Close();
3428
}
3529

@@ -42,5 +36,11 @@ private void btnSteam_Click(object sender, EventArgs e)
4236

4337
this.Close();
4438
}
39+
40+
private void btnEAApp_Click(object sender, EventArgs e)
41+
{
42+
SelectedVersion = GameVersionType.Origin;
43+
this.Close();
44+
}
4545
}
4646
}

Spore ModAPI Launcher/Injector.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static IntPtr InjectDLL(PROCESS_INFORMATION pi, string dllPath)
113113
return new IntPtr((Int64)thread_result);
114114
}
115115

116-
public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorHandle, bool is_disk_spore, List<string> dlls)
116+
public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorHandle, bool is_disc_spore, List<string> dlls)
117117
{
118118
IntPtr hLocalDLLInjectorHandle = NativeMethods.LoadLibraryEx("ModAPI.DLLInjector.dll", IntPtr.Zero, LoadLibraryFlags.DONT_RESOLVE_DLL_REFERENCES);
119119
IntPtr SetInjectDataPtr = GetProcAddress(hLocalDLLInjectorHandle, "SetInjectionData");
@@ -134,7 +134,7 @@ public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorH
134134

135135
IntPtr hProc = NativeMethods.OpenProcess(NativeMethods.AccessRequired, false, pi.dwProcessId); //Open the process with all access
136136

137-
int total_alloc_size = 1 + 4; //1 byte for if we are disk spore, 4 bytes for number of strings
137+
int total_alloc_size = 1 + 4; //1 byte for if we are disc spore, 4 bytes for number of strings
138138
foreach (string dll in dlls)
139139
{
140140
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
151151
//write injection data
152152
var bytes = new byte[total_alloc_size];
153153
int byte_offset = 0;
154-
bytes[byte_offset++] = (byte)(is_disk_spore ? 1 : 0);
154+
bytes[byte_offset++] = (byte)(is_disc_spore ? 1 : 0);
155155
foreach (byte b in BitConverter.GetBytes((uint)dlls.Count))
156156
bytes[byte_offset++] = b;
157157

Spore ModAPI Launcher/Properties/Resources.Designer.cs

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Spore ModAPI Launcher/Properties/Resources.resx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
121-
<data name="VersionButton_Origin1" type="System.Resources.ResXFileRef, System.Windows.Forms">
122-
<value>..\Resources\VersionButton_Origin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
121+
<data name="VersionButton_Disc_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
122+
<value>..\Resources\VersionButton_Disc_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
123123
</data>
124-
<data name="VersionButton_Steam_GoG1" type="System.Resources.ResXFileRef, System.Windows.Forms">
125-
<value>..\Resources\VersionButton_Steam_GoG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126-
</data>
127-
<data name="VersionButton_Disk3" type="System.Resources.ResXFileRef, System.Windows.Forms">
128-
<value>..\Resources\VersionButton_Disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
124+
<data name="VersionButton_Steam_GOG_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
125+
<value>..\Resources\VersionButton_Steam_GOG_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
129126
</data>
130127
<data name="Spore_ModAPI_Launcher" type="System.Resources.ResXFileRef, System.Windows.Forms">
131128
<value>..\Spore ModAPI Launcher.manifest;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
132129
</data>
130+
<data name="VersionButton_EAApp_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
131+
<value>..\Resources\VersionButton_EAApp_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
132+
</data>
133133
</root>

Spore ModAPI Launcher/Spore ModAPI Launcher.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@
129129
</ItemGroup>
130130
<ItemGroup>
131131
<Content Include="lH5AxkU.ico" />
132+
<None Include="Resources\VersionButton_EAApp_Icon.png" />
133+
<None Include="Resources\VersionButton_Steam_GoG_Icon.png" />
134+
<None Include="Resources\VersionButton_Disc_Icon.png" />
132135
<None Include="app.config" />
133136
<None Include="packages.config" />
134137
<None Include="Resources\VersionButton_Disk.png" />

0 commit comments

Comments
 (0)