Skip to content

Commit

Permalink
Restore key-blink feature
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlaux committed Nov 27, 2024
1 parent fc93214 commit fab1aa3
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 22 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- **Merged changes from [Woof! 15.0.0](https://github.com/fabiangreffrath/woof/releases/tag/woof_15.0.0)**, note:
- NUGHUD now partially uses SBARDEF as its backend, which may cause some rendering differences
- Integrated periodic auto saves into the save/load menus
- Maintained message list, message duration, and chat-message duration settings [1]
- Maintained key blink, message list, message duration, and chat-message duration settings [1]
- Removed `show_ssg` (now default behavior), `alt_arms` and `hud_highlight_weapon` settings
- Renamed `#_bobbing_percentage` to `#_bobbing_pct` [2]
- Renamed `show_berserk` to `sts_show_berserk` [2]
Expand All @@ -32,6 +32,6 @@
- **Crash when loading WADs with empty lumps between `C_#` markers** (fixes `nt_rc1.wad`)
- **Shadows not being drawn for HUD icons when using Boom font**

**[1].** Not necessarily with the same CVARs; existing config files will be affected.
**[1].** Not necessarily with the same CVARs; existing config files may be affected.

**[2].** This will affect existing config files.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ For these settings, their CVAR names are provided alongside the _CFG-only_ label
- **_Message Lines_** setting (scrolling direction determined by the CFG-only `hud_msg_scrollup` CVAR)
- **_(Chat) Message Duration_** settings
- **_Show Powerup Timers_** setting
- **_Berserk display when using Fist** setting [partially p.f. Crispy Doom]
- **_Blink Missing Keys_** setting [partially p.f. Crispy Doom]
- **_Berserk display when using Fist_** setting [partially p.f. Crispy Doom]
- **_Automap Level Stats Format_** setting
- **Level-Stats Selection** settings (CFG-only: `hud_stats_#[_map]`)
- **Event Timers:**
Expand Down
1 change: 1 addition & 0 deletions src/mn_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,7 @@ static setup_menu_t stat_settings5[] =
{"Nugget - HUD", S_SKIP|S_TITLE, M_X, M_SPC},

{"Show Powerup Timers", S_CHOICE|S_COSMETIC, M_X, M_SPC, {"hud_power_timers"}, .strings_id = str_show_widgets},
{"Blink Missing Keys", S_ONOFF, M_X, M_SPC, {"hud_blink_keys"}},
{"Berserk display when using Fist", S_ONOFF, M_X, M_SPC, {"sts_show_berserk"}},
{"Allow HUD Icons", S_ONOFF, M_X, M_SPC, {"hud_allow_icons"}},

Expand Down
12 changes: 6 additions & 6 deletions src/p_doors.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ int EV_DoLockedDoor(line_t *line, vldoor_e type, mobj_t *thing)
doomprintf(p, MESSAGES_NONE, "%s", s_PD_BLUEO); // Ty 03/27/98 - externalized
S_StartSoundOptional(p->mo, sfx_locked, // [Nugget]: [NS] Locked door sound.
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(p, KEYBLINK_EITHER, KEYBLINK_NONE, KEYBLINK_NONE);
ST_SetKeyBlink(p, KEYBLINK_EITHER, KEYBLINK_NONE, KEYBLINK_NONE); // [Nugget] Key blinking
return 0;
}
break;
Expand All @@ -284,7 +284,7 @@ int EV_DoLockedDoor(line_t *line, vldoor_e type, mobj_t *thing)
doomprintf(p, MESSAGES_NONE, "%s", s_PD_REDO); // Ty 03/27/98 - externalized
S_StartSoundOptional(p->mo, sfx_locked, // [Nugget]: [NS] Locked door sound.
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(p, KEYBLINK_NONE, KEYBLINK_NONE, KEYBLINK_EITHER);
ST_SetKeyBlink(p, KEYBLINK_NONE, KEYBLINK_NONE, KEYBLINK_EITHER); // [Nugget] Key blinking
return 0;
}
break;
Expand All @@ -296,7 +296,7 @@ int EV_DoLockedDoor(line_t *line, vldoor_e type, mobj_t *thing)
doomprintf(p, MESSAGES_NONE, "%s", s_PD_YELLOWO); // Ty 03/27/98 - externalized
S_StartSoundOptional(p->mo, sfx_locked, // [Nugget]: [NS] Locked door sound.
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(p, KEYBLINK_NONE, KEYBLINK_EITHER, KEYBLINK_NONE);
ST_SetKeyBlink(p, KEYBLINK_NONE, KEYBLINK_EITHER, KEYBLINK_NONE); // [Nugget] Key blinking
return 0;
}
break;
Expand Down Expand Up @@ -427,7 +427,7 @@ int EV_VerticalDoor(line_t *line, mobj_t *thing)
doomprintf(player, MESSAGES_NONE, "%s", s_PD_BLUEK); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget]: [NS] Locked door sound.
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_EITHER, KEYBLINK_NONE, KEYBLINK_NONE);
ST_SetKeyBlink(player, KEYBLINK_EITHER, KEYBLINK_NONE, KEYBLINK_NONE); // [Nugget] Key blinking
return 0;
}
break;
Expand All @@ -441,7 +441,7 @@ int EV_VerticalDoor(line_t *line, mobj_t *thing)
doomprintf(player, MESSAGES_NONE, "%s", s_PD_YELLOWK); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget]: [NS] Locked door sound.
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_NONE, KEYBLINK_EITHER, KEYBLINK_NONE);
ST_SetKeyBlink(player, KEYBLINK_NONE, KEYBLINK_EITHER, KEYBLINK_NONE); // [Nugget] Key blinking
return 0;
}
break;
Expand All @@ -455,7 +455,7 @@ int EV_VerticalDoor(line_t *line, mobj_t *thing)
doomprintf(player, MESSAGES_NONE, "%s", s_PD_REDK); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget]: [NS] Locked door sound.
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_NONE, KEYBLINK_NONE, KEYBLINK_EITHER);
ST_SetKeyBlink(player, KEYBLINK_NONE, KEYBLINK_NONE, KEYBLINK_EITHER); // [Nugget] Key blinking
return 0;
}
break;
Expand Down
13 changes: 13 additions & 0 deletions src/p_mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,19 @@ void P_SpawnMapThing (mapthing_t* mthing)
{
mobj->health = 1000 + musid;
}

// [Nugget] Key blinking:
// [crispy] blinking key or skull in the status bar
switch (mobj->sprite)
{
case SPR_BKEY: st_keyorskull[it_bluecard] |= KEYBLINK_CARD; break;
case SPR_BSKU: st_keyorskull[it_bluecard] |= KEYBLINK_SKULL; break;
case SPR_RKEY: st_keyorskull[it_redcard] |= KEYBLINK_CARD; break;
case SPR_RSKU: st_keyorskull[it_redcard] |= KEYBLINK_SKULL; break;
case SPR_YKEY: st_keyorskull[it_yellowcard] |= KEYBLINK_CARD; break;
case SPR_YSKU: st_keyorskull[it_yellowcard] |= KEYBLINK_SKULL; break;
default: break;
}
}

//
Expand Down
5 changes: 5 additions & 0 deletions src/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

// [Nugget]
#include "m_array.h"
#include "st_stuff.h"

//
// MAP related Lookup tables.
Expand Down Expand Up @@ -1726,6 +1727,10 @@ void P_SetupLevel(int episode, int map, int playermask, skill_t skill)
// [crispy] fix long wall wobble
P_SegLengths(false);

// [Nugget] Key blinking:
// [crispy] blinking key or skull in the status bar
memset(st_keyorskull, 0, sizeof(st_keyorskull));

// Note: you don't need to clear player queue slots --
// a much simpler fix is in g_game.c -- killough 10/98

Expand Down
18 changes: 9 additions & 9 deletions src/p_spec.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", s_PD_ANY); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_EITHER, KEYBLINK_EITHER, KEYBLINK_EITHER);
ST_SetKeyBlink(player, KEYBLINK_EITHER, KEYBLINK_EITHER, KEYBLINK_EITHER); // [Nugget] Key blinking
return false;
}
break;
Expand All @@ -836,7 +836,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", skulliscard? s_PD_REDK : s_PD_REDC); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_NONE, KEYBLINK_NONE, skulliscard ? KEYBLINK_EITHER : KEYBLINK_CARD);
ST_SetKeyBlink(player, KEYBLINK_NONE, KEYBLINK_NONE, skulliscard ? KEYBLINK_EITHER : KEYBLINK_CARD); // [Nugget] Key blinking
return false;
}
break;
Expand All @@ -847,7 +847,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", skulliscard? s_PD_BLUEK : s_PD_BLUEC); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, skulliscard ? KEYBLINK_EITHER : KEYBLINK_CARD, KEYBLINK_NONE, KEYBLINK_NONE);
ST_SetKeyBlink(player, skulliscard ? KEYBLINK_EITHER : KEYBLINK_CARD, KEYBLINK_NONE, KEYBLINK_NONE); // [Nugget] Key blinking
return false;
}
break;
Expand All @@ -858,7 +858,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", skulliscard? s_PD_YELLOWK : s_PD_YELLOWC); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_NONE, skulliscard ? KEYBLINK_EITHER : KEYBLINK_CARD, KEYBLINK_NONE);
ST_SetKeyBlink(player, KEYBLINK_NONE, skulliscard ? KEYBLINK_EITHER : KEYBLINK_CARD, KEYBLINK_NONE); // [Nugget] Key blinking
return false;
}
break;
Expand All @@ -869,7 +869,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", skulliscard? s_PD_REDK : s_PD_REDS); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_NONE, KEYBLINK_NONE, skulliscard ? KEYBLINK_EITHER : KEYBLINK_SKULL);
ST_SetKeyBlink(player, KEYBLINK_NONE, KEYBLINK_NONE, skulliscard ? KEYBLINK_EITHER : KEYBLINK_SKULL); // [Nugget] Key blinking
return false;
}
break;
Expand All @@ -880,7 +880,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", skulliscard? s_PD_BLUEK : s_PD_BLUES); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, skulliscard ? KEYBLINK_EITHER : KEYBLINK_SKULL, KEYBLINK_NONE, KEYBLINK_NONE);
ST_SetKeyBlink(player, skulliscard ? KEYBLINK_EITHER : KEYBLINK_SKULL, KEYBLINK_NONE, KEYBLINK_NONE); // [Nugget] Key blinking
return false;
}
break;
Expand All @@ -891,7 +891,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", skulliscard? s_PD_YELLOWK : s_PD_YELLOWS); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_NONE, skulliscard ? KEYBLINK_EITHER : KEYBLINK_SKULL, KEYBLINK_NONE);
ST_SetKeyBlink(player, KEYBLINK_NONE, skulliscard ? KEYBLINK_EITHER : KEYBLINK_SKULL, KEYBLINK_NONE); // [Nugget] Key blinking
return false;
}
break;
Expand All @@ -907,7 +907,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", s_PD_ALL6); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_BOTH, KEYBLINK_BOTH, KEYBLINK_BOTH);
ST_SetKeyBlink(player, KEYBLINK_BOTH, KEYBLINK_BOTH, KEYBLINK_BOTH); // [Nugget] Key blinking
return false;
}
if (skulliscard &&
Expand All @@ -920,7 +920,7 @@ boolean P_CanUnlockGenDoor(line_t *line, player_t *player)
doomprintf(player, MESSAGES_NONE, "%s", s_PD_ALL3); // Ty 03/27/98 - externalized
S_StartSoundOptional(player->mo, sfx_locked, // [Nugget] Locked door sound
STRICTMODE(comp_keynoway) ? sfx_noway : sfx_oof); // [Nugget]
// ST_SetKeyBlink(player, KEYBLINK_EITHER, KEYBLINK_EITHER, KEYBLINK_EITHER);
ST_SetKeyBlink(player, KEYBLINK_EITHER, KEYBLINK_EITHER, KEYBLINK_EITHER); // [Nugget] Key blinking
return false;
}
break;
Expand Down
Loading

0 comments on commit fab1aa3

Please sign in to comment.