Unstable 0.17.0.0

This commit is contained in:
Markus Isberg
2022-02-26 02:43:01 +09:00
parent a83f375681
commit 3974067915
913 changed files with 32472 additions and 32364 deletions
@@ -0,0 +1,25 @@
#nullable enable
using System.Collections.Immutable;
using System.Linq;
namespace Barotrauma
{
public class FormattedLString : LocalizedString
{
private readonly LocalizedString str;
private readonly ImmutableArray<LocalizedString> subStrs;
public FormattedLString(LocalizedString str, params LocalizedString[] subStrs)
{
this.str = str;
this.subStrs = subStrs.ToImmutableArray();
}
public override bool Loaded => str.Loaded && subStrs.All(s => s.Loaded);
public override void RetrieveValue()
{
//TODO: possibly broken!
cachedValue = string.Format(str.Value, subStrs.Select(s => s.Value as object).ToArray());
UpdateLanguage();
}
}
}