r_font_hinting 1
r_font_disable_freetype 0
r_font_size_snapping 2
+
+// uid2name
+seta cl_allow_uid2name -1 "-1 = ask if the player wants to disable/enable this feature, 0 = disable, 1 = enable uid2name (allows showing your name in race rankings for instance)"
if(menu_visible)
if(menu_action(bInputType, nPrimary, nSecondary))
return TRUE;
+
+ if(autocvar_g_allow_uid2name == -1 && gametype == GAME_CTS || gametype == GAME_RACE && panel_fg_alpha) // don't lock keys before we actually see what's going on
+ {
+ string vyes_keys;
+ float keys;
+ vyes_keys = findkeysforcommand("vyes");
+ keys = tokenize(vyes_keys);
+
+ float i;
+ for (i = 0; i < keys; ++i)
+ {
+ if(nPrimary == stof(argv(i)))
+ {
+ cvar_set("cl_allow_uid2name", "1");
+ return true;
+ }
+ }
+
+ string vno_keys;
+ vno_keys = findkeysforcommand("vno");
+ keys = tokenize(vno_keys);
+
+ float i;
+ for (i = 0; i < keys; ++i)
+ {
+ if(nPrimary == stof(argv(i)))
+ {
+ cvar_set("cl_allow_uid2name", "0");
+ return true;
+ }
+ }
+ }
+
return bSkipKey;
}
var float autocvar_hud_panel_infomessages_flip;
var float autocvar_scoreboard_border_thickness;
+
+var float autocvar_cl_allow_uid2name;
void HUD_VoteWindow(void)
{
+ if(autocvar_cl_allow_uid2name == -1 && gametype == GAME_CTS || gametype == GAME_RACE)
+ {
+ vote_active = 1;
+ vote_called_vote = "This allows your name to be identified in stats instead of \"Unregistered player\"";
+ }
+
if(!autocvar_hud_panel_vote && !autocvar__hud_configure)
return;
mySize = newSize;
s = "A vote has been called for:";
+ if(autocvar_cl_allow_uid2name == -1 && gametype == GAME_CTS || gametype == GAME_RACE)
+ s = "Allow servers to store and display your name?"
drawstring_aspect(pos, s, eX * mySize_x + eY * (2/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
s = textShortenToWidth(vote_called_vote, mySize_x, '1 1 0' * mySize_y * (1.75/8), stringwidth_colors);
if(autocvar__hud_configure)
playerdemo_write();
+ if((g_cts || g_race) && self.cvar_cl_allow_uid2name)
+ {
+ if(!self.stored_netname)
+ self.stored_netname = strzone(uid2name(self.crypto_idfp));
+ if(self.stored_netname != self.stored_netname)
+ {
+ db_put(ServerProgsDB, strcat("uid2name", self.crypto_idfp), self.netname);
+ strunzone(self.stored_netname);
+ self.stored_netname = strzone(self.netname);
+ }
+ }
+
/*
if(g_race)
dprint(sprintf("%f %.6f\n", time, race_GetFractionalLapCount(self)));
.float cvar_cl_gunalign;
.float cvar_cl_noantilag;
+.float cvar_cl_allow_uid2name;
+.string stored_netname;
+
void Announce(string snd);
void AnnounceTo(entity e, string snd);
GetCvars_handleFloat(s, f, cvar_cl_forceplayermodelsfromxonotic, "cl_forceplayermodelsfromxonotic");
#endif
GetCvars_handleFloatOnce(s, f, cvar_cl_gunalign, "cl_gunalign");
+ GetCvars_handleFloat(s, f, cvar_cl_allow_uid2name, "cl_allow_uid2name");
// fixup of switchweapon (needed for LMS or when spectating is disabled, as PutClientInServer comes too early)
if (f > 0)