Add Leaderboard modal UI, visual-state leaderboard projection, and wiring#35
Merged
Conversation
# Conflicts: # src/Game.Main/VisualStateConverter.cs
The leaderboard modal was rendering behind the HUD/map because its UIDocument shared sortingOrder 0 with every other document and relied on scene-authoring order to win ties. Give it an explicit sortingOrder in code instead, per this project's own guidance not to rely on scene ordering for stacking. The table header wasn't scaling with the panel because .gs-panel uses align-items: center, so header children shrank to content size instead of stretching to the panel width — only the table header needed the fix, the title bar stays centered by design. Also moves the leaderboard button next to the player org panel, fixes org/country flag aspect ratio, disables map zoom while the window is open (full scroll-forwarding into the list is deferred), and formats scores with thousands separators. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The close button lived inside the centered title row, so it sat next to the title instead of at a fixed corner. Move it out to its own absolutely-positioned element inset by the panel's own padding, independent of the title, which stays centered. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Game.Main and Game.Configs.Loader each carried an AssemblyInfo.cs whose only purpose was granting Game.Tests blanket access to internal members. That's an invisible, all-or-nothing escape hatch rather than a deliberate API decision, and it hides which members tests actually depend on. Flip just the members Game.Tests calls (VisualStateConverter's constructor and Update/UpdateCountryScore/UpdateLeaderboards; Program .ApplyPreservedFields; ProvinceProcessor.Process, plus their containing types) to public instead, and drop both AssemblyInfo.cs files now that nothing needs InternalsVisibleTo. Document the preference in code_style.md so future test-only access follows the same pattern. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Motivation
CountryScoreSystem.GetScore).Description
Assets/UI/Modal/LeaderboardWindow/includingLeaderboardWindow.uxmlandLeaderboardWindow.uss, and added UI strings toAssets/Localization/en.assetandAssets/Localization/ru.asset.LeaderboardWindowViewandLeaderboardWindowDocumentand hooked them into HUD viaHUDDocument(addedbtn-leaderboard, click handler, and localized text refresh logic).LeaderboardEntryStateandLeaderboardStateinsrc/Game.Main/VisualState.cs, and implemented leaderboard projection and country-score population inVisualStateConverter(usesCountryScoreSystem.GetScoreandOrgScoreSystem.GetScore, sorts entries, assigns place numbers, and usesCountryConfigfor display-name fallback).CountryConfigto the converter, registeredLeaderboardWindowDocumentinGameLifetimeScope, added the leaderboard UIDocument toAssets/Scenes/Map.unity, and updated DI/scene assets and metadata accordingly.VisualStateConverterLeaderboardTeststhat validate sorting, place numbering, tie-breaking, and that country score state uses the country-score query; also addedAssemblyInfoto expose internals to tests.Testing
dotnet test(project tests includingVisualStateConverterLeaderboardTests); all added tests passed.VisualStateConverterLeaderboardTestswhich assert sorting/place numbering, deterministic tie-breaking, and country score population through the converter, and they succeeded.Codex Task