mirror of
https://github.com/nzp-team/quakespasm.git
synced 2024-11-10 06:32:03 +00:00
NX/VITA: Support displaying Double-Tap 1.0 icon
This commit is contained in:
parent
be6377e9cf
commit
99d258e5b3
4 changed files with 47 additions and 2 deletions
|
@ -1264,6 +1264,7 @@ CL_ParseServerMessage
|
|||
=====================
|
||||
*/
|
||||
extern double bettyprompt_time;
|
||||
extern qboolean doubletap_has_damage_buff;
|
||||
void CL_ParseServerMessage (void)
|
||||
{
|
||||
int cmd;
|
||||
|
@ -1599,6 +1600,10 @@ void CL_ParseServerMessage (void)
|
|||
strcpy(player_name, MSG_ReadString());
|
||||
break;
|
||||
|
||||
case svc_doubletap:
|
||||
doubletap_has_damage_buff = MSG_ReadByte();
|
||||
break;
|
||||
|
||||
//case svc_bspdecal:
|
||||
// CL_ParseBSPDecal ();
|
||||
// break;
|
||||
|
|
|
@ -49,6 +49,7 @@ qpic_t *jugpic;
|
|||
qpic_t *floppic;
|
||||
qpic_t *staminpic;
|
||||
qpic_t *doublepic;
|
||||
qpic_t *doublepic2;
|
||||
qpic_t *speedpic;
|
||||
qpic_t *deadpic;
|
||||
qpic_t *mulepic;
|
||||
|
@ -68,6 +69,7 @@ float round_center_y;
|
|||
extern qboolean paused_hack;
|
||||
qboolean domaxammo;
|
||||
qboolean has_chaptertitle;
|
||||
qboolean doubletap_has_damage_buff;
|
||||
|
||||
double HUD_Change_time;//hide hud when not chagned
|
||||
double bettyprompt_time;
|
||||
|
@ -114,6 +116,7 @@ void HUD_Init (void) {
|
|||
floppic = Draw_CachePic ("gfx/hud/flopper.tga");
|
||||
staminpic = Draw_CachePic ("gfx/hud/stamin.tga");
|
||||
doublepic = Draw_CachePic ("gfx/hud/double.tga");
|
||||
doublepic2 = Draw_CachePic ("gfx/hud/double2.tga");
|
||||
speedpic = Draw_CachePic ("gfx/hud/speed.tga");
|
||||
deadpic = Draw_CachePic ("gfx/hud/dead.tga");
|
||||
mulepic = Draw_CachePic ("gfx/hud/mule.tga");
|
||||
|
@ -1480,12 +1483,19 @@ void HUD_Perks (void)
|
|||
scale = 26;
|
||||
#endif // VITA
|
||||
|
||||
// Double-Tap 2.0 specialty icon
|
||||
qpic_t* double_tap_icon;
|
||||
if (doubletap_has_damage_buff)
|
||||
double_tap_icon = doublepic2;
|
||||
else
|
||||
double_tap_icon = doublepic;
|
||||
|
||||
// Draw second column first -- these need to be
|
||||
// overlayed below the first column.
|
||||
for (int i = 4; i < 8; i++) {
|
||||
if (perk_order[i]) {
|
||||
if (perk_order[i] == P_JUG) {Draw_StretchPic(x, y, jugpic, scale, scale);}
|
||||
if (perk_order[i] == P_DOUBLE) {Draw_StretchPic(x, y, doublepic, scale, scale);}
|
||||
if (perk_order[i] == P_DOUBLE) {Draw_StretchPic(x, y, double_tap_icon, scale, scale);}
|
||||
if (perk_order[i] == P_SPEED) {Draw_StretchPic(x, y, speedpic, scale, scale);}
|
||||
if (perk_order[i] == P_REVIVE) {Draw_StretchPic(x, y, revivepic, scale, scale);}
|
||||
if (perk_order[i] == P_FLOP) {Draw_StretchPic(x, y, floppic, scale, scale);}
|
||||
|
@ -1508,7 +1518,7 @@ void HUD_Perks (void)
|
|||
for (int i = 0; i < 4; i++) {
|
||||
if (perk_order[i]) {
|
||||
if (perk_order[i] == P_JUG) {Draw_StretchPic(x, y, jugpic, scale, scale);}
|
||||
if (perk_order[i] == P_DOUBLE) {Draw_StretchPic(x, y, doublepic, scale, scale);}
|
||||
if (perk_order[i] == P_DOUBLE) {Draw_StretchPic(x, y, double_tap_icon, scale, scale);}
|
||||
if (perk_order[i] == P_SPEED) {Draw_StretchPic(x, y, speedpic, scale, scale);}
|
||||
if (perk_order[i] == P_REVIVE) {Draw_StretchPic(x, y, revivepic, scale, scale);}
|
||||
if (perk_order[i] == P_FLOP) {Draw_StretchPic(x, y, floppic, scale, scale);}
|
||||
|
|
|
@ -1302,6 +1302,34 @@ void PF_GrenadePulse(void)
|
|||
MSG_WriteByte (&client->message,svc_pulse);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PF_SetDoubleTapVersion
|
||||
|
||||
Server tells client which HUD icon
|
||||
to draw for Double-Tap (damage buff
|
||||
v.s. just rate of fire enhancement).
|
||||
|
||||
nzp_setdoubletapver()
|
||||
=================
|
||||
*/
|
||||
void PF_SetDoubleTapVersion(void)
|
||||
{
|
||||
client_t *client;
|
||||
int entnum;
|
||||
int state;
|
||||
|
||||
entnum = G_EDICTNUM(OFS_PARM0);
|
||||
state = G_FLOAT(OFS_PARM1);
|
||||
|
||||
if (entnum < 1 || entnum > svs.maxclients)
|
||||
return;
|
||||
|
||||
client = &svs.clients[entnum-1];
|
||||
MSG_WriteByte (&client->message, svc_doubletap);
|
||||
MSG_WriteByte (&client->message, state);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PF_BettyPrompt
|
||||
|
@ -3921,6 +3949,7 @@ static builtin_t pr_builtin[] =
|
|||
PF_MaxZombies, // #503
|
||||
PF_BettyPrompt, // #504
|
||||
PF_SetPlayerName, // #505
|
||||
PF_SetDoubleTapVersion, // #506
|
||||
};
|
||||
|
||||
builtin_t *pr_builtins = pr_builtin;
|
||||
|
|
|
@ -216,6 +216,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define svc_pulse 47 // 47
|
||||
#define svc_bettyprompt 48 // 48
|
||||
#define svc_playername 49 // 49
|
||||
#define svc_doubletap 50 // 50
|
||||
|
||||
#define svc_limbupdate 51
|
||||
#define svc_achievement 52 // [string] name [byte] decal_size [coords] pos
|
||||
|
|
Loading…
Reference in a new issue