(7163b300e) Added: Way for capitalizing / lowercasing replaced variables depending on the position in the sentence & some implementations

This commit is contained in:
Joonas Rikkonen
2019-06-04 15:32:59 +03:00
parent 9e345fb7c6
commit a3e67dd40a
21 changed files with 166 additions and 67 deletions
@@ -43,7 +43,7 @@ namespace Barotrauma
{
return text;
}
text = TextManager.Get(textTag).Replace("[key]", keyBind);
text = TextManager.GetWithVariable(textTag, "[key]", keyBind);
cachedHudTexts.Add(textTag + keyBind, text);
return text;
}
@@ -119,11 +119,9 @@ namespace Barotrauma
if ((int)newLevel > (int)prevLevel)
{
GUI.AddMessage(
TextManager.Get("SkillIncreased")
.Replace("[name]", Name)
.Replace("[skillname]", TextManager.Get("SkillName." + skillIdentifier))
.Replace("[newlevel]", ((int)newLevel).ToString()),
Color.Green);
TextManager.GetWithVariables("SkillIncreased", new string[3] { "[name]", "[skillname]", "[newlevel]" },
new string[3] { Name, TextManager.Get("SkillName." + skillIdentifier), ((int)newLevel).ToString() },
new bool[3] { false, true, false }), Color.Green);
}
}
@@ -26,7 +26,7 @@ namespace Barotrauma
}
else if (state != InfectionState.Active && Character.Controlled == character)
{
GUI.AddMessage(TextManager.Get("HuskActivate").Replace("[Attack]", GameMain.Config.KeyBind(InputType.Attack).ToString()),
GUI.AddMessage(TextManager.GetWithVariable("HuskActivate", "[Attack]", GameMain.Config.KeyBind(InputType.Attack).ToString()),
Color.Red);
}
}
@@ -113,8 +113,8 @@ namespace Barotrauma
if (GameMain.Client != null && interactor == Character.Controlled)
{
var msgBox = new GUIMessageBox("", TextManager.Get("CampaignEnterOutpostPrompt")
.Replace("[locationname]", Submarine.MainSub.AtStartPosition ? Map.CurrentLocation.Name : Map.SelectedLocation.Name),
var msgBox = new GUIMessageBox("", TextManager.GetWithVariable("CampaignEnterOutpostPrompt", "[locationname]",
Submarine.MainSub.AtStartPosition ? Map.CurrentLocation.Name : Map.SelectedLocation.Name),
new string[] { TextManager.Get("Yes"), TextManager.Get("No") })
{
UserData = "watchmanprompt"
@@ -230,7 +230,7 @@ namespace Barotrauma.Tutorials
} while (!Submarine.MainSub.AtEndPosition || Submarine.MainSub.DockedTo.Count == 0);
RemoveCompletedObjective(segments[6]);
yield return new WaitForSeconds(3f, false);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.Get("Captain.Radio.Complete").Replace("[OUTPOSTNAME]", GameMain.GameSession.EndLocation.Name), ChatMessageType.Radio, null);
GameMain.GameSession?.CrewManager.AddSinglePlayerChatMessage(radioSpeakerName, TextManager.GetWithVariable("Captain.Radio.Complete", "[OUTPOSTNAME]", GameMain.GameSession.EndLocation.Name), ChatMessageType.Radio, null);
SetHighlight(captain_navConsole.Item, false);
SetHighlight(captain_sonar.Item, false);
SetHighlight(captain_statusMonitor, false);