This commit is contained in:
Ian 2023-11-22 18:25:40 -05:00
commit 670ed877a1
6 changed files with 74 additions and 6 deletions

View File

@ -1594,6 +1594,10 @@ void CL_ParseServerMessage (void)
case svc_bettyprompt:
bettyprompt_time = sv.time + 4;
break;
case svc_playername:
nameprint_time = sv.time + 11;
strcpy(player_name, MSG_ReadString());
break;
//case svc_bspdecal:
// CL_ParseBSPDecal ();

View File

@ -71,6 +71,9 @@ qboolean has_chaptertitle;
double HUD_Change_time;//hide hud when not chagned
double bettyprompt_time;
double nameprint_time;
char player_name[16];
typedef struct
{
@ -2008,6 +2011,33 @@ void HUD_BettyPrompt (void)
#endif // VITA
}
/*
===============
HUD_PlayerName
===============
*/
void HUD_PlayerName (void)
{
float alpha = 1.0;
int x, y;
float scale;
#ifdef VITA
scale = 2.0f;
x = 147;
y = 413;
#else
scale = 1.25f;
x = 100;
y = 633;
#endif
if (nameprint_time - sv.time < 1)
alpha = (nameprint_time - sv.time);
Draw_ColoredStringScale(x, y, player_name, 255, 255, 255, alpha, scale);
}
//=============================================================================
@ -2047,6 +2077,9 @@ void HUD_Draw (void) {
if (bettyprompt_time > sv.time)
HUD_BettyPrompt();
if (nameprint_time > sv.time)
HUD_PlayerName();
HUD_Blood();
HUD_Rounds();
HUD_Perks();

View File

@ -41,5 +41,7 @@ typedef struct achievement_list_s
void Achievement_Init (void);
extern achievement_list_t achievement_list[MAX_ACHIEVEMENTS];
extern qpic_t *achievement_locked;
extern char player_name[16];
extern double nameprint_time;
void HUD_Parse_Achievement (int ach);

View File

@ -583,7 +583,7 @@ int m_main_cursor;
#ifdef VITA
#define MAIN_ITEMS 5
#else
#define MAIN_ITEMS 4
#define MAIN_ITEMS 3
#endif
@ -638,7 +638,7 @@ void M_Main_Draw (void)
DRAW_BLANKOPTION("Achievements", true);
DRAW_MENUOPTION(2, "Credits", m_main_cursor, true);
DRAW_MENUOPTION(3, "Exit", m_main_cursor, false);
//DRAW_MENUOPTION(3, "Exit", m_main_cursor, false);
#endif // VITA
@ -655,7 +655,7 @@ void M_Main_Draw (void)
#else
case 2: DRAW_DESCRIPTION("View Credits for NZ:P."); break;
case 3: DRAW_DESCRIPTION("Return to Horizon."); break;
//case 3: DRAW_DESCRIPTION("Return to Horizon."); break;
#endif // VITA
@ -746,11 +746,9 @@ void M_Main_Key (int key)
break;
#ifdef VITA
case 4:
#else
case 3:
#endif
M_Menu_Quit_f ();
break;
#endif
}
}
}

View File

@ -1327,6 +1327,35 @@ void PF_BettyPrompt(void)
MSG_WriteByte (&client->message, svc_bettyprompt);
}
/*
=================
PF_SetPlayerName
sends the name string to
the client, avoids making
a protocol extension and
spamming strings.
nzp_setplayername()
=================
*/
void PF_SetPlayerName(void)
{
client_t *client;
int entnum;
char* s;
entnum = G_EDICTNUM(OFS_PARM0);
s = G_STRING(OFS_PARM1);
if (entnum < 1 || entnum > svs.maxclients)
return;
client = &svs.clients[entnum-1];
MSG_WriteByte (&client->message, svc_playername);
MSG_WriteString (&client->message, s);
}
/*
=================
PF_MaxZombies
@ -3891,6 +3920,7 @@ static builtin_t pr_builtin[] =
PF_GrenadePulse, // #502
PF_MaxZombies, // #503
PF_BettyPrompt, // #504
PF_SetPlayerName, // #505
};
builtin_t *pr_builtins = pr_builtin;

View File

@ -215,6 +215,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define svc_maxammo 46 // 46
#define svc_pulse 47 // 47
#define svc_bettyprompt 48 // 48
#define svc_playername 49 // 49
#define svc_limbupdate 51
#define svc_achievement 52 // [string] name [byte] decal_size [coords] pos