mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-25 22:05:20 -04:00
show "secret revealed" message when revealing sectors with generalized secret mask
Also, finally uncouple from general "show messages" setting.
This commit is contained in:
parent
b28aee2679
commit
c5914bb4db
@ -1520,8 +1520,7 @@ void HU_Drawer(void)
|
||||
else
|
||||
HUlib_drawSText(&w_message);
|
||||
|
||||
if (secret_on)
|
||||
HUlib_drawSText(&w_secret);
|
||||
HUlib_drawSText(&w_secret);
|
||||
|
||||
// display the interactive buffer for chat entry
|
||||
HUlib_drawIText(&w_chat);
|
||||
@ -1614,24 +1613,23 @@ void HU_Ticker(void)
|
||||
if (secret_counter && !--secret_counter)
|
||||
secret_on = false;
|
||||
|
||||
// [Woof!] "A secret is revealed!" message
|
||||
if (plr->centermessage)
|
||||
{
|
||||
extern int M_StringWidth(const char *string);
|
||||
w_secret.l[0].x = ORIGWIDTH/2 - M_StringWidth(plr->centermessage)/2;
|
||||
|
||||
HUlib_addMessageToSText(&w_secret, 0, plr->centermessage);
|
||||
plr->centermessage = NULL;
|
||||
secret_on = true;
|
||||
secret_counter = 5*TICRATE/2; // [crispy] 2.5 seconds
|
||||
}
|
||||
|
||||
// if messages on, or "Messages Off" is being displayed
|
||||
// this allows the notification of turning messages off to be seen
|
||||
// display message if necessary
|
||||
|
||||
if (showMessages || message_dontfuckwithme)
|
||||
{
|
||||
// [Woof!] "A secret is revealed!" message
|
||||
if (plr->centermessage)
|
||||
{
|
||||
extern int M_StringWidth(const char *string);
|
||||
w_secret.l[0].x = ORIGWIDTH/2 - M_StringWidth(plr->centermessage)/2;
|
||||
|
||||
HUlib_addMessageToSText(&w_secret, 0, plr->centermessage);
|
||||
plr->centermessage = NULL;
|
||||
secret_on = true;
|
||||
secret_counter = 5*TICRATE/2; // [crispy] 2.5 seconds
|
||||
}
|
||||
else if (plr->message &&
|
||||
if ((showMessages || message_dontfuckwithme) && plr->message &&
|
||||
(!message_nottobefuckedwith || message_dontfuckwithme))
|
||||
{
|
||||
//post the message to the message widget
|
||||
@ -1665,7 +1663,6 @@ void HU_Ticker(void)
|
||||
// clear the flag that "Messages Off" is being posted
|
||||
message_dontfuckwithme = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// check for incoming chat characters
|
||||
if (netgame)
|
||||
|
@ -2079,10 +2079,30 @@ int disable_nuke; // killough 12/98: nukage disabling cheat
|
||||
// Changed to ignore sector types the engine does not recognize
|
||||
//
|
||||
|
||||
static void P_SecretRevealed(player_t *player)
|
||||
{
|
||||
extern int hud_secret_message;
|
||||
|
||||
if (hud_secret_message && player == &players[consoleplayer])
|
||||
{
|
||||
static int sfx_id = -1;
|
||||
player->centermessage = s_HUSTR_SECRETFOUND;
|
||||
|
||||
if (sfx_id == -1)
|
||||
{
|
||||
sfx_id = I_GetSfxLumpNum(&S_sfx[sfx_secret]) != -1 ? sfx_secret :
|
||||
I_GetSfxLumpNum(&S_sfx[sfx_itmbk]) != -1 ? sfx_itmbk :
|
||||
-2;
|
||||
}
|
||||
|
||||
if (sfx_id >= 0)
|
||||
S_StartSound(NULL, sfx_id);
|
||||
}
|
||||
}
|
||||
|
||||
void P_PlayerInSpecialSector (player_t *player)
|
||||
{
|
||||
sector_t *sector = player->mo->subsector->sector;
|
||||
extern int hud_secret_message;
|
||||
|
||||
// Falling, not all the way down yet?
|
||||
// Sector specials don't apply in mid-air
|
||||
@ -2099,20 +2119,7 @@ void P_PlayerInSpecialSector (player_t *player)
|
||||
player->secretcount++;
|
||||
sector->special = 0;
|
||||
|
||||
if (hud_secret_message && player == &players[consoleplayer])
|
||||
{
|
||||
static int sfx_id = -1;
|
||||
player->centermessage = s_HUSTR_SECRETFOUND;
|
||||
|
||||
if (sfx_id == -1)
|
||||
{
|
||||
sfx_id = I_GetSfxLumpNum(&S_sfx[sfx_secret]) != -1 ? sfx_secret :
|
||||
I_GetSfxLumpNum(&S_sfx[sfx_itmbk]) != -1 ? sfx_itmbk : -1;
|
||||
}
|
||||
|
||||
if (sfx_id != -1)
|
||||
S_StartSound(NULL, sfx_id);
|
||||
}
|
||||
P_SecretRevealed(player);
|
||||
}
|
||||
else
|
||||
if (!disable_nuke) // killough 12/98: nukage disabling cheat
|
||||
@ -2221,6 +2228,7 @@ void P_PlayerInSpecialSector (player_t *player)
|
||||
sector->special &= ~SECRET_MASK;
|
||||
if (sector->special<32) // if all extended bits clear,
|
||||
sector->special=0; // sector is not special anymore
|
||||
P_SecretRevealed(player);
|
||||
}
|
||||
|
||||
// phares 3/19/98:
|
||||
|
Loading…
x
Reference in New Issue
Block a user