コード例 #1
0
ファイル: MiscManager.cs プロジェクト: mkdasher/STROOP
        public MiscManager(List <WatchVariableControlPrecursor> variables, WatchVariablePanel variableTable, Control miscControl)
            : base(variables, variableTable)
        {
            SplitContainer splitContainerMisc = miscControl.Controls["splitContainerMisc"] as SplitContainer;

            _checkBoxTurnOffMusic = splitContainerMisc.Panel1.Controls["checkBoxTurnOffMusic"] as CheckBox;

            GroupBox groupBoxRNGIndexTester = splitContainerMisc.Panel1.Controls["groupBoxRNGIndexTester"] as GroupBox;
            TextBox  textBoxRNGIndexTester  = groupBoxRNGIndexTester.Controls["textBoxRNGIndexTester"] as TextBox;
            Button   buttonRNGIndexTester   = groupBoxRNGIndexTester.Controls["buttonRNGIndexTester"] as Button;

            buttonRNGIndexTester.Click += (sender, e) =>
            {
                int?rngIndexNullable = ParsingUtilities.ParseIntNullable(textBoxRNGIndexTester.Text);
                if (!rngIndexNullable.HasValue)
                {
                    return;
                }
                int    rngIndex = rngIndexNullable.Value;
                ushort rngValue = RngIndexer.GetRngValue(rngIndex);
                Config.Stream.SetValue(rngValue, MiscConfig.RngAddress);
                int nextRngIndex = rngIndex + 1;
                textBoxRNGIndexTester.Text = nextRngIndex.ToString();
            };
        }
コード例 #2
0
ファイル: DataManager.cs プロジェクト: mkdasher/STROOP
 public DataManager(
     List <WatchVariableControlPrecursor> variables,
     WatchVariablePanel variablePanel,
     List <VariableGroup> allVariableGroups     = null,
     List <VariableGroup> visibleVariableGroups = null)
 {
     _variablePanel = variablePanel;
     _variablePanel.Initialize(
         variables,
         allVariableGroups,
         visibleVariableGroups);
 }
コード例 #3
0
        public MarioManager(List <WatchVariableControlPrecursor> variables, Control marioControl, WatchVariablePanel variableTable)
            : base(variables, variableTable, ALL_VAR_GROUPS, VISIBLE_VAR_GROUPS)
        {
            SplitContainer splitContainerMario = marioControl.Controls["splitContainerMario"] as SplitContainer;

            Button toggleHandsfree = splitContainerMario.Panel1.Controls["buttonMarioToggleHandsfree"] as Button;

            toggleHandsfree.Click += (sender, e) => ButtonUtilities.ToggleHandsfree();

            Button toggleVisibility = splitContainerMario.Panel1.Controls["buttonMarioVisibility"] as Button;

            toggleVisibility.Click += (sender, e) => ButtonUtilities.ToggleVisibility();

            var marioPosGroupBox = splitContainerMario.Panel1.Controls["groupBoxMarioPos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Euler,
                marioPosGroupBox,
                marioPosGroupBox.Controls["buttonMarioPosXn"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosXp"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosZn"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosZp"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosXnZn"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosXnZp"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosXpZn"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosXpZp"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosYp"] as Button,
                marioPosGroupBox.Controls["buttonMarioPosYn"] as Button,
                marioPosGroupBox.Controls["textBoxMarioPosXZ"] as TextBox,
                marioPosGroupBox.Controls["textBoxMarioPosY"] as TextBox,
                marioPosGroupBox.Controls["checkBoxMarioPosRelative"] as CheckBox,
                (float hOffset, float vOffset, float nOffset, bool useRelative) =>
            {
                ButtonUtilities.TranslateMario(
                    hOffset,
                    nOffset,
                    -1 * vOffset,
                    useRelative);
            });

            var marioStatsGroupBox = splitContainerMario.Panel1.Controls["groupBoxMarioStats"] as GroupBox;

            ControlUtilities.InitializeScalarController(
                marioStatsGroupBox.Controls["buttonMarioStatsYawN"] as Button,
                marioStatsGroupBox.Controls["buttonMarioStatsYawP"] as Button,
                marioStatsGroupBox.Controls["textBoxMarioStatsYaw"] as TextBox,
                (float value) =>
            {
                ButtonUtilities.MarioChangeYaw((int)Math.Round(value));
            });
            ControlUtilities.InitializeScalarController(
                marioStatsGroupBox.Controls["buttonMarioStatsHspdN"] as Button,
                marioStatsGroupBox.Controls["buttonMarioStatsHspdP"] as Button,
                marioStatsGroupBox.Controls["textBoxMarioStatsHspd"] as TextBox,
                (float value) =>
            {
                ButtonUtilities.MarioChangeHspd(value);
            });
            ControlUtilities.InitializeScalarController(
                marioStatsGroupBox.Controls["buttonMarioStatsVspdN"] as Button,
                marioStatsGroupBox.Controls["buttonMarioStatsVspdP"] as Button,
                marioStatsGroupBox.Controls["textBoxMarioStatsVspd"] as TextBox,
                (float value) =>
            {
                ButtonUtilities.MarioChangeVspd(value);
            });

            var marioSlidingSpeedGroupBox = splitContainerMario.Panel1.Controls["groupBoxMarioSlidingSpeed"] as GroupBox;

            ControlUtilities.InitializeScalarController(
                marioSlidingSpeedGroupBox.Controls["buttonMarioSlidingSpeedXn"] as Button,
                marioSlidingSpeedGroupBox.Controls["buttonMarioSlidingSpeedXp"] as Button,
                marioSlidingSpeedGroupBox.Controls["textBoxMarioSlidingSpeedX"] as TextBox,
                (float value) =>
            {
                ButtonUtilities.MarioChangeSlidingSpeedX(value);
            });
            ControlUtilities.InitializeScalarController(
                marioSlidingSpeedGroupBox.Controls["buttonMarioSlidingSpeedZn"] as Button,
                marioSlidingSpeedGroupBox.Controls["buttonMarioSlidingSpeedZp"] as Button,
                marioSlidingSpeedGroupBox.Controls["textBoxMarioSlidingSpeedZ"] as TextBox,
                (float value) =>
            {
                ButtonUtilities.MarioChangeSlidingSpeedZ(value);
            });
            ControlUtilities.InitializeScalarController(
                marioSlidingSpeedGroupBox.Controls["buttonMarioSlidingSpeedHn"] as Button,
                marioSlidingSpeedGroupBox.Controls["buttonMarioSlidingSpeedHp"] as Button,
                marioSlidingSpeedGroupBox.Controls["textBoxMarioSlidingSpeedH"] as TextBox,
                (float value) =>
            {
                ButtonUtilities.MarioChangeSlidingSpeedH(value);
            });
            ControlUtilities.InitializeScalarController(
                marioSlidingSpeedGroupBox.Controls["buttonMarioSlidingSpeedYawN"] as Button,
                marioSlidingSpeedGroupBox.Controls["buttonMarioSlidingSpeedYawP"] as Button,
                marioSlidingSpeedGroupBox.Controls["textBoxMarioSlidingSpeedYaw"] as TextBox,
                (float value) =>
            {
                ButtonUtilities.MarioChangeSlidingSpeedYaw(value);
            });

            Button buttonMarioHOLPGoto = splitContainerMario.Panel1.Controls["buttonMarioHOLPGoto"] as Button;

            buttonMarioHOLPGoto.Click += (sender, e) => ButtonUtilities.GotoHOLP();
            ControlUtilities.AddContextMenuStripFunctions(
                buttonMarioHOLPGoto,
                new List <string>()
            {
                "Goto HOLP", "Goto HOLP Laterally", "Goto HOLP X", "Goto HOLP Y", "Goto HOLP Z"
            },
                new List <Action>()
            {
                () => ButtonUtilities.GotoHOLP((true, true, true)),
                () => ButtonUtilities.GotoHOLP((true, false, true)),
                () => ButtonUtilities.GotoHOLP((true, false, false)),
                () => ButtonUtilities.GotoHOLP((false, true, false)),
                () => ButtonUtilities.GotoHOLP((false, false, true)),
            });
コード例 #4
0
        public FileManager(List <WatchVariableControlPrecursor> variables, TabPage tabControl, WatchVariablePanel watchVariablePanelFile, FileImageGui gui)
            : base(variables, watchVariablePanelFile)
        {
            _tabControl = tabControl;
            _gui        = gui;

            _filePictureBoxList         = new List <FilePictureBox>();
            _fileTextboxList            = new List <FileTextbox>();
            _courseStarsAddressOffsets  = new uint[numRows];
            _courseStarsMasks           = new byte[numRows];
            _courseCannonAddressOffsets = new uint?[numRows];
            _courseCannonMasks          = new byte?[numRows];
            _courseDoorAddressOffsets   = new uint?[numRows];
            _courseDoorMasks            = new byte?[numRows];

            CurrentFileMode        = FileMode.FileA;
            currentAllCoinsMeaning = AllCoinsMeaning.Coins100;

            SplitContainer splitContainerFile = tabControl.Controls["splitContainerFile"] as SplitContainer;

            GroupBox fileGroupbox = splitContainerFile.Panel1.Controls["groupBoxFile"] as GroupBox;

            (fileGroupbox.Controls["radioButtonFileA"] as RadioButton).Click
                += (sender, e) => FileMode_Click(FileMode.FileA);
            (fileGroupbox.Controls["radioButtonFileB"] as RadioButton).Click
                += (sender, e) => FileMode_Click(FileMode.FileB);
            (fileGroupbox.Controls["radioButtonFileC"] as RadioButton).Click
                += (sender, e) => FileMode_Click(FileMode.FileC);
            (fileGroupbox.Controls["radioButtonFileD"] as RadioButton).Click
                += (sender, e) => FileMode_Click(FileMode.FileD);
            (fileGroupbox.Controls["radioButtonFileASaved"] as RadioButton).Click
                += (sender, e) => FileMode_Click(FileMode.FileASaved);
            (fileGroupbox.Controls["radioButtonFileBSaved"] as RadioButton).Click
                += (sender, e) => FileMode_Click(FileMode.FileBSaved);
            (fileGroupbox.Controls["radioButtonFileCSaved"] as RadioButton).Click
                += (sender, e) => FileMode_Click(FileMode.FileCSaved);
            (fileGroupbox.Controls["radioButtonFileDSaved"] as RadioButton).Click
                += (sender, e) => FileMode_Click(FileMode.FileDSaved);

            TableLayoutPanel fileTable = splitContainerFile.Panel1.Controls["tableLayoutPanelFile"] as TableLayoutPanel;

            // stars
            for (int row = 0; row < numRows; row++)
            {
                for (int col = 0; col < 7; col++)
                {
                    string             controlName        = String.Format("filePictureBoxTableRow{0}Col{1}", row + 1, col + 1);
                    FileStarPictureBox fileStarPictureBox = fileTable.Controls[controlName] as FileStarPictureBox;
                    if (fileStarPictureBox == null)
                    {
                        continue;
                    }

                    uint   addressOffset = GetStarAddressOffset(row);
                    byte   mask          = GetStarMask(row, col);
                    string missionName   = TableConfig.Missions.GetMissionName(row + 1, col + 1);
                    fileStarPictureBox.Initialize(_gui, addressOffset, mask, _gui.PowerStarImage, _gui.PowerStarBlackImage, missionName);
                    _filePictureBoxList.Add(fileStarPictureBox);

                    _courseStarsAddressOffsets[row] = addressOffset;
                    _courseStarsMasks[row]          = (byte)(_courseStarsMasks[row] | mask);
                }
            }

            // course labels
            for (int row = 0; row < numRows; row++)
            {
                string          controlName     = String.Format("labelFileTableRow{0}", row + 1);
                FileCourseLabel fileCourseLabel = fileTable.Controls[controlName] as FileCourseLabel;
                fileCourseLabel.Initialize(_courseStarsAddressOffsets[row], _courseStarsMasks[row], row + 1);
            }

            // cannons
            for (int row = 0; row < numRows; row++)
            {
                int    col         = 7;
                string controlName = String.Format("filePictureBoxTableRow{0}Col{1}", row + 1, col + 1);
                FileBinaryPictureBox fileCannonPictureBox = fileTable.Controls[controlName] as FileBinaryPictureBox;
                if (fileCannonPictureBox == null)
                {
                    continue;
                }

                uint addressOffset = GetCannonAddressOffset(row);
                byte mask          = FileConfig.CannonMask;
                fileCannonPictureBox.Initialize(addressOffset, mask, _gui.CannonImage, _gui.CannonLidImage);
                _filePictureBoxList.Add(fileCannonPictureBox);

                _courseCannonAddressOffsets[row] = addressOffset;
                _courseCannonMasks[row]          = mask;
            }

            // doors
            for (int row = 0; row < numRows; row++)
            {
                int    col         = 8;
                string controlName = String.Format("filePictureBoxTableRow{0}Col{1}", row + 1, col + 1);
                FileBinaryPictureBox fileBinaryPictureBox = fileTable.Controls[controlName] as FileBinaryPictureBox;
                if (fileBinaryPictureBox == null)
                {
                    continue;
                }

                uint addressOffset = GetDoorAddressOffset(row);
                byte mask          = GetDoorMask(row);
                (Image onImage, Image offImage) = GetDoorImages(row);
                fileBinaryPictureBox.Initialize(addressOffset, mask, onImage, offImage);
                _filePictureBoxList.Add(fileBinaryPictureBox);

                _courseDoorAddressOffsets[row] = addressOffset;
                _courseDoorMasks[row]          = mask;
            }

            // coin scores
            for (int row = 0; row < 15; row++)
            {
                int    col         = 9;
                string controlName = String.Format("textBoxTableRow{0}Col{1}", row + 1, col + 1);
                FileCoinScoreTextbox fileCoinScoreTextBox = fileTable.Controls[controlName] as FileCoinScoreTextbox;
                fileCoinScoreTextBox.Initialize(FileConfig.CoinScoreOffsetStart + (uint)row);
                _fileTextboxList.Add(fileCoinScoreTextBox);
            }

            GroupBox hatLocationGroupbox = splitContainerFile.Panel1.Controls["groupBoxHatLocation"] as GroupBox;

            // hat location radio button pictures
            FileHatLocationPictureBox filePictureBoxHatLocationMario = hatLocationGroupbox.Controls["filePictureBoxHatLocationMario"] as FileHatLocationPictureBox;

            filePictureBoxHatLocationMario.Initialize(HatLocation.Mario, _gui.HatOnMarioImage, _gui.HatOnMarioGreyImage);
            _filePictureBoxList.Add(filePictureBoxHatLocationMario);

            FileHatLocationPictureBox filePictureBoxHatLocationKlepto = hatLocationGroupbox.Controls["filePictureBoxHatLocationKlepto"] as FileHatLocationPictureBox;

            filePictureBoxHatLocationKlepto.Initialize(HatLocation.SSLKlepto, _gui.HatOnKleptoImage, _gui.HatOnKleptoGreyImage);
            _filePictureBoxList.Add(filePictureBoxHatLocationKlepto);

            FileHatLocationPictureBox filePictureBoxHatLocationSnowman = hatLocationGroupbox.Controls["filePictureBoxHatLocationSnowman"] as FileHatLocationPictureBox;

            filePictureBoxHatLocationSnowman.Initialize(HatLocation.SLSnowman, _gui.HatOnSnowmanImage, _gui.HatOnSnowmanGreyImage);
            _filePictureBoxList.Add(filePictureBoxHatLocationSnowman);

            FileHatLocationPictureBox filePictureBoxHatLocationUkiki = hatLocationGroupbox.Controls["filePictureBoxHatLocationUkiki"] as FileHatLocationPictureBox;

            filePictureBoxHatLocationUkiki.Initialize(HatLocation.TTMUkiki, _gui.HatOnUkikiImage, _gui.HatOnUkikiGreyImage);
            _filePictureBoxList.Add(filePictureBoxHatLocationUkiki);

            FileHatLocationPictureBox filePictureBoxHatLocationSSLGround = hatLocationGroupbox.Controls["filePictureBoxHatLocationSSLGround"] as FileHatLocationPictureBox;

            filePictureBoxHatLocationSSLGround.Initialize(HatLocation.SSLGround, _gui.HatOnGroundInSSLImage, _gui.HatOnGroundInSSLGreyImage);
            _filePictureBoxList.Add(filePictureBoxHatLocationSSLGround);

            FileHatLocationPictureBox filePictureBoxHatLocationSLGround = hatLocationGroupbox.Controls["filePictureBoxHatLocationSLGround"] as FileHatLocationPictureBox;

            filePictureBoxHatLocationSLGround.Initialize(HatLocation.SLGround, _gui.HatOnGroundInSLImage, _gui.HatOnGroundInSLGreyImage);
            _filePictureBoxList.Add(filePictureBoxHatLocationSLGround);

            FileHatLocationPictureBox filePictureBoxHatLocationTTMGround = hatLocationGroupbox.Controls["filePictureBoxHatLocationTTMGround"] as FileHatLocationPictureBox;

            filePictureBoxHatLocationTTMGround.Initialize(HatLocation.TTMGround, _gui.HatOnGroundInTTMImage, _gui.HatOnGroundInTTMGreyImage);
            _filePictureBoxList.Add(filePictureBoxHatLocationTTMGround);

            // hat position textboxes
            FileHatPositionTextbox textboxHatLocationPositionX = hatLocationGroupbox.Controls["textboxHatLocationPositionX"] as FileHatPositionTextbox;

            textboxHatLocationPositionX.Initialize(FileConfig.HatPositionXOffset);
            _fileTextboxList.Add(textboxHatLocationPositionX);

            FileHatPositionTextbox textboxHatLocationPositionY = hatLocationGroupbox.Controls["textboxHatLocationPositionY"] as FileHatPositionTextbox;

            textboxHatLocationPositionY.Initialize(FileConfig.HatPositionYOffset);
            _fileTextboxList.Add(textboxHatLocationPositionY);

            FileHatPositionTextbox textboxHatLocationPositionZ = hatLocationGroupbox.Controls["textboxHatLocationPositionZ"] as FileHatPositionTextbox;

            textboxHatLocationPositionZ.Initialize(FileConfig.HatPositionZOffset);
            _fileTextboxList.Add(textboxHatLocationPositionZ);

            // miscellaneous checkbox pictures
            FileBinaryPictureBox filePictureBoxFileStarted = splitContainerFile.Panel1.Controls["filePictureBoxFileStarted"] as FileBinaryPictureBox;

            filePictureBoxFileStarted.Initialize(FileConfig.FileStartedOffset, FileConfig.FileStartedMask, _gui.FileStartedImage, _gui.FileNotStartedImage);
            _filePictureBoxList.Add(filePictureBoxFileStarted);

            FileBinaryPictureBox filePictureBoxRedCapSwitchPressed = splitContainerFile.Panel1.Controls["filePictureBoxRedCapSwitchPressed"] as FileBinaryPictureBox;

            filePictureBoxRedCapSwitchPressed.Initialize(FileConfig.CapSwitchPressedOffset, FileConfig.RedCapSwitchMask, _gui.CapSwitchRedPressedImage, _gui.CapSwitchRedUnpressedImage);
            _filePictureBoxList.Add(filePictureBoxRedCapSwitchPressed);

            FileBinaryPictureBox filePictureBoxGreenCapSwitchPressed = splitContainerFile.Panel1.Controls["filePictureBoxGreenCapSwitchPressed"] as FileBinaryPictureBox;

            filePictureBoxGreenCapSwitchPressed.Initialize(FileConfig.CapSwitchPressedOffset, FileConfig.GreenCapSwitchMask, _gui.CapSwitchGreenPressedImage, _gui.CapSwitchGreenUnpressedImage);
            _filePictureBoxList.Add(filePictureBoxGreenCapSwitchPressed);

            FileBinaryPictureBox filePictureBoxBlueCapSwitchPressed = splitContainerFile.Panel1.Controls["filePictureBoxBlueCapSwitchPressed"] as FileBinaryPictureBox;

            filePictureBoxBlueCapSwitchPressed.Initialize(FileConfig.CapSwitchPressedOffset, FileConfig.BlueCapSwitchMask, _gui.CapSwitchBluePressedImage, _gui.CapSwitchBlueUnpressedImage);
            _filePictureBoxList.Add(filePictureBoxBlueCapSwitchPressed);

            FileKeyDoorPictureBox filePictureBoxKeyDoor1Opened = splitContainerFile.Panel1.Controls["filePictureBoxKeyDoor1Opened"] as FileKeyDoorPictureBox;

            filePictureBoxKeyDoor1Opened.Initialize(FileConfig.KeyDoorOffset, FileConfig.KeyDoor1KeyMask, FileConfig.KeyDoor1OpenedMask, _gui.KeyDoorOpenKeyImage, _gui.KeyDoorClosedKeyImage, _gui.KeyDoorOpenImage, _gui.KeyDoorClosedImage);
            _filePictureBoxList.Add(filePictureBoxKeyDoor1Opened);

            FileKeyDoorPictureBox filePictureBoxKeyDoor2Opened = splitContainerFile.Panel1.Controls["filePictureBoxKeyDoor2Opened"] as FileKeyDoorPictureBox;

            filePictureBoxKeyDoor2Opened.Initialize(FileConfig.KeyDoorOffset, FileConfig.KeyDoor2KeyMask, FileConfig.KeyDoor2OpenedMask, _gui.KeyDoorOpenKeyImage, _gui.KeyDoorClosedKeyImage, _gui.KeyDoorOpenImage, _gui.KeyDoorClosedImage);
            _filePictureBoxList.Add(filePictureBoxKeyDoor2Opened);

            FileBinaryPictureBox filePictureBoxMoatDrained = splitContainerFile.Panel1.Controls["filePictureBoxMoatDrained"] as FileBinaryPictureBox;

            filePictureBoxMoatDrained.Initialize(FileConfig.MoatDrainedOffset, FileConfig.MoatDrainedMask, _gui.MoatDrainedImage, _gui.MoatNotDrainedImage);
            _filePictureBoxList.Add(filePictureBoxMoatDrained);

            FileBinaryPictureBox filePictureBoxDDDMovedBack = splitContainerFile.Panel1.Controls["filePictureBoxDDDMovedBack"] as FileBinaryPictureBox;

            filePictureBoxDDDMovedBack.Initialize(FileConfig.DDDMovedBackOffset, FileConfig.DDDMovedBackMask, _gui.DDDPaintingMovedBackImage, _gui.DDDPaintingNotMovedBackImage);
            _filePictureBoxList.Add(filePictureBoxDDDMovedBack);

            //checkbox
            _inGameCopyPasteCheckbox = splitContainerFile.Panel1.Controls["checkboxInGameCopyPaste"] as CheckBox;

            // buttons
            Button saveFileButton = splitContainerFile.Panel1.Controls["buttonFileSave"] as Button;

            saveFileButton.Click += FileSaveButton_Click;

            Button eraseFileButton = splitContainerFile.Panel1.Controls["buttonFileErase"] as Button;

            eraseFileButton.Click += FileEraseButton_Click;

            Button copyFileButton = splitContainerFile.Panel1.Controls["buttonFileCopy"] as Button;

            copyFileButton.Click += FileCopyButton_Click;

            Button pasteFileButton = splitContainerFile.Panel1.Controls["buttonFilePaste"] as Button;

            pasteFileButton.Click += FilePasteButton_Click;

            Button allStarsButton = splitContainerFile.Panel1.Controls["buttonAllStars"] as Button;

            allStarsButton.Click += (sender, e) => FileSetCategory(true, new List <FileCategory> {
                FileCategory.Stars
            });

            Button noStarsButton = splitContainerFile.Panel1.Controls["buttonNoStars"] as Button;

            noStarsButton.Click += (sender, e) => FileSetCategory(false, new List <FileCategory> {
                FileCategory.Stars
            });

            Button allCannonsButton = splitContainerFile.Panel1.Controls["buttonAllCannons"] as Button;

            allCannonsButton.Click += (sender, e) => FileSetCategory(true, new List <FileCategory> {
                FileCategory.Cannons
            });

            Button noCannonsButton = splitContainerFile.Panel1.Controls["buttonNoCannons"] as Button;

            noCannonsButton.Click += (sender, e) => FileSetCategory(false, new List <FileCategory> {
                FileCategory.Cannons
            });

            Button allDoorsButton = splitContainerFile.Panel1.Controls["buttonAllDoors"] as Button;

            allDoorsButton.Click += (sender, e) => FileSetCategory(true, new List <FileCategory> {
                FileCategory.Doors
            });

            Button noDoorsButton = splitContainerFile.Panel1.Controls["buttonNoDoors"] as Button;

            noDoorsButton.Click += (sender, e) => FileSetCategory(false, new List <FileCategory> {
                FileCategory.Doors
            });

            Button allCoinsButton = splitContainerFile.Panel1.Controls["buttonAllCoins"] as Button;

            allCoinsButton.Click += (sender, e) => FileSetCategory(true, new List <FileCategory> {
                FileCategory.Coins
            });

            Button noCoinsButton = splitContainerFile.Panel1.Controls["buttonNoCoins"] as Button;

            noCoinsButton.Click += (sender, e) => FileSetCategory(false, new List <FileCategory> {
                FileCategory.Coins
            });

            Button everythingButton = splitContainerFile.Panel1.Controls["buttonEverything"] as Button;

            everythingButton.Click += (sender, e) =>
                                      FileSetCategory(
                true,
                new List <FileCategory>
            {
                FileCategory.Stars,
                FileCategory.Cannons,
                FileCategory.Doors,
                FileCategory.Coins,
                FileCategory.Misc
            });

            Button nothingButton = splitContainerFile.Panel1.Controls["buttonNothing"] as Button;

            nothingButton.Click += (sender, e) =>
                                   FileSetCategory(
                false,
                new List <FileCategory>
            {
                FileCategory.Stars,
                FileCategory.Cannons,
                FileCategory.Doors,
                FileCategory.Coins,
                FileCategory.Misc
            });

            _numStarsButton        = splitContainerFile.Panel1.Controls["buttonFileNumStars"] as Button;
            _numStarsButton.Click += NumStarsButton_Click;

            // everything coin score radio buttons
            GroupBox allCoinsMeaningGroupbox = splitContainerFile.Panel1.Controls["groupBoxAllCoinsMeaning"] as GroupBox;

            (allCoinsMeaningGroupbox.Controls["radioButtonAllCoinsMeaning100Coins"] as RadioButton).Click
                += (sender, e) => { currentAllCoinsMeaning = AllCoinsMeaning.Coins100; };
            (allCoinsMeaningGroupbox.Controls["radioButtonAllCoinsMeaning255Coins"] as RadioButton).Click
                += (sender, e) => { currentAllCoinsMeaning = AllCoinsMeaning.Coins255; };
            (allCoinsMeaningGroupbox.Controls["radioButtonAllCoinsMeaningMaxWithoutGlitches"] as RadioButton).Click
                += (sender, e) => { currentAllCoinsMeaning = AllCoinsMeaning.MaxWithoutGlitches; };
            (allCoinsMeaningGroupbox.Controls["radioButtonAllCoinsMeaningMaxWithGlitches"] as RadioButton).Click
                += (sender, e) => { currentAllCoinsMeaning = AllCoinsMeaning.MaxWithGlitches; };
        }
コード例 #5
0
ファイル: TriangleManager.cs プロジェクト: mkdasher/STROOP
        public TriangleManager(Control tabControl, List <WatchVariableControlPrecursor> variables, WatchVariablePanel watchVariablePanel)
            : base(variables, watchVariablePanel, ALL_VAR_GROUPS, VISIBLE_VAR_GROUPS)
        {
            _triangleCache = new Dictionary <uint, TriangleStruct>();

            _triangleData = new List <short[]>();

            SplitContainer splitContainerTriangles = tabControl.Controls["splitContainerTriangles"] as SplitContainer;

            _addressBox = splitContainerTriangles.Panel1.Controls["maskedTextBoxOtherTriangle"] as MaskedTextBox;
            _useMisalignmentOffsetCheckbox = splitContainerTriangles.Panel1.Controls["checkBoxVertexMisalignment"] as CheckBox;

            _addressBox.KeyDown += AddressBox_KeyDown;
            (splitContainerTriangles.Panel1.Controls["radioButtonTriFloor"] as RadioButton).Click
                += (sender, e) => Mode_Click(sender, e, TriangleMode.Floor);
            (splitContainerTriangles.Panel1.Controls["radioButtonTriWall"] as RadioButton).Click
                += (sender, e) => Mode_Click(sender, e, TriangleMode.Wall);
            (splitContainerTriangles.Panel1.Controls["radioButtonTriCeiling"] as RadioButton).Click
                += (sender, e) => Mode_Click(sender, e, TriangleMode.Ceiling);
            (splitContainerTriangles.Panel1.Controls["radioButtonTriOther"] as RadioButton).Click
                += (sender, e) => Mode_Click(sender, e, TriangleMode.Other);

            (splitContainerTriangles.Panel1.Controls["labelTriangleSelection"] as Label).Click
                += (sender, e) => ShowTriangleCoordinates();

            (splitContainerTriangles.Panel1.Controls["buttonGotoV1"] as Button).Click
                += (sender, e) => ButtonUtilities.GotoTriangle(_triangleAddress, 1, _useMisalignmentOffsetCheckbox.Checked);
            (splitContainerTriangles.Panel1.Controls["buttonGotoV2"] as Button).Click
                += (sender, e) => ButtonUtilities.GotoTriangle(_triangleAddress, 2, _useMisalignmentOffsetCheckbox.Checked);
            (splitContainerTriangles.Panel1.Controls["buttonGotoV3"] as Button).Click
                += (sender, e) => ButtonUtilities.GotoTriangle(_triangleAddress, 3, _useMisalignmentOffsetCheckbox.Checked);
            (splitContainerTriangles.Panel1.Controls["buttonGotoVClosest"] as Button).Click += (sender, e) =>
            {
                int closestVertex = WatchVariableSpecialUtilities.GetClosestTriangleVertexIndex(_triangleAddress);
                ButtonUtilities.GotoTriangle(_triangleAddress, closestVertex, _useMisalignmentOffsetCheckbox.Checked);
            };

            (splitContainerTriangles.Panel1.Controls["buttonRetrieveTriangle"] as Button).Click
                += (sender, e) => ButtonUtilities.RetrieveTriangle(_triangleAddress);

            Button buttonNeutralizeTriangle = splitContainerTriangles.Panel1.Controls["buttonNeutralizeTriangle"] as Button;

            buttonNeutralizeTriangle.Click += (sender, e) => ButtonUtilities.NeutralizeTriangle(_triangleAddress);
            ControlUtilities.AddContextMenuStripFunctions(
                buttonNeutralizeTriangle,
                new List <string>()
            {
                "Neutralize", "Neutralize with 0", "Neutralize with 21"
            },
                new List <Action>()
            {
                () => ButtonUtilities.NeutralizeTriangle(_triangleAddress),
                () => ButtonUtilities.NeutralizeTriangle(_triangleAddress, false),
                () => ButtonUtilities.NeutralizeTriangle(_triangleAddress, true),
            });

            (splitContainerTriangles.Panel1.Controls["buttonAnnihilateTriangle"] as Button).Click
                += (sender, e) => ButtonUtilities.AnnihilateTriangle(_triangleAddress);

            var trianglePosGroupBox = splitContainerTriangles.Panel1.Controls["groupBoxTrianglePos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Euler,
                trianglePosGroupBox,
                trianglePosGroupBox.Controls["buttonTrianglePosXn"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosXp"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosZn"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosZp"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosXnZn"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosXnZp"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosXpZn"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosXpZp"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosYp"] as Button,
                trianglePosGroupBox.Controls["buttonTrianglePosYn"] as Button,
                trianglePosGroupBox.Controls["textBoxTrianglePosXZ"] as TextBox,
                trianglePosGroupBox.Controls["textBoxTrianglePosY"] as TextBox,
                trianglePosGroupBox.Controls["checkBoxTrianglePosRelative"] as CheckBox,
                (float hOffset, float vOffset, float nOffset, bool useRelative) =>
            {
                ButtonUtilities.MoveTriangle(
                    _triangleAddress,
                    hOffset,
                    nOffset,
                    -1 * vOffset,
                    useRelative);
            });

            var triangleNormalGroupBox = splitContainerTriangles.Panel1.Controls["groupBoxTriangleNormal"] as GroupBox;

            ControlUtilities.InitializeScalarController(
                triangleNormalGroupBox.Controls["buttontriangleNormalN"] as Button,
                triangleNormalGroupBox.Controls["buttontriangleNormalP"] as Button,
                triangleNormalGroupBox.Controls["textBoxTriangleNormal"] as TextBox,
                (float normalValue) =>
            {
                ButtonUtilities.MoveTriangleNormal(_triangleAddress, normalValue);
            });

            _checkBoxNeutralizeTriangle = splitContainerTriangles.Panel1.Controls["checkBoxNeutralizeTriangle"] as CheckBox;

            (splitContainerTriangles.Panel1.Controls["buttonTriangleShowCoords"] as Button).Click
                += (sender, e) => ShowTriangleCoordinates();
            (splitContainerTriangles.Panel1.Controls["buttonTriangleShowEquation"] as Button).Click
                += (sender, e) => ShowTriangleEquation();

            _recordTriangleDataCheckbox = splitContainerTriangles.Panel1.Controls["checkBoxRecordTriangleData"] as CheckBox;
            _recordTriangleCountLabel   = splitContainerTriangles.Panel1.Controls["labelRecordTriangleCount"] as Label;

            (splitContainerTriangles.Panel1.Controls["buttonTriangleShowData"] as Button).Click
                += (sender, e) => ShowTriangleData();
            (splitContainerTriangles.Panel1.Controls["buttonTriangleShowVertices"] as Button).Click
                += (sender, e) => ShowTriangleVertices();
            (splitContainerTriangles.Panel1.Controls["buttonTriangleClearData"] as Button).Click
                += (sender, e) => ClearTriangleData();

            _repeatFirstVertexCheckbox = splitContainerTriangles.Panel1.Controls["checkBoxRepeatFirstVertex"] as CheckBox;

            (splitContainerTriangles.Panel1.Controls["buttonTriangleShowLevelTris"] as Button).Click
                += (sender, e) => TriangleUtilities.ShowTriangles(TriangleUtilities.GetLevelTriangles());
            (splitContainerTriangles.Panel1.Controls["buttonTriangleShowObjTris"] as Button).Click
                += (sender, e) => TriangleUtilities.ShowTriangles(TriangleUtilities.GetObjectTriangles());
            (splitContainerTriangles.Panel1.Controls["buttonTriangleShowAllTris"] as Button).Click
                += (sender, e) => TriangleUtilities.ShowTriangles(TriangleUtilities.GetAllTriangles());

            var buttonTriangleNeutralizeAllTriangles = splitContainerTriangles.Panel1.Controls["buttonTriangleNeutralizeAllTriangles"] as Button;

            buttonTriangleNeutralizeAllTriangles.Click += (sender, e) => TriangleUtilities.NeutralizeTriangles();

            ControlUtilities.AddContextMenuStripFunctions(
                buttonTriangleNeutralizeAllTriangles,
                new List <string>()
            {
                "Neutralize All Triangles",
                "Neutralize Wall Triangles",
                "Neutralize Floor Triangles",
                "Neutralize Ceiling Triangles",
            },
                new List <Action>()
            {
                () => TriangleUtilities.NeutralizeTriangles(),
                () => TriangleUtilities.NeutralizeTriangles(TriangleClassification.Wall),
                () => TriangleUtilities.NeutralizeTriangles(TriangleClassification.Floor),
                () => TriangleUtilities.NeutralizeTriangles(TriangleClassification.Ceiling),
            });

            var buttonTriangleDisableAllCamCollision = splitContainerTriangles.Panel1.Controls["buttonTriangleDisableAllCamCollision"] as Button;

            buttonTriangleDisableAllCamCollision.Click += (sender, e) => TriangleUtilities.DisableCamCollision();

            ControlUtilities.AddContextMenuStripFunctions(
                buttonTriangleDisableAllCamCollision,
                new List <string>()
            {
                "Disable Cam Collision for All Triangles",
                "Disable Cam Collision for Wall Triangles",
                "Disable Cam Collision for Floor Triangles",
                "Disable Cam Collision for Ceiling Triangles",
            },
                new List <Action>()
            {
                () => TriangleUtilities.DisableCamCollision(),
                () => TriangleUtilities.DisableCamCollision(TriangleClassification.Wall),
                () => TriangleUtilities.DisableCamCollision(TriangleClassification.Floor),
                () => TriangleUtilities.DisableCamCollision(TriangleClassification.Ceiling),
            });
        }
コード例 #6
0
ファイル: InputManager.cs プロジェクト: mkdasher/STROOP
        public InputManager(List <WatchVariableControlPrecursor> variables, Control inputControl, WatchVariablePanel variableTable, InputImageGui gui)
            : base(variables, variableTable)
        {
            _gui = gui;

            SplitContainer splitContainerInput = inputControl.Controls["splitContainerInput"] as SplitContainer;

            _inputDisplayPanel = splitContainerInput.Panel1.Controls["inputDisplayPanel"] as InputDisplayPanel;

            _inputDisplayPanel.setInputDisplayGui(_gui);
        }
コード例 #7
0
ファイル: ObjectManager.cs プロジェクト: mkdasher/STROOP
        public ObjectManager(List <WatchVariableControlPrecursor> variables, Control objectControl, WatchVariablePanel variableTable)
            : base(variables, variableTable, ALL_VAR_GROUPS, VISIBLE_VAR_GROUPS)
        {
            SplitContainer splitContainerObject = objectControl.Controls["splitContainerObject"] as SplitContainer;

            _objAddressLabelValue    = splitContainerObject.Panel1.Controls["labelObjAddValue"] as Label;
            _objAddressLabel         = splitContainerObject.Panel1.Controls["labelObjAdd"] as Label;
            _objSlotIndexLabel       = splitContainerObject.Panel1.Controls["labelObjSlotIndValue"] as Label;
            _objSlotPositionLabel    = splitContainerObject.Panel1.Controls["labelObjSlotPosValue"] as Label;
            _objBehaviorLabel        = splitContainerObject.Panel1.Controls["labelObjBhvValue"] as Label;
            _objBehaviorLabel.Click += _objBehaviorLabel_Click;
            _objectNameTextBox       = splitContainerObject.Panel1.Controls["textBoxObjName"] as TextBox;
            _objectBorderPanel       = splitContainerObject.Panel1.Controls["panelObjectBorder"] as Panel;
            _objectImagePictureBox   = _objectBorderPanel.Controls["pictureBoxObject"] as IntPictureBox;

            _objAddressLabelValue.Click += ObjAddressLabel_Click;
            _objAddressLabel.Click      += ObjAddressLabel_Click;

            Panel objPanel = splitContainerObject.Panel1.Controls["panelObj"] as Panel;

            var goToButton = objPanel.Controls["buttonObjGoto"] as Button;

            goToButton.Click += (sender, e) => ButtonUtilities.GotoObjects(_currentAddresses);
            ControlUtilities.AddContextMenuStripFunctions(
                goToButton,
                new List <string>()
            {
                "Goto", "Goto Laterally", "Goto X", "Goto Y", "Goto Z"
            },
                new List <Action>()
            {
                () => ButtonUtilities.GotoObjects(_currentAddresses, (true, true, true)),
                () => ButtonUtilities.GotoObjects(_currentAddresses, (true, false, true)),
                () => ButtonUtilities.GotoObjects(_currentAddresses, (true, false, false)),
                () => ButtonUtilities.GotoObjects(_currentAddresses, (false, true, false)),
                () => ButtonUtilities.GotoObjects(_currentAddresses, (false, false, true)),
            });
コード例 #8
0
ファイル: ActionsManager.cs プロジェクト: mkdasher/STROOP
 public ActionsManager(List <WatchVariableControlPrecursor> variables, WatchVariablePanel variableTable, Control actionsControl)
     : base(variables, variableTable)
 {
     actionDescriptionLabel    = actionsControl.Controls["labelActionDescription"] as Label;
     animationDescriptionLabel = actionsControl.Controls["labelAnimationDescription"] as Label;
 }
コード例 #9
0
        public CameraManager(List <WatchVariableControlPrecursor> cameraData, Control tabControl, WatchVariablePanel variableTable)
            : base(cameraData, variableTable)
        {
            var splitContainer = tabControl.Controls["splitContainerCamera"] as SplitContainer;

            var cameraPosGroupBox = splitContainer.Panel1.Controls["groupBoxCameraPos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Euler,
                cameraPosGroupBox,
                cameraPosGroupBox.Controls["buttonCameraPosXn"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosXp"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosZn"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosZp"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosXnZn"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosXnZp"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosXpZn"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosXpZp"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosYp"] as Button,
                cameraPosGroupBox.Controls["buttonCameraPosYn"] as Button,
                cameraPosGroupBox.Controls["textBoxCameraPosXZ"] as TextBox,
                cameraPosGroupBox.Controls["textBoxCameraPosY"] as TextBox,
                cameraPosGroupBox.Controls["checkBoxCameraPosRelative"] as CheckBox,
                (float hOffset, float vOffset, float nOffset, bool useRelative) =>
            {
                ButtonUtilities.TranslateCamera(
                    hOffset,
                    nOffset,
                    -1 * vOffset,
                    useRelative);
            });

            var cameraSphericalPosGroupBox = splitContainer.Panel1.Controls["groupBoxCameraSphericalPos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Spherical,
                cameraSphericalPosGroupBox,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosTn"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosTp"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosPn"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosPp"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosTnPn"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosTnPp"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosTpPn"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosTpPp"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosRn"] as Button,
                cameraSphericalPosGroupBox.Controls["buttonCameraSphericalPosRp"] as Button,
                cameraSphericalPosGroupBox.Controls["textBoxCameraSphericalPosTP"] as TextBox,
                cameraSphericalPosGroupBox.Controls["textBoxCameraSphericalPosR"] as TextBox,
                cameraSphericalPosGroupBox.Controls["checkBoxCameraSphericalPosPivotOnFocus"] as CheckBox,
                (float hOffset, float vOffset, float nOffset, bool pivotOnFocus) =>
            {
                ButtonUtilities.TranslateCameraSpherically(
                    -1 * nOffset,
                    hOffset,
                    -1 * vOffset,
                    getSphericalPivotPoint(pivotOnFocus));
            });

            _buttonDisableFOVFunctions = splitContainer.Panel1.Controls["buttonDisableFOVFunctions"] as BinaryButton;
            _buttonDisableFOVFunctions.Initialize(
                "Disable FOV Functions",
                "Enable FOV Functions",
                () =>
            {
                List <uint> addresses = CameraConfig.FovFunctionAddresses;
                for (int i = 0; i < addresses.Count; i++)
                {
                    Config.Stream.SetValue(0, addresses[i]);
                }
            },
                () =>
            {
                List <uint> addresses = CameraConfig.FovFunctionAddresses;
                List <uint> values    = CameraConfig.FovFunctionValues;
                for (int i = 0; i < addresses.Count; i++)
                {
                    Config.Stream.SetValue(values[i], addresses[i]);
                }
            },
                () =>
            {
                return(CameraConfig.FovFunctionAddresses.All(
                           address => Config.Stream.GetUInt32(address) == 0));
            });
        }
コード例 #10
0
ファイル: HudManager.cs プロジェクト: mkdasher/STROOP
        public HudManager(List <WatchVariableControlPrecursor> variables, Control tabControl, WatchVariablePanel watchVariablePanelHud)
            : base(variables, watchVariablePanelHud)
        {
            _tabControl = tabControl;

            SplitContainer splitContainerHud = tabControl.Controls["splitContainerHud"] as SplitContainer;

            (splitContainerHud.Panel1.Controls["buttonFullHp"] as Button).Click      += (sender, e) => ButtonUtilities.FullHp();
            (splitContainerHud.Panel1.Controls["buttonDie"] as Button).Click         += (sender, e) => ButtonUtilities.Die();
            (splitContainerHud.Panel1.Controls["button99Coins"] as Button).Click     += (sender, e) => ButtonUtilities.Coins99();
            (splitContainerHud.Panel1.Controls["button100Lives"] as Button).Click    += (sender, e) => ButtonUtilities.Lives100();
            (splitContainerHud.Panel1.Controls["buttonStandardHud"] as Button).Click += (sender, e) => ButtonUtilities.StandardHud();

            _turnOnOffHudButton = splitContainerHud.Panel1.Controls["buttonTurnOnOffHud"] as BinaryButton;
            _turnOnOffHudButton.Initialize(
                "Turn Off HUD",
                "Turn On HUD",
                () => ButtonUtilities.SetHudVisibility(false),
                () => ButtonUtilities.SetHudVisibility(true),
                () => (Config.Stream.GetByte(MarioConfig.StructAddress + HudConfig.VisibilityOffset) & HudConfig.VisibilityMask) == 0);

            _checkBoxFullHP = splitContainerHud.Panel1.Controls["checkBoxFullHP"] as CheckBox;
        }
コード例 #11
0
ファイル: CustomManager.cs プロジェクト: mkdasher/STROOP
        public CustomManager(List <WatchVariableControlPrecursor> variables, Control customControl, WatchVariablePanel variableTable)
            : base(variables, variableTable)
        {
            EnableCustomVariableFunctionality();

            SplitContainer splitContainerCustom         = customControl.Controls["splitContainerCustom"] as SplitContainer;
            SplitContainer splitContainerCustomControls = splitContainerCustom.Panel1.Controls["splitContainerCustomControls"] as SplitContainer;

            // Panel 1 controls

            Button buttonClearVariables = splitContainerCustomControls.Panel1.Controls["buttonClearVariables"] as Button;

            buttonClearVariables.Click += (sender, e) => ClearVariables();

            _checkBoxCustomRecordValues        = splitContainerCustomControls.Panel1.Controls["checkBoxCustomRecordValues"] as CheckBox;
            _checkBoxCustomRecordValues.Click += (sender, e) => ToggleRecording();

            _textBoxRecordValuesCount = splitContainerCustomControls.Panel1.Controls["textBoxRecordValuesCount"] as BetterTextbox;

            _buttonCustomShowValues        = splitContainerCustomControls.Panel1.Controls["buttonCustomShowValues"] as Button;
            _buttonCustomShowValues.Click += (sender, e) => ShowRecordedValues();

            _buttonCustomClearValues        = splitContainerCustomControls.Panel1.Controls["buttonCustomClearValues"] as Button;
            _buttonCustomClearValues.Click += (sender, e) => ClearRecordedValues();

            _checkBoxUseValueAtStartOfGlobalTimer = splitContainerCustomControls.Panel1.Controls["checkBoxUseValueAtStartOfGlobalTimer"] as CheckBox;

            _labelCustomRecordingFrequencyValue = splitContainerCustomControls.Panel1.Controls["labelCustomRecordingFrequencyValue"] as Label;

            _labelCustomRecordingGapsValue = splitContainerCustomControls.Panel1.Controls["labelCustomRecordingGapsValue"] as Label;

            _recordedValues = new Dictionary <int, List <string> >();
            _lastTimer      = null;
            _numGaps        = 0;
            _recordFreq     = 1;

            // Panel 2 controls

            Button buttonResetVariableSizeToDefault = splitContainerCustomControls.Panel2.Controls["buttonResetVariableSizeToDefault"] as Button;

            buttonResetVariableSizeToDefault.Click += (sender, e) =>
            {
                WatchVariableControl.VariableNameWidth  = WatchVariableControl.DEFAULT_VARIABLE_NAME_WIDTH;
                WatchVariableControl.VariableValueWidth = WatchVariableControl.DEFAULT_VARIABLE_VALUE_WIDTH;
                WatchVariableControl.VariableHeight     = WatchVariableControl.DEFAULT_VARIABLE_HEIGHT;
            };

            GroupBox groupBoxVarNameWidth = splitContainerCustomControls.Panel2.Controls["groupBoxVarNameWidth"] as GroupBox;

            InitializeAddSubtractGetSetFuncionality(
                groupBoxVarNameWidth.Controls["buttonVarNameWidthSubtract"] as Button,
                groupBoxVarNameWidth.Controls["buttonVarNameWidthAdd"] as Button,
                groupBoxVarNameWidth.Controls["buttonVarNameWidthGet"] as Button,
                groupBoxVarNameWidth.Controls["buttonVarNameWidthSet"] as Button,
                groupBoxVarNameWidth.Controls["betterTextboxVarNameWidthAddSubtract"] as TextBox,
                groupBoxVarNameWidth.Controls["betterTextboxVarNameWidthGetSet"] as TextBox,
                (int value) => { WatchVariableControl.VariableNameWidth = value; },
                () => WatchVariableControl.VariableNameWidth);

            GroupBox groupBoxVarValueWidth = splitContainerCustomControls.Panel2.Controls["groupBoxVarValueWidth"] as GroupBox;

            InitializeAddSubtractGetSetFuncionality(
                groupBoxVarValueWidth.Controls["buttonVarValueWidthSubtract"] as Button,
                groupBoxVarValueWidth.Controls["buttonVarValueWidthAdd"] as Button,
                groupBoxVarValueWidth.Controls["buttonVarValueWidthGet"] as Button,
                groupBoxVarValueWidth.Controls["buttonVarValueWidthSet"] as Button,
                groupBoxVarValueWidth.Controls["betterTextboxVarValueWidthAddSubtract"] as TextBox,
                groupBoxVarValueWidth.Controls["betterTextboxVarValueWidthGetSet"] as TextBox,
                (int value) => { WatchVariableControl.VariableValueWidth = value; },
                () => WatchVariableControl.VariableValueWidth);

            GroupBox groupBoxVarHeight = splitContainerCustomControls.Panel2.Controls["groupBoxVarHeight"] as GroupBox;

            InitializeAddSubtractGetSetFuncionality(
                groupBoxVarHeight.Controls["buttonVarHeightSubtract"] as Button,
                groupBoxVarHeight.Controls["buttonVarHeightAdd"] as Button,
                groupBoxVarHeight.Controls["buttonVarHeightGet"] as Button,
                groupBoxVarHeight.Controls["buttonVarHeightSet"] as Button,
                groupBoxVarHeight.Controls["betterTextboxVarHeightAddSubtract"] as TextBox,
                groupBoxVarHeight.Controls["betterTextboxVarHeightGetSet"] as TextBox,
                (int value) => { WatchVariableControl.VariableHeight = value; },
                () => WatchVariableControl.VariableHeight);
        }
コード例 #12
0
ファイル: WaterManager.cs プロジェクト: mkdasher/STROOP
 public WaterManager(List <WatchVariableControlPrecursor> variables, WatchVariablePanel variableTable)
     : base(variables, variableTable)
 {
 }
コード例 #13
0
ファイル: DebugManager.cs プロジェクト: mkdasher/STROOP
        public DebugManager(List <WatchVariableControlPrecursor> variables, Control tabControl, WatchVariablePanel variableTable)
            : base(variables, variableTable)
        {
            SplitContainer splitContainerDebug = tabControl.Controls["splitContainerDebug"] as SplitContainer;

            // Advanced mode
            GroupBox advancedModeGroupbox = splitContainerDebug.Panel1.Controls["groupBoxAdvancedMode"] as GroupBox;

            _advancedModeOffRadioButton        = advancedModeGroupbox.Controls["radioButtonAdvancedModeOff"] as RadioButton;
            _advancedModeOffRadioButton.Click += (sender, e) =>
            {
                Config.Stream.SetValue((byte)0, DebugConfig.AdvancedModeAddress);
                Config.Stream.SetValue((byte)0, DebugConfig.AdvancedModeSettingAddress);
            };

            _advancedModeSettingRadioButtons    = new RadioButton[6];
            _advancedModeSettingRadioButtons[0] = advancedModeGroupbox.Controls["radioButtonAdvancedModeObjectCounter"] as RadioButton;
            _advancedModeSettingRadioButtons[1] = advancedModeGroupbox.Controls["radioButtonAdvancedModeCheckInfo"] as RadioButton;
            _advancedModeSettingRadioButtons[2] = advancedModeGroupbox.Controls["radioButtonAdvancedModeMapInfo"] as RadioButton;
            _advancedModeSettingRadioButtons[3] = advancedModeGroupbox.Controls["radioButtonAdvancedModeStageInfo"] as RadioButton;
            _advancedModeSettingRadioButtons[4] = advancedModeGroupbox.Controls["radioButtonAdvancedModeEffectInfo"] as RadioButton;
            _advancedModeSettingRadioButtons[5] = advancedModeGroupbox.Controls["radioButtonAdvancedModeEnemyInfo"] as RadioButton;
            for (int i = 0; i < _advancedModeSettingRadioButtons.Length; i++)
            {
                byte localIndex = (byte)i;
                _advancedModeSettingRadioButtons[i].Click += (sender, e) =>
                {
                    Config.Stream.SetValue((byte)1, DebugConfig.AdvancedModeAddress);
                    Config.Stream.SetValue(localIndex, DebugConfig.AdvancedModeSettingAddress);
                };
            }

            // Resource meter
            GroupBox resourceMeterGroupbox = splitContainerDebug.Panel1.Controls["groupBoxResourceMeter"] as GroupBox;

            _resourceMeterOffRadioButton        = resourceMeterGroupbox.Controls["radioButtonResourceMeterOff"] as RadioButton;
            _resourceMeterOffRadioButton.Click += (sender, e) =>
            {
                Config.Stream.SetValue((byte)0, DebugConfig.ResourceMeterAddress);
                Config.Stream.SetValue((ushort)0, DebugConfig.ResourceMeterSettingAddress);
            };

            _resourceMeter1RadioButton        = resourceMeterGroupbox.Controls["radioButtonResourceMeter1"] as RadioButton;
            _resourceMeter1RadioButton.Click += (sender, e) =>
            {
                Config.Stream.SetValue((byte)1, DebugConfig.ResourceMeterAddress);
                Config.Stream.SetValue((ushort)0, DebugConfig.ResourceMeterSettingAddress);
            };

            _resourceMeter2RadioButton        = resourceMeterGroupbox.Controls["radioButtonResourceMeter2"] as RadioButton;
            _resourceMeter2RadioButton.Click += (sender, e) =>
            {
                Config.Stream.SetValue((byte)1, DebugConfig.ResourceMeterAddress);
                Config.Stream.SetValue((ushort)1, DebugConfig.ResourceMeterSettingAddress);
            };

            // Misc debug
            GroupBox miscDebugGroupbox = splitContainerDebug.Panel1.Controls["groupBoxMiscDebug"] as GroupBox;

            _classicModeCheckbox        = miscDebugGroupbox.Controls["checkBoxClassicMode"] as CheckBox;
            _classicModeCheckbox.Click += (sender, e) =>
            {
                Config.Stream.SetValue(_classicModeCheckbox.Checked ? (byte)0x01 : (byte)0x00, DebugConfig.ClassicModeAddress);
            };

            _spawnModeCheckbox        = miscDebugGroupbox.Controls["checkBoxSpawnMode"] as CheckBox;
            _spawnModeCheckbox.Click += (sender, e) =>
            {
                Config.Stream.SetValue(_spawnModeCheckbox.Checked ? (byte)0x03 : (byte)0x00, DebugConfig.AdvancedModeSettingAddress);
                Config.Stream.SetValue(_spawnModeCheckbox.Checked ? (byte)0x01 : (byte)0x00, DebugConfig.SpawnModeAddress);
            };

            _stageSelectCheckbox        = miscDebugGroupbox.Controls["checkBoxStageSelect"] as CheckBox;
            _stageSelectCheckbox.Click += (sender, e) =>
            {
                Config.Stream.SetValue(_stageSelectCheckbox.Checked ? (byte)0x01 : (byte)0x00, DebugConfig.StageSelectAddress);
            };

            _freeMovementCheckbox        = miscDebugGroupbox.Controls["checkBoxFreeMovement"] as CheckBox;
            _freeMovementCheckbox.Click += (sender, e) =>
            {
                Config.Stream.SetValue(
                    _freeMovementCheckbox.Checked ? DebugConfig.FreeMovementOnValue : DebugConfig.FreeMovementOffValue,
                    DebugConfig.FreeMovementAddress);
            };
        }
コード例 #14
0
        public AreaManager(Control tabControl, List <WatchVariableControlPrecursor> variables, WatchVariablePanel watchVariableLayoutPanel)
            : base(variables, watchVariableLayoutPanel)
        {
            _selectedAreaAddress = AreaUtilities.GetAreaAddress(0);

            SplitContainer splitContainerArea = tabControl.Controls["splitContainerArea"] as SplitContainer;

            _selectedAreaRadioButtons = new List <RadioButton>();
            for (int i = 0; i < 8; i++)
            {
                _selectedAreaRadioButtons.Add(splitContainerArea.Panel1.Controls["radioButtonArea" + i] as RadioButton);
            }
            _selectCurrentAreaCheckbox = splitContainerArea.Panel1.Controls["checkBoxSelectCurrentArea"] as CheckBox;

            for (int i = 0; i < _selectedAreaRadioButtons.Count; i++)
            {
                int index = i;
                _selectedAreaRadioButtons[i].Click += (sender, e) =>
                {
                    _selectCurrentAreaCheckbox.Checked = false;
                    _selectedAreaAddress = AreaUtilities.GetAreaAddress(index);
                };
            }
        }
コード例 #15
0
ファイル: CamHackManager.cs プロジェクト: mkdasher/STROOP
        public CamHackManager(List <WatchVariableControlPrecursor> variables, TabPage camHackControl, WatchVariablePanel variableTable)
            : base(variables, variableTable)
        {
            _currentCamHackMode = CamHackMode.REGULAR;

            var splitContainer = camHackControl.Controls["splitContainerCamHack"] as SplitContainer;

            _mode0RadioButton = splitContainer.Panel1.Controls["radioButtonCamHackMode0"] as RadioButton;
            _mode1RadioButtonRelativeAngle = splitContainer.Panel1.Controls["radioButtonCamHackMode1RelativeAngle"] as RadioButton;
            _mode1RadioButtonAbsoluteAngle = splitContainer.Panel1.Controls["radioButtonCamHackMode1AbsoluteAngle"] as RadioButton;
            _mode2RadioButton = splitContainer.Panel1.Controls["radioButtonCamHackMode2"] as RadioButton;
            _mode3RadioButton = splitContainer.Panel1.Controls["radioButtonCamHackMode3"] as RadioButton;

            _mode0RadioButton.Click += (sender, e) => Config.Stream.SetValue(0, CameraHackConfig.CameraHackStruct + CameraHackConfig.CameraModeOffset);
            _mode1RadioButtonRelativeAngle.Click += (sender, e) =>
            {
                Config.Stream.SetValue(1, CameraHackConfig.CameraHackStruct + CameraHackConfig.CameraModeOffset);
                Config.Stream.SetValue((ushort)0, CameraHackConfig.CameraHackStruct + CameraHackConfig.AbsoluteAngleOffset);
            };
            _mode1RadioButtonAbsoluteAngle.Click += (sender, e) =>
            {
                Config.Stream.SetValue(1, CameraHackConfig.CameraHackStruct + CameraHackConfig.CameraModeOffset);
                Config.Stream.SetValue((ushort)1, CameraHackConfig.CameraHackStruct + CameraHackConfig.AbsoluteAngleOffset);
            };
            _mode2RadioButton.Click += (sender, e) => Config.Stream.SetValue(2, CameraHackConfig.CameraHackStruct + CameraHackConfig.CameraModeOffset);
            _mode3RadioButton.Click += (sender, e) => Config.Stream.SetValue(3, CameraHackConfig.CameraHackStruct + CameraHackConfig.CameraModeOffset);

            var cameraHackPosGroupBox = splitContainer.Panel1.Controls["groupBoxCameraHackPos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Euler,
                cameraHackPosGroupBox,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosXn"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosXp"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosZn"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosZp"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosXnZn"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosXnZp"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosXpZn"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosXpZp"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosYp"] as Button,
                cameraHackPosGroupBox.Controls["buttonCameraHackPosYn"] as Button,
                cameraHackPosGroupBox.Controls["textBoxCameraHackPosXZ"] as TextBox,
                cameraHackPosGroupBox.Controls["textBoxCameraHackPosY"] as TextBox,
                cameraHackPosGroupBox.Controls["checkBoxCameraHackPosRelative"] as CheckBox,
                (float hOffset, float vOffset, float nOffset, bool useRelative) =>
            {
                ButtonUtilities.TranslateCameraHack(
                    _currentCamHackMode,
                    hOffset,
                    nOffset,
                    -1 * vOffset,
                    useRelative);
            });

            var cameraHackSphericalPosGroupBox = splitContainer.Panel1.Controls["groupBoxCameraHackSphericalPos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Spherical,
                cameraHackSphericalPosGroupBox,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosTn"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosTp"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosPn"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosPp"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosTnPn"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosTnPp"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosTpPn"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosTpPp"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosRn"] as Button,
                cameraHackSphericalPosGroupBox.Controls["buttonCameraHackSphericalPosRp"] as Button,
                cameraHackSphericalPosGroupBox.Controls["textBoxCameraHackSphericalPosTP"] as TextBox,
                cameraHackSphericalPosGroupBox.Controls["textBoxCameraHackSphericalPosR"] as TextBox,
                null /* checkbox */,
                (float hOffset, float vOffset, float nOffset, bool _) =>
            {
                ButtonUtilities.TranslateCameraHackSpherically(
                    _currentCamHackMode,
                    -1 * nOffset,
                    hOffset,
                    -1 * vOffset);
            });

            var cameraHackFocusPosGroupBox = splitContainer.Panel1.Controls["groupBoxCameraHackFocusPos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Euler,
                cameraHackFocusPosGroupBox,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosXn"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosXp"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosZn"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosZp"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosXnZn"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosXnZp"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosXpZn"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosXpZp"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosYp"] as Button,
                cameraHackFocusPosGroupBox.Controls["buttonCameraHackFocusPosYn"] as Button,
                cameraHackFocusPosGroupBox.Controls["textBoxCameraHackFocusPosXZ"] as TextBox,
                cameraHackFocusPosGroupBox.Controls["textBoxCameraHackFocusPosY"] as TextBox,
                cameraHackFocusPosGroupBox.Controls["checkBoxCameraHackFocusPosRelative"] as CheckBox,
                (float hOffset, float vOffset, float nOffset, bool useRelative) =>
            {
                ButtonUtilities.TranslateCameraHackFocus(
                    _currentCamHackMode,
                    hOffset,
                    nOffset,
                    -1 * vOffset,
                    useRelative);
            });

            var cameraHackSphericalFocusPosGroupBox = splitContainer.Panel1.Controls["groupBoxCameraHackSphericalFocusPos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Spherical,
                cameraHackSphericalFocusPosGroupBox,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosTn"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosTp"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosPn"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosPp"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosTnPn"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosTnPp"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosTpPn"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosTpPp"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosRp"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["buttonCameraHackSphericalFocusPosRn"] as Button,
                cameraHackSphericalFocusPosGroupBox.Controls["textBoxCameraHackSphericalFocusPosTP"] as TextBox,
                cameraHackSphericalFocusPosGroupBox.Controls["textBoxCameraHackSphericalFocusPosR"] as TextBox,
                null /* checkbox */,
                (float hOffset, float vOffset, float nOffset, bool _) =>
            {
                ButtonUtilities.TranslateCameraHackFocusSpherically(
                    _currentCamHackMode,
                    nOffset,
                    hOffset,
                    -1 * vOffset);
            });

            var cameraHackBothPosGroupBox = splitContainer.Panel1.Controls["groupBoxCameraHackBothPos"] as GroupBox;

            ControlUtilities.InitializeThreeDimensionController(
                CoordinateSystem.Euler,
                cameraHackBothPosGroupBox,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosXn"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosXp"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosZn"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosZp"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosXnZn"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosXnZp"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosXpZn"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosXpZp"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosYp"] as Button,
                cameraHackBothPosGroupBox.Controls["buttonCameraHackBothPosYn"] as Button,
                cameraHackBothPosGroupBox.Controls["textBoxCameraHackBothPosXZ"] as TextBox,
                cameraHackBothPosGroupBox.Controls["textBoxCameraHackBothPosY"] as TextBox,
                cameraHackBothPosGroupBox.Controls["checkBoxCameraHackBothPosRelative"] as CheckBox,
                (float hOffset, float vOffset, float nOffset, bool useRelative) =>
            {
                ButtonUtilities.TranslateCameraHackBoth(
                    _currentCamHackMode,
                    hOffset,
                    nOffset,
                    -1 * vOffset,
                    useRelative);
            });
        }