Ejemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (File.Exists(".\\" + filename))
            {
                try
                {
                    Keys key;

                    textBox_Attack.Text   = Hack.iniReader(".\\" + filename, MainWindow.InGameName, "KeyAttack", false, "", out MainWindow.keyAttack);
                    textBox_Teleport.Text = Hack.iniReader(".\\" + filename, MainWindow.InGameName, "KeyTeleport", false, "", out MainWindow.keyTeleport);
                    textBox_PickUp.Text   = Hack.iniReader(".\\" + filename, MainWindow.InGameName, "KeyPickUp", false, "", out MainWindow.keyPickUp);
                    textBox_Jump.Text     = Hack.iniReader(".\\" + filename, MainWindow.InGameName, "KeyJump", false, "", out MainWindow.keyJump);
                    //textBox_Door.Text = Hack.iniReader(".\\" + filename, MainWindow.InGameName, "KeyDoor", false, "", out MainWindow.keyDoor);
                    textBox_Skill.Text  = Hack.iniReader(".\\" + filename, MainWindow.InGameName, "KeySkill", false, "", out MainWindow.keySkill);
                    textBox_Combo1.Text = Hack.iniReader(".\\" + filename, MainWindow.InGameName, "KeyCombo1", false, "", out MainWindow.keyCombo1);
                    textBox_Combo2.Text = Hack.iniReader(".\\" + filename, MainWindow.InGameName, "KeyCombo2", false, "", out MainWindow.keyCombo2);

                    textBox_Combo1Delay.Text = Hack.iniReader(".\\" + filename, MainWindow.InGameName,
                                                              "KeyCombo1Delay", true, "3000", out key);
                    int.TryParse(textBox_Combo1Delay.Text, out MainWindow.delayComboKey1);

                    textBox_Combo2Delay.Text = Hack.iniReader(".\\" + filename, MainWindow.InGameName,
                                                              "KeyCombo2Delay", true, "3000", out key);
                    int.TryParse(textBox_Combo2Delay.Text, out MainWindow.delayComboKey2);

                    textBox_AttackParam.Text = Hack.iniReader(".\\" + filename, MainWindow.InGameName,
                                                              "AttackParam", true, "50", out key);
                    int.TryParse(textBox_AttackParam.Text, out MainWindow.attackParam);
                }
                catch
                {
                    System.Windows.MessageBox.Show("設定檔錯誤,請刪除data.ini後再嘗試一次");
                }
            }
        }