Exemple #1
0
        private void save()
        {
            SAV.Game   = (byte)(CB_Game.SelectedIndex + 30);
            SAV.Gender = (byte)CB_Gender.SelectedIndex;

            SAV.TID           = (ushort)Util.ToUInt32(MT_TID.Text);
            SAV.SID           = (ushort)Util.ToUInt32(MT_SID.Text);
            SAV.Money         = Util.ToUInt32(MT_Money.Text);
            SAV.SubRegion     = Util.getIndex(CB_Region);
            SAV.Country       = Util.getIndex(CB_Country);
            SAV.ConsoleRegion = Util.getIndex(CB_3DSReg);
            SAV.Language      = Util.getIndex(CB_Language);
            SAV.AlolaTime     = (ulong)Util.getIndex(CB_AlolaTime);

            SAV.OT = TB_OTName.Text;

            // Copy Position
            if (GB_Map.Enabled && MapUpdated)
            {
                SAV.M = (int)NUD_M.Value;
                SAV.X = (float)NUD_X.Value;
                SAV.Z = (float)NUD_Z.Value;
                SAV.Y = (float)NUD_Y.Value;
                SAV.R = (float)NUD_R.Value;
            }

            // Save PlayTime
            SAV.PlayedHours   = ushort.Parse(MT_Hours.Text);
            SAV.PlayedMinutes = ushort.Parse(MT_Minutes.Text) % 60;
            SAV.PlayedSeconds = ushort.Parse(MT_Seconds.Text) % 60;

            int seconds = (int)(CAL_AdventureStartDate.Value - new DateTime(2000, 1, 1)).TotalSeconds;

            seconds           -= seconds % 86400;
            seconds           += (int)(CAL_AdventureStartTime.Value - new DateTime(2000, 1, 1)).TotalSeconds;
            SAV.SecondsToStart = seconds;

            int fame = (int)(CAL_HoFDate.Value - new DateTime(2000, 1, 1)).TotalSeconds;

            fame -= fame % 86400;
            fame += (int)(CAL_HoFTime.Value - new DateTime(2000, 1, 1)).TotalSeconds;
            SAV.SecondsToFame = fame;

            if (SAV.LastSavedDate.HasValue)
            {
                SAV.LastSavedDate = new DateTime(CAL_LastSavedDate.Value.Year, CAL_LastSavedDate.Value.Month, CAL_LastSavedDate.Value.Day, CAL_LastSavedTime.Value.Hour, CAL_LastSavedTime.Value.Minute, 0);
            }

            SAV.BP         = (uint)NUD_BP.Value;
            SAV.FestaCoins = (uint)NUD_FC.Value;

            // Poké Finder
            SAV.PokeFinderSnapCount        = (uint)NUD_SnapCount.Value;
            SAV.PokeFinderThumbsTotalValue = (uint)NUD_ThumbsTotal.Value;
            SAV.PokeFinderThumbsHighValue  = (uint)NUD_ThumbsRecord.Value;

            SAV.PokeFinderCameraVersion = (ushort)CB_CameraVersion.SelectedIndex;
            SAV.PokeFinderGyroFlag      = CHK_Gyro.Checked;

            // Battle Tree
            SAV.setTreeStreak((int)NUD_RCStreak0.Value, 0, super: false, max: false);
            SAV.setTreeStreak((int)NUD_RCStreak1.Value, 1, super: false, max: false);
            SAV.setTreeStreak((int)NUD_RCStreak2.Value, 2, super: false, max: false);
            SAV.setTreeStreak((int)NUD_RMStreak0.Value, 0, super: false, max: true);
            SAV.setTreeStreak((int)NUD_RMStreak1.Value, 1, super: false, max: true);
            SAV.setTreeStreak((int)NUD_RMStreak2.Value, 2, super: false, max: true);

            SAV.setTreeStreak((int)NUD_SCStreak0.Value, 0, super: true, max: false);
            SAV.setTreeStreak((int)NUD_SCStreak1.Value, 1, super: true, max: false);
            SAV.setTreeStreak((int)NUD_SCStreak2.Value, 2, super: true, max: false);
            SAV.setTreeStreak((int)NUD_SMStreak0.Value, 0, super: true, max: true);
            SAV.setTreeStreak((int)NUD_SMStreak1.Value, 1, super: true, max: true);
            SAV.setTreeStreak((int)NUD_SMStreak2.Value, 2, super: true, max: true);

            SAV.DressUpSkinColor = CB_SkinColor.SelectedIndex;
        }