X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_multiplayer_profile.qc;h=ad3a3cbb5dfb0cca21cf0cec582823bb8a28aff6;hb=e19be1e6321de909c7d920871cb9bf73e948bebf;hp=6c753a98c669e3beb29c53425b9658fa4193a30c;hpb=6fdf9ec10563a47738d4e207aa7246d16017de08;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc index 6c753a98c..ad3a3cbb5 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc @@ -1,19 +1,17 @@ -#ifndef DIALOG_MULTIPLAYER_PROFILE_H -#define DIALOG_MULTIPLAYER_PROFILE_H -#include "tab.qc" -CLASS(XonoticProfileTab, XonoticTab) - METHOD(XonoticProfileTab, fill, void(entity)); - METHOD(XonoticProfileTab, draw, void(entity)); - ATTRIB(XonoticProfileTab, intendedWidth, float, 0.9) - ATTRIB(XonoticProfileTab, rows, float, 23) - ATTRIB(XonoticProfileTab, columns, float, 6.1) // added extra .2 for center space - ATTRIB(XonoticProfileTab, playerNameLabel, entity, NULL) - ATTRIB(XonoticProfileTab, playerNameLabelAlpha, float, SKINALPHA_HEADER) -ENDCLASS(XonoticProfileTab) -entity makeXonoticProfileTab(); -#endif +#include "dialog_multiplayer_profile.qh" + +#include "playermodel.qh" +#include "statslist.qh" +#include "languagelist.qh" +#include "textlabel.qh" +#include "commandbutton.qh" +#include "inputbox.qh" +#include "colorpicker.qh" +#include "charmap.qh" +#include "colorbutton.qh" +#include "checkbox.qh" +#include "radiobutton.qh" -#ifdef IMPLEMENTATION entity makeXonoticProfileTab() { entity me; @@ -29,17 +27,19 @@ void XonoticProfileTab_draw(entity me) me.playerNameLabel.alpha = me.playerNameLabelAlpha; SUPER(XonoticProfileTab).draw(me); } +void language_selector_click(entity me, entity btn) +{ + localcmd("\nmenu_cmd languageselect\n"); +} void XonoticProfileTab_fill(entity me) { entity e, pms, label, box; float i; entity profileApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', - "color -1 -1;" + "color -1 -1;" // apply colors contained in _cl_color "name \"$_cl_name\";" "playermodel $_cl_playermodel;" "playerskin $_cl_playerskin;" - "sendcvar cl_allow_uidtracking;" - "sendcvar cl_allow_uid2name;" , COMMANDBUTTON_APPLY); profileApplyButton.disableOnClick = true; @@ -64,6 +64,7 @@ void XonoticProfileTab_fill(entity me) box.maxLength = -127; // negative means encoded length in bytes box.saveImmediately = 0; // Sorry, can't do this, it spams "name" commands. box.enableClearButton = 0; + box.applyButton = profileApplyButton; label.textEntity = box; me.TR(me); me.TD(me, 5, 1, e = makeXonoticColorpicker(box)); @@ -124,13 +125,18 @@ void XonoticProfileTab_fill(entity me) me.TR(me); me.TDempty(me, 0.25); me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidtracking", _("Allow player statistics to track your client"))); - e.applyButton = profileApplyButton; + e.sendCvars = true; me.TR(me); me.TDempty(me, 0.25); me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname"))); - e.applyButton = profileApplyButton; + e.sendCvars = true; setDependent(e, "cl_allow_uidtracking", 1, 1); - me.gotoRC(me, 4, 3.1); // TOP RIGHT + me.TR(me); + me.TDempty(me, 0.25); + me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidranking", _("Allow player statistics to rank you in leaderboards"))); + e.sendCvars = true; + setDependent(e, "cl_allow_uidtracking", 1, 1); + me.gotoRC(me, 4.5, 3.1); // TOP RIGHT //me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT //me.gotoRC(me, 12.5, 0); // BOTTOM LEFT me.TDempty(me, 0.25); @@ -143,39 +149,18 @@ void XonoticProfileTab_fill(entity me) me.gotoRC(me, 16, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS //me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP SECTION, TOP POS - me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Country"))); + //me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Country"))); me.TR(me); + me.TDempty(me, 0.75); + me.TD(me, 1, 1.5, e = makeXonoticButton(_("Select language..."), '0 0 0')); + e.onClick = language_selector_click; + e.onClickEntity = me; + /* me.TDempty(me, 0.5); me.TD(me, 4.5, 2, e = makeXonoticLanguageList()); // todo: cl_country: create proper country list - - - // ================ - // GENDER SECTION - // ================ - me.gotoRC(me, 13.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, TOP POS - //me.gotoRC(me, 19.5, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM SECTION, BOTTOM POS - //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")); - e.addValue(e, _("Undisclosed"), "0"); - e.addValue(e, _("Female"), "1"); - e.addValue(e, _("Male"), "2"); - e.configureXonoticTextSliderValues(e); - #else - me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Gender"))); - me.TR(me); - #define GENDERWIDTH_OFFSET 0.25 - #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"))); - #endif + */ me.gotoRC(me, me.rows - 1, 0); me.TD(me, 1, me.columns, profileApplyButton); } -#endif