Esempio n. 1
0
        private void SaveConfig()
        {
            // datafiles
            Dictionary <String, String> datafiles = ParseDatafiles();

            if (datafiles == null)
            {
                return;
            }
            parser.DeleteSection("DataFiles");
            foreach (KeyValuePair <String, String> pair in datafiles)
            {
                parser.AddSetting("DataFiles", pair.Key, pair.Value);
            }

            // 2238
            SetFromObject(checkBox1, "2238", "DisplayNames");
            SetFromObject(checkBox2, "2238", "Awareness");
            SetFromObject(checkBox3, "2238", "DisplayTC");
            SetFromObject(comboBox1, "2238", "DisplayTCZones");
            SetFromObject(checkBox5, "2238", "Autosave");
            parser.AddSetting("2238", "MouseScroll", checkBox6.Checked?"0":"1");

            // timeouts
            SetFromObject(checkBox4, "Timeouts", "Enabled");
            SetFromObject(comboBox2, "Timeouts", "Direction");
            parser.AddSetting("Timeouts", "Font", (comboBox3.SelectedIndex + 4).ToString());
            SetFromObject(numericUpDown1, "Timeouts", "Transparency");
            SetFromObject(checkBox7, "Timeouts", "Worldmap");

            // timeouts colors
            SetFromObject(button4, "Timeouts", "NameColor");
            SetFromObject(button5, "Timeouts", "ValueColor");

            // timeouts pos
            SetFromObject(numericUpDown2, "Timeouts", "PositionX");
            SetFromObject(numericUpDown3, "Timeouts", "PositionY");
            SetFromObject(numericUpDown4, "Timeouts", "SpacingX");
            SetFromObject(numericUpDown5, "Timeouts", "SpacingY");
            SetFromObject(numericUpDown7, "Timeouts", "WorldmapX");
            SetFromObject(numericUpDown6, "Timeouts", "WorldmapY");

            KeyBinds.Save(parser);
            parser.SaveSettings();

            // DataFiles2238.cfg
            StreamWriter sw = new StreamWriter(@"DataFiles2238.cfg");

            sw.WriteLine(textBox1.Text);
            sw.WriteLine(textBox2.Text);
            sw.Close();
        }
Esempio n. 2
0
        public static void Save(IniParser parser)
        {
            parser.DeleteSection("Bindings");
            int idx = 0;

            foreach (KeyBind bind in Binds)
            {
                if (bind.Type.Equals("UseBind"))
                {
                    parser.AddSetting("Bindings", "UseBind" + idx, bind.GetSave());
                    idx++;
                }
                else
                {
                    parser.AddSetting("Bindings", bind.Type, bind.GetSave());
                }
            }
        }
Esempio n. 3
0
 public static void Save(IniParser parser)
 {
     parser.DeleteSection("Bindings");
     int idx = 0;
     foreach (KeyBind bind in Binds)
     {
         if (bind.Type.Equals("UseBind"))
         {
             parser.AddSetting("Bindings", "UseBind" + idx,bind.GetSave());
             idx++;
         }
         else parser.AddSetting("Bindings", bind.Type, bind.GetSave());
     }
 }