(e7e775e7b) Fixed non-translated "Toggle Battery Output" display text in Orca, increased the size of the docking labels in Bunyip to create more space for translated texts

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:25:11 +03:00
parent 75b88e0c18
commit cb519b455d
19 changed files with 125 additions and 153 deletions
@@ -36,16 +36,6 @@ namespace Barotrauma
get { return (GameMain.GraphicsWidth / 1920.0f + GameMain.GraphicsHeight / 1080.0f) / 2.0f * GameSettings.HUDScale; } get { return (GameMain.GraphicsWidth / 1920.0f + GameMain.GraphicsHeight / 1080.0f) / 2.0f * GameSettings.HUDScale; }
} }
public static float xScale
{
get { return GameMain.GraphicsWidth / 1920.0f * GameSettings.HUDScale; }
}
public static float yScale
{
get { return GameMain.GraphicsHeight / 1080.0f * GameSettings.HUDScale; }
}
public static GUIStyle Style; public static GUIStyle Style;
private static Texture2D t; private static Texture2D t;
@@ -356,7 +356,7 @@ namespace Barotrauma
Point? minSize = null, maxSize = null; Point? minSize = null, maxSize = null;
if (element.Attribute("minsize") != null) minSize = element.GetAttributePoint("minsize", Point.Zero); if (element.Attribute("minsize") != null) minSize = element.GetAttributePoint("minsize", Point.Zero);
//if (element.Attribute("maxsize") != null) maxSize = element.GetAttributePoint("maxsize", new Point(1000, 1000)); if (element.Attribute("maxsize") != null) maxSize = element.GetAttributePoint("maxsize", new Point(1000, 1000));
RectTransform rectTransform; RectTransform rectTransform;
if (element.Attribute("relativesize") != null) if (element.Attribute("relativesize") != null)
@@ -293,7 +293,7 @@ namespace Barotrauma.Tutorials
// Room 3 // Room 3
do { yield return null; } while (!mechanic_weldingObjectiveSensor.MotionDetected); do { yield return null; } while (!mechanic_weldingObjectiveSensor.MotionDetected);
TriggerTutorialSegment(2, GameMain.Config.KeyBind(InputType.Shoot), GameMain.Config.KeyBind(InputType.Aim)); // Welding objective TriggerTutorialSegment(2, GameMain.Config.KeyBind(InputType.Aim), GameMain.Config.KeyBind(InputType.Shoot)); // Welding objective
do do
{ {
if (!mechanic.HasEquippedItem("divingmask")) if (!mechanic.HasEquippedItem("divingmask"))
@@ -334,14 +334,13 @@ namespace Barotrauma.Tutorials
//TriggerTutorialSegment(11, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Up), GameMain.Config.KeyBind(InputType.Down), GameMain.Config.KeyBind(InputType.Select)); // Ladder objective //TriggerTutorialSegment(11, GameMain.Config.KeyBind(InputType.Select), GameMain.Config.KeyBind(InputType.Up), GameMain.Config.KeyBind(InputType.Down), GameMain.Config.KeyBind(InputType.Select)); // Ladder objective
//do { yield return null; } while (!mechanic_ladderSensor.MotionDetected); //do { yield return null; } while (!mechanic_ladderSensor.MotionDetected);
//RemoveCompletedObjective(segments[11]); //RemoveCompletedObjective(segments[11]);
yield return new WaitForSeconds(2f);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.News"), ChatMessageType.Radio, null); GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.News"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(1f); yield return new WaitForSeconds(1f);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.Fire"), ChatMessageType.Radio, null); GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Mechanic.Radio.Fire"), ChatMessageType.Radio, null);
yield return new WaitForSeconds(6f);
// Room 4 // Room 4
do { yield return null; } while (!mechanic_thirdDoor.IsOpen); do { yield return null; } while (!mechanic_thirdDoor.IsOpen);
yield return new WaitForSeconds(1f);
mechanic_fire = new DummyFireSource(new Vector2(20f, 2f), Item.ItemList.Find(i => i.HasTag("mechanic_fire")).WorldPosition); mechanic_fire = new DummyFireSource(new Vector2(20f, 2f), Item.ItemList.Find(i => i.HasTag("mechanic_fire")).WorldPosition);
//do { yield return null; } while (!mechanic_craftingObjectiveSensor.MotionDetected); //do { yield return null; } while (!mechanic_craftingObjectiveSensor.MotionDetected);
TriggerTutorialSegment(4); // Deconstruct TriggerTutorialSegment(4); // Deconstruct
@@ -755,7 +755,7 @@ namespace Barotrauma
OnClicked = (button, data) => OnClicked = (button, data) =>
{ {
// TODO: add a prompt // TODO: add a prompt
LoadDefaultConfig(); LoadDefaultConfig(setLanguage: false);
CheckBindings(true); CheckBindings(true);
RefreshItemMessages(); RefreshItemMessages();
ApplySettings(); ApplySettings();
@@ -36,9 +36,7 @@ namespace Barotrauma.Items.Components
RelativeSpacing = 0.05f RelativeSpacing = 0.05f
}; };
int indicatorSize = (int)(30 * GUI.Scale); powerIndicator = new GUITickBox(new RectTransform(new Point(30, 30), content.RectTransform),
powerIndicator = new GUITickBox(new RectTransform(new Point(indicatorSize, indicatorSize), content.RectTransform),
TextManager.Get("EnginePowered"), style: "IndicatorLightGreen") TextManager.Get("EnginePowered"), style: "IndicatorLightGreen")
{ {
CanBeFocused = false CanBeFocused = false
@@ -108,7 +108,7 @@ namespace Barotrauma.Items.Components
foreach (FabricationRecipe fi in fabricationRecipes) foreach (FabricationRecipe fi in fabricationRecipes)
{ {
GUIFrame frame = new GUIFrame(new RectTransform(new Point(itemList.Rect.Width, (int)(30 * GUI.yScale)), itemList.Content.RectTransform), style: null) GUIFrame frame = new GUIFrame(new RectTransform(new Point(itemList.Rect.Width, 30), itemList.Content.RectTransform), style: null)
{ {
UserData = fi, UserData = fi,
HoverColor = Color.Gold * 0.2f, HoverColor = Color.Gold * 0.2f,
@@ -116,7 +116,7 @@ namespace Barotrauma.Items.Components
ToolTip = fi.TargetItem.Description ToolTip = fi.TargetItem.Description
}; };
GUITextBlock textBlock = new GUITextBlock(new RectTransform(Vector2.Zero, frame.RectTransform, Anchor.CenterLeft) { AbsoluteOffset = new Point((int)(50 * GUI.xScale), 0) }, GUITextBlock textBlock = new GUITextBlock(new RectTransform(Vector2.Zero, frame.RectTransform, Anchor.CenterLeft) { AbsoluteOffset = new Point(50, 0) },
fi.DisplayName) fi.DisplayName)
{ {
ToolTip = fi.TargetItem.Description ToolTip = fi.TargetItem.Description
@@ -125,7 +125,7 @@ namespace Barotrauma.Items.Components
var itemIcon = fi.TargetItem.InventoryIcon ?? fi.TargetItem.sprite; var itemIcon = fi.TargetItem.InventoryIcon ?? fi.TargetItem.sprite;
if (itemIcon != null) if (itemIcon != null)
{ {
GUIImage img = new GUIImage(new RectTransform(new Point((int)(30 * GUI.Scale)), frame.RectTransform, Anchor.CenterLeft) { AbsoluteOffset = new Point((int)(3 * GUI.xScale), 0) }, GUIImage img = new GUIImage(new RectTransform(new Point(30, 30), frame.RectTransform, Anchor.CenterLeft) { AbsoluteOffset = new Point(3, 0) },
itemIcon, scaleToFit: true) itemIcon, scaleToFit: true)
{ {
Color = fi.TargetItem.InventoryIconColor, Color = fi.TargetItem.InventoryIconColor,
@@ -114,9 +114,9 @@ namespace Barotrauma.Items.Components
Vector2 textSize = GUI.Font.MeasureString(text); Vector2 textSize = GUI.Font.MeasureString(text);
Vector2 textPos = child.Center; Vector2 textPos = child.Center;
if (textPos.X + textSize.X / 2 > submarineContainer.Rect.Right) if (textPos.X + textSize.X / 2 > submarineContainer.Rect.Right)
textPos.X -= ((textPos.X + textSize.X / 2) - submarineContainer.Rect.Right) + 10 * GUI.xScale; textPos.X -= ((textPos.X + textSize.X / 2) - submarineContainer.Rect.Right) + 10;
if (textPos.X - textSize.X / 2 < submarineContainer.Rect.X) if (textPos.X - textSize.X / 2 < submarineContainer.Rect.X)
textPos.X += (submarineContainer.Rect.X - (textPos.X - textSize.X / 2)) + 10 * GUI.xScale; textPos.X += (submarineContainer.Rect.X - (textPos.X - textSize.X / 2)) + 10;
GUI.DrawString(spriteBatch, textPos - textSize / 2, text, GUI.DrawString(spriteBatch, textPos - textSize / 2, text,
Color.Orange * (float)Math.Abs(Math.Sin(Timing.TotalTime)), Color.Black * 0.8f); Color.Orange * (float)Math.Abs(Math.Sin(Timing.TotalTime)), Color.Black * 0.8f);
break; break;
@@ -269,7 +269,7 @@ namespace Barotrauma.Items.Components
start.Y = -start.Y; start.Y = -start.Y;
Vector2 end = (sub.HullVertices[(i + 1) % sub.HullVertices.Count] + offset) * displayScale; Vector2 end = (sub.HullVertices[(i + 1) % sub.HullVertices.Count] + offset) * displayScale;
end.Y = -end.Y; end.Y = -end.Y;
GUI.DrawLine(spriteBatch, center + start, center + end, Color.DarkCyan * Rand.Range(0.3f, 0.35f), width: (int)(10 * GUI.Scale)); GUI.DrawLine(spriteBatch, center + start, center + end, Color.DarkCyan * Rand.Range(0.3f, 0.35f), width: 10);
} }
} }
@@ -44,7 +44,7 @@ namespace Barotrauma.Items.Components
GUIFrame paddedFrame = new GUIFrame(new RectTransform(new Vector2(0.9f, 0.8f), GuiFrame.RectTransform, Anchor.Center), style: null); GUIFrame paddedFrame = new GUIFrame(new RectTransform(new Vector2(0.9f, 0.8f), GuiFrame.RectTransform, Anchor.Center), style: null);
isActiveSlider = new GUIScrollBar(new RectTransform(new Point((int)(50 * GUI.Scale), (int)(100 * GUI.Scale)), paddedFrame.RectTransform, Anchor.CenterLeft), isActiveSlider = new GUIScrollBar(new RectTransform(new Point(50, 100), paddedFrame.RectTransform, Anchor.CenterLeft),
barSize: 0.2f, style: "OnOffLever") barSize: 0.2f, style: "OnOffLever")
{ {
IsBooleanSwitch = true, IsBooleanSwitch = true,
@@ -52,7 +52,7 @@ namespace Barotrauma.Items.Components
MaxValue = 0.75f MaxValue = 0.75f
}; };
var sliderHandle = isActiveSlider.GetChild<GUIButton>(); var sliderHandle = isActiveSlider.GetChild<GUIButton>();
sliderHandle.RectTransform.NonScaledSize = new Point((int)(84 * GUI.Scale), sliderHandle.Rect.Height); sliderHandle.RectTransform.NonScaledSize = new Point(84, sliderHandle.Rect.Height);
isActiveSlider.OnMoved = (GUIScrollBar scrollBar, float barScroll) => isActiveSlider.OnMoved = (GUIScrollBar scrollBar, float barScroll) =>
{ {
bool active = scrollBar.BarScroll < 0.5f; bool active = scrollBar.BarScroll < 0.5f;
@@ -73,7 +73,7 @@ namespace Barotrauma.Items.Components
var rightArea = new GUILayoutGroup(new RectTransform(new Vector2(0.75f, 1.0f), paddedFrame.RectTransform, Anchor.CenterRight)) { RelativeSpacing = 0.1f }; var rightArea = new GUILayoutGroup(new RectTransform(new Vector2(0.75f, 1.0f), paddedFrame.RectTransform, Anchor.CenterRight)) { RelativeSpacing = 0.1f };
powerIndicator = new GUITickBox(new RectTransform(new Point((int)(30 * GUI.Scale)), rightArea.RectTransform), TextManager.Get("PumpPowered"), style: "IndicatorLightGreen") powerIndicator = new GUITickBox(new RectTransform(new Point(30, 30), rightArea.RectTransform), TextManager.Get("PumpPowered"), style: "IndicatorLightGreen")
{ {
CanBeFocused = false CanBeFocused = false
}; };
@@ -14,21 +14,19 @@ namespace Barotrauma.Items.Components
{ {
if (GuiFrame == null) return; if (GuiFrame == null) return;
Point indicatorSize = new Point((int)(30 * GUI.Scale));
var paddedFrame = new GUIFrame(new RectTransform(new Vector2(0.9f, 0.7f), GuiFrame.RectTransform, Anchor.Center), style: null); var paddedFrame = new GUIFrame(new RectTransform(new Vector2(0.9f, 0.7f), GuiFrame.RectTransform, Anchor.Center), style: null);
powerIndicator = new GUITickBox(new RectTransform(indicatorSize, paddedFrame.RectTransform), powerIndicator = new GUITickBox(new RectTransform(new Point(30, 30), paddedFrame.RectTransform),
TextManager.Get("PowerTransferPowered"), style: "IndicatorLightGreen") TextManager.Get("PowerTransferPowered"), style: "IndicatorLightGreen")
{ {
Enabled = false Enabled = false
}; };
highVoltageIndicator = new GUITickBox(new RectTransform(indicatorSize, paddedFrame.RectTransform) { AbsoluteOffset = new Point(0, (int)(40 * GUI.yScale)) }, highVoltageIndicator = new GUITickBox(new RectTransform(new Point(30, 30), paddedFrame.RectTransform) { AbsoluteOffset = new Point(0, 40) },
TextManager.Get("PowerTransferHighVoltage"), style: "IndicatorLightRed") TextManager.Get("PowerTransferHighVoltage"), style: "IndicatorLightRed")
{ {
ToolTip = TextManager.Get("PowerTransferTipOvervoltage"), ToolTip = TextManager.Get("PowerTransferTipOvervoltage"),
Enabled = false Enabled = false
}; };
lowVoltageIndicator = new GUITickBox(new RectTransform(indicatorSize, paddedFrame.RectTransform) { AbsoluteOffset = new Point(0, (int)(80 * GUI.yScale)) }, lowVoltageIndicator = new GUITickBox(new RectTransform(new Point(30, 30), paddedFrame.RectTransform) { AbsoluteOffset = new Point(0, 80) },
TextManager.Get("PowerTransferLowVoltage"), style: "IndicatorLightRed") TextManager.Get("PowerTransferLowVoltage"), style: "IndicatorLightRed")
{ {
ToolTip = TextManager.Get("PowerTransferTipLowvoltage"), ToolTip = TextManager.Get("PowerTransferTipLowvoltage"),
@@ -57,15 +57,15 @@ namespace Barotrauma.Items.Components
} }
} }
Vector2 rightPos = new Vector2(x + width - 130 * GUI.xScale, y + 80 * GUI.yScale); Vector2 rightPos = new Vector2(x + width - 130, y + 80);
Vector2 leftPos = new Vector2(x + 130 * GUI.xScale, y + 80 * GUI.yScale); Vector2 leftPos = new Vector2(x + 130, y + 80);
Vector2 rightWirePos = new Vector2(x + width - 5 * GUI.xScale, y + 30 * GUI.yScale); Vector2 rightWirePos = new Vector2(x + width - 5, y + 30);
Vector2 leftWirePos = new Vector2(x + 5 * GUI.xScale, y + 30 * GUI.yScale); Vector2 leftWirePos = new Vector2(x + 5, y + 30);
int wireInterval = (height - (int)(20 * GUI.yScale)) / Math.Max(totalWireCount, 1); int wireInterval = (height - 20) / Math.Max(totalWireCount, 1);
int connectorIntervalLeft = (height - (int)(100 * GUI.yScale)) / Math.Max(panel.Connections.Count(c => c.IsOutput), 1); int connectorIntervalLeft = (height - 100) / Math.Max(panel.Connections.Count(c => c.IsOutput), 1);
int connectorIntervalRight = (height - (int)(100 * GUI.yScale)) / Math.Max(panel.Connections.Count(c => !c.IsOutput), 1); int connectorIntervalRight = (height - 100) / Math.Max(panel.Connections.Count(c => !c.IsOutput), 1);
foreach (Connection c in panel.Connections) foreach (Connection c in panel.Connections)
{ {
@@ -84,7 +84,7 @@ namespace Barotrauma.Items.Components
if (c.IsOutput) if (c.IsOutput)
{ {
c.Draw(spriteBatch, panel, rightPos, c.Draw(spriteBatch, panel, rightPos,
new Vector2(rightPos.X - GUI.SmallFont.MeasureString(c.DisplayName).X - 20 * GUI.xScale, rightPos.Y + 3 * GUI.yScale), new Vector2(rightPos.X - GUI.SmallFont.MeasureString(c.DisplayName).X - 20, rightPos.Y + 3),
rightWirePos, rightWirePos,
mouseInRect, equippedWire, mouseInRect, equippedWire,
wireInterval); wireInterval);
@@ -361,6 +361,9 @@
<Content Include="$(MSBuildThisFileDirectory)Content\Effects\waterbump.png"> <Content Include="$(MSBuildThisFileDirectory)Content\Effects\waterbump.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="$(MSBuildThisFileDirectory)Content\Fonts\Exo2-SemiBold.otf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="$(MSBuildThisFileDirectory)Content\Fonts\NotoSans\NotoSansCJKsc-Bold.otf"> <Content Include="$(MSBuildThisFileDirectory)Content\Fonts\NotoSans\NotoSansCJKsc-Bold.otf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@@ -146,7 +146,7 @@ namespace Barotrauma
{ {
bool isDifferentTarget = Vector2.DistanceSquared(target, currentTarget) > 1; bool isDifferentTarget = Vector2.DistanceSquared(target, currentTarget) > 1;
//find a new path if one hasn't been found yet or the target is different from the current target //find a new path if one hasn't been found yet or the target is different from the current target
if (currentPath == null || Vector2.DistanceSquared(target, currentTarget) > 1.0f || findPathTimer < -1.0f) if (currentPath == null || isDifferentTarget || findPathTimer < -1.0f)
{ {
IsPathDirty = true; IsPathDirty = true;
@@ -163,7 +163,11 @@ namespace Barotrauma
} }
} }
currentPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")"); var newPath = pathFinder.FindPath(pos, target, "(Character: " + character.Name + ")");
if (currentPath == null || isDifferentTarget || newPath.Cost < currentPath.Cost)
{
currentPath = newPath;
}
findPathTimer = Rand.Range(1.0f, 1.2f); findPathTimer = Rand.Range(1.0f, 1.2f);
@@ -175,7 +175,7 @@ namespace Barotrauma
{ {
if (character.CanInteractWith(item, out _, checkLinked: false)) { isCompleted = true; } if (character.CanInteractWith(item, out _, checkLinked: false)) { isCompleted = true; }
} }
else if (Target is Character targetCharacter) else if (Target is Character targetCharacter && !FollowControlledCharacter)
{ {
if (character.CanInteractWith(targetCharacter, CloseEnough)) { isCompleted = true; } if (character.CanInteractWith(targetCharacter, CloseEnough)) { isCompleted = true; }
} }
@@ -230,13 +230,6 @@ namespace Barotrauma
//if searching for a path inside the sub, make sure the waypoint is visible //if searching for a path inside the sub, make sure the waypoint is visible
if (insideSubmarine) if (insideSubmarine)
{ {
// Doesn't seem to work
//var body = Submarine.CheckVisibility(end, node.Waypoint.SimPosition);
//if (body != null && body.UserData is Structure)
//{
// continue;
//}
var body = Submarine.PickBody(end, node.Waypoint.SimPosition, null, var body = Submarine.PickBody(end, node.Waypoint.SimPosition, null,
Physics.CollisionWall | Physics.CollisionLevel | Physics.CollisionStairs ); Physics.CollisionWall | Physics.CollisionLevel | Physics.CollisionStairs );
@@ -415,6 +415,69 @@ namespace Barotrauma
} }
} }
#region Load DefaultConfig
private void LoadDefaultConfig(bool setLanguage = true)
{
XDocument doc = XMLExtensions.TryLoadXml(savePath);
if (setLanguage || string.IsNullOrEmpty(Language))
{
Language = doc.Root.GetAttributeString("language", "English");
}
}
public void CheckBindings(bool useDefaults)
{
foreach (InputType inputType in Enum.GetValues(typeof(InputType)))
{
var binding = keyMapping[(int)inputType];
if (binding == null)
{
switch (inputType)
{
case InputType.Deselect:
if (useDefaults)
{
binding = new KeyOrMouse(1);
}
else
{
// Legacy support
var selectKey = keyMapping[(int)InputType.Select];
if (selectKey != null && selectKey.Key != Keys.None)
{
binding = new KeyOrMouse(selectKey.Key);
}
}
break;
case InputType.Shoot:
if (useDefaults)
{
binding = new KeyOrMouse(0);
}
else
{
// Legacy support
var useKey = keyMapping[(int)InputType.Use];
if (useKey != null && useKey.MouseButton.HasValue)
{
binding = new KeyOrMouse(useKey.MouseButton.Value);
}
}
break;
default:
break;
}
if (binding == null)
{
DebugConsole.ThrowError("Key binding for the input type \"" + inputType + " not set!");
binding = new KeyOrMouse(Keys.D1);
}
keyMapping[(int)inputType] = binding;
}
}
}
#region Load DefaultConfig #region Load DefaultConfig
private void LoadDefaultConfig() private void LoadDefaultConfig()
{ {
@@ -432,6 +495,16 @@ namespace Barotrauma
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", ""); QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
MasterServerUrl = doc.Root.GetAttributeString("masterserverurl", "");
AutoCheckUpdates = doc.Root.GetAttributeBool("autocheckupdates", true);
WasGameUpdated = doc.Root.GetAttributeBool("wasgameupdated", false);
VerboseLogging = doc.Root.GetAttributeBool("verboselogging", false);
SaveDebugConsoleLogs = doc.Root.GetAttributeBool("savedebugconsolelogs", false);
QuickStartSubmarineName = doc.Root.GetAttributeString("quickstartsub", "");
if (doc == null) if (doc == null)
{ {
GraphicsWidth = 1024; GraphicsWidth = 1024;
@@ -817,58 +890,6 @@ namespace Barotrauma
{ {
VoiceSetting = voiceSetting; VoiceSetting = voiceSetting;
} }
foreach (ContentFile file in contentPackage.Files)
{
ToolBox.IsProperFilenameCase(file.Path);
}
}
if (!SelectedContentPackages.Any())
{
var availablePackage = ContentPackage.List.FirstOrDefault(cp => cp.IsCompatible() && cp.CorePackage);
if (availablePackage != null)
{
SelectedContentPackages.Add(availablePackage);
}
}
//save to get rid of the invalid selected packages in the config file
if (missingPackagePaths.Count > 0 || incompatiblePackages.Count > 0) { SaveNewPlayerConfig(); }
}
#endregion
#region Save DefaultConfig
private void SaveNewDefaultConfig()
{
XDocument doc = new XDocument();
if (doc.Root == null)
{
doc.Add(new XElement("config"));
}
doc.Root.Add(
new XAttribute("language", TextManager.Language),
new XAttribute("masterserverurl", MasterServerUrl),
new XAttribute("autocheckupdates", AutoCheckUpdates),
new XAttribute("musicvolume", musicVolume),
new XAttribute("soundvolume", soundVolume),
new XAttribute("voicechatvolume", voiceChatVolume),
new XAttribute("verboselogging", VerboseLogging),
new XAttribute("savedebugconsolelogs", SaveDebugConsoleLogs),
new XAttribute("enablesplashscreen", EnableSplashScreen),
new XAttribute("usesteammatchmaking", useSteamMatchmaking),
new XAttribute("quickstartsub", QuickStartSubmarineName),
new XAttribute("requiresteamauthentication", requireSteamAuthentication),
new XAttribute("aimassistamount", aimAssistAmount));
if (!ShowUserStatisticsPrompt)
{
doc.Root.Add(new XAttribute("senduserstatistics", sendUserStatistics));
}
if (WasGameUpdated)
{
doc.Root.Add(new XAttribute("wasgameupdated", true));
} }
useSteamMatchmaking = doc.Root.GetAttributeBool("usesteammatchmaking", useSteamMatchmaking); useSteamMatchmaking = doc.Root.GetAttributeBool("usesteammatchmaking", useSteamMatchmaking);
@@ -935,55 +956,6 @@ namespace Barotrauma
selectedContentPackagePaths = new HashSet<string>(); selectedContentPackagePaths = new HashSet<string>();
foreach (XElement subElement in doc.Root.Elements())
{
switch (subElement.Name.ToString().ToLowerInvariant())
{
case "keymapping":
LoadKeyBinds(subElement);
break;
case "gameplay":
jobPreferences = new List<string>();
foreach (XElement ele in subElement.Element("jobpreferences").Elements("job"))
{
string jobIdentifier = ele.GetAttributeString("identifier", "");
if (string.IsNullOrEmpty(jobIdentifier)) continue;
jobPreferences.Add(jobIdentifier);
}
break;
case "player":
defaultPlayerName = subElement.GetAttributeString("name", defaultPlayerName);
CharacterHeadIndex = subElement.GetAttributeInt("headindex", CharacterHeadIndex);
if (Enum.TryParse(subElement.GetAttributeString("gender", "none"), true, out Gender g))
{
CharacterGender = g;
}
if (Enum.TryParse(subElement.GetAttributeString("race", "white"), true, out Race r))
{
CharacterRace = r;
}
else
{
CharacterRace = Race.White;
}
CharacterHairIndex = subElement.GetAttributeInt("hairindex", CharacterHairIndex);
CharacterBeardIndex = subElement.GetAttributeInt("beardindex", CharacterBeardIndex);
CharacterMoustacheIndex = subElement.GetAttributeInt("moustacheindex", CharacterMoustacheIndex);
CharacterFaceAttachmentIndex = subElement.GetAttributeInt("faceattachmentindex", CharacterFaceAttachmentIndex);
break;
case "tutorials":
foreach (XElement tutorialElement in subElement.Elements())
{
CompletedTutorialNames.Add(tutorialElement.GetAttributeString("name", ""));
}
break;
}
}
UnsavedSettings = false;
selectedContentPackagePaths = new HashSet<string>();
foreach (XElement subElement in doc.Root.Elements()) foreach (XElement subElement in doc.Root.Elements())
{ {
gSettings = new XElement("graphicssettings"); gSettings = new XElement("graphicssettings");
@@ -602,7 +602,7 @@ namespace Barotrauma
if (ladderItem != null) Ladders = ladderItem.GetComponent<Ladder>(); if (ladderItem != null) Ladders = ladderItem.GetComponent<Ladder>();
} }
Body pickedBody = Submarine.PickBody(SimPosition, SimPosition - Vector2.UnitY * 2.0f, null, Physics.CollisionWall | Physics.CollisionStairs); Body pickedBody = Submarine.PickBody(SimPosition, SimPosition - Vector2.UnitY * 2.0f, null, Physics.CollisionStairs);
if (pickedBody != null && pickedBody.UserData is Structure) if (pickedBody != null && pickedBody.UserData is Structure)
{ {
Structure structure = (Structure)pickedBody.UserData; Structure structure = (Structure)pickedBody.UserData;
Binary file not shown.
Binary file not shown.
+15
View File
@@ -1,3 +1,18 @@
---------------------------------------------------------------------------------------------------------
v0.9.0.2
---------------------------------------------------------------------------------------------------------
- Fixed a bug that caused frequent desync kicks when playing a multiplayer monster mission.
- Fixed an index out of range error in DoctorTutorial if proceeding too fast to the submarine.
- Fixes to missing translations and UI layout problems when using languages other than English.
- More readable font and a fix to some texts appearing slightly "clipped".
- Additions to the credits.
- Fixed bots loading only half of the target items in the contain item objective.
- Minor tweaks to subs and shuttles.
- Fixed find safety AI objective not working properly.
- Miscellaneous crew AI fixes and improvements.
- Fixed incorrect reward amount in the "Chemical shipment" description.
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------
v0.9.0.1 v0.9.0.1
--------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------