Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two bugs in the character creation screen and adds build support for Visual Studio 2026.
The critical bug: on accounts with no characters yet, the creation screen was visible and accepted keyboard input, but every click was dead — class buttons, OK and Cancel did nothing, and the Menu/Create buttons in the corner of the screen were unresponsive too, leaving the player stuck with no option other than closing the process. Accounts that already had a character worked fine. That asymmetry was the giveaway.
The second bug was purely visual: the 3D character preview was rendered near the bottom of the screen instead of in its top-left slot.
Root cause
1. Dead clicks (empty accounts only)
CUIMng::CreateCharacterScene()published the character selection window last:CCharSelMainWin::UpdateDisplay()intentionally auto-shows the creation window when the account has no live character. The followingShowWin(m_CharSelMainWin)then calledSetActiveWin(), pushing the selection bar to the head of the window list and marking it active — so the creation window ended up visible but inactive.CWin::Update()only invokesUpdateWhileActive()for the active window, and that is the only place where the Rml creation panel consumes its pending changes:The RmlUi panel did register the click (
changes_.ok = ok_.IsClick() || changes_.ok), but nobody ever read it.A click could not "wake up" the window either: while the Rml panel is visible,
RmlCharacterCreatePanel::Impl::Input()returnstruefor every pointer event, so the legacy path is skipped inApplicationLoopFrame—MouseLButtonPushnever updates, and theCUIMng::Update()loop that would callSetActiveWin()never fires. Fully circular.The corner Create/Menu buttons were dead for the same reason (
CCharSelMainWin::UpdateWhileActive()reads the same frozen input), and ESC could not open the system menu becauseCUIMng::Update()bails out while the creation window is shown, while the panel's own ESC handling lived in the inactive window.Why it worked with an existing character: the creation window started hidden, so
ProcessModernUiInput()returnedfalseand legacy clicks flowed normally. The Create button then calledShowWin(m_CharMakeWin)as the last action, leaving the window active — everything worked from there.2. Preview in the wrong place
PreviewBounds()derives the preview rectangle from the Rml layout usingPanel-Reference(640x480), so it is top-left origin:bounds_ = { offset.x * reference[0] / viewport.width, offset.y * reference[1] / viewport.height, ... };CCharMakeWin::RenderCreateCharacter()passed it straight toBeginOpengl(), but the render tape viewport is bottom-left origin —MapGpuRect()in the GPU backend converts withsurfaceHeight - rect.y - rect.height. Withtop: 0, the preview landed at the bottom of the screen and was clipped by the edge.Changes
UI fixes
src/client/ui/session/UiSessionLogic.cpp—CUIMng::CreateCharacterScene()now showsm_CharSelMainWinbefore callingUpdateDisplay(), so the auto-shown creation window ends up on top of the list and active.UpdateWhileActive()runs again, and OK/Cancel/class buttons/Enter/Esc all respond. Existing-character flow is untouched becauseUpdateDisplay()shows nothing in that case.This also fixes window resizing, since
RepositionSceneUI()recreates the scene through the same path.src/client/ui/features/Shell/ShellRender.cpp—RenderCreateCharacter()flips the Y coordinate at theBeginOpengl()call:This matches the convention already used by
SetupMainSceneViewport().PreviewBounds()keeps its Rml-native top-left semantics.Visual Studio 2026 build support
CMakePresets.jsonwindows-vs2026-baseusing theVisual Studio 18 2026generator, restricted toCMAKE_CONFIGURATION_TYPES=Debug;Releaseand Windows hosts.vs2026-x64andvs2026-x86, mirroring thevs2022ones (toolset host=x64, same toolchain files witharchitecturex64/Win32 so the active config is not overridden), outputting tobin/x64andbin/x86.vs2026-x64-debug,vs2026-x64-release,vs2026-x86-debug,vs2026-x86-release.Build.ps1— newGet-VisualStudioPresetPrefixhelper. It locatesvswhere.exe, checks for the C++ workload (Microsoft.VisualStudio.Component.VC.Tools.x86.x64) in the[18.0,19.0)version range, and returnsvs2026when found, otherwisevs2022../Build.ps1therefore picks the newest installed Visual Studio automatically; the-Generator Ninjapath is unaffected.README.md— requirements updated to "Visual Studio 2022 or 2026", preset list extended, and the example now usesvs2026-x64.How to test
Character creation:
Build:
or simply
./Build.ps1, which auto-detects VS2022/VS2026. Verified locally: configure and full build succeed, producingbin/x64/Release/Main.exeandbin/x64/Release/MuLauncher.exewith assets copied by theCopyAssetstarget.Notes
Preview-Camerauses a narrow FOV (10) andPreview-Modelsscales the Dark Knight at 5.9. Not addressed here.src/client/network/generated/,src/client-library/) may appear modified after a build due to CRLF rewriting; they are content-identical and were not included in this PR.