Ejemplo n.º 1
0
        private void B_Save_Click(object sender, EventArgs e)
        {
            SaveEntry(entry);
            EL_Ground.SaveCurrent();
            EL_Water.SaveCurrent();
            EL_Old.SaveCurrent();
            EL_Good.SaveCurrent();
            EL_Super.SaveCurrent();
            EL_Sky.SaveCurrent();

            Close();
        }
Ejemplo n.º 2
0
        private void B_Save_Click(object sender, EventArgs e)
        {
            SaveEntry(entry);
            EL_Ground.SaveCurrent();
            EL_Water.SaveCurrent();
            EL_Old.SaveCurrent();
            EL_Good.SaveCurrent();
            EL_Super.SaveCurrent();

            Result = Tables.WriteJson();
            // Clipboard.SetText(Result);
            Close();
        }
Ejemplo n.º 3
0
        private void SaveEntry(int i)
        {
            if (i < 0)
            {
                return;
            }
            var arr = Tables.EncounterTables[i];

            arr.TrainerRankMin = (int)NUD_RankMin.Value;
            arr.TrainerRankMax = (int)NUD_RankMax.Value;

            arr.GroundTableLevelMin      = (int)EL_Ground.NUD_Min.Value;
            arr.GroundTableLevelMax      = (int)EL_Ground.NUD_Max.Value;
            arr.GroundTableEncounterRate = (int)EL_Ground.NUD_SpawnRate.Value;
            arr.GroundSpawnCountMax      = (int)EL_Ground.NUD_Count.Value;
            arr.GroundSpawnDuration      = (int)EL_Ground.NUD_Duration.Value;

            arr.WaterTableLevelMin      = (int)EL_Water.NUD_Min.Value;
            arr.WaterTableLevelMax      = (int)EL_Water.NUD_Max.Value;
            arr.WaterTableEncounterRate = (int)EL_Water.NUD_SpawnRate.Value;
            arr.WaterSpawnCountMax      = (int)EL_Water.NUD_Count.Value;
            arr.WaterSpawnDuration      = (int)EL_Water.NUD_Duration.Value;

            arr.OldRodTableLevelMin      = (int)EL_Old.NUD_Min.Value;
            arr.OldRodTableLevelMax      = (int)EL_Old.NUD_Max.Value;
            arr.OldRodTableEncounterRate = (int)EL_Old.NUD_SpawnRate.Value;

            arr.GoodRodTableLevelMin      = (int)EL_Good.NUD_Min.Value;
            arr.GoodRodTableLevelMax      = (int)EL_Good.NUD_Max.Value;
            arr.GoodRodTableEncounterRate = (int)EL_Good.NUD_SpawnRate.Value;

            arr.SuperRodTableLevelMin      = (int)EL_Super.NUD_Min.Value;
            arr.SuperRodTableLevelMax      = (int)EL_Super.NUD_Max.Value;
            arr.SuperRodTableEncounterRate = (int)EL_Super.NUD_SpawnRate.Value;

            arr.SkyTableLevelMin      = (int)EL_Sky.NUD_Min.Value;
            arr.SkyTableLevelMax      = (int)EL_Sky.NUD_Max.Value;
            arr.SkyTableEncounterRate = (int)EL_Sky.NUD_SpawnRate.Value;
            arr.SkySpawnCountMax      = (int)EL_Sky.NUD_Count.Value;
            arr.SkySpawnDuration      = (int)EL_Sky.NUD_Duration.Value;

            EL_Ground.SaveCurrent();
            EL_Water.SaveCurrent();
            EL_Old.SaveCurrent();
            EL_Good.SaveCurrent();
            EL_Super.SaveCurrent();
            EL_Sky.SaveCurrent();
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
0
        private void LoadEntry(int i)
        {
            var arr = Tables.EncounterTables[i];

            NUD_RankMin.Value = arr.TrainerRankMin;
            NUD_RankMax.Value = arr.TrainerRankMax;

            EL_Ground.LoadSlots(arr.GroundTable);
            EL_Water.LoadSlots(arr.WaterTable);
            EL_Old.LoadSlots(arr.OldRodTable);
            EL_Good.LoadSlots(arr.GoodRodTable);
            EL_Super.LoadSlots(arr.SuperRodTable);
            EL_Sky.LoadSlots(arr.SkyTable);

            EL_Ground.NUD_Min.Value       = arr.GroundTableLevelMin;
            EL_Ground.NUD_Max.Value       = arr.GroundTableLevelMax;
            EL_Ground.NUD_SpawnRate.Value = arr.GroundTableEncounterRate;
            EL_Ground.NUD_Count.Value     = arr.GroundSpawnCountMax;
            EL_Ground.NUD_Duration.Value  = arr.GroundSpawnDuration;

            EL_Water.NUD_Min.Value       = arr.WaterTableLevelMin;
            EL_Water.NUD_Max.Value       = arr.WaterTableLevelMax;
            EL_Water.NUD_SpawnRate.Value = arr.WaterTableEncounterRate;
            EL_Water.NUD_Count.Value     = arr.WaterSpawnCountMax;
            EL_Water.NUD_Duration.Value  = arr.WaterSpawnDuration;

            EL_Old.NUD_Min.Value       = arr.OldRodTableLevelMin;
            EL_Old.NUD_Max.Value       = arr.OldRodTableLevelMax;
            EL_Old.NUD_SpawnRate.Value = arr.OldRodTableEncounterRate;

            EL_Good.NUD_Min.Value       = arr.GoodRodTableLevelMin;
            EL_Good.NUD_Max.Value       = arr.GoodRodTableLevelMax;
            EL_Good.NUD_SpawnRate.Value = arr.GoodRodTableEncounterRate;

            EL_Super.NUD_Min.Value       = arr.SuperRodTableLevelMin;
            EL_Super.NUD_Max.Value       = arr.SuperRodTableLevelMax;
            EL_Super.NUD_SpawnRate.Value = arr.SuperRodTableEncounterRate;

            EL_Sky.NUD_Min.Value       = arr.SkyTableLevelMin;
            EL_Sky.NUD_Max.Value       = arr.SkyTableLevelMax;
            EL_Sky.NUD_SpawnRate.Value = arr.SkyTableEncounterRate;
            EL_Sky.NUD_Count.Value     = arr.SkySpawnCountMax;
            EL_Sky.NUD_Duration.Value  = arr.SkySpawnDuration;
        }
Ejemplo n.º 6
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;
        }