Some more hard-coded text removal

This commit is contained in:
Joonas Rikkonen
2018-01-31 19:01:48 +02:00
parent 6e231b7e7d
commit dcb6de32c0
21 changed files with 136 additions and 105 deletions

View File

@@ -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();

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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();

View File

@@ -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));

View File

@@ -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

View File

@@ -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()

View File

@@ -110,19 +110,19 @@ namespace Barotrauma.Items.Components
string text;
if (!inadequateSkills.Any())
{
text = "Required items:\n";
text = TextManager.Get("FabricatorRequiredItems")+ ":\n";
foreach (Tuple<ItemPrefab, int, float, bool> 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;

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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()

View File

@@ -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,

View File

@@ -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()

View File

@@ -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()

View File

@@ -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),

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Jobs>
<Job name="Captain" description="The Commanding Officer is responsible for commanding the entirety of the crew and ensuring that everything is running smoothly." minnumber="1" maxnumber="1" minkarma="0.7">
<Job name="Captain" description="The Commanding Officer is responsible for commanding the entirety of the crew and ensuring that everything is running smoothly."
minnumber="1" maxnumber="1" minkarma="0.7" initialcount="1">
<Skills>
<Skill name="Weapons" level="50,60"/>
<Skill name="Construction" level="20,30"/>
@@ -22,7 +23,8 @@
</Items>
</Job>
<Job name="Engineer" description="Engineers are the backbone of a submarine's crew, complementing a mechanic's construction skill with their knowledge of electrical engineering. They are capable of performing maintenance on the various electrical pieces of the submarine." minnumber="1" minkarma="0.5">
<Job name="Engineer" description="Engineers are the backbone of a submarine's crew, complementing a mechanic's construction skill with their knowledge of electrical engineering. They are capable of performing maintenance on the various electrical pieces of the submarine."
minnumber="1" minkarma="0.5" initialcount="1">
<Skills>
<Skill name="Weapons" level="10,30"/>
<Skill name="Construction" level="20,30"/>
@@ -40,7 +42,8 @@
</Items>
</Job>
<Job name="Mechanic" description="Mechanics are capable of fixing various mechanical devices with their high construction skill. Together with engineers they ensure a submarine is working to its fullest." minnumber="1" minkarma="0.5">
<Job name="Mechanic" description="Mechanics are capable of fixing various mechanical devices with their high construction skill. Together with engineers they ensure a submarine is working to its fullest."
minnumber="1" minkarma="0.5" initialcount="1">
<Skills>
<Skill name="Weapons" level="10,30"/>
<Skill name="Construction" level="50,60"/>

View File

@@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<infotexts>
<infotexts>
<!-- Loading screen -->
<Loading>Loading...</Loading>
<PressAnyKey>Press any key to continue</PressAnyKey>
<!-- Main menu buttons -->
<TutorialButton>Tutorial</TutorialButton>
<NewGameButton>New Game</NewGameButton>
@@ -52,7 +56,9 @@
<OxygenBarInfo>Running out of oxygen!</OxygenBarInfo>
<PressureInfo>Water pressure increasing!</PressureInfo>
<Grabbing>Grabbing</Grabbing>
<Stun>Stun</Stun>
<Stun>Stun</Stun>
<Disguised>(Disguised)</Disguised>
<UseItemButton>Use</UseItemButton>
<!-- Status -->
<StatusOK>OK</StatusOK>
@@ -113,6 +119,7 @@
<PronounReflexiveFemale>Herself</PronounReflexiveFemale>
<!-- Mission info -->
<MissionInfo>Mission info</MissionInfo>
<NoMission>No mission</NoMission>
<MissionReward>Reward: [reward]</MissionReward>
@@ -146,6 +153,12 @@
<Credit>Credit</Credit>
<Credits>Credits</Credits>
<!-- Ingame menus -->
<EndRound>End round</EndRound>
<EnterLocation>Enter [locationname]</EnterLocation>
<LeaveSubBehind>One of your vessels isn't at the exit yet. Do you want to leave it behind?</LeaveSubBehind>
<LeaveSubsBehind>Some of your vessels aren't at the exit yet. Do you want to leave them behind?</LeaveSubsBehind>
<!-- Server list -->
<JoinServer>Join server</JoinServer>
<YourName>Your name</YourName>
@@ -243,8 +256,7 @@
<NoWaypointsWarning>No waypoints found in the submarine. AI controlled crew members won't be able to navigate without waypoints.</NoWaypointsWarning>
<NoCargoSpawnpointWarning>"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".</NoCargoSpawnpointWarning>
<FarAwayEntitiesWarning>One or more structures have been placed very far from the submarine. Show the structures?</FarAwayEntitiesWarning>
<!-- Sub description -->
<Dimensions>Dimensions</Dimensions>
<DimensionsFormat>[width]x[height] m</DimensionsFormat>
@@ -278,6 +290,41 @@
<SpamFilterKicked>You have been kicked by the spam filter.</SpamFilterKicked>
<SpamFilterBlocked>You have been blocked by the spam filter. Try again after 10 seconds.</SpamFilterBlocked>
<!-- Item HUDs -->
<Force>Force</Force>
<FabricatorRequiredItems>Required items</FabricatorRequiredItems>
<FabricatorRequiredTime>Required time</FabricatorRequiredTime>
<FabricatorCondition>Condition</FabricatorCondition>
<FabricatorRequiredSkills>Skills required to calibrate</FabricatorRequiredSkills>
<FabricatorCreate>Create</FabricatorCreate>
<Lvl>Lvl</Lvl>
<MiniMapHullBreach>Hull breach</MiniMapHullBreach>
<MiniMapWaterLevel>Water level</MiniMapWaterLevel>
<MiniMapWaterLevelUnavailable>Water level data not available</MiniMapWaterLevelUnavailable>
<MiniMapAirQuality>Air quality</MiniMapAirQuality>
<MiniMapAirQualityUnavailable>Air quality data not available</MiniMapAirQualityUnavailable>
<PumpRunning>Running</PumpRunning>
<PumpIn>IN</PumpIn>
<PumpOut>OUT</PumpOut>
<PumpSpeed>Pumping speed</PumpSpeed>
<ReactorAutoTemp>Automatic temperature control</ReactorAutoTemp>
<ReactorOutput>Output</ReactorOutput>
<ReactorGridLoad>Grid load</ReactorGridLoad>
<ReactorShutdownTemp>Shutdown temperature</ReactorShutdownTemp>
<ReactorFissionRate>Fission rate</ReactorFissionRate>
<ReactorCoolingRate>Cooling rate</ReactorCoolingRate>
<SteeringAutoPilot>Autopilot</SteeringAutoPilot>
<SteeringMaintainPos>Maintain position</SteeringMaintainPos>
<SteeringVelocityX>Velocity: [kph] km/h</SteeringVelocityX>
<SteeringVelocityY>Descent velocity: [kph] km/h</SteeringVelocityY>
<SteeringDepth>Depth: [m] m</SteeringDepth>
<PowerContainerCharge>Charge: [charge] kWm ([percentage] %)</PowerContainerCharge>
<PowerContainerRechargeRate>Recharge rate</PowerContainerRechargeRate>
<PowerTransferPower>Power: [power] kW</PowerTransferPower>
<PowerTransferLoad>Load: [load] kW</PowerTransferLoad>
<ConnectionLocked>(Locked)</ConnectionLocked>
<!-- Item fixing -->
<FixHeader>Attempting to fix [itemname]</FixHeader>
<FixButton>Fix</FixButton>
@@ -327,6 +374,7 @@
<GiveInButton>Give in</GiveInButton>
<GiveInHelpMultiplayer>Let go of your character and enter spectator mode (other players will no longer be able to revive you)</GiveInHelpMultiplayer>
<GiveInHelpSingleplayer>"The character can no longer be revived if you give in."</GiveInHelpSingleplayer>
<DeathChatNotification>Your chat messages will only be visible to other dead players.</DeathChatNotification>
<!-- Status -->
<Deceased>Deceased</Deceased>
@@ -361,4 +409,7 @@
</infotexts>

View File

@@ -12,6 +12,9 @@ namespace Barotrauma
public List<SkillPrefab> 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);

View File

@@ -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))
{