From 16bebd57be2a4a6c42494667cdcf0e51119679f2 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Thu, 25 Apr 2019 17:44:05 +0300 Subject: [PATCH] (9d4f6093f) Standardize the console commands for switching to editors. Revisit the descriptions and add Level Editor, Sprite Editor, and Particle Editor in the debug console help. Reduce the variants for all the commands. --- .../BarotraumaClient/Source/DebugConsole.cs | 18 +++++++++++------- Barotrauma/BarotraumaServer/Source/Map/Hull.cs | 3 +-- Barotrauma/BarotraumaShared/Source/Map/Hull.cs | 10 ++++++++++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs index 1ee8fba4d..a3b0fdc51 100644 --- a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs @@ -346,7 +346,7 @@ namespace Barotrauma } })); - commands.Add(new Command("mainmenuscreen|mainmenu|menu", "mainmenu/menu: Go to the main menu.", (string[] args) => + commands.Add(new Command("mainmenu|menu", "mainmenu/menu: Go to the main menu.", (string[] args) => { GameMain.GameSession = null; @@ -359,7 +359,7 @@ namespace Barotrauma GameMain.MainMenuScreen.Select(); })); - commands.Add(new Command("gamescreen|game", "gamescreen/game: Go to the \"in-game\" view.", (string[] args) => + commands.Add(new Command("game", "gamescreen/game: Go to the \"in-game\" view.", (string[] args) => { if (Screen.Selected == GameMain.SubEditorScreen) { @@ -368,7 +368,7 @@ namespace Barotrauma GameMain.GameScreen.Select(); })); - commands.Add(new Command("editsubscreen|editsub|subeditor", "editsub/subeditor: Switch to the submarine editor.", (string[] args) => + commands.Add(new Command("editsubs|subeditor", "editsubs/subeditor: Switch to the Submarine Editor to create or edit submarines.", (string[] args) => { if (args.Length > 0) { @@ -377,23 +377,27 @@ namespace Barotrauma GameMain.SubEditorScreen.Select(); })); - commands.Add(new Command("editparticles|particleeditor", "", (string[] args) => + commands.Add(new Command("editparticles|particleeditor", "editparticles/particleeditor: Switch to the Particle Editor to edit particle effects.", (string[] args) => { GameMain.ParticleEditorScreen.Select(); })); - commands.Add(new Command("editlevels|editlevel|leveleditor", "", (string[] args) => + commands.Add(new Command("editlevels|leveleditor", "editlevels/leveleditor: Switch to the Level Editor to edit levels.", (string[] args) => { GameMain.LevelEditorScreen.Select(); })); - commands.Add(new Command("editsprites|editsprite|spriteeditor|spriteedit", "", (string[] args) => + commands.Add(new Command("editsprites|spriteeditor", "editsprites/spriteeditor: Switch to the Sprite Editor to edit the source rects and origins of sprites.", (string[] args) => { GameMain.SpriteEditorScreen.Select(); })); - commands.Add(new Command("charactereditor|editcharacter|editcharacters|editanimation|editanimations|animedit|animationeditor|animeditor|animationedit", "charactereditor: Edit characters, animations, ragdolls....", (string[] args) => + commands.Add(new Command("editcharacters|charactereditor", "editcharacters/charactereditor: Switch to the Character Editor to edit/create the ragdolls and animations of characters.", (string[] args) => { + if (Screen.Selected == GameMain.GameScreen) + { + NewMessage("WARNING: Switching between the character editor and the game view may cause odd behaviour or bugs. Use with caution.", Color.Orange); + } GameMain.CharacterEditorScreen.Select(); })); diff --git a/Barotrauma/BarotraumaServer/Source/Map/Hull.cs b/Barotrauma/BarotraumaServer/Source/Map/Hull.cs index 3fc9ec6d3..3b10a7a24 100644 --- a/Barotrauma/BarotraumaServer/Source/Map/Hull.cs +++ b/Barotrauma/BarotraumaServer/Source/Map/Hull.cs @@ -33,8 +33,7 @@ namespace Barotrauma //update client hulls if the amount of water has changed by >10% //or if oxygen percentage has changed by 5% if (Math.Abs(lastSentVolume - waterVolume) > Volume * 0.1f || - Math.Abs(lastSentOxygen - OxygenPercentage) > 5f || - FireSources.Count > 0) + Math.Abs(lastSentOxygen - OxygenPercentage) > 5f) { sendUpdateTimer -= deltaTime; if (sendUpdateTimer < 0.0f) diff --git a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs index 23fc81dce..4c3b594d6 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Hull.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Hull.cs @@ -417,6 +417,11 @@ namespace Barotrauma public void AddFireSource(FireSource fireSource) { FireSources.Add(fireSource); + + if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer && !IdFreed) + { + GameMain.NetworkMember.CreateEntityEvent(this); + } } public override void Update(float deltaTime, Camera cam) @@ -584,6 +589,11 @@ namespace Barotrauma public void RemoveFire(FireSource fire) { FireSources.Remove(fire); + + if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsServer && !Removed && !IdFreed) + { + GameMain.NetworkMember.CreateEntityEvent(this); + } } public IEnumerable GetConnectedHulls(int? searchDepth)