Skip to content

Comments

Tune faction GUI sizing for Auto scale (tabs + map)#165

Merged
plan3t merged 2 commits intomainfrom
codex/fix-ui-scaling-for-factions-mod-e1hodu
Feb 17, 2026
Merged

Tune faction GUI sizing for Auto scale (tabs + map)#165
plan3t merged 2 commits intomainfrom
codex/fix-ui-scaling-for-factions-mod-e1hodu

Conversation

@plan3t
Copy link
Owner

@plan3t plan3t commented Feb 17, 2026

Motivation

  • The Factions UI was visually oversized under the Auto GUI scale and tab labels/buttons could overflow or look misaligned. The change intends to tighten sizes so controls and the map fit better on compact/large resolutions.
  • The tab centering math included an extra trailing gap which caused tabs to be offset on many widths and scaling modes.

Description

  • Reduced tab/button footprint by lowering TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT, MIN_TAB_BUTTON_WIDTH, TAB_BUTTON_GAP, PANEL_CONTENT_WIDTH and minimum panel width in FactionMainScreen to make top tabs and controls more compact.
  • Fixed tab centering by computing totalTabWidth = tabCount * tabButtonWidth + (tabCount - 1) * TAB_BUTTON_GAP and using that to center the tab row.
  • Added runtime panel scaling by introducing panelContentWidth, horizontalScale, and helper methods scaledWidth(int) and panelX(int) to scale control widths/positions consistently, and converted many hardcoded control sizes/offsets to use those helpers.
  • Added small member-section toggle buttons and layout helpers (membersSectionButton, invitesSectionButton, layoutMemberSectionButtons, updateMemberSectionButtonState) and a MemberSection enum to allow compact members/invites UI inside the Members tab.
  • Refactored visibility handling to helper methods setButtonVisible(Button, boolean) and setEditBoxVisible(EditBox, boolean) and adjusted dynamic visibility logic to account for the new member section state.
  • Reduced faction map footprint in FactionMapRenderer by tightening the map width/height budget and lowering cellSize bounds so the grid renders smaller and fits better at Auto scale.
  • Added compact tab labels via FactionTab changes (new compactLabel and getCompactLabel()), and use compact labels when tabButtonWidth < TAB_COMPACT_LABEL_THRESHOLD.

Testing

  • Ran ./gradlew compileJava and the build completed successfully.
  • No automated GUI tests were present; changes were limited to layout constants, helper functions, and rendering math so compilation success is the validation performed.

Codex Task

@plan3t plan3t merged commit 1cf1f8a 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