(1587318e9) Don't show the combat mission success text if it hasn't been translated
This commit is contained in:
@@ -61,25 +61,27 @@ namespace Barotrauma
|
|||||||
}
|
}
|
||||||
|
|
||||||
//don't show the mission info if the mission was not completed and there's no localized "mission failed" text available
|
//don't show the mission info if the mission was not completed and there's no localized "mission failed" text available
|
||||||
if (GameMain.GameSession.Mission != null &&
|
if (GameMain.GameSession.Mission != null)
|
||||||
(GameMain.GameSession.Mission.Completed || !string.IsNullOrEmpty(GameMain.GameSession.Mission.FailureMessage)))
|
|
||||||
{
|
{
|
||||||
//spacing
|
string message = GameMain.GameSession.Mission.Completed ? GameMain.GameSession.Mission.SuccessMessage : GameMain.GameSession.Mission.FailureMessage;
|
||||||
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.1f), infoTextBox.Content.RectTransform), style: null);
|
if (!string.IsNullOrEmpty(message))
|
||||||
|
|
||||||
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoTextBox.Content.RectTransform),
|
|
||||||
TextManager.AddPunctuation(':', TextManager.Get("Mission"), GameMain.GameSession.Mission.Name),
|
|
||||||
font: GUI.LargeFont);
|
|
||||||
|
|
||||||
var missionInfo = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoTextBox.Content.RectTransform),
|
|
||||||
GameMain.GameSession.Mission.Completed ? GameMain.GameSession.Mission.SuccessMessage : GameMain.GameSession.Mission.FailureMessage,
|
|
||||||
wrap: true);
|
|
||||||
|
|
||||||
if (GameMain.GameSession.Mission.Completed && singleplayer)
|
|
||||||
{
|
{
|
||||||
var missionReward = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoTextBox.Content.RectTransform),
|
//spacing
|
||||||
TextManager.Get("MissionReward").Replace("[reward]", GameMain.GameSession.Mission.Reward.ToString()));
|
new GUIFrame(new RectTransform(new Vector2(1.0f, 0.1f), infoTextBox.Content.RectTransform), style: null);
|
||||||
}
|
|
||||||
|
new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoTextBox.Content.RectTransform),
|
||||||
|
TextManager.AddPunctuation(':', TextManager.Get("Mission"), GameMain.GameSession.Mission.Name),
|
||||||
|
font: GUI.LargeFont);
|
||||||
|
|
||||||
|
var missionInfo = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoTextBox.Content.RectTransform),
|
||||||
|
message, wrap: true);
|
||||||
|
|
||||||
|
if (GameMain.GameSession.Mission.Completed && singleplayer)
|
||||||
|
{
|
||||||
|
var missionReward = new GUITextBlock(new RectTransform(new Vector2(1.0f, 0.0f), infoTextBox.Content.RectTransform),
|
||||||
|
TextManager.Get("MissionReward").Replace("[reward]", GameMain.GameSession.Mission.Reward.ToString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (GUIComponent child in infoTextBox.Content.Children)
|
foreach (GUIComponent child in infoTextBox.Content.Children)
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (Winner == Character.TeamType.None) { return ""; }
|
if (Winner == Character.TeamType.None || string.IsNullOrEmpty(base.SuccessMessage)) { return ""; }
|
||||||
|
|
||||||
|
//disable success message for now if it hasn't been translated
|
||||||
|
if (!TextManager.ContainsTag("MissionSuccess." + Prefab.Identifier)) { return ""; }
|
||||||
|
|
||||||
var loser = Winner == Character.TeamType.Team1 ?
|
var loser = Winner == Character.TeamType.Team1 ?
|
||||||
Character.TeamType.Team2 :
|
Character.TeamType.Team2 :
|
||||||
|
|||||||
Reference in New Issue
Block a user