private void SaveAndExit() { for (int i = 0; i < HotkeyLabels.Count; i++) { CmConfig.Section_hotkeys[HotkeyLabels[i]] = HotkeyButtons[i]; } CmConfig.WriteConfig(); CmConfig.SetKeyBindings(); Destroy(Instance); }
public static CmConfig Load() { if (Instance == null) { Instance = FindObjectOfType(typeof(CmConfig)) as CmConfig; if (Instance == null) { GameObject cmconfig_command = new GameObject().AddComponent <CmConfig>().gameObject; cmconfig_command.name = "CmConfig"; Instance = cmconfig_command.GetComponent <CmConfig>(); } } return(Instance); }
public void Awake() { Instance = this; DevConsole.RegisterConsoleCommand(this, "cmconfig", false, false); SNLogger.Log($"[{Config.PROGRAM_NAME}] Information: Enter 'cmconfig' command for configuration window."); }