Skip to content

Commit

Permalink
Make alt_arms menu item rebuild ST widgets
Browse files Browse the repository at this point in the history
Additionally, some reformatting.
  • Loading branch information
MrAlaux committed Dec 1, 2023
1 parent 5aee869 commit f4442cb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3712,7 +3712,7 @@ setup_menu_t stat_settings4[] =
{"Nugget - Extended HUD", S_SKIP|S_TITLE, m_null, M_X, M_Y + stat4_title1 * M_SPC},

{"Show Powerup Timers", S_YESNO|S_COSMETIC, m_null, M_X, M_Y + stat4_powers * M_SPC, {"hud_power_timers"}},
{"Alternative Arms Display", S_YESNO, m_null, M_X, M_Y + stat4_altarms * M_SPC, {"alt_arms"}},
{"Alternative Arms Display", S_YESNO, m_null, M_X, M_Y + stat4_altarms * M_SPC, {"alt_arms"}, 0, ST_createWidgets},
{"Smart Totals", S_YESNO, m_null, M_X, M_Y + stat4_smart * M_SPC, {"smarttotals"}},
{"Show Kills Percentage", S_YESNO, m_null, M_X, M_Y + stat4_killspct * M_SPC, {"hud_kills_percentage"}},

Expand Down
25 changes: 13 additions & 12 deletions src/p_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ void P_MovePlayer (player_t* player)
{
ticcmd_t *cmd = &player->cmd;
mobj_t *mo = player->mo;
// [Nugget]
static boolean crouchKeyDown = false;
int cforwardmove, csidemove;
static boolean crouchKeyDown = false; // [Nugget]

mo->angle += cmd->angleturn << 16;
onground = mo->z <= mo->floorz;
Expand Down Expand Up @@ -376,23 +374,26 @@ void P_MovePlayer (player_t* player)
int bobfactor =
friction < ORIG_FRICTION ? movefactor : ORIG_FRICTION_FACTOR;

// [Nugget]
cforwardmove = cmd->forwardmove;
csidemove = cmd->sidemove;
// Check for crouching
// [Nugget] /-------------------------------------------------------

char forwardmove = cmd->forwardmove,
sidemove = cmd->sidemove;

if (player->mo->intflags & MIF_CROUCHING)
{ cforwardmove /= 2; csidemove /= 2; }
{ forwardmove /= 2; sidemove /= 2; }

// [Nugget] -------------------------------------------------------/

if (cmd->forwardmove)
{
P_Bob(player,mo->angle,cforwardmove*bobfactor);
P_Thrust(player,mo->angle,cforwardmove*movefactor);
P_Bob(player,mo->angle,forwardmove*bobfactor);
P_Thrust(player,mo->angle,forwardmove*movefactor);
}

if (cmd->sidemove)
{
P_Bob(player,mo->angle-ANG90,csidemove*bobfactor);
P_Thrust(player,mo->angle-ANG90,csidemove*movefactor);
P_Bob(player,mo->angle-ANG90,sidemove*bobfactor);
P_Thrust(player,mo->angle-ANG90,sidemove*movefactor);
}
}
// [Nugget] Allow minimal mid-air movement if Jumping is enabled
Expand Down
2 changes: 0 additions & 2 deletions src/st_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,6 @@ int st_crispyhud; // [Nugget] Now an int
static boolean st_classicstatusbar;
static boolean st_statusbarface; // [Nugget] Face may still be drawn in NUGHUD

void ST_createWidgets(); // [Nugget] Prototype this

// !deathmatch
static boolean st_notdeathmatch;

Expand Down
2 changes: 2 additions & 0 deletions src/st_stuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ void ST_Warnings(void);
// [crispy] forcefully initialize the status bar backing screen
extern void ST_refreshBackground(boolean force);

extern void ST_createWidgets(void); // [Nugget]

// killough 5/2/98: moved from m_misc.c:

// [Alaux]
Expand Down

0 comments on commit f4442cb

Please sign in to comment.