Пример #1
0
        /// <summary>
        /// Triggers when the form is finished loading
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormLoaded(object sender, EventArgs e)
        {
            //Start the timer once the form is loaded
            InitTimer();

            MainTabControl.SelectedTab = RushingTab;

            TabPage firstRushing = CreateTab(RushingTabControl, new RushingUserControl(0), 0);
            Button  button       = FindControl <Button>("AddScript", firstRushing);

            button.Enabled   = false;
            button.BackColor = Color.Gray;

            int lastIndex = 1;

            //If there are more rushing tabs that should be created, create them
            for (int i = 1; i < Data.rushConfigs.Length; i++)
            {
                if (Data.rushConfigs[i] != null)
                {
                    TabPage tp = CreateTab(RushingTabControl, new RushingUserControl(i), i);
                    Button  b  = FindControl <Button>("AddScript", tp);
                    b.Enabled   = false;
                    b.BackColor = Color.Gray;
                    lastIndex++;
                }
            }

            button           = FindControl <Button>("AddScript", FindControl <TabPage>("Script" + lastIndex));
            button.Enabled   = true;
            button.BackColor = Color.White;

            //Create a new blank RUC in order to copy the controls over to the game info tab
            RushingUserControl ruc = new RushingUserControl(-1);

            GameInfoPanel.Controls.Add(ruc.SettingsPanel);

            foreach (CustomCheckBox box in FindControls <CustomCheckBox>("", GameInfoPanel))
            {
                box.AutoCheck = false;
                box.Cursor    = Cursors.Default;
                box.Loaded();
            }

            //Set the current tab as the first one
            RushingTabControl.SelectedTab = firstRushing;
            MainTabControl.SelectedTab    = MainTab;

            //Apply the link to the LinkLabels
            GitHubLink.Links.Add(0, 0, "https://github.com/StarOfDoom/RotMGScripts");
            GitHubLink.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkClicked);

            //Update the version label to include the current version number
            VersionNumberLabel.Text = Info.version;

            //Add event handlers for when you click hotkey buttons
            HotkeyButton0.Click += new EventHandler(HotkeyButtonClick);

            //Set the paint handler for adding images to the background
            DebuggingInfoPanel.Paint += new PaintEventHandler(InfoTabPaint);

            //Set the paint handler for adding images to the title bar
            TitleBarPanel.Paint += new PaintEventHandler(TitleBarPaint);

            //Call event when the text is changed in the process name field
            ProcessName.TextChanged += new EventHandler(ProcessTextChanged);

            //Call event when a key is pressed in the console input to check for an Enter or Arrow key
            ConsoleInput.KeyDown    += new KeyEventHandler(ConsoleInputKeyDown);
            ConsoleSendButton.Click += new EventHandler(ConsoleSendClick);

            //Update the two delays
            SearchDelayInput.ValueChanged += new EventHandler(DelayInputValueChanged);
            UpdateDelayInput.ValueChanged += new EventHandler(DelayInputValueChanged);

            //Add event handlers for checking the auto resize box
            foreach (CheckBox box in FindControls <CheckBox>("", AspectRatioGroup))
            {
                box.MouseClick += new MouseEventHandler(AspectBoxChanged);
            }

            //Lets you drag around the window without a windows title bar
            TitleBarPanel.MouseDown += new MouseEventHandler(TitleBar);
            TitleLabel.MouseDown    += new MouseEventHandler(TitleBar);

            ExitButton.InitializeButton();
            MinimizeButton.InitializeButton();

            KeyboardHook.StartHook();
        }
Пример #2
0
        /// <summary>
        /// Triggers when the form is finished loading
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FormLoaded(object sender, EventArgs e)
        {
            //Set the current tab as the first one
            MainTabControl.SelectedTab = MainTab;

            //Apply the link to the LinkLabels
            GitHubLink.Links.Add(0, 0, "https://github.com/StarOfDoom/PokerNeuralNetwork");
            GitHubLink.LinkClicked += new LinkLabelLinkClickedEventHandler(LinkClicked);

            //Update the version label to include the current version number
            VersionNumberLabel.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();

            //Set the paint handler for adding images to the background
            DebuggingInfoPanel.Paint += new PaintEventHandler(InfoTabPaint);

            //Set the paint handler for adding images to the title bar
            TitleBarPanel.Paint += new PaintEventHandler(TitleBarPaint);

            //Lets you drag around the window without a windows title bar
            TitleBarPanel.MouseDown += new MouseEventHandler(TitleBar);
            TitleLabel.MouseDown    += new MouseEventHandler(TitleBar);

            //When one of the settings is changed
            SBValue.ValueChanged      += new EventHandler(SBValueChanged);
            ChipsValue.ValueChanged   += new EventHandler(ChipsValueChanged);
            PlayersValue.ValueChanged += new EventHandler(PlayersValueChanged);

            //Call event when a key is pressed in the console input to check for an Enter or Arrow key
            ConsoleInput.KeyDown    += new KeyEventHandler(ConsoleInputKeyDown);
            ConsoleSendButton.Click += new EventHandler(ConsoleSendClick);

            //Scroll when rich text box changed
            RichConsoleText.TextChanged += new EventHandler(ConsoleTextChanged);

            //Play new game
            StartHoldemButton.Click += new EventHandler(StartNewGame);

            VisualTab.Enabled   = false;
            SettingsTab.Enabled = false;

            ConsolePopoutCheckbox.Cursor = Cursors.Hand;
            ConsolePopoutCheckbox.Loaded();
            ConsolePopoutCheckbox.Click += ConsoleCheckboxToggle;

            SBText.Cursor    = Cursors.IBeam;
            ChipsText.Cursor = Cursors.IBeam;

            //ThreadPool.SetMinThreads(4, 4);
            ThreadPool.SetMaxThreads(16, 16);

            ExitButton.InitializeButton();
            MinimizeButton.InitializeButton();

            SaveData data = Data.Load();

            Console.WriteLine(JsonConvert.SerializeObject(data));

            if (data != null)
            {
                bool boxChecked = data.ConsolePopOut;
                this.ConsolePopoutCheckbox.Checked = boxChecked;

                if (boxChecked)
                {
                    ConsoleTab.Enabled = false;
                    console.Show();
                }
                else
                {
                    ConsoleTab.Enabled = true;
                    console.Hide();
                }

                this.SBValue.Value      = data.SmallBlind;
                this.ChipsValue.Value   = data.StartingChips;
                this.PlayersValue.Value = data.Players;
            }
        }