Skip to content

Commit 027a337

Browse files
Fix "compact HUD" (Tate/Portrait Mode) behavior for SBARDEF (#1618)
1 parent 3a24940 commit 027a337

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

Core/Layer/Worlds/WorldLayer.Render.Hud.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ private void DrawBottomHud(IHudRenderContext hud, bool automapVisible, StatusBar
456456
return;
457457

458458
bool isWidescreen = hud.WindowDimension.AspectRatio > 4.0f / 3.0f;
459+
bool isCompact = hud.WindowDimension.AspectRatio < 4.0f / 3.0f;
459460
int fps = (int)Math.Round(m_fpsTracker.AverageFramesPerSecond);
460461

461462
string? consoleMsg = null;
@@ -484,8 +485,8 @@ private void DrawBottomHud(IHudRenderContext hud, bool automapVisible, StatusBar
484485
}
485486
}
486487

487-
var context = new StatusBarContext(World, Player, World.MapInfo, activeLayout, automapVisible, isWidescreen, fps, consoleMsg,
488-
isCentered, Player.Inventory.HasItemOfClass(Inventory.BackPackBaseClassName), HasTicks);
488+
var context = new StatusBarContext(World, Player, World.MapInfo, activeLayout, automapVisible, isWidescreen, isCompact, fps,
489+
consoleMsg, isCentered, Player.Inventory.HasItemOfClass(Inventory.BackPackBaseClassName), HasTicks);
489490
m_statusBarRenderer.Draw(hud, activeLayout, context, m_hudPaddingX);
490491
}
491492

Core/World/StatusBar/StatusBarConditionResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ private static bool CheckGameMode(GameConfDefinition? gameConf, int param, bool
342342

343343
private static bool CheckHudMode(StatusBarContext context, int param)
344344
{
345-
int mode = context.ActiveLayout?.FullscreenRender == true ? 1 : 0;
345+
int mode = context.IsCompact ? 1 : 0;
346346
return mode == param;
347347
}
348348

Core/World/StatusBar/StatusBarContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public readonly record struct StatusBarContext(
1111
StatusBarLayoutDef? ActiveLayout,
1212
bool AutomapVisible,
1313
bool Widescreen,
14+
bool IsCompact,
1415
int Fps,
1516
string? ConsoleMessage,
1617
bool IsMessageCentered,

RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- Fix to match boom behavior to parsing dehacked integers with failures defaulting to zero.
3636
- Fix SBARDEF crash when children element was explicity set to null.
3737
- Fix dehacked dropped ammo types only giving half ammo.
38+
- Fix "Compact HUD" (Tate/Portrait Window) behavior for SBARDEF
3839

3940
## Misc:
4041
- Refactor of old Status Bar renderer to data-driven SBARDEF format.

0 commit comments

Comments
 (0)