Esempio n. 1
0
        void SaveCfg()
        {
            ConfigNode file = new ConfigNode();
            ConfigNode node = new ConfigNode();

            node.AddValue("actionKey", actionKey.ToString());
            node.AddValue("snapMode", snapMode.ToString());
            file.AddNode(CFC_NODE, node);
            file.Save(CFC_CFG_FILE);
        }
Esempio n. 2
0
 /*
  * This method is called whenever the user presses the confirm button in the
  * custom experience mode panel or in the mod settings panel.
  * You also don't need to override this method if you don't need it.
  */
 protected override void OnConfirm()
 {
     Debug.Log("Settings applied!");
     Debug.Log("boolVal = " + boolVal);
     Debug.Log("stringChoice = " + stringChoice);
     Debug.Log("enumChoice = " + enumChoice);
     Debug.Log("timeOfDayChoice = " + timeOfDayChoice);
     Debug.Log("steplessSliderValue = " + steplessSliderValue);
     Debug.Log("steppedSliderValue = " + steppedSliderValue);
     Debug.Log("intSliderValue = " + intSliderValue);
     Debug.Log("keyCode = " + keyCode.ToString());
 }
Esempio n. 3
0
        bool LoadCfg()
        {
            ConfigNode file;

            if (System.IO.File.Exists(CFC_CFG_FILE))
            {
                file = ConfigNode.Load(CFC_CFG_FILE);
            }
            else
            {
                return(false);
            }

            ConfigNode node = file.GetNode(CFC_NODE);

            if (node != null)
            {
                actionKey = (KeyCode)System.Enum.Parse(typeof(KeyCode), SafeLoad(node.GetValue("actionKey"), "O"));
                snapMode  = (SnapMode)System.Enum.Parse(typeof(SnapMode), SafeLoad(node.GetValue("snapMode"), SnapMode.smooth.ToString()));
                DebugPrint("LoadCfg, actionKey: " + actionKey.ToString() + ", snapMode: " + snapMode.ToString());
            }
            return(true);
        }