From d476037f452efe0b3f087286fdd2c84c693df899 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 22 Oct 2019 23:43:16 +0200 Subject: [PATCH] - hooked up hud_custom. --- source/blood/src/menus.cpp | 8 -------- source/common/gamecvars.cpp | 2 +- source/duke3d/src/game.h | 2 +- source/duke3d/src/gamestructures.cpp | 4 ++-- source/duke3d/src/menus.cpp | 8 +------- source/rr/src/game.h | 2 +- source/rr/src/menus.cpp | 8 +------- 7 files changed, 7 insertions(+), 27 deletions(-) diff --git a/source/blood/src/menus.cpp b/source/blood/src/menus.cpp index a192cd509..c3ef414ac 100644 --- a/source/blood/src/menus.cpp +++ b/source/blood/src/menus.cpp @@ -2011,14 +2011,6 @@ static void Menu_Pre(MenuID_t cm) } MenuEntry_HideOnCondition(&ME_SCREENSETUP_SCREENSIZE, (MEO_SCREENSETUP_SCREENSIZE.steps < 2)); - vpsize = !(ud.statusbarflags & STATUSBAR_NONONE) + - (ud.screen_size >= 4 && !(ud.statusbarflags & STATUSBAR_NOMODERN)) + - (ud.screen_size >= 4 && ud.althud == 0 && !(ud.statusbarflags & STATUSBAR_NOMINI)) * (ud.statusbarcustom + 1) + - (ud.screen_size >= 8 && !(ud.statusbarflags & STATUSBAR_NOOVERLAY)) + - (ud.screen_size >= 8 && ud.statusbarmode == 0 && !(ud.statusbarflags & STATUSBAR_NOFULL)) + - (ud.screen_size > 8 && !(ud.statusbarflags & STATUSBAR_NOSHRINK)) * ((ud.screen_size - 8) >> 2) - -1; - #ifndef EDUKE32_STANDALONE #ifdef TEXFILTER_MENU_OPTIONS if (videoGetRenderMode() != REND_CLASSIC) diff --git a/source/common/gamecvars.cpp b/source/common/gamecvars.cpp index ea75274e8..e923b65be 100644 --- a/source/common/gamecvars.cpp +++ b/source/common/gamecvars.cpp @@ -201,7 +201,7 @@ bool G_ChangeHudLayout(int direction) } int hud_statusbarrange; // will be set by the game's configuration setup. -CUSTOM_CVARD(Int, hud_custom, 0, CVAR_ARCHIVE|CVAR_NOINITCALL, "change the custom hud")// not implemented by Blood , (void*)&ud.statusbarcustom, CVAR_INT, 0, ud.statusbarrange }, +CUSTOM_CVARD(Int, hud_custom, 0, CVAR_ARCHIVE|CVAR_NOINITCALL, "change the custom hud") // this has no backing implementation, it seems to be solely for scripted HUDs. { if (self < 0) self = 0; else if (self >= hud_statusbarrange) self = hud_statusbarrange - 1; diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index f2b879a07..a059690a4 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -181,7 +181,7 @@ typedef struct { int32_t color,msgdisptime,statusbarmode; int32_t m_noexits,noexits; int32_t team, althud, weaponscale, textscale; - int32_t statusbarflags, statusbarrange, statusbarcustom; + int32_t statusbarflags, statusbarrange; int32_t hudontop; int32_t menu_slidebarz, menu_slidebarmargin, menu_slidecursorz; int32_t menu_scrollbartilenum, menu_scrollbarz, menu_scrollcursorz; diff --git a/source/duke3d/src/gamestructures.cpp b/source/duke3d/src/gamestructures.cpp index d29e5e005..463fa29e2 100644 --- a/source/duke3d/src/gamestructures.cpp +++ b/source/duke3d/src/gamestructures.cpp @@ -1506,7 +1506,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2) case USERDEFS_MENUBACKGROUND: labelNum = ud.menubackground; break; case USERDEFS_STATUSBARFLAGS: labelNum = 0/*ud.statusbarflags*/; break; case USERDEFS_STATUSBARRANGE: labelNum = ud.statusbarrange; break; - case USERDEFS_STATUSBARCUSTOM: labelNum = ud.statusbarcustom; break; + case USERDEFS_STATUSBARCUSTOM: labelNum = hud_custom; break; case USERDEFS_HUDONTOP: labelNum = ud.hudontop; break; case USERDEFS_MENU_SLIDEBARZ: labelNum = ud.menu_slidebarz; break; case USERDEFS_MENU_SLIDEBARMARGIN: labelNum = ud.menu_slidebarmargin; break; @@ -1699,7 +1699,7 @@ void __fastcall VM_SetUserdef(int const labelNum, int const lParm2, int32_t cons case USERDEFS_MENUBACKGROUND: ud.menubackground = iSet; break; case USERDEFS_STATUSBARFLAGS: ud.statusbarflags = iSet; break; // Sigh... Ion Fury needs this. :( case USERDEFS_STATUSBARRANGE: ud.statusbarrange = iSet; break; - case USERDEFS_STATUSBARCUSTOM: ud.statusbarcustom = iSet; break; + case USERDEFS_STATUSBARCUSTOM: hud_custom = iSet; break; //!!! case USERDEFS_HUDONTOP: ud.hudontop = iSet; break; case USERDEFS_MENU_SLIDEBARZ: ud.menu_slidebarz = iSet; break; case USERDEFS_MENU_SLIDEBARMARGIN: ud.menu_slidebarmargin = iSet; break; diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index b6cada58f..3be677dfc 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -2025,13 +2025,7 @@ static void Menu_Pre(MenuID_t cm) } MenuEntry_HideOnCondition(&ME_SCREENSETUP_SCREENSIZE, (MEO_SCREENSETUP_SCREENSIZE.steps < 2)); - vpsize = !(ud.statusbarflags & STATUSBAR_NONONE) + - (ud.screen_size >= 4 && !(ud.statusbarflags & STATUSBAR_NOMODERN)) + - (ud.screen_size >= 4 && ud.althud == 0 && !(ud.statusbarflags & STATUSBAR_NOMINI)) * (ud.statusbarcustom + 1) + - (ud.screen_size >= 8 && !(ud.statusbarflags & STATUSBAR_NOOVERLAY)) + - (ud.screen_size >= 8 && ud.statusbarmode == 0 && !(ud.statusbarflags & STATUSBAR_NOFULL)) + - (ud.screen_size > 8 && !(ud.statusbarflags & STATUSBAR_NOSHRINK)) * ((ud.screen_size - 8) >> 2) - -1; + vpsize = -1; #ifndef EDUKE32_STANDALONE #ifdef TEXFILTER_MENU_OPTIONS diff --git a/source/rr/src/game.h b/source/rr/src/game.h index b4b5d274a..e61241d3b 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -160,7 +160,7 @@ typedef struct { int32_t color,msgdisptime,statusbarmode; int32_t m_noexits,noexits,automsg; int32_t team, althud, weaponscale, textscale; - int32_t statusbarflags, statusbarrange, statusbarcustom; + int32_t statusbarflags, statusbarrange; int32_t hudontop; int32_t menu_slidebarz, menu_slidebarmargin, menu_slidecursorz; int32_t menu_scrollbartilenum, menu_scrollbarz, menu_scrollcursorz; diff --git a/source/rr/src/menus.cpp b/source/rr/src/menus.cpp index 7aae8eafa..5765f56a1 100644 --- a/source/rr/src/menus.cpp +++ b/source/rr/src/menus.cpp @@ -1995,13 +1995,7 @@ static void Menu_Pre(MenuID_t cm) MEO_SCREENSETUP_SCREENSIZE.max = MEO_SCREENSETUP_SCREENSIZE.steps - 1; MenuEntry_DisableOnCondition(&ME_SCREENSETUP_SCREENSIZE, (MEO_SCREENSETUP_SCREENSIZE.steps < 2)); - vpsize = !(ud.statusbarflags & STATUSBAR_NONONE) + - (ud.screen_size >= 4 && !(ud.statusbarflags & STATUSBAR_NOMODERN)) + - (ud.screen_size >= 4 && ud.althud == 0 && !(ud.statusbarflags & STATUSBAR_NOMINI)) * (ud.statusbarcustom + 1) + - (ud.screen_size >= 8 && !(ud.statusbarflags & STATUSBAR_NOOVERLAY)) + - (ud.screen_size >= 8 && ud.statusbarmode == 0 && !(ud.statusbarflags & STATUSBAR_NOFULL)) + - (ud.screen_size > 8 && !(ud.statusbarflags & STATUSBAR_NOSHRINK)) * ((ud.screen_size - 8) >> 2) - -1; + vpsize = -1; if (videoGetRenderMode() != REND_CLASSIC) {