public bool Load(string filepath = "") { if (!String.IsNullOrEmpty(filepath)) { FilePath = filepath; } // Load config file if (File.Exists(Defines.ConfigFile)) { configTable = Toml.ReadFile(Defines.ConfigFile).ToDictionary(); if (configTable.ContainsKey(Defines.KeyConfig)) { InputMonitor.SetKeys((Dictionary <string, object>)configTable[Defines.KeyConfig]); } if (configTable.ContainsKey(Defines.TouchConfig)) { TouchSettings.SetConfig((Dictionary <string, object>)configTable[Defines.TouchConfig]); } if (configTable.ContainsKey(Defines.GameConfig)) { GameSettingsScreen.SetConfig((Dictionary <string, object>)configTable[Defines.GameConfig]); } } else { // Build defaults } return(true); }
public void ResetGameSettings() { configTable = Toml.ReadFile(Defines.ConfigFile).ToDictionary(); if (configTable.ContainsKey(Defines.GameConfig)) { GameSettingsScreen.SetConfig((Dictionary <string, object>)configTable[Defines.GameConfig]); } }