santardo Posted March 2 Posted March 2 (edited) View File CenteredUI v1.0 Centered Interface for CK2 Ultrawide Monitors CK2's interface is pinned to the upper-left corner by default — on ultrawide monitors all panels and buttons sit far to the left while the rest of the screen is empty. CenteredUI fixes this by centering the topbar buttons and all domestic panels on screen. The mod includes an auto-patcher script that reads your resolution and GUI scale from settings.txt and recalculates all positions dynamically. Works with any resolution and any gui_scale setting. ━ WHAT GETS CENTERED Topbar: All 26 topbar elements — ruler portrait, shield, crown, tab buttons, extensions, diplomacy message icons Domestic Panels: Overview, Court, Diplomacy, Dynastic, Factions, Law, Military, Missions, Nomad, Plots, Religion, Republic, Societies, Technology, TreasuryCourt companion windows (jobs_view, honorary_titles_view, council_view)Religion sub-windows (saints, cardinal, fraticelli cardinal) Not centered: Offmap buttons (China etc.), character view, event popups, and other floating windows — these are handled separately by the game. ━ HOW IT WORKS CK2 has no dynamic layout system — all positions are absolute pixel values. CenteredUI uses a two-part approach: 1. Domestic Panels use CK2's Orientation = "CENTER" feature, positioning windows relative to screen center. The x-offset is static (−288 = half panel width); the y-offset is recalculated whenever gui_scale changes to maintain topbar clearance. 2. Topbar Elements are children of the main fullscreen window and cannot use CENTER orientation. The patcher calculates the required pixel offset: effective_width = resolution_x / gui_scale topbar_offset = effective_width / 2 - 288 Each topbar element's original x-position is shifted by this offset. The patcher reads settings.txt on every launch, patches the GUI files, and starts CK2 via Steam — fully automatic. ━ HOW TO USE Option A — Batch launcher (recommended): Run Launch_CK2_Centered.batIt patches GUI files and launches CK2 automatically Option B — Manual patch: Run CenteredUI_Patcher.ps1 in PowerShellLaunch CK2 normally through Steam Important: Re-run the patcher whenever you change your resolution or gui_scale in CK2's settings. Using the batch file handles this automatically every launch. ━ REQUIREMENTS A Bigger Interface mod — must be loaded before CenteredUI (set automatically in CenteredUI.mod)PowerShell — included with Windows 10/11 ━ INSTALLATION Place CenteredUI.mod in the /mod/ folderPlace the CenteredUI/ folder in the /mod/ folderEnable "Centered UI" in the CK2 launcherEnable "A Bigger Interface" in the CK2 launcherLaunch via Launch_CK2_Centered.bat (or run the patcher first) No manual configuration needed — the patcher reads resolution and gui_scale directly from CK2's settings.txt. ━ TECHNICAL DETAILS Topbar offset formula: effective_width = resolution_x / gui_scale topbar_offset = floor(effective_width / 2) - 288 Panel Y-position formula: effective_height = resolution_y / gui_scale center_y = floor(effective_height / 2) y_tall = 100 - center_y (100px topbar clearance) y_honorary = y_tall + 175 (court companion offset) y_council = y_tall + 350 (court companion offset) Example at 5120×1440, gui_scale=1.2: effective = 4266×1200 · topbar_offset = +1845 · y_tall = −500 All files are written UTF-8 WITHOUT BOM — CK2 crashes with BOM. ━ COMPATIBILITY Overrides 15 domestic_*.gui files from A Bigger InterfaceOverrides main.gui from base game (auto-generated from template)Compatible with most mods that don't modify domestic panel positionsNot compatible with other mods that override the same GUI filesSafe to add or remove at any time — no save game dependency ━ KNOWN LIMITATIONS Windows are not draggable yet (planned for a future version)Offmap buttons (China) are not centered — use a separate offmap modIf you change gui_scale in-game, restart via the batch file for new positions to take effectThe template file (main.gui.template) must remain unmodified — it is the vanilla base the patcher reads from ━ VERSION HISTORY v1.0 — Initial release. Centered topbar (26 elements) and domestic panels (15 files). Auto-patcher for dynamic resolution + gui_scale support. Batch launcher for automatic patching on game start. UTF-8 NO BOM output to prevent CK2 crashes. Submitter santardo Submitted 03/02/26 Category Crusader Kings 2 Requirements - A Bigger Interface mod — MUST be loaded before CenteredUI - PowerShell (included with Windows 10/11) - The dependency is set automatically in CenteredUI.mod Edited March 4 by santardo 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now