GameMain.LuaCs is no more
This commit is contained in:
@@ -89,7 +89,7 @@ namespace Barotrauma.Networking
|
||||
if (flaggedAsSpam) { return; }
|
||||
|
||||
bool? should = null;
|
||||
GameMain.LuaCs.EventService.PublishEvent<IEventChatMessage>(x => should = x.OnChatMessage(txt, c, type, ChatMessage.Create(c.Name, txt, type, null, c)) ?? should);
|
||||
LuaCsSetup.Instance.EventService.PublishEvent<IEventChatMessage>(x => should = x.OnChatMessage(txt, c, type, ChatMessage.Create(c.Name, txt, type, null, c)) ?? should);
|
||||
if (should != null && should.Value) { return; }
|
||||
|
||||
if (type == ChatMessageType.Order)
|
||||
|
||||
@@ -440,7 +440,7 @@ namespace Barotrauma.Networking
|
||||
(permadeathMode && (!character.IsDead || character.CauseOfDeath?.Type == CauseOfDeathType.Disconnected)));
|
||||
if (!character.IsDead)
|
||||
{
|
||||
if (!GameMain.LuaCs.Game.disableDisconnectCharacter)
|
||||
if (!LuaCsSetup.Instance.Game.disableDisconnectCharacter)
|
||||
{
|
||||
character.KillDisconnectedTimer += deltaTime;
|
||||
character.SetStun(1.0f);
|
||||
@@ -3178,7 +3178,7 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
|
||||
TraitorManager.Initialize(GameMain.GameSession.EventManager, Level.Loaded);
|
||||
if (GameMain.LuaCs.Game.overrideTraitors)
|
||||
if (LuaCsSetup.Instance.Game.overrideTraitors)
|
||||
{
|
||||
TraitorManager.Enabled = false;
|
||||
}
|
||||
@@ -3512,7 +3512,7 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
|
||||
bool? result = null;
|
||||
GameMain.LuaCs.EventService.PublishEvent<IEventTryClientChangeName>(x => result = x.OnTryClienChangeName(c, newName, newJob, newTeam) ?? result);
|
||||
LuaCsSetup.Instance.EventService.PublishEvent<IEventTryClientChangeName>(x => result = x.OnTryClienChangeName(c, newName, newJob, newTeam) ?? result);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
@@ -3964,7 +3964,7 @@ namespace Barotrauma.Networking
|
||||
senderName = null;
|
||||
senderCharacter = null;
|
||||
}
|
||||
else if (type == ChatMessageType.Radio && !GameMain.LuaCs.Game.overrideSignalRadio)
|
||||
else if (type == ChatMessageType.Radio && !LuaCsSetup.Instance.Game.overrideSignalRadio)
|
||||
{
|
||||
//send to chat-linked wifi components
|
||||
Signal s = new Signal(message, sender: senderCharacter, source: senderRadio.Item);
|
||||
@@ -4771,7 +4771,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (GameMain.Server == null || !GameMain.Server.ServerSettings.SaveServerLogs) { return; }
|
||||
|
||||
GameMain.LuaCs?.EventService.PublishEvent<IEventServerLog>(x => x.OnServerLog(line, messageType));
|
||||
LuaCsSetup.Instance?.EventService.PublishEvent<IEventServerLog>(x => x.OnServerLog(line, messageType));
|
||||
|
||||
GameMain.Server.ServerSettings.ServerLog.WriteLine(line, messageType);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Barotrauma.Networking
|
||||
MultiPlayerCampaign campaign = GameMain.GameSession.GameMode as MultiPlayerCampaign;
|
||||
foreach (Client c in networkMember.ConnectedClients)
|
||||
{
|
||||
if (GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
if (LuaCsSetup.Instance.Game.overrideRespawnSub)
|
||||
continue;
|
||||
|
||||
if (!c.InGame) { continue; }
|
||||
@@ -169,7 +169,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
private bool ShouldStartRespawnCountdown(int characterToRespawnCount)
|
||||
{
|
||||
if (GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
if (LuaCsSetup.Instance.Game.overrideRespawnSub)
|
||||
{
|
||||
characterToRespawnCount = 0;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
var teamId = teamSpecificState.TeamID;
|
||||
var respawnShuttle = GetShuttle(teamId);
|
||||
if (respawnShuttle != null && !GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
if (respawnShuttle != null && !LuaCsSetup.Instance.Game.overrideRespawnSub)
|
||||
{
|
||||
respawnShuttle.Velocity = Vector2.Zero;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ namespace Barotrauma.Networking
|
||||
if (RespawnShuttles.Any())
|
||||
{
|
||||
ResetShuttle(teamSpecificState);
|
||||
if (GameMain.LuaCs.Game.overrideRespawnSub)
|
||||
if (LuaCsSetup.Instance.Game.overrideRespawnSub)
|
||||
{
|
||||
teamSpecificState.CurrentState = State.Waiting;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Barotrauma.Networking
|
||||
(recipientSpectating || ChatMessage.CanUseRadio(recipient.Character, out recipientRadio)))
|
||||
{
|
||||
bool? canUse = null;
|
||||
GameMain.LuaCs.EventService.PublishEvent<IEventCanUseVoiceRadio>(x => canUse = x.OnCanUseVoiceRadio(sender, recipient) ?? canUse);
|
||||
LuaCsSetup.Instance.EventService.PublishEvent<IEventCanUseVoiceRadio>(x => canUse = x.OnCanUseVoiceRadio(sender, recipient) ?? canUse);
|
||||
|
||||
if (canUse != null)
|
||||
{
|
||||
@@ -121,7 +121,7 @@ namespace Barotrauma.Networking
|
||||
}
|
||||
|
||||
float range = 1.0f;
|
||||
GameMain.LuaCs.EventService.PublishEvent<IEventChangeLocalVoiceRange>(x => range = x.OnChangeLocalVoiceRange(sender, recipient) ?? range);
|
||||
LuaCsSetup.Instance.EventService.PublishEvent<IEventChangeLocalVoiceRange>(x => range = x.OnChangeLocalVoiceRange(sender, recipient) ?? range);
|
||||
|
||||
if (recipientSpectating)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user