mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
c02aad66a0
The main menu clipped its own title and bottom button in debug builds. The project lays out in a hard-fixed 1920x1080 logical viewport (window/stretch/mode="viewport"), and the only overflow strategy in the scene was a CenterContainer, which centres its child rather than clipping and scrolling. With DevSection visible the content measures 1133px against 1080, so roughly 53px spilled off both ends with no way to reach it — and main_menu.gd grabs focus on a button that may itself be off-screen. Worth recording because it is counter-intuitive: this is not resolution-dependent. Because the viewport is fixed, a 4K display magnifies the same clipped 1080p frame rather than giving the menu more room, so the fix has to make the layout scroll, not scale. Each menu is now MarginContainer > ScrollContainer > CenterContainer > VBoxContainer. ScrollContainer sizes its child to max(own size, child minimum), so an expanding CenterContainer keeps today's centred look when the content is short and grows past the viewport when it is tall — which is exactly when scrolling should start. follow_focus is on so keyboard and controller navigation cannot strand focus off-screen. Lobby and matchmaking share the same shape and get the same treatment before they hit the same wall; settings gained its wrapper alongside the Controls tab. Also stops the dev bot dropdowns widening the whole menu: they are filled from res://bots filenames and expand horizontally, so a long checkpoint name dragged the layout past its 420px minimum. test_menu_layout asserts each screen's bottom-most control really sits inside a ScrollContainer. That is a structural guard against the wrapper being removed or a new section being added outside it — not proof that nothing visually clips, which was checked by hand at 1000x600, 1280x720 and 1920x1080.
17 lines
861 B
GDScript
17 lines
861 B
GDScript
class_name ScenePaths
|
|
|
|
const MAIN_MENU := "res://scenes/main_menu.tscn"
|
|
const SETTINGS := "res://scenes/settings.tscn"
|
|
# §6.2 step 10: after RESULTS both peers return HERE, not to the main menu —
|
|
# a community server whose players are all dumped back to their own menus
|
|
# every 2.5 minutes has no way to keep a lobby together.
|
|
const LOBBY := "res://scenes/lobby.tscn"
|
|
# Task 6.5: the dedicated server's match loop needs this by name, and it was
|
|
# previously only ever reached by test harnesses hardcoding the string.
|
|
const NETWORKED_MATCH := "res://scenes/networked_match.tscn"
|
|
const SERVER_BOOT := "res://scenes/server_boot.tscn"
|
|
# Arena variants add presentation-only scenery. The dedicated server uses the
|
|
# common physical layout instead, while MatchSim still tells clients which
|
|
# variant to render.
|
|
const SERVER_ARENA := "res://scenes/arena_base.tscn"
|