Exemplo n.º 1
0
        public static void AppendDescribe(this TextBuilder builder, Symbol symbol, string str, Color color, DialogFormatting dialog = null)
        {
            TextFormatting formatting = new TextFormatting()
            {
                Bold      = true,
                GetParams = (pos) => new DialogParams()
                {
                    Color  = color,
                    Border = Color.Black,
                    Scale  = Vector2.One,
                }
            };

            builder.StartNoBreak();
            builder.AppendText(str, formatting, dialog);
            builder.AppendSymbol(symbol, formatting, dialog);
            builder.EndNoBreak();
        }
Exemplo n.º 2
0
        private void Init()
        {
            var cursor = SpriteLoader.Instance.AddSprite("content/cursor");

            Text = new TextBuilder(Width, float.MaxValue);
            int index = 0;

            foreach (var action in Actions)
            {
                Text.StartTableRow(Width, new ColumnConfigs(new IColumnWidth[] {
                    new ColumnFixedWidth(16, true),
                    new ColumnFixedWidth(0, false),
                    new ColumnFixedWidth(16, true),
                })
                {
                    Padding = 0
                });
                Text.StartTableCell();
                Text.AppendElement(new TextElementCursor(cursor, 16, 16, () => IsSelected(action)));
                Text.EndTableCell();
                Text.StartTableCell();
                action.Text(Text);
                Text.EndTableCell();
                Text.StartTableCell();

                Text.EndTableCell();
                var row           = Text.EndTableRow();
                var selectionArea = new MenuAreaText(Text, 0, null);
                selectionArea.Add(row);
                SelectionAreas.Add(index, selectionArea);
                index++;
            }
            Text.EndContainer();
            Text.Finish();
            Dirty = false;
        }
Exemplo n.º 3
0
 public void AddTooltip(TextBuilder text)
 {
     Provider(text);
 }
Exemplo n.º 4
0
 public void AddTooltip(TextBuilder tooltip)
 {
     //NOOP
 }
Exemplo n.º 5
0
 public void GenerateTooltip(TextBuilder text)
 {
     //NOOP
 }
Exemplo n.º 6
0
 public void GenerateTooltip(TextBuilder text)
 {
     TooltipProvider?.AddTooltip(text);
 }
Exemplo n.º 7
0
 public MenuAreaText(TextBuilder text, double priority, ITooltipProvider tooltipProvider)
 {
     Text            = text;
     Priority        = priority;
     TooltipProvider = tooltipProvider;
 }
Exemplo n.º 8
0
 public static void AppendSymbol(this TextBuilder builder, Symbol symbol, TextFormatting format = null, DialogFormatting dialogFormat = null)
 {
     builder.AppendSymbol(symbol, format, dialogFormat);
 }
Exemplo n.º 9
0
 public static void AppendText(this TextBuilder builder, string str, TextFormatting format = null, DialogFormatting dialogFormat = null)
 {
     builder.AppendText(str, format, dialogFormat);
 }
Exemplo n.º 10
0
 public static void AppendDamage(this TextBuilder builder, Symbol symbol, int damage, Color color, DialogFormatting dialog = null)
 {
     AppendDescribe(builder, symbol, $"{damage:+0;-#}", color, dialog);
 }
Exemplo n.º 11
0
 public static void AppendGain(this TextBuilder builder, Symbol symbol, int amount, Color color, DialogFormatting dialog = null)
 {
     AppendDescribe(builder, symbol, amount.ToString("+#;-#;0"), color, dialog);
 }
Exemplo n.º 12
0
 public static void AppendStored(this TextBuilder builder, Symbol symbol, int amount, Color color, DialogFormatting dialog = null)
 {
     AppendStatus(builder, symbol, amount.ToString(), color, dialog);
 }
Exemplo n.º 13
0
 public static void AppendAsKey(this TextBuilder builder, string str, DialogFormatting dialog = null)
 {
     AppendAsKey(builder, str, Color.White, dialog);
 }