diff --git a/TSOClient/tso.simantics/VM.cs b/TSOClient/tso.simantics/VM.cs index 66b3a6cd2..297191d80 100644 --- a/TSOClient/tso.simantics/VM.cs +++ b/TSOClient/tso.simantics/VM.cs @@ -264,7 +264,7 @@ public void Update() allSounds.AddRange(ent.SoundThreads.Select(x => x.Sound)); } - if (SpeedMultiplier < 1 && LastFrameSpeed >= 1) allSounds.ForEach((x) => x.Pause()); + if (SpeedMultiplier < 1 && SpeedMultiplier > -2 && LastFrameSpeed >= 1) allSounds.ForEach((x) => x.Pause()); else if (SpeedMultiplier >= 1 && LastFrameSpeed < 1) allSounds.ForEach((x) => x.Resume()); LastFrameSpeed = SpeedMultiplier; } diff --git a/TSOClient/tso.simantics/entities/VMAvatar.cs b/TSOClient/tso.simantics/entities/VMAvatar.cs index da3a57290..e9083dc18 100644 --- a/TSOClient/tso.simantics/entities/VMAvatar.cs +++ b/TSOClient/tso.simantics/entities/VMAvatar.cs @@ -1057,11 +1057,13 @@ public override bool PlaceInSlot(VMEntity obj, int slot, bool cleanOld, VMContex { obj.WorldUI.Container = this.WorldUI; obj.WorldUI.ContainerSlot = slot; - if (obj.WorldUI is ObjectComponent) + HandObject.RecurseSlotFunc(contained => { - var objC = (ObjectComponent)obj.WorldUI; - objC.ForceDynamic = true; - } + if (contained is VMGameObject) + { + ((ObjectComponent)contained.WorldUI).ForceDynamic = true; + } + }); } obj.Position = Position; //TODO: is physical position the same as the slot offset position? if (cleanOld) obj.PositionChange(context, false); @@ -1090,11 +1092,13 @@ public override void ClearSlot(int slot) HandObject.WorldUI.Container = null; HandObject.WorldUI.ContainerSlot = 0; - if (HandObject.WorldUI is ObjectComponent) + HandObject.RecurseSlotFunc(contained => { - var objC = (ObjectComponent)HandObject.WorldUI; - objC.ForceDynamic = false; - } + if (contained is VMGameObject) + { + ((ObjectComponent)contained.WorldUI).ForceDynamic = false; + } + }); } HandObject = null; diff --git a/TSOClient/tso.simantics/entities/VMEntity.cs b/TSOClient/tso.simantics/entities/VMEntity.cs index 1083e9a03..de2e4a3ff 100644 --- a/TSOClient/tso.simantics/entities/VMEntity.cs +++ b/TSOClient/tso.simantics/entities/VMEntity.cs @@ -880,6 +880,21 @@ public void RecurseSlotPositionChange(VMContext context, bool noEntryPoint) PositionChange(context, noEntryPoint); } + public void RecurseSlotFunc(Action func) + { + func(this); + var count = TotalSlots(); + + for (int i = 0; i < count; i++) + { + var item = GetSlot(i); + if (item != null) + { + item.RecurseSlotFunc(func); + } + } + } + public bool WillLoopSlot(VMEntity test) { if (test == this) return true; diff --git a/TSOClient/tso.simantics/primitives/VMDialogPrivateStrings.cs b/TSOClient/tso.simantics/primitives/VMDialogPrivateStrings.cs index 2d24d32f7..fb2c17edd 100644 --- a/TSOClient/tso.simantics/primitives/VMDialogPrivateStrings.cs +++ b/TSOClient/tso.simantics/primitives/VMDialogPrivateStrings.cs @@ -57,7 +57,7 @@ public static VMPrimitiveExitCode ExecuteGeneric(VMStackFrame context, VMPrimiti { context.VM.GlobalBlockingDialog = context.Caller; context.VM.LastSpeedMultiplier = context.VM.SpeedMultiplier; - context.VM.SpeedMultiplier = -1; + context.VM.SpeedMultiplier = -2; } return VMPrimitiveExitCode.CONTINUE_NEXT_TICK; } diff --git a/TSOClient/tso.vitaboy.model/Animation.cs b/TSOClient/tso.vitaboy.model/Animation.cs index 5f149a1ca..1b5cf3979 100644 --- a/TSOClient/tso.vitaboy.model/Animation.cs +++ b/TSOClient/tso.vitaboy.model/Animation.cs @@ -40,6 +40,8 @@ public class Animation /// public int NumFrames { get; set; } + public BCF ParentBCF; + /// /// Reads an animation from a stream. /// diff --git a/TSOClient/tso.vitaboy.model/Appearance.cs b/TSOClient/tso.vitaboy.model/Appearance.cs index 0df4bd67a..34f3b2034 100644 --- a/TSOClient/tso.vitaboy.model/Appearance.cs +++ b/TSOClient/tso.vitaboy.model/Appearance.cs @@ -30,6 +30,8 @@ public class Appearance public int Type; public int Zero; + public BCF ParentBCF; + /// /// Gets the ContentID instance for this appearance. /// diff --git a/TSOClient/tso.vitaboy.model/Skeleton.cs b/TSOClient/tso.vitaboy.model/Skeleton.cs index 90cf8859f..08cc39a05 100644 --- a/TSOClient/tso.vitaboy.model/Skeleton.cs +++ b/TSOClient/tso.vitaboy.model/Skeleton.cs @@ -27,6 +27,8 @@ public class Skeleton public Bone[] Bones; public Bone RootBone; + public BCF ParentBCF; + /// /// Gets a bone from this Skeleton instance. /// diff --git a/TSOClient/tso.world/components/ObjectComponent.cs b/TSOClient/tso.world/components/ObjectComponent.cs index aa550b438..d5ae3900b 100644 --- a/TSOClient/tso.world/components/ObjectComponent.cs +++ b/TSOClient/tso.world/components/ObjectComponent.cs @@ -210,7 +210,8 @@ public bool ForceDynamic { get { - return _ForceDynamic || Headline != null || Mode.HasFlag(ComponentRenderMode._3D); + var bottomMost = GetBottomContainer(); + return _ForceDynamic || Headline != null || Mode.HasFlag(ComponentRenderMode._3D) || bottomMost is AvatarComponent; } set { @@ -221,7 +222,6 @@ public bool ForceDynamic } _ForceDynamic = value; } - } private ulong _DynamicSpriteFlags = 0x00000000;