Exemple #1
0
        public override void InitializeTab()
        {
            base.InitializeTab();

            TableConfig.MusicData = XmlConfigParser.OpenMusicTable(@"Config/MusicData.xml");
            TableConfig.MusicData.GetMusicEntryList().ForEach(musicEntry => listBoxSoundMusic.Items.Add(musicEntry));
            listBoxSoundMusic.Click += (sender, e) =>
            {
                MusicEntry musicEntry = listBoxSoundMusic.SelectedItem as MusicEntry;
                textBoxSoundMusic.Text = musicEntry.Index.ToString();
            };
            buttonSoundPlayMusic.Click += (sender, e) =>
            {
                int?musicIndexNullable = ParsingUtilities.ParseIntNullable(textBoxSoundMusic.Text);
                if (musicIndexNullable == null)
                {
                    return;
                }
                int musicIndex = musicIndexNullable.Value;
                if (musicIndex < 0 || musicIndex > 34)
                {
                    return;
                }
                uint setMusic = RomVersionConfig.SwitchMap(0x80320544, 0x8031F690);
                InGameFunctionCall.WriteInGameFunctionCall(setMusic, 0, (uint)musicIndex, 0);
            };

            foreach (uint soundEffect in _soundEffects)
            {
                string soundEffectString = HexUtilities.FormatValue(soundEffect, 4);
                listBoxSoundSoundEffect.Items.Add(soundEffectString);
            }
            listBoxSoundSoundEffect.Click += (sender, e) =>
            {
                textBoxSoundSoundEffect.Text = listBoxSoundSoundEffect.SelectedItem.ToString() + "FF81";
            };
            buttonSoundPlaySoundEffect.Click += (sender, e) =>
            {
                uint setSound            = RomVersionConfig.SwitchMap(0x8031EB00, 0x8031DC78);
                uint soundArg            = RomVersionConfig.SwitchMap(0x803331F0, 0x803320E0);
                uint?soundEffectNullable = ParsingUtilities.ParseHexNullable(textBoxSoundSoundEffect.Text);
                if (!soundEffectNullable.HasValue)
                {
                    return;
                }
                uint soundEffect = soundEffectNullable.Value;
                InGameFunctionCall.WriteInGameFunctionCall(setSound, soundEffect, soundArg);
            };
        }
Exemple #2
0
        public void LoadConfig(MainLoadingForm loadingForm)
        {
            Config.ObjectSlotManagerGui = new ObjectSlotManagerGui()
            {
                TabControl              = tabControlMain,
                LockLabelsCheckbox      = checkBoxObjLockLabels,
                FlowLayoutContainer     = WatchVariablePanelObjects,
                SortMethodComboBox      = comboBoxSortMethod,
                LabelMethodComboBox     = comboBoxLabelMethod,
                SelectionMethodComboBox = comboBoxSelectionMethod,
            };

            int statusNum = 0;

            // Read configuration
            loadingForm.UpdateStatus("Loading main configuration", statusNum++);
            XmlConfigParser.OpenConfig(@"Config/Config.xml");
            XmlConfigParser.OpenSavedSettings(@"Config/SavedSettings.xml");
            loadingForm.UpdateStatus("Loading Miscellaneous Data", statusNum++);
            loadingForm.UpdateStatus("Loading Object Data", statusNum++);
            loadingForm.UpdateStatus("Loading Object Associations", statusNum++);
            Config.ObjectAssociations = XmlConfigParser.OpenObjectAssoc(@"Config/ObjectAssociations.xml", Config.ObjectSlotManagerGui);
            loadingForm.UpdateStatus("Loading Mario Data", statusNum++);
            loadingForm.UpdateStatus("Loading Camera Data", statusNum++);
            loadingForm.UpdateStatus("Loading Actions Data", statusNum++);
            loadingForm.UpdateStatus("Loading Water Data", statusNum++);
            loadingForm.UpdateStatus("Loading Input Data", statusNum++);
            loadingForm.UpdateStatus("Loading Input Image Associations", statusNum++);
            _inputImageGuiList = XmlConfigParser.CreateInputImageAssocList(@"Config/InputImageAssociations.xml");
            loadingForm.UpdateStatus("Loading File Data", statusNum++);
            loadingForm.UpdateStatus("Loading File Image Associations", statusNum++);
            XmlConfigParser.OpenFileImageAssoc(@"Config/FileImageAssociations.xml", _fileImageGui);
            loadingForm.UpdateStatus("Loading Area Data", statusNum++);
            loadingForm.UpdateStatus("Loading Quarter Frame Data", statusNum++);
            loadingForm.UpdateStatus("Loading Camera Hack Data", statusNum++);
            loadingForm.UpdateStatus("Loading Triangles Data", statusNum++);
            loadingForm.UpdateStatus("Loading Debug Data", statusNum++);
            loadingForm.UpdateStatus("Loading HUD Data", statusNum++);
            loadingForm.UpdateStatus("Loading Map Associations", statusNum++);
            Config.MapAssociations = XmlConfigParser.OpenMapAssoc(@"Config/MapAssociations.xml");
            loadingForm.UpdateStatus("Loading Scripts", statusNum++);
            _scriptParser = XmlConfigParser.OpenScripts(@"Config/Scripts.xml");
            loadingForm.UpdateStatus("Loading Hacks", statusNum++);
            _romHacks = XmlConfigParser.OpenHacks(@"Config/Hacks.xml");
            loadingForm.UpdateStatus("Loading Mario Actions", statusNum++);

            TableConfig.MarioActions            = XmlConfigParser.OpenActionTable(@"Config/MarioActions.xml");
            TableConfig.MarioAnimations         = XmlConfigParser.OpenAnimationTable(@"Config/MarioAnimations.xml");
            TableConfig.TriangleInfo            = XmlConfigParser.OpenTriangleInfoTable(@"Config/TriangleInfo.xml");
            TableConfig.PendulumSwings          = XmlConfigParser.OpenPendulumSwingTable(@"Config/PendulumSwings.xml");
            TableConfig.RacingPenguinWaypoints  = XmlConfigParser.OpenWaypointTable(@"Config/RacingPenguinWaypoints.xml");
            TableConfig.KoopaTheQuick1Waypoints = XmlConfigParser.OpenWaypointTable(@"Config/KoopaTheQuick1Waypoints.xml");
            TableConfig.KoopaTheQuick2Waypoints = XmlConfigParser.OpenWaypointTable(@"Config/KoopaTheQuick2Waypoints.xml");
            TableConfig.TtmBowlingBallPoints    = XmlConfigParser.OpenPointTable(@"Config/TtmBowlingBallPoints.xml");
            TableConfig.MusicData  = XmlConfigParser.OpenMusicTable(@"Config/MusicData.xml");
            TableConfig.Missions   = XmlConfigParser.OpenMissionTable(@"Config/Missions.xml");
            TableConfig.CourseData = XmlConfigParser.OpenCourseDataTable(@"Config/CourseData.xml");
            TableConfig.FlyGuyData = new FlyGuyDataTable();
            TableConfig.WdwRotatingPlatformTable = new ObjectAngleTable(1120);
            TableConfig.ElevatorAxleTable        = new ObjectAngleTable(400);

            loadingForm.UpdateStatus("Creating Managers", statusNum++);
            CreateManagers();

            loadingForm.UpdateStatus("Finishing", statusNum);
        }