From 20db6b0c784b09c8f303acde944eefce08261740 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 2 Feb 2021 23:49:04 +0100 Subject: [PATCH] - added protection against oversized menu caption bars. SWC20 is a mod that contains a caption that is larger then the entire screen and was pushing the actual menu content out of it. Fixes #239 --- wadsrc/static/zscript/games/blood/ui/menu.zs | 2 +- wadsrc/static/zscript/games/duke/ui/menu.zs | 2 +- wadsrc/static/zscript/games/sw/ui/menu.zs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wadsrc/static/zscript/games/blood/ui/menu.zs b/wadsrc/static/zscript/games/blood/ui/menu.zs index 775afb5d3..53035e7af 100644 --- a/wadsrc/static/zscript/games/blood/ui/menu.zs +++ b/wadsrc/static/zscript/games/blood/ui/menu.zs @@ -26,7 +26,7 @@ class BloodMenuDelegate : RazeMenuDelegate } double fx, fy, fw, fh; [fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top); - int h = texid.isValid()? texsize.Y : fonth; + int h = texid.isValid() && texsize.Y < 40? texsize.Y : fonth; return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels. } diff --git a/wadsrc/static/zscript/games/duke/ui/menu.zs b/wadsrc/static/zscript/games/duke/ui/menu.zs index c8fe25b6d..6c81fbae3 100644 --- a/wadsrc/static/zscript/games/duke/ui/menu.zs +++ b/wadsrc/static/zscript/games/duke/ui/menu.zs @@ -21,7 +21,7 @@ class DukeMenuDelegate : RazeMenuDelegate } double fx, fy, fw, fh; [fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top); - int h = texid.isValid()? texsize.Y : fonth; + int h = texid.isValid() && texsize.Y < 40? texsize.Y : fonth; return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels. } diff --git a/wadsrc/static/zscript/games/sw/ui/menu.zs b/wadsrc/static/zscript/games/sw/ui/menu.zs index 7d3684fd7..61ef4a62c 100644 --- a/wadsrc/static/zscript/games/sw/ui/menu.zs +++ b/wadsrc/static/zscript/games/sw/ui/menu.zs @@ -33,7 +33,7 @@ class SWMenuDelegate : RazeMenuDelegate } double fx, fy, fw, fh; [fx, fy, fw, fh] = Screen.GetFullscreenRect(320, 200, FSMode_ScaleToFit43Top); - int h = texid.isValid()? texsize.Y : fonth; + int h = texid.isValid() && texsize.Y < 40? texsize.Y : fonth; return int((y+h) * fh / 200); // This must be the covered height of the header in true pixels. }