Skip to content

Comments

Apply hex faction colors to chat/tab formatting using styled Components#163

Merged
plan3t merged 1 commit intomainfrom
codex/fix-faction-color-function-acct8z
Feb 17, 2026
Merged

Apply hex faction colors to chat/tab formatting using styled Components#163
plan3t merged 1 commit intomainfrom
codex/fix-faction-color-function-acct8z

Conversation

@plan3t
Copy link
Owner

@plan3t plan3t commented Feb 17, 2026

Motivation

  • Faction color updates using hex values were not reliably reflected in chat and tab outputs because legacy section-sign formatting codes were embedded in plain strings instead of applying component styles.
  • The goal is to make faction color changes immediately take effect in chat/tab by applying the hex RGB as a real TextColor on Component output and preserve configurable format tokens like {faction_color} and {reset}.

Description

  • Refactor FactionTextFormatter to build and return a styled Component instead of producing a plain string with legacy formatting codes, by replacing applyFormat to produce MutableComponent output.
  • Implement token-driven styling: {faction_color} applies Style.withColor(TextColor.fromRgb(...)), {reset} resets to Style.EMPTY, and placeholders {faction}, {player}, {message}, and {role} append text under the current style.
  • Add appendLiteral helper to append styled literal segments to the resulting MutableComponent.
  • Keep existing integration points: formatChat uses FactionConfig.SERVER.* formats and formatTabList still uses the tab format string.

Testing

  • Ran ./gradlew compileJava, which completed successfully (BUILD SUCCESSFUL).
  • No automated unit tests were added or modified in this change.

Codex Task

@plan3t plan3t merged commit 152af0d into main Feb 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant