status store
This commit is contained in:
parent
873ee1d7d3
commit
59db0ad1fb
|
|
@ -674,6 +674,35 @@ public class GlobalFuncs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CheckOpenedStatus(bool write)
|
||||||
|
{
|
||||||
|
string cfgpath = GlobalPaths.ConfigDir + "\\" + GlobalPaths.StatusName;
|
||||||
|
|
||||||
|
if (!File.Exists(cfgpath))
|
||||||
|
{
|
||||||
|
// force write mode on if the file doesn't exist.
|
||||||
|
write = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (write)
|
||||||
|
{
|
||||||
|
//WRITE
|
||||||
|
INIFile ini = new INIFile(cfgpath);
|
||||||
|
|
||||||
|
string section = "Status";
|
||||||
|
ini.IniWriteValue(section, "GameOpened", ((int)GlobalVars.GameOpened).ToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//READ
|
||||||
|
string clientopened;
|
||||||
|
INIFile ini = new INIFile(cfgpath);
|
||||||
|
string section = "Status";
|
||||||
|
clientopened = ini.IniReadValue(section, "GameOpened", ((int)GlobalVars.GameOpened).ToString());
|
||||||
|
GlobalVars.GameOpened = (ScriptType)Enum.Parse(typeof(ScriptType), clientopened);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static bool InitColors()
|
public static bool InitColors()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ public class GlobalPaths
|
||||||
public static readonly string ConfigName = "config.ini";
|
public static readonly string ConfigName = "config.ini";
|
||||||
public static string ConfigNameCustomization = "config_customization.ini";
|
public static string ConfigNameCustomization = "config_customization.ini";
|
||||||
public static readonly string InfoName = "info.ini";
|
public static readonly string InfoName = "info.ini";
|
||||||
|
public static readonly string StatusName = "status.ini";
|
||||||
public static readonly string ScriptName = "CSMPFunctions";
|
public static readonly string ScriptName = "CSMPFunctions";
|
||||||
public static readonly string ScriptGenName = "CSMPBoot";
|
public static readonly string ScriptGenName = "CSMPBoot";
|
||||||
public static readonly string ContentProviderXMLName = "ContentProviders.xml";
|
public static readonly string ContentProviderXMLName = "ContentProviders.xml";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue