components/prboom/st_stuff.c
// killough 2/28/98: traditional status bar keys
killough 2/28/98: traditional status bar keys
killough 2 / 28 / 98 : traditional status bar keys
static void ST_updateWidgets(void)
{
  static int  largeammo = 1994; 
  int         i;
  if (weaponinfo[plyr->readyweapon].ammo == am_noammo)
    w_ready.num = &largeammo;
  else
    w_ready.num = &plyr->ammo[weaponinfo[plyr->readyweapon].ammo];
  w_ready.data = plyr->readyweapon;
  for (i=0;i<3;i++)
    {
      keyboxes[i] = plyr->cards[i] ? i : -1;
      if (plyr->cards[i+3])
        keyboxes[i] = keyboxes[i]==-1 || sts_traditional_keys ? i+3 : i+6;
    }
  ST_updateFaceWidget();
  st_notdeathmatch = !deathmatch;
  st_armson = st_statusbaron && !deathmatch;
  st_fragson = deathmatch && st_statusbaron;
  st_fragscount = 0;
  for (i=0 ; i<MAXPLAYERS ; i++)
    {
      if (i != displayplayer)            
        st_fragscount += plyr->frags[i];
      else
        st_fragscount -= plyr->frags[i];
    }
  if (!--st_msgcounter)
    st_chat = st_oldchat;
}
static void ST_updateWidgets ( void ) { static int largeammo = 1994 ; int i ; if ( weaponinfo [ plyr -> readyweapon ] . ammo == am_noammo ) w_ready . num = & largeammo ; else w_ready . num = & plyr -> ammo [ weaponinfo [ plyr -> readyweapon ] . ammo ] ; w_ready . data = plyr -> readyweapon ; for ( i = 0 ; i < 3 ; i ++ ) { keyboxes [ i ] = plyr -> cards [ i ] ? i : -1 ; if ( plyr -> cards [ i + 3 ] ) keyboxes [ i ] = keyboxes [ i ] == -1 || sts_traditional_keys ? i + 3 : i + 6 ; } ST_updateFaceWidget ( ) ; st_notdeathmatch = ! deathmatch ; st_armson = st_statusbaron && ! deathmatch ; st_fragson = deathmatch && st_statusbaron ; st_fragscount = 0 ; for ( i = 0 ; i < MAXPLAYERS ; i ++ ) { if ( i != displayplayer ) st_fragscount += plyr -> frags [ i ] ; else st_fragscount -= plyr -> frags [ i ] ; } if ( ! -- st_msgcounter ) st_chat = st_oldchat ; }
killough 2/28/98: traditional status bar keys
killough 2 / 28 / 98 : traditional status bar keys
// means "n/a" // must redirect the pointer if the ready weapon has changed. //  if (w_ready.data != plyr->readyweapon) //  { //{ // static int tic=0; // static int dir=-1; // if (!(tic&15)) //   plyr->ammo[weaponinfo[plyr->readyweapon].ammo]+=dir; // if (plyr->ammo[weaponinfo[plyr->readyweapon].ammo] == -100) //   dir = 1; // tic++; // } // if (*w_ready.on) //  STlib_updateNum(&w_ready, true); // refresh weapon change //  } // update keycard multiple widgets //jff 2/24/98 select double key //killough 2/28/98: preserve traditional keys by config option // refresh everything if this is him coming back to life // used by the w_armsbg widget // used by w_arms[] widgets // used by w_frags widget // killough 3/7/98 // get rid of chat window if up because of message