void ST_createWidgets(void) { // ready weapon ammo STlib_initNum(&w_ready,ST_AMMOX,ST_AMMOY,tallnum,&plyr->ammo[weaponinfo[plyr->readyweapon].ammo],&st_statusbaron,ST_AMMOWIDTH ); // the last weapon type w_ready.data = plyr->readyweapon; // health percentage STlib_initPercent(&w_health,ST_HEALTHX,ST_HEALTHY,tallnum,&plyr->health,&st_statusbaron,tallpercent); // arms background STlib_initBinIcon(&w_armsbg,ST_ARMSBGX,ST_ARMSBGY,armsbg,&st_notdeathmatch,&st_statusbaron); // weapons owned STlib_initBinIcon(&w_arms_0,ST_ARMSX+(0*ST_ARMSXSPACE),ST_ARMSY+(0*ST_ARMSYSPACE),arms_0, &plyr->weaponowned[1],&st_armson); STlib_initBinIcon(&w_arms_1,ST_ARMSX+(1*ST_ARMSXSPACE),ST_ARMSY+(0*ST_ARMSYSPACE),arms_1, &plyr->weaponowned[2],&st_armson); STlib_initBinIcon(&w_arms_2,ST_ARMSX+(2*ST_ARMSXSPACE),ST_ARMSY+(0*ST_ARMSYSPACE),arms_2, &plyr->weaponowned[3],&st_armson); STlib_initBinIcon(&w_arms_3,ST_ARMSX+(0*ST_ARMSXSPACE),ST_ARMSY+(1*ST_ARMSYSPACE),arms_3, &plyr->weaponowned[4],&st_armson); STlib_initBinIcon(&w_arms_4,ST_ARMSX+(1*ST_ARMSXSPACE),ST_ARMSY+(1*ST_ARMSYSPACE),arms_4, &plyr->weaponowned[5],&st_armson); STlib_initBinIcon(&w_arms_5,ST_ARMSX+(2*ST_ARMSXSPACE),ST_ARMSY+(1*ST_ARMSYSPACE),arms_5, &plyr->weaponowned[6],&st_armson); // frags sum STlib_initNum(&w_frags,ST_FRAGSX,ST_FRAGSY,tallnum,&st_fragscount,&st_fragson,ST_FRAGSWIDTH); // faces STlib_initMultIcon(&w_faces,ST_FACESX,ST_FACESY,faces,&st_faceindex,&st_statusbaron); // armor percentage - should be colored later STlib_initPercent(&w_armor,ST_ARMORX,ST_ARMORY,tallnum,&plyr->armorpoints,&st_statusbaron, tallpercent); // keyboxes 0-2 STlib_initMultIcon(&w_keyboxes_0,ST_KEY0X,ST_KEY0Y,keys,&keyboxes_1,&st_statusbaron); STlib_initMultIcon(&w_keyboxes_1,ST_KEY1X,ST_KEY1Y,keys,&keyboxes_1,&st_statusbaron); STlib_initMultIcon(&w_keyboxes_2,ST_KEY2X,ST_KEY2Y,keys,&keyboxes_2,&st_statusbaron); // ammo count (all four kinds) STlib_initNum(&w_ammo[0],ST_AMMO0X,ST_AMMO0Y,shortnum,&plyr->ammo[0],&st_statusbaron,ST_AMMO0WIDTH); STlib_initNum(&w_ammo[1],ST_AMMO1X,ST_AMMO1Y,shortnum,&plyr->ammo[1],&st_statusbaron,ST_AMMO1WIDTH); STlib_initNum(&w_ammo[2],ST_AMMO2X,ST_AMMO2Y,shortnum,&plyr->ammo[2],&st_statusbaron,ST_AMMO2WIDTH); STlib_initNum(&w_ammo[3],ST_AMMO3X,ST_AMMO3Y,shortnum,&plyr->ammo[3],&st_statusbaron,ST_AMMO3WIDTH); // max ammo count (all four kinds) STlib_initNum(&w_maxammo[0],ST_MAXAMMO0X,ST_MAXAMMO0Y,shortnum,&plyr->maxammo[0],&st_statusbaron,ST_MAXAMMO0WIDTH); STlib_initNum(&w_maxammo[1],ST_MAXAMMO1X,ST_MAXAMMO1Y,shortnum,&plyr->maxammo[1],&st_statusbaron,ST_MAXAMMO1WIDTH); STlib_initNum(&w_maxammo[2],ST_MAXAMMO2X,ST_MAXAMMO2Y,shortnum,&plyr->maxammo[2],&st_statusbaron,ST_MAXAMMO2WIDTH); STlib_initNum(&w_maxammo[3],ST_MAXAMMO3X,ST_MAXAMMO3Y,shortnum,&plyr->maxammo[3],&st_statusbaron,ST_MAXAMMO3WIDTH); }
// // STlib_initPercent() // // Initialize a st_percent_t number with percent sign widget // // Passed a st_percent_t widget, the position, the digit patches, a pointer // to the number to display, a pointer to the enable flag, and patch // for the percent sign. // Returns nothing. // void STlib_initPercent ( st_percent_t* p, int x, int y, const patchnum_t* pl, int* num, dboolean* on, const patchnum_t* percent ) { STlib_initNum(&p->n, x, y, pl, num, on, 3); p->p = percent; }
void STlib_initPercent ( st_percent_t* p, int x, int y, patch_t** pl, int* num, qboolean* on, patch_t* percent ) { STlib_initNum(&p->n, x, y, pl, num, on, 3); p->p = percent; }