fixed reloadlua breaking __call metamethods, fixed singleplayer crash, added fun things to client-side lua :)
This commit is contained in:
@@ -998,6 +998,8 @@ namespace Barotrauma
|
||||
|
||||
SoundManager?.Update();
|
||||
|
||||
GameMain.Lua.hook.Call("think", new object[] { });
|
||||
|
||||
Timing.Accumulator -= Timing.Step;
|
||||
|
||||
sw.Stop();
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Barotrauma.Networking;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
partial class LuaSetup
|
||||
{
|
||||
public class LuaGUI
|
||||
{
|
||||
LuaSetup env;
|
||||
public LuaGUI(LuaSetup _env)
|
||||
{
|
||||
env = _env;
|
||||
}
|
||||
|
||||
public ChatBox ChatBox
|
||||
{
|
||||
get
|
||||
{
|
||||
return GameMain.Client.ChatBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2805,6 +2805,10 @@ namespace Barotrauma.Networking
|
||||
|
||||
public override void AddChatMessage(ChatMessage message)
|
||||
{
|
||||
var should = new LuaResult(GameMain.Lua.hook.Call("chatMessage", new object[] { message.Text, message.SenderClient, message.Type, message }));
|
||||
|
||||
if (should.Bool()) return;
|
||||
|
||||
base.AddChatMessage(message);
|
||||
|
||||
if (string.IsNullOrEmpty(message.Text)) { return; }
|
||||
|
||||
Reference in New Issue
Block a user