diff --git a/Client/Simitone/Simitone.Client/UI/Screens/TS1GameScreen.cs b/Client/Simitone/Simitone.Client/UI/Screens/TS1GameScreen.cs index b77285f..e03869c 100644 --- a/Client/Simitone/Simitone.Client/UI/Screens/TS1GameScreen.cs +++ b/Client/Simitone/Simitone.Client/UI/Screens/TS1GameScreen.cs @@ -1,4 +1,4 @@ - + using FSO.Client; using FSO.Client.Debug; using FSO.Client.UI.Controls; @@ -56,6 +56,7 @@ public class TS1GameScreen : FSO.Client.UI.Framework.GameScreen //for TS1 hybrid mode public UINeighborhoodSelectionPanel TS1NeighPanel; public FAMI ActiveFamily; + private ushort CurrentNeighborhoodMode = 4; // default to Normal/Old Town public bool InLot { @@ -172,6 +173,16 @@ public VMAvatar SelectedAvatar } } + private ushort GetNeighborhoodModeFromHouse(short house) + { + // House number ranges match the lot types + if (house >= 21 && house <= 31) return 2; // Downtown + else if (house >= 40 && house <= 49) return 3; // Vacation + else if (house >= 81 && house <= 90) return 5; // Studiotown + else if (house >= 90 && house <= 99) return 7; // Magictown + else return 4; // Normal/Old Town (default) + } + public TS1GameScreen(NeighSelectionMode mode) : base() { Bg = new UISimitoneBg(); @@ -194,12 +205,17 @@ public void StartMoveIn(int familyID) } public void NeighSelection(NeighSelectionMode mode) + { + var nbd = (ushort)((mode == NeighSelectionMode.MoveInMagic) ? 7 : 4); + NeighSelection(nbd, mode != NeighSelectionMode.Normal); + } + + public void NeighSelection(ushort neighborhoodMode, bool moveInMode = false) { Content.Get().Neighborhood.PreparePersonDataFromObject = PersonGeneratorHelper.PreparePersonDataFromObject; Content.Get().Neighborhood.AddMissingNeighbors(); - var nbd = (ushort)((mode == NeighSelectionMode.MoveInMagic) ? 7 : 4); - TS1NeighPanel = new UINeighborhoodSelectionPanel(nbd); - var switcher = new UINeighbourhoodSwitcher(TS1NeighPanel, nbd, mode != NeighSelectionMode.Normal); + TS1NeighPanel = new UINeighborhoodSelectionPanel(neighborhoodMode); + var switcher = new UINeighbourhoodSwitcher(TS1NeighPanel, neighborhoodMode, moveInMode); TS1NeighPanel.OnHouseSelect += (house) => { if (MoveInFamily != null) @@ -232,6 +248,7 @@ public void NeighSelection(NeighSelectionMode mode) public void PlayHouse(short house, UIElement switcher) { ActiveFamily = Content.Get().Neighborhood.GetFamilyForHouse((short)house); + CurrentNeighborhoodMode = GetNeighborhoodModeFromHouse(house); InitializeLot(Content.Get().Neighborhood.GetHousePath(house), false);// "UserData/Houses/House21.iff" Remove(TS1NeighPanel); if (switcher != null) Remove(switcher); @@ -880,7 +897,7 @@ public PNG GeneratePNG(Texture2D data) public void ExitLot() { CleanupLastWorld(); - NeighSelection(NeighSelectionMode.Normal); + NeighSelection(CurrentNeighborhoodMode); Downtown = false; SavedLot = null; } @@ -892,4 +909,4 @@ public enum NeighSelectionMode MoveIn, MoveInMagic } -} \ No newline at end of file +}