Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Widgets

Widgets are the visual building blocks of Two-Face. Each widget type displays a specific kind of game information.

Overview

Two-Face provides these widget types:

WidgetTypePurpose
Text WindowtextScrollable game text
Tabbed Texttabbed_textMultiple streams in tabs
Command Inputcommand_inputCommand entry field
Progress BarprogressHealth, mana, etc.
CountdowncountdownRT, cast time
CompasscompassAvailable exits
HandhandItems in hands
IndicatorindicatorStatus conditions
Injury Dollinjury_dollBody injuries
Active Effectsactive_effectsBuffs/debuffs
Room WindowroomRoom description
InventoryinventoryItem list
SpellsspellsKnown spells
DashboarddashboardComposite status
PerformanceperformanceDebug metrics

Common Properties

All widgets share these properties in layout.toml:

Identity

[[windows]]
name = "my_widget"     # Unique identifier (required)
type = "text"          # Widget type (required)

Position

# Grid-based positioning
row = 0                # Row (0 = top)
col = 0                # Column (0 = left)

# OR pixel positioning
x = 100                # X coordinate
y = 50                 # Y coordinate

Size

# Fixed size
width = 40             # Columns wide
height = 10            # Rows tall

# OR percentage
width = "50%"          # Half of layout width
height = "100%"        # Full layout height

Borders

show_border = true           # Display border
border_style = "rounded"     # Style: plain, rounded, double, thick
border_sides = "all"         # Which sides: all, none, top, bottom, etc.
border_color = "#5588AA"     # Border color

Title

show_title = true            # Show title bar
title = "Custom Title"       # Override default title

Colors

background_color = "#000000" # Background
text_color = "#CCCCCC"       # Default text
transparent_background = false  # See-through background

Widget Categories

Text Displays

Widgets that show game text:

  • Text Window - Main game output, speech, thoughts
  • Tabbed Text - Multiple streams in one widget
  • Room Window - Room name, description, exits

Status Displays

Widgets that show character status:

  • Progress Bar - Health, mana, stamina, spirit
  • Countdown - Roundtime, cast time
  • Hand - Left hand, right hand, spell
  • Indicator - Stunned, hidden, webbed, etc.
  • Injury Doll - Body part injuries
  • Active Effects - Spells, buffs, cooldowns

Widgets for game navigation:

  • Compass - Available exits with directions

Lists

Widgets that display lists:

  • Inventory - Items carried
  • Spells - Known spells

Composite

Widgets combining multiple elements:

  • Dashboard - Configurable status panel

Debug

Developer/debugging widgets:

  • Performance - Frame rate, memory, network stats

Stream Mapping

Text-based widgets receive data from game streams:

StreamContentDefault Widget
mainPrimary game outputMain text window
speechPlayer dialogueSpeech tab/window
thoughtsESP/telepathyThoughts tab/window
combatCombat messagesCombat tab/window
deathDeath messagesDeath window
logonsLogin/logoutArrivals window
familiarFamiliar messagesFamiliar window
groupGroup informationGroup window
roomRoom dataRoom window
invInventory dataInventory window

Configure stream mapping in layout:

[[windows]]
name = "my_window"
type = "text"
stream = "speech"    # Display speech stream

Creating Custom Layouts

Combine widgets to create your ideal interface:

[layout]
columns = 120
rows = 40

# Main game text (left side)
[[windows]]
name = "main"
type = "text"
row = 0
col = 0
width = 80
height = 35

# Channels on right
[[windows]]
name = "channels"
type = "tabbed_text"
tabs = ["speech", "thoughts", "combat"]
row = 0
col = 80
width = 40
height = 20

# Status area
[[windows]]
name = "health"
type = "progress"
stat = "health"
row = 20
col = 80
width = 40
height = 1

# Command input at bottom
[[windows]]
name = "input"
type = "command_input"
row = 38
col = 0
width = 120
height = 2

Widget Interaction

Focus

  • Click a widget to focus it
  • Use Ctrl+Tab to cycle focus
  • Focused widget has highlighted border

Scrolling

  • Page Up / Page Down - Scroll focused text widget
  • Mouse wheel - Scroll widget under cursor
  • Home / End - Jump to top/bottom

Selection

  • Click and drag to select text
  • Ctrl+C to copy selection
  • Double-click to select word

If links = true in config:

  • Click game objects to interact
  • Right-click for context menu

Performance Considerations

Buffer Sizes

Text widgets buffer a limited number of lines:

[[windows]]
name = "main"
type = "text"
buffer_size = 2000    # Max lines (default)

Larger buffers use more memory. Reduce for secondary windows.

Widget Count

Each widget has rendering overhead. For performance:

  • Use tabbed windows instead of multiple text windows
  • Disable unused widgets
  • Reduce buffer sizes on secondary windows

See Also