From dcb6de32c0e7a6bd8305dbbe770e611e01388849 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 31 Jan 2018 19:01:48 +0200 Subject: [PATCH] Some more hard-coded text removal --- .../Source/Characters/AI/CrewCommander.cs | 2 +- .../Source/Characters/Character.cs | 8 +-- .../Source/Characters/Jobs/JobPrefab.cs | 4 +- .../Source/Events/Missions/Mission.cs | 2 +- .../Source/Events/Missions/MissionMode.cs | 2 +- .../Source/GUI/LoadingScreen.cs | 18 +++--- .../GameModes/SinglePlayerCampaign.cs | 41 ++++--------- .../Source/Items/CharacterInventory.cs | 2 +- .../Items/Components/Machines/Engine.cs | 9 +-- .../Items/Components/Machines/Fabricator.cs | 12 ++-- .../Items/Components/Machines/MiniMap.cs | 6 +- .../Source/Items/Components/Machines/Pump.cs | 8 +-- .../Items/Components/Machines/Reactor.cs | 21 +++---- .../Items/Components/Machines/Steering.cs | 10 ++-- .../Items/Components/Power/PowerContainer.cs | 4 +- .../Items/Components/Power/PowerTransfer.cs | 9 ++- .../Items/Components/Signal/Connection.cs | 2 +- Barotrauma/BarotraumaShared/Content/Jobs.xml | 9 ++- Barotrauma/BarotraumaShared/Content/Texts.xml | 59 +++++++++++++++++-- .../Source/Characters/Jobs/JobPrefab.cs | 5 ++ .../BarotraumaShared/Source/ContentPackage.cs | 8 +-- 21 files changed, 136 insertions(+), 105 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Characters/AI/CrewCommander.cs b/Barotrauma/BarotraumaClient/Source/Characters/AI/CrewCommander.cs index 99746d6d4..8dfc1d414 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/AI/CrewCommander.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/AI/CrewCommander.cs @@ -55,7 +55,7 @@ namespace Barotrauma frame = new GUIFrame(Rectangle.Empty, Color.Black * 0.6f, null); frame.Padding = new Vector4(200.0f, 100.0f, 200.0f, 100.0f); - GUIButton closeButton = new GUIButton(new Rectangle(0, 50, 100, 20), "Close", Alignment.BottomCenter, "", frame); + GUIButton closeButton = new GUIButton(new Rectangle(0, 50, 100, 20), TextManager.Get("Close"), Alignment.BottomCenter, "", frame); closeButton.OnClicked = (GUIButton button, object userData) => { ToggleGUIFrame(); diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Character.cs b/Barotrauma/BarotraumaClient/Source/Characters/Character.cs index 485390d78..25ce20628 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/Character.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/Character.cs @@ -182,10 +182,10 @@ namespace Barotrauma partial void KillProjSpecific() { - if (GameMain.NetworkMember != null && Character.controlled == this) + if (GameMain.NetworkMember != null && controlled == this) { string chatMessage = TextManager.Get("Self_CauseOfDeathDescription." + causeOfDeath.ToString()); - if (GameMain.Client != null) chatMessage += " Your chat messages will only be visible to other dead players."; + if (GameMain.Client != null) chatMessage += " " + TextManager.Get("DeathChatNotification"); GameMain.NetworkMember.AddChatMessage(chatMessage, ChatMessageType.Dead); GameMain.LightManager.LosEnabled = false; @@ -290,11 +290,11 @@ namespace Barotrauma } if (this == controlled) return; - + if (nameVisible && info != null) { string name = Info.DisplayName; - if (controlled == null && name != Info.Name) name += " (Disguised)"; + if (controlled == null && name != Info.Name) name += " " + TextManager.Get("Disguised"); Vector2 namePos = new Vector2(pos.X, pos.Y - 110.0f - (5.0f / cam.Zoom)) - GUI.Font.MeasureString(Info.Name) * 0.5f / cam.Zoom; Vector2 screenSize = new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight); diff --git a/Barotrauma/BarotraumaClient/Source/Characters/Jobs/JobPrefab.cs b/Barotrauma/BarotraumaClient/Source/Characters/Jobs/JobPrefab.cs index c3f3c4ff9..631bc2bd0 100644 --- a/Barotrauma/BarotraumaClient/Source/Characters/Jobs/JobPrefab.cs +++ b/Barotrauma/BarotraumaClient/Source/Characters/Jobs/JobPrefab.cs @@ -18,7 +18,7 @@ namespace Barotrauma var descriptionBlock = new GUITextBlock(new Rectangle(0, 40, 0, 0), Description, "", Alignment.TopLeft, Alignment.TopLeft, frame, true, GUI.SmallFont); - new GUITextBlock(new Rectangle(0, 40 + descriptionBlock.Rect.Height + 20, 100, 20), "Skills: ", "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont); + new GUITextBlock(new Rectangle(0, 40 + descriptionBlock.Rect.Height + 20, 100, 20), TextManager.Get("Skills") + ": ", "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont); int y = 40 + descriptionBlock.Rect.Height + 50; foreach (SkillPrefab skill in Skills) @@ -36,7 +36,7 @@ namespace Barotrauma y += 20; } - new GUITextBlock(new Rectangle(250, 40 + descriptionBlock.Rect.Height + 20, 0, 20), "Items: ", "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont); + new GUITextBlock(new Rectangle(250, 40 + descriptionBlock.Rect.Height + 20, 0, 20), TextManager.Get("Items") + ": ", "", Alignment.TopLeft, Alignment.TopLeft, frame, false, GUI.LargeFont); y = 40 + descriptionBlock.Rect.Height + 50; foreach (string itemName in ItemNames) diff --git a/Barotrauma/BarotraumaClient/Source/Events/Missions/Mission.cs b/Barotrauma/BarotraumaClient/Source/Events/Missions/Mission.cs index dc9b959b6..9375f6ca7 100644 --- a/Barotrauma/BarotraumaClient/Source/Events/Missions/Mission.cs +++ b/Barotrauma/BarotraumaClient/Source/Events/Missions/Mission.cs @@ -11,7 +11,7 @@ namespace Barotrauma string header = index < headers.Count ? headers[index] : ""; string message = index < messages.Count ? messages[index] : ""; - GameServer.Log("Mission info: " + header + " - " + message, ServerLog.MessageType.ServerMessage); + GameServer.Log(TextManager.Get("MissionInfo") + ": " + header + " - " + message, ServerLog.MessageType.ServerMessage); new GUIMessageBox(header, message); } diff --git a/Barotrauma/BarotraumaClient/Source/Events/Missions/MissionMode.cs b/Barotrauma/BarotraumaClient/Source/Events/Missions/MissionMode.cs index d3c9c6af6..263c82826 100644 --- a/Barotrauma/BarotraumaClient/Source/Events/Missions/MissionMode.cs +++ b/Barotrauma/BarotraumaClient/Source/Events/Missions/MissionMode.cs @@ -9,7 +9,7 @@ var missionMsg = new GUIMessageBox(mission.Name, mission.Description, 400, 400); missionMsg.UserData = "missionstartmessage"; - Networking.GameServer.Log("Mission: " + mission.Name, Networking.ServerLog.MessageType.ServerMessage); + Networking.GameServer.Log(TextManager.Get("Mission") + ": " + mission.Name, Networking.ServerLog.MessageType.ServerMessage); Networking.GameServer.Log(mission.Description, Networking.ServerLog.MessageType.ServerMessage); } } diff --git a/Barotrauma/BarotraumaClient/Source/GUI/LoadingScreen.cs b/Barotrauma/BarotraumaClient/Source/GUI/LoadingScreen.cs index 45acc973d..16696b0b3 100644 --- a/Barotrauma/BarotraumaClient/Source/GUI/LoadingScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/GUI/LoadingScreen.cs @@ -155,24 +155,24 @@ namespace Barotrauma string loadText = ""; if (loadState == 100.0f) { - loadText = "Press any key to continue"; + loadText = TextManager.Get("PressAnyKey"); } else { - loadText = "Loading... "; - if (loadState!=null) + loadText = TextManager.Get("Loading"); + if (loadState != null) { - loadText += (int)loadState + " %"; + loadText += " " + (int)loadState + " %"; } } - if (GUI.LargeFont!=null) + if (GUI.LargeFont != null) { - GUI.LargeFont.DrawString(spriteBatch, loadText, - new Vector2(GameMain.GraphicsWidth/2.0f - GUI.LargeFont.MeasureString(loadText).X/2.0f, GameMain.GraphicsHeight*0.8f), - Color.White); + GUI.LargeFont.DrawString(spriteBatch, loadText, + new Vector2(GameMain.GraphicsWidth / 2.0f - GUI.LargeFont.MeasureString(loadText).X / 2.0f, GameMain.GraphicsHeight * 0.8f), + Color.White); } - + } spriteBatch.End(); diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/SinglePlayerCampaign.cs b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/SinglePlayerCampaign.cs index f22fbae1a..41c0fd664 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/SinglePlayerCampaign.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/GameModes/SinglePlayerCampaign.cs @@ -28,30 +28,19 @@ namespace Barotrauma public SinglePlayerCampaign(GameModePreset preset, object param) : base(preset, param) { - endRoundButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), "End round", null, Alignment.TopLeft, Alignment.Center, ""); + endRoundButton = new GUIButton(new Rectangle(GameMain.GraphicsWidth - 220, 20, 200, 25), TextManager.Get("EndRound"), null, Alignment.TopLeft, Alignment.Center, ""); endRoundButton.Font = GUI.SmallFont; endRoundButton.OnClicked = TryEndRound; - for (int i = 0; i < 3; i++) + foreach (JobPrefab jobPrefab in JobPrefab.List) { - JobPrefab jobPrefab = null; - switch (i) + for (int i = 0; i < jobPrefab.InitialCount; i++) { - case 0: - jobPrefab = JobPrefab.List.Find(jp => jp.Name == "Captain"); - break; - case 1: - jobPrefab = JobPrefab.List.Find(jp => jp.Name == "Engineer"); - break; - case 2: - jobPrefab = JobPrefab.List.Find(jp => jp.Name == "Mechanic"); - break; + CrewManager.AddCharacterInfo(new CharacterInfo(Character.HumanConfigFile, "", Gender.None, jobPrefab)); } - - CrewManager.AddCharacterInfo(new CharacterInfo(Character.HumanConfigFile, "", Gender.None, jobPrefab)); } } - + public override void Start() { CargoManager.CreateItems(); @@ -116,13 +105,13 @@ namespace Barotrauma } else if (leavingSub.AtEndPosition) { - endRoundButton.Text = ToolBox.LimitString("Enter " + Map.SelectedLocation.Name, endRoundButton.Font, endRoundButton.Rect.Width - 5); + endRoundButton.Text = ToolBox.LimitString(TextManager.Get("EnterLocation").Replace("[locationname]", Map.SelectedLocation.Name), endRoundButton.Font, endRoundButton.Rect.Width - 5); endRoundButton.UserData = leavingSub; endRoundButton.Visible = true; } else if (leavingSub.AtStartPosition) { - endRoundButton.Text = ToolBox.LimitString("Enter " + Map.CurrentLocation.Name, endRoundButton.Font, endRoundButton.Rect.Width - 5); + endRoundButton.Text = ToolBox.LimitString(TextManager.Get("EnterLocation").Replace("[locationname]", Map.CurrentLocation.Name), endRoundButton.Font, endRoundButton.Rect.Width - 5); endRoundButton.UserData = leavingSub; endRoundButton.Visible = true; } @@ -218,7 +207,7 @@ namespace Barotrauma summaryScreen = summaryScreen.children[0]; summaryScreen.RemoveChild(summaryScreen.children.Find(c => c is GUIButton)); - var okButton = new GUIButton(new Rectangle(-120, 0, 100, 30), "Load game", Alignment.BottomRight, "", summaryScreen); + var okButton = new GUIButton(new Rectangle(-120, 0, 100, 30), TextManager.Get("LoadGameButton"), Alignment.BottomRight, "", summaryScreen); okButton.OnClicked += (GUIButton button, object obj) => { GameMain.GameSession.LoadPrevious(); @@ -227,7 +216,7 @@ namespace Barotrauma return true; }; - var quitButton = new GUIButton(new Rectangle(0, 0, 100, 30), "Quit", Alignment.BottomRight, "", summaryScreen); + var quitButton = new GUIButton(new Rectangle(0, 0, 100, 30), TextManager.Get("QuitButton"), Alignment.BottomRight, "", summaryScreen); quitButton.OnClicked += GameMain.LobbyScreen.QuitToMainMenu; quitButton.OnClicked += (GUIButton button, object obj) => { GUIMessageBox.MessageBoxes.Remove(GUIMessageBox.VisibleBox); return true; }; } @@ -256,17 +245,9 @@ namespace Barotrauma if (subsToLeaveBehind.Any()) { - string msg = ""; - if (subsToLeaveBehind.Count == 1) - { - msg = "One of your vessels isn't at the exit yet. Do you want to leave it behind?"; - } - else - { - msg = "Some of your vessels aren't at the exit yet. Do you want to leave them behind?"; - } + string msg = TextManager.Get(subsToLeaveBehind.Count == 1 ? "LeaveSubBehind" : "LeaveSubsBehind"); - var msgBox = new GUIMessageBox("Warning", msg, new string[] {"Yes", "No"}); + var msgBox = new GUIMessageBox(TextManager.Get("Warning"), msg, new string[] { TextManager.Get("Yes"), TextManager.Get("No") }); msgBox.Buttons[0].OnClicked += EndRound; msgBox.Buttons[0].OnClicked += msgBox.Close; msgBox.Buttons[0].UserData = Submarine.Loaded.FindAll(s => !subsToLeaveBehind.Contains(s)); diff --git a/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs b/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs index c6c9ceb61..fd901a17b 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/CharacterInventory.cs @@ -45,7 +45,7 @@ namespace Barotrauma useOnSelfButton[i - 3] = new GUIButton( new Rectangle((int)SlotPositions[i].X, (int)(SlotPositions[i].Y - spacing - rectHeight), - rectWidth, rectHeight), "Use", "") + rectWidth, rectHeight), TextManager.Get("UseItemButton"), "") { UserData = i, OnClicked = UseItemOnSelf diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Engine.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Engine.cs index 228b7af76..19e01d9a1 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Engine.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Engine.cs @@ -7,16 +7,9 @@ namespace Barotrauma.Items.Components { public override void DrawHUD(SpriteBatch spriteBatch, Character character) { - //isActive = true; GuiFrame.Draw(spriteBatch); - //int width = 300, height = 300; - //int x = Game1.GraphicsWidth / 2 - width / 2; - //int y = Game1.GraphicsHeight / 2 - height / 2 - 50; - - //GUI.DrawRectangle(spriteBatch, new Rectangle(x, y, width, height), Color.Black, true); - - GUI.Font.DrawString(spriteBatch, "Force: " + (int)(targetForce) + " %", new Vector2(GuiFrame.Rect.X + 30, GuiFrame.Rect.Y + 30), Color.White); + GUI.Font.DrawString(spriteBatch, TextManager.Get("Force") + ": " + (int)(targetForce) + " %", new Vector2(GuiFrame.Rect.X + 30, GuiFrame.Rect.Y + 30), Color.White); } public override void AddToGUIUpdateList() diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Fabricator.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Fabricator.cs index fb3aebc16..ac83492d0 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Fabricator.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Fabricator.cs @@ -110,19 +110,19 @@ namespace Barotrauma.Items.Components string text; if (!inadequateSkills.Any()) { - text = "Required items:\n"; + text = TextManager.Get("FabricatorRequiredItems")+ ":\n"; foreach (Tuple ip in targetItem.RequiredItems) { - text += " - " + ip.Item1.Name + " x" + ip.Item2 + (ip.Item3 < 1.0f ? ", " + ip.Item3 * 100 + "% condition\n" : "\n"); + text += " - " + ip.Item1.Name + " x" + ip.Item2 + (ip.Item3 < 1.0f ? ", " + ip.Item3 * 100 + "% " + TextManager.Get("FabricatorRequiredCondition") + "\n" : "\n"); } - text += "Required time: " + targetItem.RequiredTime + " s"; + text += TextManager.Get("FabricatorRequiredTime") + ": " + targetItem.RequiredTime + " s"; } else { - text = "Skills required to calibrate:\n"; + text = TextManager.Get("FabricatorRequiredSkills") + ":\n"; foreach (Skill skill in inadequateSkills) { - text += " - " + skill.Name + " lvl " + skill.Level + "\n"; + text += " - " + skill.Name + " " + TextManager.Get("Lvl").ToLower() + " " + skill.Level + "\n"; } textColor = Color.Red; @@ -136,7 +136,7 @@ namespace Barotrauma.Items.Components Alignment.TopLeft, null, selectedItemFrame); - activateButton = new GUIButton(new Rectangle(0, -30, 100, 20), "Create", Color.White, Alignment.CenterX | Alignment.Bottom, "", selectedItemFrame); + activateButton = new GUIButton(new Rectangle(0, -30, 100, 20), TextManager.Get("FabricatorCreate"), Color.White, Alignment.CenterX | Alignment.Bottom, "", selectedItemFrame); activateButton.OnClicked = StartButtonClicked; activateButton.UserData = targetItem; activateButton.Enabled = false; diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/MiniMap.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/MiniMap.cs index 992dc315f..d15434fe0 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/MiniMap.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/MiniMap.cs @@ -104,18 +104,18 @@ namespace Barotrauma.Items.Components { GUI.DrawString(spriteBatch, new Vector2(x + 10, y + height - 60), - "Hull breach", Color.Red, Color.Black * 0.5f, 2, GUI.SmallFont); + TextManager.Get("MiniMapHullBreach"), Color.Red, Color.Black * 0.5f, 2, GUI.SmallFont); } GUI.DrawString(spriteBatch, new Vector2(x + 10, y + height - 60), - oxygenAmount == null ? "Air quality data not available" : "Air quality: " + (int)oxygenAmount + " %", + oxygenAmount == null ? TextManager.Get("MiniMapAirQualityUnavailable") : TextManager.Get("MiniMapAirQuality") + ": " + (int)oxygenAmount + " %", oxygenAmount == null ? Color.Red : Color.Lerp(Color.Red, Color.LightGreen, (float)oxygenAmount / 100.0f), Color.Black * 0.5f, 2, GUI.SmallFont); GUI.DrawString(spriteBatch, new Vector2(x + 10, y + height - 40), - waterAmount == null ? "Water level data not available" : "Water level: " + (int)(waterAmount * 100.0f) + " %", + waterAmount == null ? TextManager.Get("MiniMapWaterLevelUnavailable") : TextManager.Get("MiniMapWaterLevel") + ": " + (int)(waterAmount * 100.0f) + " %", waterAmount == null ? Color.Red : Color.Lerp(Color.LightGreen, Color.Red, (float)waterAmount), Color.Black * 0.5f, 2, GUI.SmallFont); } diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Pump.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Pump.cs index 2e9691150..2729d07dc 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Pump.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Pump.cs @@ -10,7 +10,7 @@ namespace Barotrauma.Items.Components partial void InitProjSpecific() { - isActiveTickBox = new GUITickBox(new Rectangle(0, 0, 20, 20), "Running", Alignment.TopLeft, GuiFrame); + isActiveTickBox = new GUITickBox(new Rectangle(0, 0, 20, 20), TextManager.Get("PumpRunning"), Alignment.TopLeft, GuiFrame); isActiveTickBox.OnSelected = (GUITickBox box) => { targetLevel = null; @@ -31,7 +31,7 @@ namespace Barotrauma.Items.Components return true; }; - var button = new GUIButton(new Rectangle(160, 40, 35, 30), "OUT", "", GuiFrame); + var button = new GUIButton(new Rectangle(160, 40, 35, 30), TextManager.Get("PumpOut"), "", GuiFrame); button.OnClicked = (GUIButton btn, object obj) => { FlowPercentage -= 10.0f; @@ -50,7 +50,7 @@ namespace Barotrauma.Items.Components return true; }; - button = new GUIButton(new Rectangle(210, 40, 35, 30), "IN", "", GuiFrame); + button = new GUIButton(new Rectangle(210, 40, 35, 30), TextManager.Get("PumpIn"), "", GuiFrame); button.OnClicked = (GUIButton btn, object obj) => { FlowPercentage += 10.0f; @@ -77,7 +77,7 @@ namespace Barotrauma.Items.Components GuiFrame.Draw(spriteBatch); - GUI.Font.DrawString(spriteBatch, "Pumping speed: " + (int)flowPercentage + " %", new Vector2(x + 40, y + 85), Color.White); + GUI.Font.DrawString(spriteBatch, TextManager.Get("PumpSpeed") + ": " + (int)flowPercentage + " %", new Vector2(x + 40, y + 85), Color.White); } diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Reactor.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Reactor.cs index 47e31d51c..1bb841ef7 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Reactor.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Reactor.cs @@ -50,7 +50,7 @@ namespace Barotrauma.Items.Components return false; }; - autoTempTickBox = new GUITickBox(new Rectangle(410, 170, 20, 20), "Automatic temperature control", Alignment.TopLeft, GuiFrame); + autoTempTickBox = new GUITickBox(new Rectangle(410, 170, 20, 20), TextManager.Get("ReactorAutoTemp"), Alignment.TopLeft, GuiFrame); autoTempTickBox.OnSelected = ToggleAutoTemp; button = new GUIButton(new Rectangle(210, 290, 40, 40), "+", "", GuiFrame); @@ -148,12 +148,10 @@ namespace Barotrauma.Items.Components GuiFrame.Draw(spriteBatch); float xOffset = graphTimer / updateGraphInterval; - - //GUI.DrawRectangle(spriteBatch, new Rectangle(x, y, width, height), Color.Black, true); - - GUI.Font.DrawString(spriteBatch, "Output: " + (int)temperature + " kW", + + GUI.Font.DrawString(spriteBatch, TextManager.Get("ReactorOutput") + ": " + (int)temperature + " kW", new Vector2(x + 450, y + 30), Color.Red); - GUI.Font.DrawString(spriteBatch, "Grid load: " + (int)load + " kW", + GUI.Font.DrawString(spriteBatch, TextManager.Get("ReactorGridLoad") + ": " + (int)load + " kW", new Vector2(x + 600, y + 30), Color.Yellow); float maxLoad = 0.0f; @@ -168,23 +166,18 @@ namespace Barotrauma.Items.Components DrawGraph(loadGraph, spriteBatch, new Rectangle(x + 30, y + 30, 400, 250), Math.Max(10000.0f, maxLoad), xOffset, Color.Yellow); - GUI.Font.DrawString(spriteBatch, "Shutdown Temperature: " + (int)shutDownTemp, new Vector2(x + 450, y + 80), Color.White); - - //GUI.Font.DrawString(spriteBatch, "Automatic Temperature Control: " + ((autoTemp) ? "ON" : "OFF"), new Vector2(x + 450, y + 180), Color.White); + GUI.Font.DrawString(spriteBatch, TextManager.Get("ReactorShutdownTemp") + ": " + (int)shutDownTemp, new Vector2(x + 450, y + 80), Color.White); y += 300; - GUI.Font.DrawString(spriteBatch, "Fission rate: " + (int)fissionRate + " %", new Vector2(x + 30, y), Color.White); + GUI.Font.DrawString(spriteBatch, TextManager.Get("ReactorFissionRate") + ": " + (int)fissionRate + " %", new Vector2(x + 30, y), Color.White); DrawGraph(fissionRateGraph, spriteBatch, new Rectangle(x + 30, y + 30, 200, 100), 100.0f, xOffset, Color.Orange); - GUI.Font.DrawString(spriteBatch, "Cooling rate: " + (int)coolingRate + " %", new Vector2(x + 320, y), Color.White); + GUI.Font.DrawString(spriteBatch, TextManager.Get("ReactorCoolingRate") + ": " + (int)coolingRate + " %", new Vector2(x + 320, y), Color.White); DrawGraph(coolingRateGraph, spriteBatch, new Rectangle(x + 320, y + 30, 200, 100), 100.0f, xOffset, Color.LightBlue); - - - //y = y - 260; } public override void AddToGUIUpdateList() diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Steering.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Steering.cs index bfdbba14a..504454253 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Steering.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Machines/Steering.cs @@ -31,7 +31,7 @@ namespace Barotrauma.Items.Components partial void InitProjSpecific() { - autopilotTickBox = new GUITickBox(new Rectangle(0, 25, 20, 20), "Autopilot", Alignment.TopLeft, GuiFrame); + autopilotTickBox = new GUITickBox(new Rectangle(0, 25, 20, 20), TextManager.Get("SteeringAutoPilot"), Alignment.TopLeft, GuiFrame); autopilotTickBox.OnSelected = (GUITickBox box) => { AutoPilot = box.Selected; @@ -40,7 +40,7 @@ namespace Barotrauma.Items.Components return true; }; - maintainPosTickBox = new GUITickBox(new Rectangle(5, 50, 15, 15), "Maintain position", Alignment.TopLeft, GUI.SmallFont, GuiFrame); + maintainPosTickBox = new GUITickBox(new Rectangle(5, 50, 15, 15), TextManager.Get("SteeringMaintainPos"), Alignment.TopLeft, GUI.SmallFont, GuiFrame); maintainPosTickBox.Enabled = false; maintainPosTickBox.OnSelected = ToggleMaintainPosition; @@ -100,12 +100,12 @@ namespace Barotrauma.Items.Components Vector2 realWorldVelocity = ConvertUnits.ToDisplayUnits(item.Submarine.Velocity * Physics.DisplayToRealWorldRatio) * 3.6f; float realWorldDepth = Math.Abs(item.Submarine.Position.Y - Level.Loaded.Size.Y) * Physics.DisplayToRealWorldRatio; GUI.DrawString(spriteBatch, new Vector2(x + 20, y + height - 65), - "Velocity: " + (int)realWorldVelocity.X + " km/h", Color.LightGreen, null, 0, GUI.SmallFont); + TextManager.Get("SteeringVelocityX").Replace("[kph]", ((int)realWorldVelocity.X).ToString()), Color.LightGreen, null, 0, GUI.SmallFont); GUI.DrawString(spriteBatch, new Vector2(x + 20, y + height - 50), - "Descent velocity: " + -(int)realWorldVelocity.Y + " km/h", Color.LightGreen, null, 0, GUI.SmallFont); + TextManager.Get("SteeringVelocityY").Replace("[kph]", ((int)-realWorldVelocity.Y).ToString()), Color.LightGreen, null, 0, GUI.SmallFont); GUI.DrawString(spriteBatch, new Vector2(x + 20, y + height - 30), - "Depth: " + (int)realWorldDepth + " m", Color.LightGreen, null, 0, GUI.SmallFont); + TextManager.Get("SteeringDepth").Replace("[m]", ((int)realWorldDepth).ToString()), Color.LightGreen, null, 0, GUI.SmallFont); } GUI.DrawLine(spriteBatch, diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Power/PowerContainer.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Power/PowerContainer.cs index 0de3d0b2b..40ca47380 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Power/PowerContainer.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Power/PowerContainer.cs @@ -72,10 +72,10 @@ namespace Barotrauma.Items.Components //GUI.DrawRectangle(spriteBatch, new Rectangle(x, y, width, height), Color.Black, true); GUI.Font.DrawString(spriteBatch, - "Charge: " + (int)charge + "/" + (int)capacity + " kWm (" + (int)((charge / capacity) * 100.0f) + " %)", + TextManager.Get("PowerContainerCharge").Replace("[charge]", (int)charge + "/" + (int)capacity).Replace("[percentage]", ((int)((charge / capacity) * 100.0f)).ToString()), new Vector2(x + 30, y + 30), Color.White); - GUI.Font.DrawString(spriteBatch, "Recharge rate: " + (int)((rechargeSpeed / maxRechargeSpeed) * 100.0f) + " %", new Vector2(x + 30, y + 95), Color.White); + GUI.Font.DrawString(spriteBatch, TextManager.Get("RechargeRate") + ": " + (int)((rechargeSpeed / maxRechargeSpeed) * 100.0f) + " %", new Vector2(x + 30, y + 95), Color.White); } public override void AddToGUIUpdateList() diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Power/PowerTransfer.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Power/PowerTransfer.cs index 67c72484b..8f280730e 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Power/PowerTransfer.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Power/PowerTransfer.cs @@ -14,8 +14,13 @@ namespace Barotrauma.Items.Components GuiFrame.Draw(spriteBatch); - GUI.Font.DrawString(spriteBatch, "Power: " + (int)(-currPowerConsumption) + " kW", new Vector2(x + 30, y + 30), Color.White); - GUI.Font.DrawString(spriteBatch, "Load: " + (int)powerLoad + " kW", new Vector2(x + 30, y + 100), Color.White); + GUI.Font.DrawString(spriteBatch, + TextManager.Get("PowerTransferPower").Replace("[power]", ((int)(-currPowerConsumption)).ToString()), + new Vector2(x + 30, y + 30), Color.White); + + GUI.Font.DrawString(spriteBatch, + TextManager.Get("PowerTransferLoad").Replace("[load]", ((int)powerLoad).ToString()), + new Vector2(x + 30, y + 100), Color.White); } public override void AddToGUIUpdateList() diff --git a/Barotrauma/BarotraumaClient/Source/Items/Components/Signal/Connection.cs b/Barotrauma/BarotraumaClient/Source/Items/Components/Signal/Connection.cs index 7efc9cf88..30a27fc2d 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Components/Signal/Connection.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Components/Signal/Connection.cs @@ -225,7 +225,7 @@ namespace Barotrauma.Items.Components Vector2.Distance(end, PlayerInput.MousePosition) < 20.0f || new Rectangle((start.X < end.X) ? textX - 100 : textX, (int)start.Y - 5, 100, 14).Contains(PlayerInput.MousePosition)); - string label = wire.Locked ? item.Name + "\n(Locked)" : item.Name; + string label = wire.Locked ? item.Name + "\n" + TextManager.Get("ConnectionLocked") : item.Name; GUI.DrawString(spriteBatch, new Vector2(start.X < end.X ? textX - GUI.SmallFont.MeasureString(label).X : textX, start.Y - 5.0f), diff --git a/Barotrauma/BarotraumaShared/Content/Jobs.xml b/Barotrauma/BarotraumaShared/Content/Jobs.xml index 4ed0e602f..315a1df39 100644 --- a/Barotrauma/BarotraumaShared/Content/Jobs.xml +++ b/Barotrauma/BarotraumaShared/Content/Jobs.xml @@ -1,6 +1,7 @@  - + @@ -22,7 +23,8 @@ - + @@ -40,7 +42,8 @@ - + diff --git a/Barotrauma/BarotraumaShared/Content/Texts.xml b/Barotrauma/BarotraumaShared/Content/Texts.xml index 528e2323e..a2bc3f7f3 100644 --- a/Barotrauma/BarotraumaShared/Content/Texts.xml +++ b/Barotrauma/BarotraumaShared/Content/Texts.xml @@ -1,5 +1,9 @@  - + + + Loading... + Press any key to continue + Tutorial New Game @@ -52,7 +56,9 @@ Running out of oxygen! Water pressure increasing! Grabbing - Stun + Stun + (Disguised) + Use OK @@ -113,6 +119,7 @@ Herself + Mission info No mission Reward: [reward] @@ -146,6 +153,12 @@ Credit Credits + + End round + Enter [locationname] + One of your vessels isn't at the exit yet. Do you want to leave it behind? + Some of your vessels aren't at the exit yet. Do you want to leave them behind? + Join server Your name @@ -243,8 +256,7 @@ No waypoints found in the submarine. AI controlled crew members won't be able to navigate without waypoints. "The submarine does not have spawnpoints for cargo (which are used for determining where to place bought items). To fix this, create a new spawnpoint and change its "spawn type" parameter to "cargo". One or more structures have been placed very far from the submarine. Show the structures? - - + Dimensions [width]x[height] m @@ -278,6 +290,41 @@ You have been kicked by the spam filter. You have been blocked by the spam filter. Try again after 10 seconds. + + + Force + Required items + Required time + Condition + Skills required to calibrate + Create + Lvl + Hull breach + Water level + Water level data not available + Air quality + Air quality data not available + Running + IN + OUT + Pumping speed + Automatic temperature control + Output + Grid load + Shutdown temperature + Fission rate + Cooling rate + Autopilot + Maintain position + Velocity: [kph] km/h + Descent velocity: [kph] km/h + Depth: [m] m + Charge: [charge] kWm ([percentage] %) + Recharge rate + Power: [power] kW + Load: [load] kW + (Locked) + Attempting to fix [itemname] Fix @@ -327,6 +374,7 @@ Give in Let go of your character and enter spectator mode (other players will no longer be able to revive you) "The character can no longer be revived if you give in." + Your chat messages will only be visible to other dead players. Deceased @@ -361,4 +409,7 @@ + + + \ No newline at end of file diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Jobs/JobPrefab.cs b/Barotrauma/BarotraumaShared/Source/Characters/Jobs/JobPrefab.cs index d757e6992..f667a3ee7 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Jobs/JobPrefab.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Jobs/JobPrefab.cs @@ -12,6 +12,9 @@ namespace Barotrauma public List Skills; + //the number of these characters in the crew the player starts with + public readonly int InitialCount; + public string Name { get; @@ -69,6 +72,8 @@ namespace Barotrauma MaxNumber = element.GetAttributeInt("maxnumber", 10); MinKarma = element.GetAttributeFloat("minkarma", 0.0f); + InitialCount = element.GetAttributeInt("initialcount", 0); + Commonness = element.GetAttributeInt("commonness", 10); AllowAlways = element.GetAttributeBool("allowalways", false); diff --git a/Barotrauma/BarotraumaShared/Source/ContentPackage.cs b/Barotrauma/BarotraumaShared/Source/ContentPackage.cs index 4fb40c6e9..71b867604 100644 --- a/Barotrauma/BarotraumaShared/Source/ContentPackage.cs +++ b/Barotrauma/BarotraumaShared/Source/ContentPackage.cs @@ -156,9 +156,9 @@ namespace Barotrauma try { if (file.path.EndsWith(".xml", true, System.Globalization.CultureInfo.InvariantCulture)) - hashes.Add(calculateXmlHash(file, ref md5)); + hashes.Add(CalculateXmlHash(file, ref md5)); else - hashes.Add(calculateFileHash(file, ref md5)); + hashes.Add(CalculateFileHash(file, ref md5)); } catch (Exception e) @@ -180,7 +180,7 @@ namespace Barotrauma } - private byte[] calculateXmlHash(ContentFile file, ref MD5 md5) //todo: Change ref to in (in C# 7.2) + private byte[] CalculateXmlHash(ContentFile file, ref MD5 md5) //todo: Change ref to in (in C# 7.2) { var doc = XMLExtensions.TryLoadXml(file.path); @@ -200,7 +200,7 @@ namespace Barotrauma } } - private byte[] calculateFileHash(ContentFile file, ref MD5 md5) + private byte[] CalculateFileHash(ContentFile file, ref MD5 md5) { using (var stream = File.OpenRead(file.path)) {