Beispiel #1
0
        public EditorForm(UserSettings settings, string initial_file_path = null)
        {
            InitializeComponent();

            ColorPic.BackColor         = Color.Black;
            SavedLabel.ForeColor       = Color.Green;
            KeyCodeCombo.SelectedIndex = 0;
            InitialButtonColor         = StartScriptButton.BackColor;
            InitialTextBoxColor        = MouseSpeedTextBox.BackColor;
            ParentThread = Thread.CurrentThread;

            script.ScriptStopped += Script_ScriptStopped;
            script.LoopFinished  += Script_LoopFinished;

            HotKeyMngr.CreateHotKey(Keys.F6, StopFindCoordsHotKeyPressed);
            HotKeyMngr.CreateHotKey(Keys.F3, ToggleScriptHotkeyPressed);

            JaggedMouseMover Jagged = new JaggedMouseMover();

            MouseMovers = new Dictionary <string, MouseActionPerformer>()
            {
                { "Linear", new LinearMouseMover() },
                { "Recorded", new RecordedMouseMover(MousePathsFile.Paths, Jagged) },
                { "Teleport", new MouseActionPerformer() },
                { "Jagged", Jagged }
            };

            // Initialize MouseMoverComboBox
            foreach (string mover_name in MouseMovers.Keys)
            {
                MouseMoverComboBox.Items.Add(mover_name);
            }
            MouseMoverComboBox.SelectedIndex = 0;

            // Initialize MouseFunctionComboBox
            MouseFunctionComboBox.DataSource    = CursorLocationSetters;
            MouseFunctionComboBox.SelectedIndex = 0;

            InitializeMenuStrip();

            // these are initialized here, so the script properties get set
            // by the TextChanged events
            XBox.Text                = "0";
            YBox.Text                = "0";
            MousePollTextBox.Text    = "125";
            KeyboardPollTextBox.Text = "125";
            MouseSpeedTextBox.Text   = "388~48";
            TypingSpeedTextBox.Text  = "5.2~2.3";
            StandardWaitTextBox.Text = "49~11";

            LoadOptions(settings);
        }