Skip to content

Commit

Permalink
Add chat disable flag, invisible outfit type
Browse files Browse the repository at this point in the history
  • Loading branch information
riperiperi committed Mar 31, 2021
1 parent 892527d commit 7978d85
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
28 changes: 18 additions & 10 deletions TSOClient/tso.client/UI/Panels/UIChatPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using FSO.Common;
using FSO.SimAntics.Model.TSOPlatform;
using FSO.Common.Rendering.Framework.IO;
using FSO.SimAntics.Model;

namespace FSO.Client.UI.Panels
{
Expand Down Expand Up @@ -161,23 +162,30 @@ private void SendMessage(string message)
message = message.Replace("\n", "");
if (message != "" && Owner.ActiveEntity != null)
{
if (message[0] == '!')
if ((Owner.ActiveEntity.GetValue(VMStackObjectVariable.FlagField2) & (short)VMEntityFlags2.FSODisableChat) != 0)
{
Owner.Cheats.SubmitCommand(message);
HistoryDialog.ReceiveEvent(new VMChatEvent(null, VMChatEventType.Generic, "You can't speak right now."));
}
else
{
if (message == "/trace")
if (message[0] == '!')
{
vm.UseSchedule = false;
vm.Trace = new SimAntics.Engine.Debug.VMSyncTrace();
Owner.Cheats.SubmitCommand(message);
}
vm.SendCommand(new VMNetChatCmd
else
{
ActorUID = Owner.ActiveEntity.PersistID,
Message = message,
ChannelID = (byte)ActiveChannel
});
if (message == "/trace")
{
vm.UseSchedule = false;
vm.Trace = new SimAntics.Engine.Debug.VMSyncTrace();
}
vm.SendCommand(new VMNetChatCmd
{
ActorUID = Owner.ActiveEntity.PersistID,
Message = message,
ChannelID = (byte)ActiveChannel
});
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions TSOClient/tso.simantics/Engine/Scopes/VMSuitScope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public enum VMPersonSuits
DynamicCostume = 25,
signnotepad = 26,

FSOInvisible = 128,

Head = 65535 //internal
}

Expand Down
2 changes: 2 additions & 0 deletions TSOClient/tso.simantics/Engine/VMSuitProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ public static object GetSuit(VMStackFrame context, VMSuitScope scope, ushort id)
return (ulong)(0x5740000000D);
case VMPersonSuits.TeleporterMishap:
return (ulong)(male ? 0x2900000000D : 0x4A0000000D);
case VMPersonSuits.FSOInvisible:
return (ulong)0x00000000000;


case VMPersonSuits.DynamicDaywear:
Expand Down
2 changes: 1 addition & 1 deletion TSOClient/tso.simantics/Entities/VMEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ public enum VMEntityFlags2
GeneratesLight = 1 << 10,
CanGetDirty = 1 << 11,
ContributesToAsthetic = 1 << 12,
unused14 = 1 << 13,
FSODisableChat = 1 << 13,
ArchitectualWindow = 1 << 14,
ArchitectualDoor = 1 << 15
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ private OutfitType GetOutfitType(VMChangeSuitOrAccessoryOperand operand)
case VMPersonSuits.SkeletonMinus:
case VMPersonSuits.SkeletonPlus:
case VMPersonSuits.TeleporterMishap:
case VMPersonSuits.FSOInvisible:
return OutfitType.BODY;

default:
Expand Down

0 comments on commit 7978d85

Please sign in to comment.