Exemple #1
0
        private void GetTextBoxes()
        {
            // Get Data
            CB_Game.SelectedIndex   = SAV.Game - (int)GameVersion.SN;
            CB_Gender.SelectedIndex = SAV.Gender;

            // Display Data
            TB_OTName.Text = SAV.OT;
            trainerID1.LoadIDValues(SAV);
            MT_Money.Text = SAV.Money.ToString();

            CB_Country.SelectedValue  = SAV.Country;
            CB_Region.SelectedValue   = SAV.SubRegion;
            CB_3DSReg.SelectedValue   = SAV.ConsoleRegion;
            CB_Language.SelectedValue = SAV.Language;
            var time = SAV.AlolaTime;

            if (time == 0)
            {
                time = 24 * 60 * 60; // Patch up any bad times from previous program versions.
            }
            if (time == 9_999_999)
            {
                CB_AlolaTime.Enabled = false; // alola time doesn't exist yet
            }
            else
            {
                CB_AlolaTime.SelectedValue = (int)time;
            }
            if (CB_AlolaTime.SelectedValue == null)
            {
                CB_AlolaTime.Enabled = false;
            }

            NUD_M.Value = SAV.M;
            // Sanity Check Map Coordinates
            try
            {
                NUD_X.Value = (decimal)SAV.X;
                NUD_Z.Value = (decimal)SAV.Z;
                NUD_Y.Value = (decimal)SAV.Y;
                NUD_R.Value = (decimal)SAV.R;
            }
            catch { GB_Map.Enabled = false; }

            // Load Play Time
            MT_Hours.Text   = SAV.PlayedHours.ToString();
            MT_Minutes.Text = SAV.PlayedMinutes.ToString();
            MT_Seconds.Text = SAV.PlayedSeconds.ToString();

            if (SAV.LastSavedDate.HasValue)
            {
                CAL_LastSavedDate.Value = SAV.LastSavedDate.Value;
                CAL_LastSavedTime.Value = SAV.LastSavedDate.Value;
            }
            else
            {
                L_LastSaved.Visible = CAL_LastSavedDate.Visible = CAL_LastSavedTime.Visible = false;
            }

            var epoch = new DateTime(2000, 1, 1);

            CAL_AdventureStartDate.Value = epoch.AddSeconds(SAV.SecondsToStart);
            CAL_AdventureStartTime.Value = epoch.AddSeconds(SAV.SecondsToStart % 86400);
            CAL_HoFDate.Value            = epoch.AddSeconds(SAV.SecondsToFame);
            CAL_HoFTime.Value            = epoch.AddSeconds(SAV.SecondsToFame % 86400);

            NUD_BP.Value = Math.Min(NUD_BP.Maximum, SAV.BP);
            NUD_FC.Value = Math.Min(NUD_FC.Maximum, SAV.FestaCoins);

            // Poké Finder
            NUD_SnapCount.Value    = Math.Min(NUD_SnapCount.Maximum, SAV.PokeFinderSnapCount);
            NUD_ThumbsTotal.Value  = Math.Min(NUD_ThumbsTotal.Maximum, SAV.PokeFinderThumbsTotalValue);
            NUD_ThumbsRecord.Value = Math.Min(NUD_ThumbsRecord.Maximum, SAV.PokeFinderThumbsHighValue);

            CB_CameraVersion.SelectedIndex = Math.Min(CB_CameraVersion.Items.Count - 1, SAV.PokeFinderCameraVersion);
            CHK_Gyro.Checked = SAV.PokeFinderGyroFlag;

            // Battle Tree
            NUD_RCStreak0.Value = Math.Min(NUD_RCStreak0.Maximum, SAV.GetTreeStreak(0, super: false, max: false));
            NUD_RCStreak1.Value = Math.Min(NUD_RCStreak1.Maximum, SAV.GetTreeStreak(1, super: false, max: false));
            NUD_RCStreak2.Value = Math.Min(NUD_RCStreak2.Maximum, SAV.GetTreeStreak(2, super: false, max: false));
            NUD_RMStreak0.Value = Math.Min(NUD_RMStreak0.Maximum, SAV.GetTreeStreak(0, super: false, max: true));
            NUD_RMStreak1.Value = Math.Min(NUD_RMStreak1.Maximum, SAV.GetTreeStreak(1, super: false, max: true));
            NUD_RMStreak2.Value = Math.Min(NUD_RMStreak2.Maximum, SAV.GetTreeStreak(2, super: false, max: true));

            NUD_SCStreak0.Value = Math.Min(NUD_SCStreak0.Maximum, SAV.GetTreeStreak(0, super: true, max: false));
            NUD_SCStreak1.Value = Math.Min(NUD_SCStreak1.Maximum, SAV.GetTreeStreak(1, super: true, max: false));
            NUD_SCStreak2.Value = Math.Min(NUD_SCStreak2.Maximum, SAV.GetTreeStreak(2, super: true, max: false));
            NUD_SMStreak0.Value = Math.Min(NUD_SMStreak0.Maximum, SAV.GetTreeStreak(0, super: true, max: true));
            NUD_SMStreak1.Value = Math.Min(NUD_SMStreak1.Maximum, SAV.GetTreeStreak(1, super: true, max: true));
            NUD_SMStreak2.Value = Math.Min(NUD_SMStreak2.Maximum, SAV.GetTreeStreak(2, super: true, max: true));

            CB_SkinColor.SelectedIndex = SAV.DressUpSkinColor;
            TB_PlazaName.Text          = SAV.FestivalPlazaName;

            CB_Vivillon.SelectedIndex   = (SAV.Vivillon < CB_Vivillon.Items.Count) ? SAV.Vivillon : -1;
            NUD_DaysFromRefreshed.Value = Math.Min(NUD_DaysFromRefreshed.Maximum, SAV.DaysFromRefreshed);

            if (SAV.BallThrowType >= 0 && SAV.BallThrowType < CB_BallThrowType.Items.Count)
            {
                CB_BallThrowType.SelectedIndex = SAV.BallThrowType;
            }

            if (SAV.SM)
            {
                LoadThrowTypeLists();
            }
            else
            {
                CB_BallThrowTypeListMode.Visible = LB_BallThrowTypeLearned.Visible = LB_BallThrowTypeUnlocked.Visible = false;
            }

            uint stampBits = SAV.Stamps;

            for (int i = 0; i < LB_Stamps.Items.Count; i++)
            {
                LB_Stamps.SetSelected(i, (stampBits & (1 << i)) != 0);
            }

            CHK_UnlockSuperSingles.Checked = SAV.GetEventFlag(333);
            CHK_UnlockSuperDoubles.Checked = SAV.GetEventFlag(334);
            CHK_UnlockSuperMulti.Checked   = SAV.GetEventFlag(335);

            CHK_UnlockMega.Checked  = SAV.MegaUnlocked;
            CHK_UnlockZMove.Checked = SAV.ZMoveUnlocked;

            LoadMapFlyToData();
        }
Exemple #2
0
        private void getTextBoxes()
        {
            // Get Data
            string OT_NAME = SAV.OT;

            CB_Game.SelectedIndex   = SAV.Game - 30;
            CB_Gender.SelectedIndex = SAV.Gender;

            // Display Data
            TB_OTName.Text = OT_NAME;

            MT_TID.Text   = SAV.TID.ToString("00000");
            MT_SID.Text   = SAV.SID.ToString("00000");
            MT_G7TID.Text = SAV.TrainerID7.ToString("000000");
            MT_Money.Text = SAV.Money.ToString();

            CB_Country.SelectedValue  = SAV.Country;
            CB_Region.SelectedValue   = SAV.SubRegion;
            CB_3DSReg.SelectedValue   = SAV.ConsoleRegion;
            CB_Language.SelectedValue = SAV.Language;
            if (SAV.AlolaTime == 0)
            {
                SAV.AlolaTime = 24 * 60 * 60; // Patch up any bad times from previous program versions.
            }
            CB_AlolaTime.SelectedValue = (int)SAV.AlolaTime;

            NUD_M.Value = SAV.M;
            // Sanity Check Map Coordinates
            try
            {
                NUD_X.Value = (decimal)SAV.X;
                NUD_Z.Value = (decimal)SAV.Z;
                NUD_Y.Value = (decimal)SAV.Y;
                NUD_R.Value = (decimal)SAV.R;
            }
            catch { GB_Map.Enabled = false; }

            // Load Play Time
            MT_Hours.Text   = SAV.PlayedHours.ToString();
            MT_Minutes.Text = SAV.PlayedMinutes.ToString();
            MT_Seconds.Text = SAV.PlayedSeconds.ToString();

            if (SAV.LastSavedDate.HasValue)
            {
                CAL_LastSavedDate.Value = SAV.LastSavedDate.Value;
                CAL_LastSavedTime.Value = SAV.LastSavedDate.Value;
            }
            else
            {
                L_LastSaved.Visible = CAL_LastSavedDate.Visible = CAL_LastSavedTime.Visible = false;
            }

            CAL_AdventureStartDate.Value = new DateTime(2000, 1, 1).AddSeconds(SAV.SecondsToStart);
            CAL_AdventureStartTime.Value = new DateTime(2000, 1, 1).AddSeconds(SAV.SecondsToStart % 86400);
            CAL_HoFDate.Value            = new DateTime(2000, 1, 1).AddSeconds(SAV.SecondsToFame);
            CAL_HoFTime.Value            = new DateTime(2000, 1, 1).AddSeconds(SAV.SecondsToFame % 86400);

            NUD_BP.Value = Math.Min(NUD_BP.Maximum, SAV.BP);
            NUD_FC.Value = Math.Min(NUD_FC.Maximum, SAV.FestaCoins);

            // Poké Finder
            NUD_SnapCount.Value    = Math.Min(NUD_SnapCount.Maximum, SAV.PokeFinderSnapCount);
            NUD_ThumbsTotal.Value  = Math.Min(NUD_ThumbsTotal.Maximum, SAV.PokeFinderThumbsTotalValue);
            NUD_ThumbsRecord.Value = Math.Min(NUD_ThumbsRecord.Maximum, SAV.PokeFinderThumbsHighValue);

            CB_CameraVersion.SelectedIndex = Math.Min(CB_CameraVersion.Items.Count - 1, SAV.PokeFinderCameraVersion);
            CHK_Gyro.Checked = SAV.PokeFinderGyroFlag;

            // Battle Tree
            NUD_RCStreak0.Value = Math.Min(NUD_RCStreak0.Maximum, SAV.getTreeStreak(0, super: false, max: false));
            NUD_RCStreak1.Value = Math.Min(NUD_RCStreak1.Maximum, SAV.getTreeStreak(1, super: false, max: false));
            NUD_RCStreak2.Value = Math.Min(NUD_RCStreak2.Maximum, SAV.getTreeStreak(2, super: false, max: false));
            NUD_RMStreak0.Value = Math.Min(NUD_RMStreak0.Maximum, SAV.getTreeStreak(0, super: false, max: true));
            NUD_RMStreak1.Value = Math.Min(NUD_RMStreak1.Maximum, SAV.getTreeStreak(1, super: false, max: true));
            NUD_RMStreak2.Value = Math.Min(NUD_RMStreak2.Maximum, SAV.getTreeStreak(2, super: false, max: true));

            NUD_SCStreak0.Value = Math.Min(NUD_SCStreak0.Maximum, SAV.getTreeStreak(0, super: true, max: false));
            NUD_SCStreak1.Value = Math.Min(NUD_SCStreak1.Maximum, SAV.getTreeStreak(1, super: true, max: false));
            NUD_SCStreak2.Value = Math.Min(NUD_SCStreak2.Maximum, SAV.getTreeStreak(2, super: true, max: false));
            NUD_SMStreak0.Value = Math.Min(NUD_SMStreak0.Maximum, SAV.getTreeStreak(0, super: true, max: true));
            NUD_SMStreak1.Value = Math.Min(NUD_SMStreak1.Maximum, SAV.getTreeStreak(1, super: true, max: true));
            NUD_SMStreak2.Value = Math.Min(NUD_SMStreak2.Maximum, SAV.getTreeStreak(2, super: true, max: true));

            CB_SkinColor.SelectedIndex = SAV.DressUpSkinColor;
            TB_PlazaName.Text          = SAV.FestivalPlazaName;

            CB_Vivillon.SelectedIndex   = (SAV.Vivillon < CB_Vivillon.Items.Count) ? SAV.Vivillon : -1;
            NUD_DaysFromRefreshed.Value = Math.Min(NUD_DaysFromRefreshed.Maximum, SAV.DaysFromRefreshed);

            if (SAV.BallThrowType >= 0 && SAV.BallThrowType < CB_BallThrowType.Items.Count)
            {
                CB_BallThrowType.SelectedIndex = SAV.BallThrowType;
            }

            byte bttu = SAV.BallThrowTypeUnlocked;

            LB_BallThrowTypeUnlocked.SetSelected(0, true);
            LB_BallThrowTypeUnlocked.SetSelected(1, true);
            for (int i = 2; i < LB_BallThrowTypeUnlocked.Items.Count; i++)
            {
                LB_BallThrowTypeUnlocked.SetSelected(i, (bttu & (1 << i)) != 0);
            }

            byte bttl = SAV.BallThrowTypeLearned;

            LB_BallThrowTypeLearned.SetSelected(0, true);
            for (int i = 1; i < LB_BallThrowTypeLearned.Items.Count; i++)
            {
                LB_BallThrowTypeLearned.SetSelected(i, (bttl & (1 << i)) != 0);
            }

            CB_BallThrowTypeListMode.SelectedIndex = 0;

            uint stampBits = SAV.Stamps;

            for (int i = 0; i < LB_Stamps.Items.Count; i++)
            {
                LB_Stamps.SetSelected(i, (stampBits & (1 << i)) != 0);
            }

            byte btsu = SAV.BattleTreeSuperUnlocked;

            CHK_UnlockSuperSingles.Checked = (btsu & 1) != 0;
            CHK_UnlockSuperDoubles.Checked = (btsu & (1 << 1)) != 0;
            CHK_UnlockSuperMulti.Checked   = (btsu & (1 << 2)) != 0;

            CHK_UnlockMega.Checked = SAV.MegaUnlocked;
        }