Beispiel #1
0
        public Map2Manager(Map2Gui mapGui)
        {
            _mapGui = mapGui;

            _marioMapObj = new Map2Object(Config.ObjectAssociations.MarioMapImage, 1);
            _marioMapObj.UsesRotation = true;

            _holpMapObj = new Map2Object(Config.ObjectAssociations.HolpImage, 2);

            _intendedNextPositionMapObj = new Map2Object(Config.ObjectAssociations.IntendedNextPositionImage, 2);
            _intendedNextPositionMapObj.UsesRotation = true;

            _pointMapObj = new Map2Object(Config.ObjectAssociations.IntendedNextPositionImage, 2);
            _pointMapObj.UsesRotation = true;

            _cameraMapObj = new Map2Object(Config.ObjectAssociations.CameraMapImage, 1);
            _cameraMapObj.UsesRotation = true;
            _floorTriangleMapObj       = new TriangleMap2Object(Color.FromArgb(200, Color.Cyan), 3);
            _ceilingTriangleMapObj     = new TriangleMap2Object(Color.FromArgb(200, Color.Red), 2);

            _cogFloorTris = new List <TriangleMap2Object>();
            for (int i = 0; i < 4; i++)
            {
                _cogFloorTris.Add(new TriangleMap2Object(Color.FromArgb(200, Color.Cyan), 3));
            }

            _cog2FloorTris = new List <TriangleMap2Object>();
            for (int i = 0; i < 4; i++)
            {
                _cog2FloorTris.Add(new TriangleMap2Object(Color.FromArgb(200, Color.Magenta), 3));
            }

            _cogWallTris = new List <TriangleMap2Object>();
            for (int i = 0; i < 12; i++)
            {
                _cogWallTris.Add(new TriangleMap2Object(Color.FromArgb(200, Color.Green), 3));
            }

            _triObjectWalls  = new List <List <TriangleMap2Object> >();
            _triObjectFloors = new List <List <TriangleMap2Object> >();
            for (int numSides = SHAPE_MIN_SIDES; numSides <= SHAPE_MAX_SIDSE; numSides++)
            {
                (List <TriangleShape> floors, List <TriangleShape> walls) = GetTriShapes(numSides);

                List <TriangleMap2Object> wallTris = new List <TriangleMap2Object>();
                foreach (TriangleShape tri in walls)
                {
                    wallTris.Add(new TriangleMap2Object(Color.FromArgb(200, Color.Green), 3));
                }
                _triObjectWalls.Add(wallTris);

                List <TriangleMap2Object> floorTris = new List <TriangleMap2Object>();
                foreach (TriangleShape tri in floors)
                {
                    floorTris.Add(new TriangleMap2Object(Color.FromArgb(200, Color.Cyan), 3));
                }
                _triObjectFloors.Add(floorTris);
            }
        }
Beispiel #2
0
        private void CreateManagers()
        {
            // Create map manager
            Config.MapGui = new MapGui()
            {
                // Main controls
                GLControl = glControlMap,
                MapTrackerFlowLayoutPanel = flowLayoutPanelMapTrackers,
                TabControlView            = tabControlMap,

                // Controls in options tab
                TabPageOptions               = tabPageMapOptions,
                CheckBoxTrackMario           = checkBoxMapControlsTrackMario,
                CheckBoxTrackHolp            = checkBoxMapControlsTrackHolp,
                CheckBoxTrackCamera          = checkBoxMapControlsTrackCamera,
                CheckBoxTrackFloorTriangle   = checkBoxMapControlsTrackFloorTriangle,
                CheckBoxTrackWallTriangle    = checkBoxMapControlsTrackWallTriangle,
                CheckBoxTrackCeilingTriangle = checkBoxMapControlsTrackCeilingTriangle,
                CheckBoxTrackAllObjects      = checkBoxMapControlsTrackAllObjects,
                CheckBoxTrackGridlines       = checkBoxMapControlsTrackGridlines,

                ButtonAddNewTracker        = buttonMapControlsAddNewTracker,
                ButtonClearAllTrackers     = buttonMapControlsClearAllTrackers,
                ButtonTrackSelectedObjects = buttonMapControlsTrackSelectedObjects,

                ComboBoxLevel      = comboBoxMapOptionsLevel,
                ComboBoxBackground = comboBoxMapOptionsBackground,

                // Controls in 2D tab
                TabPage2D = tabPageMap2D,
                RadioButtonScaleCourseDefault = radioButtonMapControlsScaleCourseDefault,
                RadioButtonScaleMaxCourseSize = radioButtonMapControlsScaleMaxCourseSize,
                RadioButtonScaleCustom        = radioButtonMapControlsScaleCustom,
                TextBoxScaleCustom            = betterTextboxMapControlsScaleCustom,

                ButtonCenterScaleChangeMinus = buttonMapControlsScaleChangeMinus,
                ButtonCenterScaleChangePlus  = buttonMapControlsScaleChangePlus,
                TextBoxScaleChange           = betterTextboxMapControlsScaleChange,

                RadioButtonCenterBestFit = radioButtonMapControlsCenterBestFit,
                RadioButtonCenterOrigin  = radioButtonMapControlsCenterOrigin,
                RadioButtonCenterCustom  = radioButtonMapControlsCenterCustom,
                TextBoxCenterCustom      = betterTextboxMapControlsCenterCustom,

                ButtonCenterChangeUp        = buttonMapControlsCenterChangeUp,
                ButtonCenterChangeDown      = buttonMapControlsCenterChangeDown,
                ButtonCenterChangeLeft      = buttonMapControlsCenterChangeLeft,
                ButtonCenterChangeRight     = buttonMapControlsCenterChangeRight,
                ButtonCenterChangeUpLeft    = buttonMapControlsCenterChangeUpLeft,
                ButtonCenterChangeUpRight   = buttonMapControlsCenterChangeUpRight,
                ButtonCenterChangeDownLeft  = buttonMapControlsCenterChangeDownLeft,
                ButtonCenterChangeDownRight = buttonMapControlsCenterChangeDownRight,

                RadioButtonAngle0      = radioButtonMapControlsAngle0,
                RadioButtonAngle16384  = radioButtonMapControlsAngle16384,
                RadioButtonAngle32768  = radioButtonMapControlsAngle32768,
                RadioButtonAngle49152  = radioButtonMapControlsAngle49152,
                RadioButtonAngleCustom = radioButtonMapControlsAngleCustom,
                TextBoxAngleCustom     = betterTextboxMapControlsAngleCustom,

                ButtonAngleChangeCounterclockwise = buttonMapControlsAngleChangeCounterclockwise,
                ButtonAngleChangeClockwise        = buttonMapControlsAngleChangeClockwise,
                TextBoxAngleChange = betterTextboxMapControlsAngleChange,

                // Controls in the 3D map tab
                TabPage3D = tabPageMap3D,
                CheckBoxMapGameCamOrientation = checkBoxMapGameCamOrientation,
                ComboBoxMapColorMethod        = comboBoxMapColorMethod
            };

            Map2Gui map2Gui = new Map2Gui()
            {
                GLControl                   = glControlMap2,
                MapIdLabel                  = labelMap2Id,
                MapNameLabel                = labelMap2Name,
                MapSubNameLabel             = labelMap2SubName,
                PuValueLabel                = labelMap2PuValue,
                QpuValueLabel               = labelMap2QpuValue,
                MapIconSizeTrackbar         = trackBarMap2IconSize,
                MapShowInactiveObjects      = checkBoxMap2ShowInactive,
                MapShowMario                = checkBoxMap2ShowMario,
                MapShowHolp                 = checkBoxMap2ShowHolp,
                MapShowIntendedNextPosition = checkBoxMap2ShowIntendedNextPosition,
                MapShowCamera               = checkBoxMap2ShowCamera,
                MapShowFloorTriangle        = checkBoxMap2ShowFloor,
                MapShowCeilingTriangle      = checkBoxMap2ShowCeiling,

                MapBoundsUpButton        = buttonMap2BoundsUp,
                MapBoundsDownButton      = buttonMap2BoundsDown,
                MapBoundsLeftButton      = buttonMap2BoundsLeft,
                MapBoundsRightButton     = buttonMap2BoundsRight,
                MapBoundsUpLeftButton    = buttonMap2BoundsUpLeft,
                MapBoundsUpRightButton   = buttonMap2BoundsUpRight,
                MapBoundsDownLeftButton  = buttonMap2BoundsDownLeft,
                MapBoundsDownRightButton = buttonMap2BoundsDownRight,
                MapBoundsPositionTextBox = textBoxMap2BoundsPosition,

                MapBoundsZoomInButton  = buttonMap2BoundsZoomIn,
                MapBoundsZoomOutButton = buttonMap2BoundsZoomOut,
                MapBoundsZoomTextBox   = textBoxMap2BoundsZoom,

                MapArtificialMarioYLabelTextBox = textBoxMap2ArtificialMarioYLabel
            };

            M64Gui m64Gui = new M64Gui()
            {
                LabelFileName       = labelM64FileName,
                LabelNumInputsValue = labelM64NumInputsValue,

                ComboBoxFrameInputRelation = comboBoxM64FrameInputRelation,
                CheckBoxMaxOutViCount      = checkBoxMaxOutViCount,

                ButtonSave         = buttonM64Save,
                ButtonSaveAs       = buttonM64SaveAs,
                ButtonResetChanges = buttonM64ResetChanges,
                ButtonOpen         = buttonM64Open,
                ButtonClose        = buttonM64Close,
                ButtonGoto         = buttonM64Goto,
                TextBoxGoto        = textBoxM64Goto,

                DataGridViewInputs = dataGridViewM64Inputs,
                PropertyGridHeader = propertyGridM64Header,
                PropertyGridStats  = propertyGridM64Stats,

                TabControlDetails = tabControlM64Details,
                TabPageInputs     = tabPageM64Inputs,
                TabPageHeader     = tabPageM64Header,
                TabPageStats      = tabPageM64Stats,

                ProgressBar      = progressBarM64,
                LabelProgressBar = labelM64ProgressBar,

                ButtonSetUsRom = buttonM64SetUsRom,
                ButtonSetJpRom = buttonM64SetJpRom,
                ButtonCopyRom  = buttonM64CopyRom,
                ButtonPasteRom = buttonM64PasteRom,

                TextBoxOnValue = textBoxM64OnValue,

                TextBoxSelectionStartFrame = textBoxM64SelectionStartFrame,
                TextBoxSelectionEndFrame   = textBoxM64SelectionEndFrame,
                TextBoxSelectionInputs     = textBoxM64SelectionInputs,

                ButtonTurnOffRowRange   = buttonM64TurnOffRowRange,
                ButtonTurnOffInputRange = buttonM64TurnOffInputRange,
                ButtonTurnOffCells      = buttonM64TurnOffCells,
                ButtonDeleteRowRange    = buttonM64DeleteRowRange,
                ButtonTurnOnInputRange  = buttonM64TurnOnInputRange,
                ButtonTurnOnCells       = buttonM64TurnOnCells,
                ButtonCopyRowRange      = buttonM64CopyRowRange,
                ButtonCopyInputRange    = buttonM64CopyInputRange,

                ListBoxCopied            = listBoxM64Copied,
                ButtonPasteInsert        = buttonM64PasteInsert,
                ButtonPasteOverwrite     = buttonM64PasteOverwrite,
                TextBoxPasteMultiplicity = textBoxM64PasteMultiplicity,

                TextBoxQuickDuplication1stIterationStart = textBoxM64QuickDuplication1stIterationStart,
                TextBoxQuickDuplication2ndIterationStart = textBoxM64QuickDuplication2ndIterationStart,
                TextBoxQuickDuplicationTotalIterations   = textBoxM64QuickDuplicationTotalIterations,
                ButtonQuickDuplicationDuplicate          = buttonM64QuickDuplicationDuplicate,

                ButtonAddPauseBufferFrames = buttonM64AddPauseBufferFrames,
            };

            // Create managers
            Config.MapManager  = new MapManager();
            Config.Map2Manager = new Map2Manager(map2Gui);

            Config.ModelManager        = new ModelManager(tabPageModel);
            Config.ActionsManager      = new ActionsManager(@"Config/ActionsData.xml", watchVariablePanelActions, tabPageActions);
            Config.WaterManager        = new WaterManager(@"Config/WaterData.xml", watchVariablePanelWater);
            Config.SnowManager         = new SnowManager(@"Config/SnowData.xml", watchVariablePanelSnow);
            Config.InputManager        = new InputManager(@"Config/InputData.xml", tabPageInput, watchVariablePanelInput, _inputImageGuiList);
            Config.MarioManager        = new MarioManager(@"Config/MarioData.xml", tabPageMario, WatchVariablePanelMario);
            Config.HudManager          = new HudManager(@"Config/HudData.xml", tabPageHud, watchVariablePanelHud);
            Config.MiscManager         = new MiscManager(@"Config/MiscData.xml", watchVariablePanelMisc, tabPageMisc);
            Config.CameraManager       = new CameraManager(@"Config/CameraData.xml", tabPageCamera, watchVariablePanelCamera);
            Config.TriangleManager     = new TriangleManager(tabPageTriangles, @"Config/TrianglesData.xml", watchVariablePanelTriangles);
            Config.DebugManager        = new DebugManager(@"Config/DebugData.xml", tabPageDebug, watchVariablePanelDebug);
            Config.PuManager           = new PuManager(@"Config/PuData.xml", tabPagePu, watchVariablePanelPu);
            Config.TasManager          = new TasManager(@"Config/TasData.xml", tabPageTas, watchVariablePanelTas);
            Config.FileManager         = new FileManager(@"Config/FileData.xml", tabPageFile, watchVariablePanelFile, _fileImageGui);
            Config.MainSaveManager     = new MainSaveManager(@"Config/MainSaveData.xml", tabPageMainSave, watchVariablePanelMainSave);
            Config.AreaManager         = new AreaManager(tabPageArea, @"Config/AreaData.xml", watchVariablePanelArea);
            Config.QuarterFrameManager = new DataManager(@"Config/QuarterFrameData.xml", watchVariablePanelQuarterFrame);
            Config.CustomManager       = new CustomManager(@"Config/CustomData.xml", tabPageCustom, watchVariablePanelCustom);
            Config.VarHackManager      = new VarHackManager(tabPageVarHack, varHackPanel);
            Config.CamHackManager      = new CamHackManager(@"Config/CamHackData.xml", tabPageCamHack, watchVariablePanelCamHack);
            Config.ObjectManager       = new ObjectManager(@"Config/ObjectData.xml", tabPageObject, WatchVariablePanelObject);
            Config.OptionsManager      = new OptionsManager(tabPageOptions, pictureBoxCog);
            Config.TestingManager      = new TestingManager(tabPageTesting);
            Config.MemoryManager       = new MemoryManager(tabPageMemory, watchVariablePanelMemory, @"Config/ObjectData.xml");
            Config.CoinManager         = new CoinManager(tabPageCoin);
            Config.ScriptManager       = new ScriptManager(tabPageScripts);
            Config.GfxManager          = new GfxManager(tabPageGfx, watchVariablePanelGfx);

            Config.DisassemblyManager = new DisassemblyManager(tabPageDisassembly);
            Config.DecompilerManager  = new DecompilerManager(tabPageDecompiler);
            Config.InjectionManager   = new InjectionManager(_scriptParser, checkBoxUseRomHack);
            Config.HackManager        = new HackManager(_romHacks, Config.ObjectAssociations.SpawnHacks, tabPageHacks);
            Config.M64Manager         = new M64Manager(m64Gui);

            // Create Object Slots
            _slotManagerGui.TabControl          = tabControlMain;
            _slotManagerGui.LockLabelsCheckbox  = checkBoxObjLockLabels;
            _slotManagerGui.FlowLayoutContainer = WatchVariablePanelObjects;
            _slotManagerGui.SortMethodComboBox  = comboBoxSortMethod;
            _slotManagerGui.LabelMethodComboBox = comboBoxLabelMethod;
            Config.ObjectSlotsManager           = new ObjectSlotsManager(_slotManagerGui, tabControlMain);
        }