Verify MVP UI resolution scaling
This commit is contained in:
@@ -805,7 +805,7 @@ Target deliverable: A small group can join a server, spawn into one biome, gathe
|
|||||||
- [x] Add death/respawn UI. Added a dedicated dead-state MVP panel with last death reason, Ground Zero respawn context, and `AgrarianToggleDeathRespawnUI` while preserving the existing server-authoritative respawn command.
|
- [x] Add death/respawn UI. Added a dedicated dead-state MVP panel with last death reason, Ground Zero respawn context, and `AgrarianToggleDeathRespawnUI` while preserving the existing server-authoritative respawn command.
|
||||||
- [x] Add debug/dev menu. Added a toggleable `bShowDebugDevMenu` HUD panel plus `AgrarianToggleDebugDevMenu`, listing the core MVP frontend, UI, persistence, and recovery commands for tester/admin use.
|
- [x] Add debug/dev menu. Added a toggleable `bShowDebugDevMenu` HUD panel plus `AgrarianToggleDebugDevMenu`, listing the core MVP frontend, UI, persistence, and recovery commands for tester/admin use.
|
||||||
- [x] Add accessibility basics. Added runtime MVP UI scaling with `AgrarianSetUiScale 0.75-1.5` and a frontend high-contrast mode with `AgrarianToggleHighContrastUI`, applying scale to the native frontend and HUD text surfaces.
|
- [x] Add accessibility basics. Added runtime MVP UI scaling with `AgrarianSetUiScale 0.75-1.5` and a frontend high-contrast mode with `AgrarianToggleHighContrastUI`, applying scale to the native frontend and HUD text surfaces.
|
||||||
- [ ] Ensure UI scales on common resolutions.
|
- [x] Ensure UI scales on common resolutions. Tightened native MVP frontend sizing around explicit margins, preferred panel dimensions, minimum panel bounds, and verified the layout math across common desktop resolutions and supported UI scale values.
|
||||||
|
|
||||||
## 0.1.O MVP Audio And Atmosphere
|
## 0.1.O MVP Audio And Atmosphere
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
FRONTEND_CPP = ROOT / "Source" / "AgrarianGame" / "AgrarianMvpFrontendWidget.cpp"
|
||||||
|
ROADMAP = ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md"
|
||||||
|
|
||||||
|
COMMON_RESOLUTIONS = [
|
||||||
|
(1280, 720),
|
||||||
|
(1366, 768),
|
||||||
|
(1600, 900),
|
||||||
|
(1920, 1080),
|
||||||
|
(2560, 1440),
|
||||||
|
]
|
||||||
|
SUPPORTED_SCALES = [0.75, 1.0, 1.25, 1.5]
|
||||||
|
|
||||||
|
|
||||||
|
def panel_size(width, height, scale):
|
||||||
|
minimum_margin = 24.0
|
||||||
|
preferred_width = 780.0
|
||||||
|
preferred_height = 430.0
|
||||||
|
available_width = max(320.0, width - (minimum_margin * 2.0))
|
||||||
|
available_height = max(240.0, height - (minimum_margin * 2.0))
|
||||||
|
return min(available_width, preferred_width * scale), min(available_height, preferred_height * scale)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
frontend_text = FRONTEND_CPP.read_text(encoding="utf-8")
|
||||||
|
roadmap_text = ROADMAP.read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
expected_source = [
|
||||||
|
"MinimumPanelMargin = 24.0f",
|
||||||
|
"PreferredPanelWidth = 780.0f",
|
||||||
|
"PreferredPanelHeight = 430.0f",
|
||||||
|
"AvailablePanelSize",
|
||||||
|
"FMath::Clamp(UiScale, 0.75f, 1.5f)",
|
||||||
|
]
|
||||||
|
missing = [snippet for snippet in expected_source if snippet not in frontend_text]
|
||||||
|
|
||||||
|
for width, height in COMMON_RESOLUTIONS:
|
||||||
|
for scale in SUPPORTED_SCALES:
|
||||||
|
panel_width, panel_height = panel_size(width, height, scale)
|
||||||
|
if panel_width > width - 48.0:
|
||||||
|
missing.append(f"panel overflows width at {width}x{height} scale {scale}")
|
||||||
|
if panel_height > height - 48.0:
|
||||||
|
missing.append(f"panel overflows height at {width}x{height} scale {scale}")
|
||||||
|
if panel_width < 320.0 or panel_height < 240.0:
|
||||||
|
missing.append(f"panel below minimum at {width}x{height} scale {scale}")
|
||||||
|
|
||||||
|
if "[x] Ensure UI scales on common resolutions." not in roadmap_text:
|
||||||
|
missing.append("roadmap item not complete")
|
||||||
|
|
||||||
|
if missing:
|
||||||
|
raise RuntimeError("MVP UI common resolution scaling verification failed: " + "; ".join(missing))
|
||||||
|
|
||||||
|
print("Agrarian MVP UI common resolution scaling verification complete.")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -92,6 +92,12 @@ int32 UAgrarianMvpFrontendWidget::NativePaint(
|
|||||||
|
|
||||||
const FVector2D Size = AllottedGeometry.GetLocalSize();
|
const FVector2D Size = AllottedGeometry.GetLocalSize();
|
||||||
const float Scale = FMath::Clamp(UiScale, 0.75f, 1.5f);
|
const float Scale = FMath::Clamp(UiScale, 0.75f, 1.5f);
|
||||||
|
constexpr float MinimumPanelMargin = 24.0f;
|
||||||
|
constexpr float PreferredPanelWidth = 780.0f;
|
||||||
|
constexpr float PreferredPanelHeight = 430.0f;
|
||||||
|
const FVector2D AvailablePanelSize(
|
||||||
|
FMath::Max(320.0f, Size.X - (MinimumPanelMargin * 2.0f)),
|
||||||
|
FMath::Max(240.0f, Size.Y - (MinimumPanelMargin * 2.0f)));
|
||||||
const FLinearColor BackdropColor = bUseHighContrast ? FLinearColor(0.0f, 0.0f, 0.0f, 0.96f) : FLinearColor(0.015f, 0.018f, 0.014f, 0.92f);
|
const FLinearColor BackdropColor = bUseHighContrast ? FLinearColor(0.0f, 0.0f, 0.0f, 0.96f) : FLinearColor(0.015f, 0.018f, 0.014f, 0.92f);
|
||||||
const FLinearColor PanelColor = bUseHighContrast ? FLinearColor(0.0f, 0.0f, 0.0f, 0.98f) : FLinearColor(0.035f, 0.045f, 0.034f, 0.96f);
|
const FLinearColor PanelColor = bUseHighContrast ? FLinearColor(0.0f, 0.0f, 0.0f, 0.98f) : FLinearColor(0.035f, 0.045f, 0.034f, 0.96f);
|
||||||
const FLinearColor AccentColor = bUseHighContrast ? FLinearColor(0.95f, 0.95f, 0.30f, 1.0f) : FLinearColor(0.45f, 0.72f, 0.40f, 1.0f);
|
const FLinearColor AccentColor = bUseHighContrast ? FLinearColor(0.95f, 0.95f, 0.30f, 1.0f) : FLinearColor(0.45f, 0.72f, 0.40f, 1.0f);
|
||||||
@@ -105,8 +111,8 @@ int32 UAgrarianMvpFrontendWidget::NativePaint(
|
|||||||
BackdropColor);
|
BackdropColor);
|
||||||
|
|
||||||
const FVector2D PanelSize(
|
const FVector2D PanelSize(
|
||||||
FMath::Min(Size.X - 48.0f, 780.0f * Scale),
|
FMath::Min(AvailablePanelSize.X, PreferredPanelWidth * Scale),
|
||||||
FMath::Min(Size.Y - 48.0f, 430.0f * Scale));
|
FMath::Min(AvailablePanelSize.Y, PreferredPanelHeight * Scale));
|
||||||
const FVector2D PanelPosition(
|
const FVector2D PanelPosition(
|
||||||
(Size.X - PanelSize.X) * 0.5f,
|
(Size.X - PanelSize.X) * 0.5f,
|
||||||
(Size.Y - PanelSize.Y) * 0.5f);
|
(Size.Y - PanelSize.Y) * 0.5f);
|
||||||
|
|||||||
Reference in New Issue
Block a user