Skip to content

Commit

Permalink
libdoom|libheretic|Added: Console variable "hud-cheat-counter-show-ma…
Browse files Browse the repository at this point in the history
…popen"

Only show the cheat counter heads-up displays while the automap
is open (default: on).
  • Loading branch information
danij-deng committed Feb 4, 2012
1 parent ae13987 commit 776b3e2
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 8 deletions.
15 changes: 13 additions & 2 deletions doomsday/plugins/common/src/hu_menu.c
Expand Up @@ -167,6 +167,9 @@ cvarbutton_t mnCVarButtons[] = {
{ 0, "hud-ammo" },
{ 0, "hud-armor" },
#endif
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
{ 0, "hud-cheat-counter-show-mapopen" },
#endif
#if __JHERETIC__ || __JHEXEN__
{ 0, "hud-currentitem" },
#endif
Expand Down Expand Up @@ -633,6 +636,9 @@ mndata_text_t txt_hud_full_show_keys = { "Show Keys" };
#if __JHERETIC__ || __JHEXEN__
mndata_text_t txt_hud_full_show_readyitem = { "Show Ready-Item" };
#endif
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
mndata_text_t txt_hud_cntr_mapopen = { "Automap Only" };
#endif

mndata_button_t btn_hud_single_key_display = { true, "hud-keys-combine" };
mndata_button_t btn_hud_unhide_receive_damage = { true, "hud-unhide-damage" };
Expand Down Expand Up @@ -667,6 +673,9 @@ mndata_button_t btn_hud_full_show_keys = { true, "hud-keys" };
#if __JHERETIC__ || __JHEXEN__
mndata_button_t btn_hud_full_show_readyitem = { true, "hud-currentitem" };
#endif
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
mndata_button_t btn_hud_cntr_mapopen = { true, "hud-cheat-counter-show-mapopen" };
#endif

static mn_object_t HudMenuObjects[] = {
{ MN_TEXT, 0, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_hud_view_size },
Expand Down Expand Up @@ -727,12 +736,14 @@ static mn_object_t HudMenuObjects[] = {
#endif
#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
{ MN_TEXT, 5, 0, 0, MENU_FONT1, MENU_COLOR2, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_hud_counters },
{ MN_TEXT, 5, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_hud_cntr_kills },
{ MN_LISTINLINE, 5, 0, 'k',MENU_FONT1, MENU_COLOR3, MNListInline_UpdateGeometry, MNListInline_Drawer, { Hu_MenuCvarList, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNListInline_CommandResponder, NULL, NULL, &list_hud_cntr_kills },
{ MN_TEXT, 5, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_hud_cntr_items },
{ MN_LISTINLINE, 5, 0, 'i',MENU_FONT1, MENU_COLOR3, MNListInline_UpdateGeometry, MNListInline_Drawer, { Hu_MenuCvarList, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNListInline_CommandResponder, NULL, NULL, &list_hud_cntr_items },
{ MN_TEXT, 5, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_hud_cntr_kills },
{ MN_LISTINLINE, 5, 0, 'k',MENU_FONT1, MENU_COLOR3, MNListInline_UpdateGeometry, MNListInline_Drawer, { Hu_MenuCvarList, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNListInline_CommandResponder, NULL, NULL, &list_hud_cntr_kills },
{ MN_TEXT, 5, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_hud_cntr_secrets },
{ MN_LISTINLINE, 5, 0, 's',MENU_FONT1, MENU_COLOR3, MNListInline_UpdateGeometry, MNListInline_Drawer, { Hu_MenuCvarList, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNListInline_CommandResponder, NULL, NULL, &list_hud_cntr_secrets },
{ MN_TEXT, 5, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_hud_cntr_mapopen },
{ MN_BUTTON, 5, 0, 0, MENU_FONT1, MENU_COLOR3, MNButton_UpdateGeometry, MNButton_Drawer, { Hu_MenuCvarButton, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNButton_CommandResponder, NULL, NULL, &btn_hud_cntr_mapopen },
{ MN_TEXT, 5, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_hud_cntr_size },
{ MN_SLIDER, 5, 0, 0, MENU_FONT1, MENU_COLOR1, MNSlider_UpdateGeometry, MNSlider_Drawer, { Hu_MenuCvarSlider, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNSlider_CommandResponder, NULL, NULL, &sld_hud_cntr_size },
#endif
Expand Down
9 changes: 5 additions & 4 deletions doomsday/plugins/common/src/p_user.c
Expand Up @@ -1430,16 +1430,17 @@ void P_PlayerThinkPsprites(player_t *player)

void P_PlayerThinkHUD(player_t* player)
{
playerbrain_t* brain = &player->brain;
uint playerIdx = player - players;
playerbrain_t* brain = &player->brain;

if(brain->hudShow)
ST_HUDUnHide(player - players, HUE_FORCE);
ST_HUDUnHide(playerIdx, HUE_FORCE);

if(brain->scoreShow)
HU_ScoreBoardUnHide(player - players);
HU_ScoreBoardUnHide(playerIdx);

if(brain->logRefresh)
ST_LogRefresh(player - players);
ST_LogRefresh(playerIdx);
}

void P_PlayerThinkMap(player_t* player)
Expand Down
3 changes: 3 additions & 0 deletions doomsday/plugins/jdoom/data/conhelp.txt
Expand Up @@ -479,6 +479,9 @@ desc = 6-bit bitfield. Show kills, items and secret counters.
[hud-cheat-counter-scale]
desc = Size factor for the counters.

[hud-cheat-counter-show-mapopen]
desc = 1=Only show the cheat counters while the automap is open.

[map-customcolors]
desc = Custom automap coloring 0=Never, 1=Auto (enabled if unchanged), 2=Always.

Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom/include/d_config.h
Expand Up @@ -166,6 +166,7 @@ typedef struct jdoom_config_s {

byte hudShownCheatCounters;
float hudCheatCounterScale;
byte hudCheatCounterShowWithAutomap; ///< Only show when the automap is open.

// Automap stuff.
/* int automapPos;
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom/src/d_main.c
Expand Up @@ -374,6 +374,7 @@ void D_PreInit(void)
cfg.automapOpenSeconds = AUTOMAP_OPEN_SECONDS;

cfg.hudCheatCounterScale = .7f;
cfg.hudCheatCounterShowWithAutomap = true;

cfg.msgCount = 4;
cfg.msgScale = .8f;
Expand Down
7 changes: 7 additions & 0 deletions doomsday/plugins/jdoom/src/st_stuff.c
Expand Up @@ -242,6 +242,7 @@ void ST_Register(void)
C_VAR_BYTE2( "hud-armor", &cfg.hudShown[HUD_ARMOR], 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-cheat-counter", &cfg.hudShownCheatCounters, 0, 0, 63, unhideHUD )
C_VAR_FLOAT2( "hud-cheat-counter-scale", &cfg.hudCheatCounterScale, 0, .1f, 1, unhideHUD )
C_VAR_BYTE2( "hud-cheat-counter-show-mapopen", &cfg.hudCheatCounterShowWithAutomap, 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-face", &cfg.hudShown[HUD_FACE], 0, 0, 1, unhideHUD )
C_VAR_BYTE( "hud-face-ouchfix", &cfg.fixOuchFace, 0, 0, 1 )
C_VAR_BYTE2( "hud-frags", &cfg.hudShown[HUD_FRAGS], 0, 0, 1, unhideHUD )
Expand Down Expand Up @@ -2194,6 +2195,7 @@ void Kills_Drawer(uiwidget_t* obj, const Point2Raw* offset)
if(!(cfg.hudShownCheatCounters & (CCH_KILLS | CCH_KILLS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(kills->value == 1994) return;

strcpy(buf, "Kills: ");
Expand Down Expand Up @@ -2236,6 +2238,7 @@ void Kills_UpdateGeometry(uiwidget_t* obj)
if(!(cfg.hudShownCheatCounters & (CCH_KILLS | CCH_KILLS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(kills->value == 1994) return;

strcpy(buf, "Kills: ");
Expand Down Expand Up @@ -2276,6 +2279,7 @@ void Items_Drawer(uiwidget_t* obj, const Point2Raw* offset)
if(!(cfg.hudShownCheatCounters & (CCH_ITEMS | CCH_ITEMS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(items->value == 1994) return;

strcpy(buf, "Items: ");
Expand Down Expand Up @@ -2318,6 +2322,7 @@ void Items_UpdateGeometry(uiwidget_t* obj)
if(!(cfg.hudShownCheatCounters & (CCH_ITEMS | CCH_ITEMS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(items->value == 1994) return;

strcpy(buf, "Items: ");
Expand Down Expand Up @@ -2349,6 +2354,7 @@ void Secrets_Drawer(uiwidget_t* obj, const Point2Raw* offset)
if(!(cfg.hudShownCheatCounters & (CCH_SECRETS | CCH_SECRETS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(scrt->value == 1994) return;

strcpy(buf, "Secret: ");
Expand Down Expand Up @@ -2400,6 +2406,7 @@ void Secrets_UpdateGeometry(uiwidget_t* obj)
if(!(cfg.hudShownCheatCounters & (CCH_SECRETS | CCH_SECRETS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(scrt->value == 1994) return;

strcpy(buf, "Secret: ");
Expand Down
3 changes: 3 additions & 0 deletions doomsday/plugins/jdoom64/data/conhelp.txt
Expand Up @@ -481,6 +481,9 @@ desc = 6-bit bitfield. Show kills, items and secret counters.
[hud-cheat-counter-scale]
desc = Size factor for the counters.

[hud-cheat-counter-show-mapopen]
desc = 1=Only show the cheat counters while the automap is open.

[map-customcolors]
desc = Custom automap coloring 0=Never, 1=Auto (enabled if unchanged), 2=Always.

Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom64/include/d_config.h
Expand Up @@ -161,6 +161,7 @@ typedef struct jdoom64_config_s {

byte hudShownCheatCounters;
float hudCheatCounterScale;
byte hudCheatCounterShowWithAutomap; ///< Only show when the automap is open.

// Automap stuff.
/* int automapPos;
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/jdoom64/src/d_main.c
Expand Up @@ -308,7 +308,9 @@ void D_PreInit(void)
cfg.automapPanSpeed = .5f;
cfg.automapPanResetOnOpen = true;
cfg.automapOpenSeconds = AUTOMAP_OPEN_SECONDS;
cfg.hudCheatCounterScale = .7f; // From jHeretic.

cfg.hudCheatCounterScale = .7f;
cfg.hudCheatCounterShowWithAutomap = true;

cfg.msgCount = 1;
cfg.msgScale = .8f;
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom64/src/st_stuff.c
Expand Up @@ -111,6 +111,7 @@ void ST_Register(void)
C_VAR_BYTE2( "hud-armor", &cfg.hudShown[HUD_ARMOR], 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-cheat-counter", &cfg.hudShownCheatCounters, 0, 0, 63, unhideHUD )
C_VAR_FLOAT2( "hud-cheat-counter-scale", &cfg.hudCheatCounterScale, 0, .1f, 1, unhideHUD )
C_VAR_BYTE2( "hud-cheat-counter-show-mapopen", &cfg.hudCheatCounterShowWithAutomap, 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-frags", &cfg.hudShown[HUD_FRAGS], 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-health", &cfg.hudShown[HUD_HEALTH], 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-keys", &cfg.hudShown[HUD_KEYS], 0, 0, 1, unhideHUD )
Expand Down
3 changes: 3 additions & 0 deletions doomsday/plugins/jheretic/data/conhelp.txt
Expand Up @@ -509,6 +509,9 @@ desc = 6-bit bitfield. Show kills, items and secret counters.
[hud-cheat-counter-scale]
desc = Size factor for the counters.

[hud-cheat-counter-show-mapopen]
desc = 1=Only show the cheat counters while the automap is open.

[map-customcolors]
desc = Custom automap coloring 0=Never, 1=Auto (enabled if unchanged), 2=Always.

Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jheretic/include/h_config.h
Expand Up @@ -163,6 +163,7 @@ typedef struct jheretic_config_s {

byte hudShownCheatCounters;
float hudCheatCounterScale;
byte hudCheatCounterShowWithAutomap; ///< Only show when the automap is open.

// Automap stuff.
/* int automapPos;
Expand Down
2 changes: 2 additions & 0 deletions doomsday/plugins/jheretic/src/h_main.c
Expand Up @@ -313,7 +313,9 @@ void H_PreInit(void)
cfg.automapPanSpeed = .5f;
cfg.automapPanResetOnOpen = true;
cfg.automapOpenSeconds = AUTOMAP_OPEN_SECONDS;

cfg.hudCheatCounterScale = .7f;
cfg.hudCheatCounterShowWithAutomap = true;

cfg.msgCount = 4;
cfg.msgScale = .8f;
Expand Down
7 changes: 7 additions & 0 deletions doomsday/plugins/jheretic/src/st_stuff.c
Expand Up @@ -195,6 +195,7 @@ void ST_Register(void)
C_VAR_BYTE2( "hud-armor", &cfg.hudShown[HUD_ARMOR], 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-cheat-counter", &cfg.hudShownCheatCounters, 0, 0, 63, unhideHUD )
C_VAR_FLOAT2( "hud-cheat-counter-scale", &cfg.hudCheatCounterScale, 0, .1f, 1, unhideHUD )
C_VAR_BYTE2( "hud-cheat-counter-show-mapopen", &cfg.hudCheatCounterShowWithAutomap, 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-currentitem", &cfg.hudShown[HUD_READYITEM], 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-health", &cfg.hudShown[HUD_HEALTH], 0, 0, 1, unhideHUD )
C_VAR_BYTE2( "hud-keys", &cfg.hudShown[HUD_KEYS], 0, 0, 1, unhideHUD )
Expand Down Expand Up @@ -2052,6 +2053,7 @@ void Kills_Drawer(uiwidget_t* obj, const Point2Raw* offset)
if(!(cfg.hudShownCheatCounters & (CCH_KILLS | CCH_KILLS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(kills->value == 1994) return;

strcpy(buf, "Kills: ");
Expand Down Expand Up @@ -2094,6 +2096,7 @@ void Kills_UpdateGeometry(uiwidget_t* obj)
if(!(cfg.hudShownCheatCounters & (CCH_KILLS | CCH_KILLS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(kills->value == 1994) return;

strcpy(buf, "Kills: ");
Expand Down Expand Up @@ -2134,6 +2137,7 @@ void Items_Drawer(uiwidget_t* obj, const Point2Raw* offset)
if(!(cfg.hudShownCheatCounters & (CCH_ITEMS | CCH_ITEMS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(items->value == 1994) return;

strcpy(buf, "Items: ");
Expand Down Expand Up @@ -2176,6 +2180,7 @@ void Items_UpdateGeometry(uiwidget_t* obj)
if(!(cfg.hudShownCheatCounters & (CCH_ITEMS | CCH_ITEMS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(items->value == 1994) return;

strcpy(buf, "Items: ");
Expand Down Expand Up @@ -2216,6 +2221,7 @@ void Secrets_Drawer(uiwidget_t* obj, const Point2Raw* offset)
if(!(cfg.hudShownCheatCounters & (CCH_SECRETS | CCH_SECRETS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(scrt->value == 1994) return;

strcpy(buf, "Secret: ");
Expand Down Expand Up @@ -2258,6 +2264,7 @@ void Secrets_UpdateGeometry(uiwidget_t* obj)
if(!(cfg.hudShownCheatCounters & (CCH_SECRETS | CCH_SECRETS_PRCNT))) return;
if(ST_AutomapIsActive(obj->player) && cfg.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[obj->player].plr->mo) && Get(DD_PLAYBACK)) return;
if(cfg.hudCheatCounterShowWithAutomap && !ST_AutomapIsActive(obj->player)) return;
if(scrt->value == 1994) return;

strcpy(buf, "Secret: ");
Expand Down
2 changes: 2 additions & 0 deletions doomsday/plugins/jhexen/include/x_config.h
Expand Up @@ -115,8 +115,10 @@ typedef struct {
int weaponOrder[NUM_WEAPON_TYPES];
byte weaponNextMode; // if true use the weaponOrder for next/previous.
float filterStrength;

byte hudShownCheatCounters;
float hudCheatCounterScale;
byte hudCheatCounterShowWithAutomap; ///< Only show when the automap is open.

// Automap stuff.
/* int automapPos;
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/jhexen/src/h2_main.c
Expand Up @@ -304,7 +304,9 @@ void X_PreInit(void)
cfg.automapPanSpeed = .5f;
cfg.automapPanResetOnOpen = true;
cfg.automapOpenSeconds = AUTOMAP_OPEN_SECONDS;
cfg.hudCheatCounterScale = .7f; //From jHeretic

cfg.hudCheatCounterScale = .7f;
cfg.hudCheatCounterShowWithAutomap = true;

cfg.msgCount = 4;
cfg.msgScale = .8f;
Expand Down

0 comments on commit 776b3e2

Please sign in to comment.