mirror of
https://github.com/kwsch/NHSE.git
synced 2026-10-01 14:26:38 -05:00
Relocate Fruits/Flowers + cleanup strings (#711)
Relocated island/sister fruit/flower functionality to new FruitsFlowersEditor out of MiscPlayer to better follow existing layout. Added new button for this editor to Map tab for the new form. MiscPlayer fruit now sets passport only, FruitsFlowersEditor sets both. Other functionality remains as before. Retired FieldGoods from the Map button in favour of above. Adjusted UI anchors and open positions for new forms + cleaned up recent lang_xx string additions.
This commit is contained in:
committed by
GitHub
parent
c412da8217
commit
9bcaee6fc9
@@ -18,11 +18,8 @@ public MiscPlayerEditor(Player p, MainSave s)
|
||||
Player = p;
|
||||
Save = s;
|
||||
|
||||
var fruitsSpecialty = ComboItemUtil.GetArray(GameLists.Fruits, GameInfo.Strings.itemlistdisplay);
|
||||
RIS_ProfileFruit.Initialize(fruitsSpecialty);
|
||||
|
||||
var fruitsSister = ComboItemUtil.GetArray(GameLists.Fruits, GameInfo.Strings.itemlistdisplay);
|
||||
RIS_SisterFruit.Initialize(fruitsSister);
|
||||
var profileFruit = ComboItemUtil.GetArray(GameLists.Fruits, GameInfo.Strings.itemlistdisplay);
|
||||
RIS_ProfileFruit.Initialize(profileFruit);
|
||||
|
||||
LoadPlayer();
|
||||
}
|
||||
@@ -41,15 +38,6 @@ private void LoadPlayer()
|
||||
CHK_ProfileMadeVillage.Checked = pers.ProfileIsMakeVillage;
|
||||
|
||||
RIS_ProfileFruit.Value = pers.ProfileFruit;
|
||||
RIS_SisterFruit.Value = sav.SisterFruit;
|
||||
|
||||
var flowersProfile = Enum.GetNames<IslandFlowers>();
|
||||
CB_ProfileFlower.Items.AddRange(flowersProfile);
|
||||
CB_ProfileFlower.SelectedIndex = (int)sav.SpecialtyFlower;
|
||||
|
||||
var flowersSister = Enum.GetNames<IslandFlowers>();
|
||||
CB_SisterFlower.Items.AddRange(flowersSister);
|
||||
CB_SisterFlower.SelectedIndex = (int)sav.SisterFlower;
|
||||
|
||||
CAL_ProfileTimestamp.Value = pers.ProfileTimestamp;
|
||||
}
|
||||
@@ -62,30 +50,6 @@ private void B_Save_Click(object sender, EventArgs e)
|
||||
Close();
|
||||
}
|
||||
|
||||
public void UpdateFruitFlags(MainSave sav)
|
||||
{
|
||||
var fruit = new byte[] { 00, 00, 00, 00, 00 };
|
||||
switch (sav.SpecialtyFruit)
|
||||
{
|
||||
case 2213: // Apple
|
||||
fruit[0] = 01;
|
||||
break;
|
||||
case 2287: // Cherry
|
||||
fruit[4] = 01;
|
||||
break;
|
||||
case 2214: // Orange
|
||||
fruit[1] = 01;
|
||||
break;
|
||||
case 2286: // Peach
|
||||
fruit[3] = 01;
|
||||
break;
|
||||
case 2285: // Pear
|
||||
fruit[2] = 01;
|
||||
break;
|
||||
}
|
||||
sav.FruitFlags = fruit;
|
||||
}
|
||||
|
||||
private void SavePlayer()
|
||||
{
|
||||
var p = Player;
|
||||
@@ -102,13 +66,6 @@ private void SavePlayer()
|
||||
pers.ProfileIsMakeVillage = CHK_ProfileMadeVillage.Checked;
|
||||
|
||||
pers.ProfileFruit = RIS_ProfileFruit.Value;
|
||||
sav.SpecialtyFruit = RIS_ProfileFruit.Value;
|
||||
sav.SisterFruit = RIS_SisterFruit.Value;
|
||||
|
||||
UpdateFruitFlags(sav);
|
||||
|
||||
sav.SpecialtyFlower = (IslandFlowers)CB_ProfileFlower.SelectedIndex;
|
||||
sav.SisterFlower = (IslandFlowers)CB_SisterFlower.SelectedIndex;
|
||||
|
||||
pers.ProfileTimestamp = CAL_ProfileTimestamp.Value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user