(add7a8fe6) Fixed: Error in localization when importing npc conversations. Added: proofread englishvanilla

This commit is contained in:
Joonas Rikkonen
2019-04-15 12:09:22 +03:00
parent 6943ff8586
commit 8a42bb3bbd
5 changed files with 36 additions and 21 deletions
@@ -151,6 +151,7 @@ namespace Barotrauma
for (int i = traitStart + NPCPersonalityTrait.List.Count; i < csvContent.Length; i++) // Conversations for (int i = traitStart + NPCPersonalityTrait.List.Count; i < csvContent.Length; i++) // Conversations
{ {
string[] presplit = csvContent[i].Split(','); // Handling speaker index fetching, somehow doesn't work with the regex
string[] split = SplitCSV(csvContent[i]); string[] split = SplitCSV(csvContent[i]);
int emptyFields = 0; int emptyFields = 0;
@@ -172,20 +173,20 @@ namespace Barotrauma
continue; continue;
} }
string speaker = split[1]; string speaker = presplit[1];
int depthIndex = int.Parse(split[2]); int depthIndex = int.Parse(presplit[2]);
// 3 = original line // 3 = original line
string line = split[4].Replace("\"", ""); string line = split[4].Replace("\"", "");
string flags = split[5].Replace("\"", ""); string flags = split[5].Replace("\"", "");
string allowedJobs = split[6].Replace("\"", ""); string allowedJobs = split[6].Replace("\"", "");
string speakerTags = split[7].Replace("\"", ""); string speakerTags = split[7].Replace("\"", "");
string minIntensity = split[8].Replace("\"", ""); string minIntensity = split[8].Replace("\"", "").Replace(",", ".");
string maxIntensity = split[9].Replace("\"", ""); string maxIntensity = split[9].Replace("\"", "").Replace(",", ".");
string element = string element =
$"{GetIndenting(depthIndex)}" + $"{GetIndenting(depthIndex)}" +
$"<Conversation line=\"{line}\" " + $"<Conversation line=\"{line}\" " +
$"{GetVariable("speaker" ,speaker)}" + $"{GetVariable("speaker", speaker)}" +
$"{GetVariable("flags", flags)}" + $"{GetVariable("flags", flags)}" +
$"{GetVariable("allowedjobs", allowedJobs)}" + $"{GetVariable("allowedjobs", allowedJobs)}" +
$"{GetVariable("speakertags", speakerTags)}" + $"{GetVariable("speakertags", speakerTags)}" +
@@ -388,18 +388,6 @@ namespace Barotrauma
buttonPressCooldown = ButtonPressInterval; buttonPressCooldown = ButtonPressInterval;
break; break;
} }
else
{
if (!door.HasRequiredItems(character, false) && shouldBeOpen)
{
currentPath.Unreachable = true;
return;
}
door.Item.TryInteract(character, false, true, true);
buttonPressCooldown = ButtonPressInterval;
break;
}
} }
} }
} }
@@ -426,12 +414,20 @@ namespace Barotrauma
if (!nextNode.Waypoint.ConnectedDoor.HasRequiredItems(character, false)) { return null; } if (!nextNode.Waypoint.ConnectedDoor.HasRequiredItems(character, false)) { return null; }
} }
if (!canBreakDoors)
{
//door closed and the character can't open doors -> node can't be traversed
if (!canOpenDoors || character.LockHands) return null;
var doorButtons = nextNode.Waypoint.ConnectedDoor.Item.GetConnectedComponents<Controller>();
if (!doorButtons.Any()) return null;
foreach (Controller button in doorButtons) foreach (Controller button in doorButtons)
{ {
if (Math.Sign(button.Item.Position.X - nextNode.Waypoint.Position.X) != if (Math.Sign(button.Item.Position.X - nextNode.Waypoint.Position.X) !=
Math.Sign(node.Position.X - nextNode.Position.X)) { continue; } Math.Sign(node.Position.X - nextNode.Position.X)) continue;
if (!button.HasRequiredItems(character, false)) { return null; } if (!button.HasRequiredItems(character, false)) return null;
} }
} }
} }
@@ -190,7 +190,7 @@ namespace Barotrauma.Items.Components
get { return name; } get { return name; }
} }
[Editable, Serialize("", true, translationTextTag: "ItemMsg")] [Editable, Serialize("", true)]
public string Msg public string Msg
{ {
get; get;
@@ -261,6 +261,25 @@ namespace Barotrauma
} }
} }
public string DisplayName
{
get;
private set;
}
private string roomName;
[Editable, Serialize("", true, translationTextTag: "RoomName.")]
public string RoomName
{
get { return roomName; }
set
{
if (roomName == value) { return; }
roomName = value;
DisplayName = TextManager.Get(roomName, returnNull: true) ?? roomName;
}
}
public override Rectangle Rect public override Rectangle Rect
{ {
get get
@@ -37,7 +37,6 @@ namespace Barotrauma
text = text.Replace("&amp;", "&"); text = text.Replace("&amp;", "&");
text = text.Replace("&lt;", "<"); text = text.Replace("&lt;", "<");
text = text.Replace("&gt;", ">"); text = text.Replace("&gt;", ">");
text = text.Replace("&quot;", "\"");
infoList.Add(text); infoList.Add(text);
} }
} }