예제 #1
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     parser = new IniParser(@".\FOnline2238.cfg");
     LoadConfig();
     KeyBinds.Init(listBoxBindings, parser);
     KeybindForm.LoadIndex();
 }
예제 #2
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     Bind.Type = index[cmbType.SelectedIndex].Key;
     if (Bind.Type.Equals("UseBind"))
     {
         Bind.SetItemsFromControl(listBox1);
     }
     Bind.SetFromControls(cbShift, cbAlt, cbCtrl, cmbKey);
     KeyBinds.RefreshLastIndex();
     Close();
 }
예제 #3
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();
        }
예제 #4
0
 private void btnRemoveBind_Click(object sender, EventArgs e)
 {
     KeyBinds.RemovePressed();
 }
예제 #5
0
 private void btnAddBind_Click(object sender, EventArgs e)
 {
     KeyBinds.AddPressed();
 }
예제 #6
0
 private void listBoxBindings_DoubleClick(object sender, EventArgs e)
 {
     KeyBinds.DoubleClick();
 }