Esempio n. 1
0
        private void SetUpContextMenuStrips()
        {
            ControlUtilities.AddContextMenuStripFunctions(
                labelVersionNumber,
                new List <string>()
            {
                "Open Mapping",
                "Clear Mapping",
                "Inject Hitbox View Code",
                "Free Movement Action",
                "Everything in File",
                "Go to Closest Floor Vertex",
                "Save as Savestate",
                "Show MHS Vars",
                "Download Latest STROOP Release",
                "Documentation",
                "Show All Helpful Hints",
                "Enable TASer Settings",
                "Show Image Form",
                "Show Coin Ring Display Form",
                "Format Subtitles",
            },
                new List <Action>()
            {
                () => MappingConfig.OpenMapping(),
                () => MappingConfig.ClearMapping(),
                () => gfxTab.InjectHitboxViewCode(),
                () => Config.Stream.SetValue(MarioConfig.FreeMovementAction, MarioConfig.StructAddress + MarioConfig.ActionOffset),
                () => fileTab.DoEverything(),
                () => trianglesTab.GoToClosestVertex(),
                () => saveAsSavestate(),
                () =>
                {
                    string varFilePath = @"Config/MhsData.xml";
                    List <WatchVariableControlPrecursor> precursors =
                        XmlConfigParser.OpenWatchVariableControlPrecursors(varFilePath);
                    List <WatchVariableControl> controls = precursors.ConvertAll(
                        precursor => precursor.CreateWatchVariableControl());
                    VariablePopOutForm form = new VariablePopOutForm();
                    form.Initialize(controls);
                    form.ShowForm();
                },
                () => Process.Start("https://github.com/SM64-TAS-ABC/STROOP/releases/download/vDev/STROOP.zip"),
                () => Process.Start("https://ukikipedia.net/wiki/STROOP"),
                () => HelpfulHintUtilities.ShowAllHelpfulHints(),
                () =>
                {
                    tasTab.EnableTASerSettings();
                    tabControlMain.SelectedTab = tabPageTas;
                },
                () =>
                {
                    ImageForm imageForm = new ImageForm();
                    imageForm.Show();
                },
                () =>
                {
                    CoinRingDisplayForm form = new CoinRingDisplayForm();
                    form.Show();
                },
                () => SubtitleUtilities.FormatSubtitlesFromClipboard(),
            });

            ControlUtilities.AddCheckableContextMenuStripFunctions(
                labelVersionNumber,
                new List <string>()
            {
                "Update Cam Hack Angle",
                "Update Floor Tri",
            },
                new List <Func <bool> >()
            {
                () =>
                {
                    TestingConfig.UpdateCamHackAngle = !TestingConfig.UpdateCamHackAngle;
                    return(TestingConfig.UpdateCamHackAngle);
                },
                () =>
                {
                    TestingConfig.UpdateFloorTri = !TestingConfig.UpdateFloorTri;
                    return(TestingConfig.UpdateFloorTri);
                },
            });

            ControlUtilities.AddContextMenuStripFunctions(
                buttonMoveTabLeft,
                new List <string>()
            {
                "Restore Recommended Tab Order"
            },
                new List <Action>()
            {
                () => SavedSettingsConfig.InvokeRecommendedTabOrder()
            });

            ControlUtilities.AddContextMenuStripFunctions(
                buttonMoveTabRight,
                new List <string>()
            {
                "Restore Recommended Tab Order"
            },
                new List <Action>()
            {
                () => SavedSettingsConfig.InvokeRecommendedTabOrder()
            });

            ControlUtilities.AddContextMenuStripFunctions(
                trackBarObjSlotSize,
                new List <string>()
            {
                "Reset to Default Object Slot Size"
            },
                new List <Action>()
            {
                () =>
                {
                    trackBarObjSlotSize.Value = ObjectSlotsManager.DefaultSlotSize;
                    ChangeObjectSlotSize(ObjectSlotsManager.DefaultSlotSize);
                }
            });
        }