LuaCs is now initialized after sub editor screen is first selected, added Game.IsSubEditor, Game.SubEditorScreen and registered editor screens

This commit is contained in:
EvilFactory
2022-07-27 20:01:20 -03:00
parent 1b020ff99e
commit 069567c681
3 changed files with 32 additions and 13 deletions

View File

@@ -1031,8 +1031,6 @@ namespace Barotrauma
return true;
}
GameMain.LuaCs.Initialize();
CloseItem();
backedUpSubInfo = new SubmarineInfo(MainSub);
@@ -1324,12 +1322,12 @@ namespace Barotrauma
public override void Select()
{
Select(enableAutoSave: true);
GameMain.LuaCs.Initialize();
}
public void Select(bool enableAutoSave = true)
{
GameMain.LuaCs.Stop();
base.Select();
TaskPool.Add(

View File

@@ -9,6 +9,13 @@ for key, value in pairs(localizedStrings) do
RegisterBarotrauma(value)
end
RegisterBarotrauma("EditorScreen")
RegisterBarotrauma("SubEditorScreen")
RegisterBarotrauma("EventEditorScreen")
RegisterBarotrauma("CharacterEditorScreen")
RegisterBarotrauma("SpriteEditorScreen")
RegisterBarotrauma("LevelEditorScreen")
RegisterBarotrauma("Networking.ClientPeer")
RegisterBarotrauma("Networking.GameClient")
RegisterBarotrauma("Networking.VoipCapture")

View File

@@ -16,10 +16,11 @@ namespace Barotrauma
public bool IsMultiplayer => GameMain.IsMultiplayer;
#if CLIENT
public bool? ForceVoice = null;
public bool? ForceLocalVoice = null;
public bool Paused => GameMain.Instance?.Paused == true;
public byte MyID => GameMain.Client.ID;
public ChatMode ActiveChatMode => GameMain.ActiveChatMode;
public ChatBox ChatBox
@@ -49,8 +50,21 @@ namespace Barotrauma
}
}
public bool? ForceVoice = null;
public bool? ForceLocalVoice = null;
public SubEditorScreen SubEditorScreen
{
get
{
return GameMain.SubEditorScreen;
}
}
public bool IsSubEditor
{
get
{
return Screen.Selected is SubEditorScreen;
}
}
#else
public bool IsDedicated
@@ -179,13 +193,13 @@ namespace Barotrauma
}
#if SERVER
public ServerPeer Peer
public ServerPeer Peer
{
get
{
get
{
return GameMain.Server.ServerPeer;
}
return GameMain.Server.ServerPeer;
}
}
#else
public ClientPeer Peer
{