Fix Rival → RivalName rename from upstream

Upstream renamed SAV8BS.Rival and Misc7b.Rival to RivalName.
Update Avalonia ViewModels to match.
This commit is contained in:
montanon 2026-03-18 15:34:36 -03:00
parent c2719273ca
commit 512caa4122
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ public SAVTrainer7GGViewModel(SAV7b sav) : base(sav)
private void LoadData()
{
OtName = _sav.OT;
RivalName = _sav.Blocks.Misc.Rival;
RivalName = _sav.Blocks.Misc.RivalName;
Gender = _sav.Gender;
Money = _sav.Blocks.Misc.Money.ToString();
Language = _sav.Language;
@ -85,7 +85,7 @@ private void Save()
_sav.Money = uint.TryParse(Money, out var m) ? m : 0u;
_sav.Language = Language;
_sav.OT = OtName;
_sav.Blocks.Misc.Rival = RivalName;
_sav.Blocks.Misc.RivalName = RivalName;
_sav.PlayedHours = (ushort)Math.Clamp(PlayedHours, 0, ushort.MaxValue);
_sav.PlayedMinutes = (ushort)Math.Clamp(PlayedMinutes, 0, 59);

View File

@ -48,7 +48,7 @@ private void LoadData()
GameIndex = Math.Clamp((byte)_sav.Version - (byte)GameVersion.BD, 0, 1);
Gender = _sav.Gender;
OtName = _sav.OT;
Rival = _sav.Rival;
Rival = _sav.RivalName;
Money = _sav.Money.ToString();
Bp = (int)_sav.BattleTower.BP;
@ -75,7 +75,7 @@ private void Save()
_sav.Version = (GameVersion)(GameIndex + (int)GameVersion.BD);
_sav.Gender = (byte)Gender;
_sav.OT = OtName;
_sav.Rival = Rival;
_sav.RivalName = Rival;
_sav.Money = uint.TryParse(Money, out var money) ? (uint)Math.Min(money, (uint)_sav.MaxMoney) : 0u;
_sav.BattleTower.BP = (uint)Math.Max(0, Bp);