]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
seta _cl_gender
authorTimePath <andrew.hardaker1995@gmail.com>
Mon, 2 Feb 2015 00:39:08 +0000 (11:39 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Mon, 2 Feb 2015 00:39:08 +0000 (11:39 +1100)
defaultXonotic.cfg
qcsrc/common/playerstats.qc
qcsrc/menu/xonotic/dialog_multiplayer_profile.c

index dce01a75a972768343de9081e74dfd79b7eb085e..034b3bb32d9df4fe1f3139dad707e1742af9c2c7 100644 (file)
@@ -52,6 +52,7 @@ mod_q3bsp_lightmapmergepower 4
 // player defaults
 _cl_color "112.211" // same effect as 112, but menuqc can detect this as the default and not intentionally set
 _cl_name ""
+seta _cl_gender 0 "storage cvar for current player gender (0 = undisclosed, 1 = male, 2 = female)"
 _cl_playermodel models/player/erebus.iqm
 _cl_playerskin 0
 
index 2c4a355e0a8c00a58a7c14649dde91a32b744fd4..65516a4ea15c67d4b4751f9f25ab2a1067199ea3 100644 (file)
@@ -15,7 +15,7 @@ void PlayerStats_GameReport_AddPlayer(entity e)
                { s = e.crypto_idfp; }
        else if(IS_BOT_CLIENT(e))
                { s = sprintf("bot#%g#%s", skill, e.cleanname); }
-               
+
        if((s == "") || find(world, playerstats_id, s)) // already have one of the ID - next one can't be tracked then!
        {
                if(IS_BOT_CLIENT(e))
@@ -23,13 +23,13 @@ void PlayerStats_GameReport_AddPlayer(entity e)
                else
                        { s = sprintf("player#%d", e.playerid); }
        }
-       
+
        e.playerstats_id = strzone(s);
 
        // now add the player to the database
        string key = sprintf("%s:*", e.playerstats_id);
        string p = db_get(PS_GR_OUT_DB, key);
-       
+
        if(p == "")
        {
                if(PS_GR_OUT_PL)
@@ -48,7 +48,7 @@ void PlayerStats_GameReport_AddTeam(float t)
 
        string key = sprintf("%d", t);
        string p = db_get(PS_GR_OUT_DB, key);
-       
+
        if(p == "")
        {
                if(PS_GR_OUT_TL)
@@ -67,7 +67,7 @@ void PlayerStats_GameReport_AddEvent(string event_id)
 
        string key = sprintf("*:%s", event_id);
        string p = db_get(PS_GR_OUT_DB, key);
-       
+
        if(p == "")
        {
                if(PS_GR_OUT_EVL)
@@ -154,7 +154,7 @@ void PlayerStats_GameReport_FinalizePlayer(entity p)
 void PlayerStats_GameReport(float finished)
 {
        if(PS_GR_OUT_DB < 0) { return; }
-       
+
        PlayerScore_Sort(score_dummyfield, 0, 0, 0);
        PlayerScore_Sort(scoreboard_pos, 1, 1, 1);
        if(teamplay) { PlayerScore_TeamStats(); }
@@ -348,7 +348,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                                nn = db_get(PS_GR_OUT_DB, sprintf("%s:_playerid", p));
                                if(nn != "") { url_fputs(fh, sprintf("i %s\n", nn)); }
 
-                               // player name 
+                               // player name
                                nn = db_get(PS_GR_OUT_DB, sprintf("%s:_netname", p));
                                if(nn != "") { url_fputs(fh, sprintf("n %s\n", nn)); }
 
@@ -387,7 +387,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                        url_fclose(fh);
                        break;
                }
-               
+
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
@@ -400,7 +400,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                        }
                        break;
                }
-               
+
                case URL_READY_ERROR:
                default:
                {
@@ -502,14 +502,14 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                        #endif
                        url_fputs(fh, sprintf("l %s\n", cvar_string("_menu_prvm_language"))); // language
                        url_fputs(fh, sprintf("c %s\n", cvar_string("_menu_prvm_country"))); // country
-                       url_fputs(fh, sprintf("g %s\n", cvar_string("_menu_prvm_gender"))); // gender
+                       url_fputs(fh, sprintf("g %s\n", cvar_string("_cl_gender"))); // gender
                        url_fputs(fh, sprintf("n %s\n", cvar_string("_cl_name"))); // name
                        url_fputs(fh, sprintf("m %s %s\n", cvar_string("_cl_playermodel"), cvar_string("_cl_playerskin"))); // model/skin
                        */url_fputs(fh, "\n");
                        url_fclose(fh);
                        break;
                }
-               
+
                case URL_READY_CANREAD:
                {
                        string s = "";
@@ -578,7 +578,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                        print("Player stats synchronized with server\n");
                        break;
                }
-               
+
                case URL_READY_ERROR:
                default:
                {
@@ -615,7 +615,7 @@ void PlayerStats_PlayerDetail_AddItem(string event, string data)
                        db_put(PS_D_IN_DB, marker, PS_D_IN_EVL);
                        strunzone(PS_D_IN_EVL);
                }
-               else { db_put(PS_D_IN_DB, marker, "#"); } 
+               else { db_put(PS_D_IN_DB, marker, "#"); }
                PS_D_IN_EVL = strzone(marker);
        }
 
@@ -703,7 +703,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                        url_fclose(fh);
                        break;
                }
-               
+
                case URL_READY_CANREAD:
                {
                        //print("PlayerStats_PlayerDetail_Handler(): Got response from player stats server:\n");
@@ -715,7 +715,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                                string key = "", event = "", data = "";
 
                                if(argv(0) == "#") { continue; }
-                               
+
                                if(count == 2)
                                {
                                        key = argv(0);
@@ -759,7 +759,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                                                }
                                                break;
                                        }
-                                       
+
                                        default:
                                        {
                                                printf(
@@ -902,7 +902,7 @@ void PlayerInfo_ready(entity fh, entity p, float status)
 #ifdef MENUQC
                         url_fputs(fh, sprintf("l %s\n", cvar_string("_menu_prvm_language"))); // language
                         url_fputs(fh, sprintf("c %s\n", cvar_string("_menu_prvm_country"))); // country
-                        url_fputs(fh, sprintf("g %s\n", cvar_string("_menu_prvm_gender"))); // gender
+                        url_fputs(fh, sprintf("g %s\n", cvar_string("_cl_gender"))); // gender
                         url_fputs(fh, sprintf("n %s\n", cvar_string("_cl_name"))); // name
                         url_fputs(fh, sprintf("m %s %s\n", cvar_string("_cl_playermodel"), cvar_string("_cl_playerskin"))); // model/skin
 #endif
index a316be73b2b1f307f9e070bbbfa54dc1cf260bed..10d42284a1da93e39d1902f528102df400a9f758 100644 (file)
@@ -114,7 +114,7 @@ void XonoticProfileTab_fill(entity me)
                me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname")));
                setDependent(e, "cl_allow_uidtracking", 1, 1);
        me.gotoRC(me, 4, 3.1); // TOP RIGHT
-       //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT 
+       //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
        //me.gotoRC(me, 12.5, 0); // BOTTOM LEFT
                me.TDempty(me, 0.25);
                me.TD(me, 9, 2.5, statslist = makeXonoticStatsList());
@@ -141,7 +141,7 @@ void XonoticProfileTab_fill(entity me)
        //me.gotoRC(me, 6.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, BOTTOM POS
        #if 0
                me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gender:")));
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_gender"));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider("_cl_gender"));
                        e.addValue(e, ZCTX(_("GENDER^Undisclosed")), "0");
                        e.addValue(e, ZCTX(_("GENDER^Female")), "1");
                        e.addValue(e, ZCTX(_("GENDER^Male")), "2");
@@ -153,9 +153,9 @@ void XonoticProfileTab_fill(entity me)
                        #define GENDERWIDTH_LENGTH 2.5
                        #define GENDERWIDTH_ITEM (GENDERWIDTH_LENGTH / 3)
                        me.TDempty(me, GENDERWIDTH_OFFSET);
-                       me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "cl_gender", "2", _("Female")));
-                       me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "cl_gender", "1", _("Male")));
-                       me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "cl_gender", "0", _("Undisclosed")));
+                       me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "2", _("Female")));
+                       me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "1", _("Male")));
+                       me.TD(me, 1, GENDERWIDTH_ITEM, e = makeXonoticRadioButton(3, "_cl_gender", "0", _("Undisclosed")));
        #endif
 
        me.gotoRC(me, me.rows - 1, 0);