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(); }
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; }
public void AddTooltip(TextBuilder text) { Provider(text); }
public void AddTooltip(TextBuilder tooltip) { //NOOP }
public void GenerateTooltip(TextBuilder text) { //NOOP }
public void GenerateTooltip(TextBuilder text) { TooltipProvider?.AddTooltip(text); }
public MenuAreaText(TextBuilder text, double priority, ITooltipProvider tooltipProvider) { Text = text; Priority = priority; TooltipProvider = tooltipProvider; }
public static void AppendSymbol(this TextBuilder builder, Symbol symbol, TextFormatting format = null, DialogFormatting dialogFormat = null) { builder.AppendSymbol(symbol, format, dialogFormat); }
public static void AppendText(this TextBuilder builder, string str, TextFormatting format = null, DialogFormatting dialogFormat = null) { builder.AppendText(str, format, dialogFormat); }
public static void AppendDamage(this TextBuilder builder, Symbol symbol, int damage, Color color, DialogFormatting dialog = null) { AppendDescribe(builder, symbol, $"{damage:+0;-#}", color, dialog); }
public static void AppendGain(this TextBuilder builder, Symbol symbol, int amount, Color color, DialogFormatting dialog = null) { AppendDescribe(builder, symbol, amount.ToString("+#;-#;0"), color, dialog); }
public static void AppendStored(this TextBuilder builder, Symbol symbol, int amount, Color color, DialogFormatting dialog = null) { AppendStatus(builder, symbol, amount.ToString(), color, dialog); }
public static void AppendAsKey(this TextBuilder builder, string str, DialogFormatting dialog = null) { AppendAsKey(builder, str, Color.White, dialog); }