Table of Contents

Class TooltipBuilder

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Builder pattern class for constructing formatted tooltip strings. Supports priority-based line ordering, rich text colors, bold, and font sizes. Uses ZString for zero-allocation string building.

public class TooltipBuilder : IDisposable
Inheritance
TooltipBuilder
Implements
Inherited Members

Methods

AddLine(string, int, string, bool, string)

Adds a formatted line to the tooltip.

public TooltipBuilder AddLine(string text, int priority = 100, string color = null, bool bold = false, string fontSize = null)

Parameters

text string

The text content. May contain rich text tags.

priority int

Sort priority (lower = earlier). Default is 100.

color string

Color string: hex with # (e.g., "#f5ad6eFF") or named (e.g., "white"). Null for no color.

bold bool

Whether to render in bold.

fontSize string

Font size string (e.g., "120%", "14"). Null for default size.

Returns

TooltipBuilder

This builder for fluent chaining.

AddSeparator(int)

Adds a separator line to the tooltip.

public TooltipBuilder AddSeparator(int priority = 50)

Parameters

priority int

Sort priority for the separator.

Returns

TooltipBuilder

This builder for fluent chaining.

Build()

Sorts all lines by priority and builds the final formatted rich text string.

public string Build()

Returns

string

The complete tooltip string with rich text formatting.

Clear()

Clears all lines from the builder for reuse.

public void Clear()

Dispose()

Disposes the builder by clearing all lines.

public void Dispose()