status store

This commit is contained in:
Bitl 2022-09-12 12:52:57 -07:00
parent 873ee1d7d3
commit 59db0ad1fb
2 changed files with 30 additions and 0 deletions

View File

@ -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()
{
try

View File

@ -112,6 +112,7 @@ public class GlobalPaths
public static readonly string ConfigName = "config.ini";
public static string ConfigNameCustomization = "config_customization.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 ScriptGenName = "CSMPBoot";
public static readonly string ContentProviderXMLName = "ContentProviders.xml";