Example #1
0
        public GGWE(GameManager rom, string json)
        {
            InitializeComponent();
            EncounterArchive obj = EncounterArchive.ReadJson(json);

            if (obj?.EncounterTables?[0]?.GroundTable == null)
            {
                WinFormsUtil.Error("Bad json data provided.", $"Unable to parse to {nameof(EncounterArchive)} data.");
                Close();
            }

            ROM = rom;

            var spec    = rom.GetStrings(TextName.SpeciesNames);
            var species = (string[])spec.Clone();

            species[0]            = "";
            EncounterList.species = species;
            var locs = rom.GetStrings(TextName.metlist_000000);

            EL_Ground.Initialize();
            EL_Water.Initialize();
            EL_Old.Initialize();
            EL_Good.Initialize();
            EL_Super.Initialize();
            EL_Sky.Initialize();

            TC_Tables.Controls.Remove(Tab_Old);
            TC_Tables.Controls.Remove(Tab_Good);
            TC_Tables.Controls.Remove(Tab_Super);
            EL_Old.OverworldSpawn = EL_Good.OverworldSpawn = EL_Super.OverworldSpawn = false;
            L_Rank.Visible        = NUD_RankMin.Visible = NUD_RankMax.Visible = false;

            PG_Species.SelectedObject = EditUtil.Settings.Species;

            Tables = obj;
            LoadFile(locs);

            EL_Ground.ShowForm        = false;
            EL_Water.ShowForm         = false;
            EL_Old.ShowForm           = false;
            EL_Good.ShowForm          = false;
            EL_Super.ShowForm         = false;
            EL_Sky.ShowForm           = false;
            CB_Location.SelectedIndex = 0;
        }
Example #2
0
        public GGWE(GameManager rom, string json)
        {
            InitializeComponent();
            EncounterArchive obj = EncounterArchive.ReadJson(json);

            ROM = rom;

            var spec    = rom.GetStrings(TextName.SpeciesNames);
            var species = (string[])spec.Clone();

            species[0]            = "";
            EncounterList.species = species;
            var locs = rom.GetStrings(TextName.metlist_000000);

            EL_Ground.Initialize();
            EL_Water.Initialize();
            EL_Old.Initialize();
            EL_Good.Initialize();
            EL_Super.Initialize();
            EL_Sky.Initialize();

            TC_Tables.Controls.Remove(Tab_Old);
            TC_Tables.Controls.Remove(Tab_Good);
            TC_Tables.Controls.Remove(Tab_Super);
            EL_Old.OverworldSpawn = EL_Good.OverworldSpawn = EL_Super.OverworldSpawn = false;
            L_Rank.Visible        = NUD_RankMin.Visible = NUD_RankMax.Visible = false;

            PG_Species.SelectedObject = EditUtil.Settings.Species;

            Tables = obj;
            LoadFile(locs);

            EL_Ground.ShowForm        = false;
            EL_Water.ShowForm         = false;
            EL_Old.ShowForm           = false;
            EL_Good.ShowForm          = false;
            EL_Super.ShowForm         = false;
            EL_Sky.ShowForm           = false;
            CB_Location.SelectedIndex = 0;
        }