예제 #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();
        }
예제 #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;
        }
예제 #3
0
 public void AddTooltip(TextBuilder text)
 {
     Provider(text);
 }
예제 #4
0
 public void AddTooltip(TextBuilder tooltip)
 {
     //NOOP
 }
예제 #5
0
 public void GenerateTooltip(TextBuilder text)
 {
     //NOOP
 }
예제 #6
0
 public void GenerateTooltip(TextBuilder text)
 {
     TooltipProvider?.AddTooltip(text);
 }
예제 #7
0
 public MenuAreaText(TextBuilder text, double priority, ITooltipProvider tooltipProvider)
 {
     Text            = text;
     Priority        = priority;
     TooltipProvider = tooltipProvider;
 }
예제 #8
0
 public static void AppendSymbol(this TextBuilder builder, Symbol symbol, TextFormatting format = null, DialogFormatting dialogFormat = null)
 {
     builder.AppendSymbol(symbol, format, dialogFormat);
 }
예제 #9
0
 public static void AppendText(this TextBuilder builder, string str, TextFormatting format = null, DialogFormatting dialogFormat = null)
 {
     builder.AppendText(str, format, dialogFormat);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #13
0
 public static void AppendAsKey(this TextBuilder builder, string str, DialogFormatting dialog = null)
 {
     AppendAsKey(builder, str, Color.White, dialog);
 }