Exemplo n.º 1
0
 DynamicText BuildHoverText(SystemTextId template, params object[] arguments) =>
 new DynamicText(() =>
 {
     var assets        = Resolve <IAssetManager>();
     var settings      = Resolve <ISettings>();
     var textFormatter = new TextFormatter(assets, settings.Gameplay.Language);
     return(textFormatter.Format(template, arguments).Item1);
 });
Exemplo n.º 2
0
        void RaiseStatusMessage(SystemTextId textId)
        {
            var assets   = Resolve <IAssetManager>();
            var settings = Resolve <ISettings>();
            var text     = assets.LoadString(textId, settings.Gameplay.Language);

            Raise(new DescriptionTextEvent(text));
        }
Exemplo n.º 3
0
        IEnumerable <TextBlock> BuildHoverText(SystemTextId id, Func <ICharacterSheet, int> getValue, Func <ICharacterSheet, int> getMax)
        {
            var party  = Resolve <IParty>();
            var tf     = Resolve <ITextFormatter>();
            var member = party[_activeCharacter]?.Apparent;

            if (member == null)
            {
                yield break;
            }

            var block = tf.Format(id).Get().First();

            block.Text += $" {getValue(member)} / {getMax(member)}";
            yield return(block);
        }
Exemplo n.º 4
0
        IEnumerable <TextBlock> BuildHoverText(SystemTextId id, Func <ICharacterSheet, int> getValue, Func <ICharacterSheet, int> getMax)
        {
            var assets    = Resolve <IAssetManager>();
            var party     = Resolve <IParty>();
            var settings  = Resolve <ISettings>();
            var formatter = new TextFormatter(assets, settings.Gameplay.Language);
            var member    = party[_activeCharacter]?.Apparent;

            if (member == null)
            {
                yield break;
            }

            var block = formatter.Format(assets.LoadString(id, settings.Gameplay.Language)).Item1.First();

            block.Text += $" {getValue(member)} / {getMax(member)}";
            yield return(block);
        }
Exemplo n.º 5
0
 static StringId S(SystemTextId id) => new StringId(AssetType.SystemText, 0, (int)id);