Skip to content

Commit

Permalink
[Simitone] Update FreeSO, Ingame UI
Browse files Browse the repository at this point in the history
See FreeSO changes for more details.
- Greatly improve catalog handling (should match TS1 now)
- Family members can no longer be switched to if they join the lot
you're visiting.
- See FreeSO changes for more details.
- Greatly improve catalog handling (should match TS1 now)
- Family members can no longer be switched to if they join the lot
you're visiting.
- Community lots edited in Simless Build/Buy (simitone fsov) are now
playable when you join them.
- Some UI tweaks.
  • Loading branch information
riperiperi committed Nov 24, 2019
1 parent 85b3db5 commit 8991fe5
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Client/Simitone/Simitone.Client/SimitoneGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ protected override void UnloadContent()
protected override void OnExiting(object sender, EventArgs args)
{
base.OnExiting(sender, args);
GameThread.Killed = true;
GameThread.OnKilled.Set();
GameThread.SetKilled();
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void Select(int cat)
{
MainButton.Texture = Content.Get().CustomUI.Get(catG.IconName).Get(GameFacade.GraphicsDevice);
}
else
if (catG.ID != cat || UIScreen.Current.ScreenHeight >= 720)
{
var btn = new UIStencilButton(Content.Get().CustomUI.Get(catG.IconName).Get(GameFacade.GraphicsDevice));
btn.Shadow = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private void ObjectHolder_OnPutDown(UIObjectSelection holding, UpdateState state

private void ObjectHolder_OnPickup(UIObjectSelection holding, UpdateState state)
{
Game.LotControl.PickupPanel.SetInfo(Game.LotControl.vm, holding.Group.BaseObject);
Game.LotControl.PickupPanel.SetInfo(Game.LotControl.vm, holding.RealEnt ?? holding.Group.BaseObject);
Game.Frontend.MainPanel.SetSubpanelPickup(0f);
}

Expand Down Expand Up @@ -817,6 +817,7 @@ public byte GetSubsort(ObjectCatalogItem item)
case UICatalogMode.Magictown:
return item.MagictownSort;
default:
if (item.RoomSort == 0) return 0; //items without a room sort should not appear.
return item.Subsort;
}
}
Expand Down Expand Up @@ -871,6 +872,10 @@ public void InitSubcategory(UICatalogSubcat cat)
else
{
var mask = 1 << index;
if (Mode == UICatalogMode.Normal && index == 7)
{
mask |= 16;
}
FilterCategory = FullCategory.Where(x => (GetSubsort(x.Item) & mask) > 0);
}
CatContainer.Reset();
Expand All @@ -893,6 +898,11 @@ public class UICatalogElement
public ObjectCatalogItem Item;
public int CalcPrice;
public UISpecialCatalogElement Special;

public override string ToString()
{
return Item.Name ?? "(unknown)";
}
}

public class UISpecialCatalogElement
Expand Down
2 changes: 1 addition & 1 deletion Client/Simitone/Simitone.Client/UI/Panels/UIMainPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ public override void Update(UpdateState state)
if (Mode != UIMainPanelMode.LIVE)
{
Game.vm.SpeedMultiplier = -1;
} else if (Game.vm.SpeedMultiplier < 0)
} else if (Game.vm.SpeedMultiplier == -1)
{
Game.vm.SpeedMultiplier = 0;
}
Expand Down
4 changes: 4 additions & 0 deletions Client/Simitone/Simitone.Client/UI/Panels/UIQueryPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ public void SetInfo(VM vm, VMEntity entity, bool bought)

var strings = motivesString.ToString().Replace("\r", "").Split('\n').TakeWhile(x => x != "");
TitleAd.Caption = string.Join("\n", strings.Take(2));
TitleAd.CaptionStyle.LineHeightModifier = -3;
TitleAd.Y = 22;
TitleAd.Alignment = TextAlignment.Middle | TextAlignment.Right;
TitleAd.Wrapped = true;
Ad.Caption = string.Join(", ", strings);

SetTitleSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ public override void Update(UpdateState state)
if (state.NewKeys.Contains(Keys.Space))
{
var selected = Game.LotControl.ActiveEntity;
var familyMembers = Game.vm.Context.ObjectQueries.Avatars.Where(x =>
((VMAvatar)x).GetPersonData(
FSO.SimAntics.Model.VMPersonDataVariable.TS1FamilyNumber) == (Game.vm.TS1State.CurrentFamily?.ChunkID)
var familyMembers = Game.vm.Context.ObjectQueries.Avatars.Where(x =>
Game.vm.TS1State.CurrentFamily.RuntimeSubset.Contains(x.Object.OBJ.GUID)
).ToList();
var index = familyMembers.IndexOf(selected);
if (familyMembers.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public UISwitchAvatarPanel(TS1GameScreen screen)
{
Game = screen;
Bg = Content.Get().CustomUI.Get("pswitch_bg.png").Get(GameFacade.GraphicsDevice);

var familyMembers = Game.vm.Context.ObjectQueries.Avatars.Where(x => ((VMAvatar)x).GetPersonData(FSO.SimAntics.Model.VMPersonDataVariable.TS1FamilyNumber) == (Game.vm.TS1State.CurrentFamily?.ChunkID));
var familyMembers = Game.vm.Context.ObjectQueries.Avatars.Where(x => Game.vm.TS1State.CurrentFamily.RuntimeSubset.Contains(x.Object.OBJ.GUID));
int i = 0;
foreach (var fam in familyMembers)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public LoadingScreen()
InterpolatedAnimation = InterpolatedAnimation;

(new Thread(() => {
FSO.Content.Content.Init(GlobalSettings.Default.StartupPath, GameFacade.GraphicsDevice);
VMContext.InitVMConfig(true);
FSO.Content.Content.Init(GlobalSettings.Default.StartupPath, GameFacade.GraphicsDevice);
lock (this)
{
LoadingComplete = true;
Expand Down
3 changes: 3 additions & 0 deletions Client/Simitone/Simitone.Client/UI/Screens/TS1GameScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,9 @@ public void BlueprintReset(string path, VM vm)
{
vm.SetGlobalValue(32, 1);
vm.SpeedMultiplier = -1;
} else
{
vm.SetGlobalValue(32, 0);
}
}

Expand Down

0 comments on commit 8991fe5

Please sign in to comment.