Started moving hard-coded texts to a separate xml file (Content/Texts.xml) to make modding and translating the game easier (see #80). Also Renamed InfoTextManager as TextManager.

This commit is contained in:
Joonas Rikkonen
2017-12-26 23:51:18 +02:00
parent a5d2dd37f4
commit 2894b74edc
16 changed files with 411 additions and 244 deletions
@@ -309,12 +309,10 @@ namespace Barotrauma
if (suicideButton == null)
{
suicideButton = new GUIButton(
new Rectangle(new Point(GameMain.GraphicsWidth / 2 - 60, 20), new Point(120, 20)), "Give in", "");
new Rectangle(new Point(GameMain.GraphicsWidth / 2 - 60, 20), new Point(120, 20)), TextManager.Get("GiveInButton"), "");
suicideButton.ToolTip = GameMain.NetworkMember == null ?
"The character can no longer be revived if you give in." :
"Let go of your character and enter spectator mode (other players will no longer be able to revive you)";
suicideButton.ToolTip = TextManager.Get(GameMain.NetworkMember == null ? "GiveInHelpSingleplayer" : "GiveInHelpMultiplayer");
suicideButton.OnClicked = (button, userData) =>
{
@@ -344,7 +342,7 @@ namespace Barotrauma
{
if (GameMain.DebugDraw)
{
GUI.DrawString(spriteBatch, new Vector2(30, GameMain.GraphicsHeight - 260), "Stun: "+character.Stun, Color.White);
GUI.DrawString(spriteBatch, new Vector2(30, GameMain.GraphicsHeight - 260), TextManager.Get("Stun") + ": " + character.Stun, Color.White);
}
if (oxygenBar == null)
@@ -364,7 +362,7 @@ namespace Barotrauma
oxygenBar.Draw(spriteBatch);
if (!oxyMsgShown)
{
GUI.AddMessage(InfoTextManager.GetInfoText("OxygenBarInfo"), new Vector2(oxygenBar.Rect.Right + 10, oxygenBar.Rect.Y), Alignment.Left, Color.White, 5.0f);
GUI.AddMessage(TextManager.Get("OxygenBarInfo"), new Vector2(oxygenBar.Rect.Right + 10, oxygenBar.Rect.Y), Alignment.Left, Color.White, 5.0f);
oxyMsgShown = true;
}
}
@@ -394,7 +392,7 @@ namespace Barotrauma
if (pressureMsgTimer > 0.5f && !pressureMsgShown)
{
GUI.AddMessage(InfoTextManager.GetInfoText("PressureInfo"), new Vector2(40.0f, healthBar.Rect.Y - 60.0f), Alignment.Left, Color.White, 5.0f);
GUI.AddMessage(TextManager.Get("PressureInfo"), new Vector2(40.0f, healthBar.Rect.Y - 60.0f), Alignment.Left, Color.White, 5.0f);
pressureMsgShown = true;
}