Add MVP accessibility basics
This commit is contained in:
@@ -67,6 +67,18 @@ void UAgrarianMvpFrontendWidget::SetSelectedCharacterArchetype(EAgrarianMvpChara
|
||||
InvalidateLayoutAndVolatility();
|
||||
}
|
||||
|
||||
void UAgrarianMvpFrontendWidget::SetUiScale(float NewUiScale)
|
||||
{
|
||||
UiScale = FMath::Clamp(NewUiScale, 0.75f, 1.5f);
|
||||
InvalidateLayoutAndVolatility();
|
||||
}
|
||||
|
||||
void UAgrarianMvpFrontendWidget::SetHighContrastMode(bool bNewUseHighContrast)
|
||||
{
|
||||
bUseHighContrast = bNewUseHighContrast;
|
||||
InvalidateLayoutAndVolatility();
|
||||
}
|
||||
|
||||
int32 UAgrarianMvpFrontendWidget::NativePaint(
|
||||
const FPaintArgs& Args,
|
||||
const FGeometry& AllottedGeometry,
|
||||
@@ -80,6 +92,9 @@ int32 UAgrarianMvpFrontendWidget::NativePaint(
|
||||
|
||||
const FVector2D Size = AllottedGeometry.GetLocalSize();
|
||||
const float Scale = FMath::Clamp(UiScale, 0.75f, 1.5f);
|
||||
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 AccentColor = bUseHighContrast ? FLinearColor(0.95f, 0.95f, 0.30f, 1.0f) : FLinearColor(0.45f, 0.72f, 0.40f, 1.0f);
|
||||
|
||||
FSlateDrawElement::MakeBox(
|
||||
OutDrawElements,
|
||||
@@ -87,7 +102,7 @@ int32 UAgrarianMvpFrontendWidget::NativePaint(
|
||||
AllottedGeometry.ToPaintGeometry(FVector2f(Size), FSlateLayoutTransform(FVector2f::ZeroVector)),
|
||||
FCoreStyle::Get().GetBrush(TEXT("WhiteBrush")),
|
||||
ESlateDrawEffect::None,
|
||||
FLinearColor(0.015f, 0.018f, 0.014f, 0.92f));
|
||||
BackdropColor);
|
||||
|
||||
const FVector2D PanelSize(
|
||||
FMath::Min(Size.X - 48.0f, 780.0f * Scale),
|
||||
@@ -102,7 +117,7 @@ int32 UAgrarianMvpFrontendWidget::NativePaint(
|
||||
AllottedGeometry.ToPaintGeometry(FVector2f(PanelSize), FSlateLayoutTransform(FVector2f(PanelPosition))),
|
||||
FCoreStyle::Get().GetBrush(TEXT("WhiteBrush")),
|
||||
ESlateDrawEffect::None,
|
||||
FLinearColor(0.035f, 0.045f, 0.034f, 0.96f));
|
||||
PanelColor);
|
||||
|
||||
FSlateDrawElement::MakeBox(
|
||||
OutDrawElements,
|
||||
@@ -110,7 +125,7 @@ int32 UAgrarianMvpFrontendWidget::NativePaint(
|
||||
AllottedGeometry.ToPaintGeometry(FVector2f(PanelSize.X, 4.0f * Scale), FSlateLayoutTransform(FVector2f(PanelPosition))),
|
||||
FCoreStyle::Get().GetBrush(TEXT("WhiteBrush")),
|
||||
ESlateDrawEffect::None,
|
||||
FLinearColor(0.45f, 0.72f, 0.40f, 1.0f));
|
||||
AccentColor);
|
||||
|
||||
if (ActiveScreen == EAgrarianMvpFrontendScreen::MainMenu)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user