Skip to content

Commit de81fa1

Browse files
committed
ModAPI.Common: mark SporePath variables readonly
1 parent ed0831b commit de81fa1

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ModAPI.Common/SporePath.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,38 @@ public enum Game
1212
Spore,
1313
CreepyAndCute
1414
}
15-
public static string[] RegistryValues = { "InstallLoc", "Install Dir" };
15+
public static readonly string[] RegistryValues = { "InstallLoc", "Install Dir" };
1616

17-
public static string[] RegistryKeys = {
17+
public static readonly string[] RegistryKeys = {
1818
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Electronic Arts\\SPORE_EP1",
1919
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\SPORE_EP1"
2020
};
2121

22-
public static string[] SporeRegistryKeys = {
22+
public static readonly string[] SporeRegistryKeys = {
2323
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Electronic Arts\\SPORE",
2424
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\SPORE"
2525
};
2626

27-
public static string[] CCRegistryKeys = {
27+
public static readonly string[] CCRegistryKeys = {
2828
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Electronic Arts\\SPORE(TM) Creepy & Cute Parts Pack",
2929
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\SPORE(TM) Creepy & Cute Parts Pack"
3030
};
3131

3232

33-
public static string RegistryDataDir = "DataDir"; // Steam/GoG users don't have InstallLoc nor Install Dir
33+
public static readonly string RegistryDataDir = "DataDir"; // Steam/GoG users don't have InstallLoc nor Install Dir
3434

3535

3636
// Some things for Steam
37-
public static string[] SteamRegistryKeys = {
37+
public static readonly string[] SteamRegistryKeys = {
3838
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Valve\\Steam",
3939
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Valve\\Steam"
4040
};
4141

42-
public static string SteamRegistryValue = "InstallPath";
42+
public static readonly string SteamRegistryValue = "InstallPath";
4343

44-
public static string SteamAppsKey = @"HKEY_CURRENT_USER\Software\Valve\Steam\Apps\";
44+
public static readonly string SteamAppsKey = @"HKEY_CURRENT_USER\Software\Valve\Steam\Apps\";
4545

46-
public static int GalacticAdventuresSteamID = 24720;
46+
public static readonly string GalacticAdventuresSteamID = "24720";
4747

4848

4949
// remove "" if necessary
@@ -61,7 +61,7 @@ private static string FixPath(string path)
6161

6262
public static bool SporeIsInstalledOnSteam()
6363
{
64-
object result = Registry.GetValue(SteamAppsKey + GalacticAdventuresSteamID.ToString(), "Installed", 0);
64+
object result = Registry.GetValue(SteamAppsKey + GalacticAdventuresSteamID, "Installed", 0);
6565
// returns null if the key does not exist, or default value if the key existed but the value did not
6666
return result == null ? false : ((int)result == 0 ? false : true);
6767
}

0 commit comments

Comments
 (0)