-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Client, SimAntics] Fix some client and TS1 things
- Also revive the weather particle system from the dead. - MP3 players no longer leak threads.
- Loading branch information
1 parent
cbeeff0
commit fa24e20
Showing
36 changed files
with
173 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
TSOClient/FSO.IDE/EditorComponent/Primitives/ShowStringDescriptor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using FSO.Files.Formats.IFF.Chunks; | ||
using FSO.IDE.EditorComponent.Model; | ||
using FSO.IDE.EditorComponent.OperandForms; | ||
using FSO.IDE.EditorComponent.OperandForms.DataProviders; | ||
using FSO.SimAntics.Primitives; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace FSO.IDE.EditorComponent.Primitives | ||
{ | ||
public class ShowStringDescriptor : PrimitiveDescriptor | ||
{ | ||
public override PrimitiveGroup Group { get { return PrimitiveGroup.Debug; } } | ||
|
||
public override Type OperandType { get { return typeof(VMShowStringOperand); } } | ||
|
||
public override PrimitiveReturnTypes Returns { get { return PrimitiveReturnTypes.TrueFalse; } } | ||
|
||
public override string GetBody(EditorScope scope) | ||
{ | ||
var op = (VMShowStringOperand)Operand; | ||
var result = new StringBuilder(); | ||
|
||
var str = scope.GetResource<STR>(op.StringTable, ScopeSource.Private); | ||
|
||
if (str == null) result.Append("String #" + op.StringID + " STR#" + op.StringTable); | ||
else result.Append(str.GetString(op.StringID - 1)); | ||
|
||
return result.ToString(); | ||
} | ||
|
||
public override void PopulateOperandView(BHAVEditor master, EditorScope escope, TableLayoutPanel panel) | ||
{ | ||
panel.Controls.Add(new OpLabelControl(master, escope, Operand, new OpStaticTextProvider("Allows the stack object to print a string. " + | ||
"In FreeSO, this message prints to chat, and can be used to make NPCs talk."))); | ||
panel.Controls.Add(new OpValueControl(master, escope, Operand, "STR Table:", "StringTable", new OpStaticValueBoundsProvider(0, 65535))); | ||
panel.Controls.Add(new OpValueControl(master, escope, Operand, "String ID:", "StringID", new OpStaticValueBoundsProvider(0, 65535))); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+36 Bytes
(100%)
TSOClient/tso.content/Content/DX/Effects/ParticleShader.xnb
Binary file not shown.
Binary file modified
BIN
-160 Bytes
(100%)
TSOClient/tso.content/Content/DX/Fonts/Fallbacks/thai.xnb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+72 Bytes
(100%)
TSOClient/tso.content/Content/OGL/Effects/ParticleShader.xnb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+981 Bytes
(100%)
TSOClient/tso.content/Content/Objects/Christmas_Station.iff
Binary file not shown.
Binary file modified
BIN
+1.48 KB
(100%)
TSOClient/tso.content/Content/Objects/food_s1_xmaspudding.iff
Binary file not shown.
Binary file modified
BIN
+444 Bytes
(120%)
TSOClient/tso.content/Content/Patch/Event/christmastree.piff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+535 Bytes
(120%)
TSOClient/tso.content/Content/Patch/buffettablevacation.piff
Binary file not shown.
Binary file modified
BIN
+5 Bytes
(100%)
TSOClient/tso.content/Content/Patch/buffettablevacation.str.piff
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using FSO.Files.Formats.IFF.Chunks; | ||
using FSO.Files.Utils; | ||
using FSO.SimAntics.Engine; | ||
using FSO.SimAntics.NetPlay.Model; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace FSO.SimAntics.Primitives | ||
{ | ||
public class VMShowString : VMPrimitiveHandler | ||
{ | ||
public override VMPrimitiveExitCode Execute(VMStackFrame context, VMPrimitiveOperand args) | ||
{ | ||
if (context.StackObject is VMGameObject) return VMPrimitiveExitCode.GOTO_TRUE; | ||
var operand = (VMShowStringOperand)args; | ||
|
||
var table = context.ScopeResource.Get<STR>(operand.StringTable); | ||
var avatar = context.StackObject as VMAvatar; | ||
|
||
if (table != null) | ||
{ | ||
var message = VMDialogHandler.ParseDialogString(context, table.GetString(operand.StringID - 1), table); | ||
var vm = context.VM; | ||
|
||
var channelID = 0; | ||
|
||
vm.SignalChatEvent(new VMChatEvent(avatar, VMChatEventType.Message, (byte)(channelID & 0x7f), avatar.Name, message)); | ||
if ((channelID & 0x80) == 0) avatar.Message = message; | ||
} | ||
|
||
return VMPrimitiveExitCode.GOTO_TRUE; | ||
} | ||
} | ||
|
||
public class VMShowStringOperand : VMPrimitiveOperand | ||
{ | ||
public ushort StringTable { get; set; } = 300; | ||
public ushort StringID { get; set; } | ||
|
||
#region VMPrimitiveOperand Members | ||
public void Read(byte[] bytes) | ||
{ | ||
using (var io = IoBuffer.FromBytes(bytes, ByteOrder.LITTLE_ENDIAN)) | ||
{ | ||
StringTable = io.ReadUInt16(); | ||
StringID = io.ReadUInt16(); | ||
} | ||
} | ||
|
||
public void Write(byte[] bytes) | ||
{ | ||
using (var io = new BinaryWriter(new MemoryStream(bytes))) | ||
{ | ||
io.Write(StringTable); | ||
io.Write(StringID); | ||
} | ||
} | ||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters