Unstable v0.1300.0.2

This commit is contained in:
Markus Isberg
2021-03-12 15:57:04 +02:00
parent 0f6de8ada9
commit 874616027b
145 changed files with 1897 additions and 939 deletions
@@ -4,6 +4,25 @@ namespace Barotrauma
{
partial class AbandonedOutpostMission : Mission
{
public override int State
{
get { return base.State; }
protected set
{
if (state != value)
{
base.State = value;
if (state == HostagesKilledState && !string.IsNullOrEmpty(hostagesKilledMessage))
{
new GUIMessageBox(string.Empty, hostagesKilledMessage, buttons: new string[0], type: GUIMessageBox.Type.InGame, icon: Prefab.Icon, parseRichText: true)
{
IconColor = Prefab.IconColor
};
}
}
}
}
public override void ClientReadInitial(IReadMessage msg)
{
byte characterCount = msg.ReadByte();
@@ -1,10 +1,52 @@
using Barotrauma.Networking;
using System;
using System.Collections.Generic;
using System.Globalization;
namespace Barotrauma
{
abstract partial class Mission
{
public string GetMissionRewardText()
{
string rewardText = TextManager.GetWithVariable("currencyformat", "[credits]", string.Format(CultureInfo.InvariantCulture, "{0:N0}", Reward));
return TextManager.GetWithVariable("missionreward", "[reward]", $"‖color:gui.orange‖{rewardText}‖end‖");
}
public string GetReputationRewardText(Location currLocation)
{
List<string> reputationRewardTexts = new List<string>();
foreach (var reputationReward in ReputationRewards)
{
string name = "";
if (reputationReward.Key.Equals("location", StringComparison.OrdinalIgnoreCase))
{
name = $"‖color:gui.orange‖{currLocation.Name}‖end‖";
}
else
{
var faction = FactionPrefab.Prefabs.Find(f => f.Identifier.Equals(reputationReward.Key, StringComparison.OrdinalIgnoreCase));
if (faction != null)
{
name = $"‖color:{XMLExtensions.ColorToString(faction.IconColor)}‖{faction.Name}‖end‖";
}
else
{
name = TextManager.Get(reputationReward.Key);
}
}
float normalizedValue = MathUtils.InverseLerp(-100.0f, 100.0f, reputationReward.Value);
string formattedValue = ((int)reputationReward.Value).ToString("+#;-#;0"); //force plus sign for positive numbers
string rewardText = TextManager.GetWithVariables(
"reputationformat",
new string[] { "[reputationname]", "[reputationvalue]" },
new string[] { name, $"‖color:{XMLExtensions.ColorToString(Reputation.GetReputationColor(normalizedValue))}‖{formattedValue}‖end‖" });
reputationRewardTexts.Add(rewardText);
}
return TextManager.AddPunctuation(':', TextManager.Get("reputation"), string.Join(", ", reputationRewardTexts));
}
partial void ShowMessageProjSpecific(int missionState)
{
int messageIndex = missionState - 1;
@@ -23,11 +65,16 @@ namespace Barotrauma
{
yield return new WaitForSeconds(1.0f);
}
CreateMessageBox(header, message);
yield return CoroutineStatus.Success;
}
protected void CreateMessageBox(string header, string message)
{
new GUIMessageBox(header, message, buttons: new string[0], type: GUIMessageBox.Type.InGame, icon: Prefab.Icon, parseRichText: true)
{
IconColor = Prefab.IconColor
};
yield return CoroutineStatus.Success;
}
public void ClientRead(IReadMessage msg)