From: terencehill Date: Tue, 3 Feb 2015 00:41:19 +0000 (+0100) Subject: Merge branch 'master' into terencehill/string_prefixes_cleanup X-Git-Tag: xonotic-v0.8.1~130^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4dd3c23aa51dd6fe855d8c5d97126a12a372eb3b;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into terencehill/string_prefixes_cleanup Conflicts: qcsrc/menu/xonotic/dialog_multiplayer_profile.qc --- 4dd3c23aa51dd6fe855d8c5d97126a12a372eb3b diff --cc qcsrc/menu/xonotic/dialog_firstrun.qc index 000000000,90988703e..9c38e0e04 mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_firstrun.qc +++ b/qcsrc/menu/xonotic/dialog_firstrun.qc @@@ -1,0 -1,96 +1,96 @@@ + #ifdef INTERFACE + CLASS(XonoticFirstRunDialog) EXTENDS(XonoticRootDialog) + METHOD(XonoticFirstRunDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls + ATTRIB(XonoticFirstRunDialog, title, string, _("Welcome")) + ATTRIB(XonoticFirstRunDialog, color, vector, SKINCOLOR_DIALOG_FIRSTRUN) + ATTRIB(XonoticFirstRunDialog, intendedWidth, float, 0.7) + ATTRIB(XonoticFirstRunDialog, rows, float, 16) + ATTRIB(XonoticFirstRunDialog, columns, float, 6) + ATTRIB(XonoticFirstRunDialog, name, string, "FirstRun") + ATTRIB(XonoticFirstRunDialog, playerNameLabel, entity, NULL) + ATTRIB(XonoticFirstRunDialog, playerNameLabelAlpha, float, 0) + + ATTRIB(XonoticFirstRunDialog, closable, float, 0) + ENDCLASS(XonoticFirstRunDialog) + #endif + + #ifdef IMPLEMENTATION + float CheckFirstRunButton(entity me) + { + if(cvar_string("_cl_name") != cvar_defstring("_cl_name")) + return 1; + + if(cvar_string("_menu_prvm_language") != prvm_language) + return 1; // OK will then reopen the dialog in another language + + if(cvar_string("cl_allow_uid2name") != "-1") + return 1; + + return 0; + } + + void firstRun_setLanguage(entity me) + { + if(prvm_language != cvar_string("_menu_prvm_language")) + localcmd("\nprvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart\n"); + } + + void XonoticFirstRunDialog_fill(entity me) + { + entity e; + entity label, box; + + me.TR(me); + me.TR(me); + me.TDempty(me, 1); + me.TD(me, 2, 4, e = makeXonoticTextLabel(0, _("Welcome to Xonotic, please select your language preference and enter your player name to get started. You can change these options later through the menu system."))); + e.allowWrap = 1; + me.TR(me); + + me.TR(me); + me.TR(me); + me.TD(me, 1, 0.5, me.playerNameLabel = makeXonoticTextLabel(0, _("Name:"))); + me.playerNameLabelAlpha = me.playerNameLabel.alpha; + me.TD(me, 1, 3.25, label = makeXonoticTextLabel(0, string_null)); + label.allowCut = 1; + label.allowColors = 1; + label.alpha = 1; + me.TR(me); + me.TD(me, 1, 3.75, box = makeXonoticInputBox(1, "_cl_name")); + box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved + box.maxLength = -127; // negative means encoded length in bytes + box.saveImmediately = 1; + label.textEntity = box; + me.TR(me); + me.TD(me, 5, 1.25, e = makeXonoticColorpicker(box)); + me.TD(me, 5, 2.5, e = makeXonoticCharmap(box)); + me.TR(me); + me.TR(me); + me.TR(me); + me.TR(me); + + me.gotoRC(me, 3, 4); me.setFirstColumn(me, me.currentColumn); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Text language:"))); + me.TR(me); + me.TD(me, 6, 2, e = makeXonoticLanguageList()); + e.name = "languageselector_firstrun"; + e.setLanguage = firstRun_setLanguage; + me.TR(me); + me.TR(me); + + me.gotoRC(me, me.rows - 4, 0); + me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, _("Allow player statistics to use your nickname at stats.xonotic.org?"))); + + me.gotoRC(me, me.rows - 3, 0); + me.TDempty(me, 1.5); - me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", ZCTX(_("ALWU2N^Yes")))); - me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "0", ZCTX(_("ALWU2N^No")))); - me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "-1", ZCTX(_("ALWU2N^Undecided")))); ++ me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "1", _("Yes"))); ++ me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "0", _("No"))); ++ me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_allow_uid2name", "-1", _("Undecided"))); + + // because of the language selector, this is a menu_restart! + me.gotoRC(me, me.rows - 1, 0); + me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Save settings"), '0 0 0', "prvm_language \"$_menu_prvm_language\"; saveconfig; menu_restart", COMMANDBUTTON_APPLY)); + setDependentWeird(e, CheckFirstRunButton); + } + #endif diff --cc qcsrc/menu/xonotic/dialog_multiplayer_media_demo_startconfirm.qc index 000000000,a5a97c550..136997eec mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo_startconfirm.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo_startconfirm.qc @@@ -1,0 -1,31 +1,31 @@@ + #ifdef INTERFACE + CLASS(XonoticDemoStartConfirmDialog) EXTENDS(XonoticDialog) + METHOD(XonoticDemoStartConfirmDialog, fill, void(entity)) + ATTRIB(XonoticDemoStartConfirmDialog, title, string, _("Disconnect")) + ATTRIB(XonoticDemoStartConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM) + ATTRIB(XonoticDemoStartConfirmDialog, intendedWidth, float, 0.5) + ATTRIB(XonoticDemoStartConfirmDialog, rows, float, 4) + ATTRIB(XonoticDemoStartConfirmDialog, columns, float, 2) + ENDCLASS(XonoticDemoStartConfirmDialog) + #endif + + #ifdef IMPLEMENTATION + void Handle_StartDemo_Click(entity unused, entity me) { demolist.startDemo(demolist); } + void XonoticDemoStartConfirmDialog_fill(entity me) + { + entity e; + + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Playing a demo will disconnect you from the current match."))); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Do you really wish to disconnect now?"))); + me.TR(me); + me.TR(me); - me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^Yes")), '1 0 0')); ++ me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0')); + e.onClick = Handle_StartDemo_Click; + e.onClickEntity = demolist; - me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^No")), '0 1 0')); ++ me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0')); + e.onClick = Dialog_Close; + e.onClickEntity = me; + } + #endif diff --cc qcsrc/menu/xonotic/dialog_multiplayer_media_demo_timeconfirm.qc index 000000000,5510710c2..5c9bf8cb3 mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo_timeconfirm.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo_timeconfirm.qc @@@ -1,0 -1,31 +1,31 @@@ + #ifdef INTERFACE + CLASS(XonoticDemoTimeConfirmDialog) EXTENDS(XonoticDialog) + METHOD(XonoticDemoTimeConfirmDialog, fill, void(entity)) + ATTRIB(XonoticDemoTimeConfirmDialog, title, string, _("Disconnect")) + ATTRIB(XonoticDemoTimeConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM) + ATTRIB(XonoticDemoTimeConfirmDialog, intendedWidth, float, 0.5) + ATTRIB(XonoticDemoTimeConfirmDialog, rows, float, 4) + ATTRIB(XonoticDemoTimeConfirmDialog, columns, float, 2) + ENDCLASS(XonoticDemoTimeConfirmDialog) + #endif + + #ifdef IMPLEMENTATION + void Handle_TimeDemo_Click(entity unused, entity unused) { demolist.timeDemo(demolist); } + void XonoticDemoTimeConfirmDialog_fill(entity me) + { + entity e; + + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Timing a demo will disconnect you from the current match."))); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Do you really wish to disconnect now?"))); + me.TR(me); + me.TR(me); - me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^Yes")), '1 0 0')); ++ me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0')); + e.onClick = Handle_TimeDemo_Click; + e.onClickEntity = demolist; - me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("DMCNFRM^No")), '0 1 0')); ++ me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0')); + e.onClick = Dialog_Close; + e.onClickEntity = me; + } + #endif diff --cc qcsrc/menu/xonotic/dialog_multiplayer_profile.qc index 000000000,1adfb015e..06bf79244 mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qc @@@ -1,0 -1,164 +1,164 @@@ + #ifdef INTERFACE + CLASS(XonoticProfileTab) EXTENDS(XonoticTab) + METHOD(XonoticProfileTab, fill, void(entity)) + METHOD(XonoticProfileTab, draw, void(entity)) + ATTRIB(XonoticProfileTab, title, string, _("Profile")) + 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 + + #ifdef IMPLEMENTATION + entity makeXonoticProfileTab() + { + entity me; + me = spawnXonoticProfileTab(); + me.configureDialog(me); + return me; + } + void XonoticProfileTab_draw(entity me) + { + if(cvar_string("_cl_name") == "Player") + me.playerNameLabel.alpha = ((mod(time * 2, 2) < 1) ? 1 : 0); + else + me.playerNameLabel.alpha = me.playerNameLabelAlpha; + SUPER(XonoticProfileTab).draw(me); + } + void XonoticProfileTab_fill(entity me) + { + entity e, pms, label, box; + float i; + + // ============== + // NAME SECTION + // ============== + me.gotoRC(me, 0.5, 0); + me.TD(me, 1, 3, me.playerNameLabel = makeXonoticHeaderLabel(_("Name"))); + + me.gotoRC(me, 1.5, 0); + me.TD(me, 1, 3, label = makeXonoticTextLabel(0.5, string_null)); + label.allowCut = 1; + label.allowColors = 1; + label.alpha = 1; + label.isBold = true; + label.fontSize = SKINFONTSIZE_TITLE; + + me.gotoRC(me, 2.5, 0); + me.TD(me, 1, 3.0, box = makeXonoticInputBox(1, "_cl_name")); + box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved + box.maxLength = -127; // negative means encoded length in bytes + box.saveImmediately = 1; + box.enableClearButton = 0; + label.textEntity = box; + me.TR(me); + me.TD(me, 5, 1, e = makeXonoticColorpicker(box)); + me.TD(me, 5, 2, e = makeXonoticCharmap(box)); + + // =============== + // MODEL SECTION + // =============== + //me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT + //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT + me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Model"))); + + me.TR(me); + //me.TDempty(me, 0); // MODEL LEFT, COLOR RIGHT + me.TDempty(me, 1); // MODEL RIGHT, COLOR LEFT + pms = makeXonoticPlayerModelSelector(); + me.TD(me, 1, 0.3, e = makeXonoticButton("<<", '0 0 0')); + e.onClick = PlayerModelSelector_Prev_Click; + e.onClickEntity = pms; + me.TD(me, 11.5, 1.4, pms); + me.TD(me, 1, 0.3, e = makeXonoticButton(">>", '0 0 0')); + e.onClick = PlayerModelSelector_Next_Click; + e.onClickEntity = pms; + + //me.setFirstColumn(me, me.currentColumn + 2); // MODEL LEFT, COLOR RIGHT + me.gotoRC(me, me.currentRow, 0); me.setFirstColumn(me, me.currentColumn); // MODEL RIGHT, COLOR LEFT + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Glowing color"))); + for(i = 0; i < 15; ++i) + { + if(mod(i, 5) == 0) + me.TR(me); + me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(1, 0, i), '0 1 0'); + } + me.TR(me); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticHeaderLabel(_("Detail color"))); + for(i = 0; i < 15; ++i) + { + if(mod(i, 5) == 0) + me.TR(me); + me.TDNoMargin(me, 1, 0.2, e = makeXonoticColorButton(2, 1, i), '0 1 0'); + } + + // ==================== + // STATISTICS SECTION + // ==================== + me.gotoRC(me, 0.5, 3.1); me.setFirstColumn(me, me.currentColumn); // TOP RIGHT + //me.gotoRC(me, 9, 3.1); me.setFirstColumn(me, me.currentColumn); // BOTTOM RIGHT + //me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); // BOTTOM LEFT + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Statistics"))); + + 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"))); + 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"))); + 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, 0); // BOTTOM LEFT + me.TDempty(me, 0.25); + me.TD(me, 9, 2.5, statslist = makeXonoticStatsList()); + //setDependent(statslist, "cl_allow_uidtracking", 1, 1); + + // ================= + // COUNTRY SECTION + // ================= + 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.TR(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, ZCTX(_("GENDER^Undisclosed")), "0"); - e.addValue(e, ZCTX(_("GENDER^Female")), "1"); - e.addValue(e, ZCTX(_("GENDER^Male")), "2"); ++ 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, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";sendcvar cl_weaponpriority;sendcvar cl_autoswitch;sendcvar cl_forceplayermodels;sendcvar cl_forceplayermodelsfromxonotic;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY)); + } + #endif diff --cc qcsrc/menu/xonotic/dialog_settings_effects.qc index 000000000,811cb0998..fcbbbbe0e mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.qc +++ b/qcsrc/menu/xonotic/dialog_settings_effects.qc @@@ -1,0 -1,214 +1,214 @@@ + #ifdef INTERFACE + CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab) + METHOD(XonoticEffectsSettingsTab, fill, void(entity)) + ATTRIB(XonoticEffectsSettingsTab, title, string, _("Effects")) + ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9) + ATTRIB(XonoticEffectsSettingsTab, rows, float, 15.5) + ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space + ENDCLASS(XonoticEffectsSettingsTab) + entity makeXonoticEffectsSettingsTab(); + #endif + + #ifdef IMPLEMENTATION + entity makeXonoticEffectsSettingsTab() + { + entity me; + me = spawnXonoticEffectsSettingsTab(); + me.configureDialog(me); + return me; + } + + float someShadowCvarIsEnabled(entity box) + { + if(cvar("r_shadow_realtime_dlight")) + if(cvar("r_shadow_realtime_dlight_shadows")) + return true; + if(cvar("r_shadow_realtime_world")) + if(cvar("r_shadow_realtime_world_shadows")) + return true; + return false; + } + + void XonoticEffectsSettingsTab_fill(entity me) + { + entity e, s; + float n; + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:"))); + n = 5 + 2 * !!cvar("developer"); + if(cvar("developer")) + me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0)); + me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Low")), '0 0 0', "exec effects-low.cfg", 0)); + me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Medium")), '0 0 0', "exec effects-med.cfg", 0)); + me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Normal")), '0 0 0', "exec effects-normal.cfg", 0)); + me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^High")), '0 0 0', "exec effects-high.cfg", 0)); + me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0)); + if(cvar("developer")) + me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0)); + + me.gotoRC(me, 1.25, 0); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Geometry detail:"))); + me.TD(me, 1, 2, e = makeXonoticTextSlider("r_subdivisions_tolerance")); + e.addValue(e, ZCTX(_("DET^Lowest")), "16"); + e.addValue(e, ZCTX(_("DET^Low")), "8"); + e.addValue(e, ZCTX(_("DET^Normal")), "4"); + e.addValue(e, ZCTX(_("DET^Good")), "3"); + e.addValue(e, ZCTX(_("DET^Best")), "2"); + e.addValue(e, ZCTX(_("DET^Insane")), "1"); + e.configureXonoticTextSliderValues(e); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player detail:"))); + me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_playerdetailreduction")); + e.addValue(e, ZCTX(_("PDET^Low")), "4"); + e.addValue(e, ZCTX(_("PDET^Medium")), "3"); + e.addValue(e, ZCTX(_("PDET^Normal")), "2"); + e.addValue(e, ZCTX(_("PDET^Good")), "1"); + e.addValue(e, ZCTX(_("PDET^Best")), "0"); + e.configureXonoticTextSliderValues(e); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:"))); + setDependent(e, "r_showsurfaces", 0, 0); + me.TD(me, 1, 2, e = makeXonoticPicmipSlider()); + if(cvar("developer")) + e.addValue(e, ZCTX(_("RES^Leet")), "1337"); + e.addValue(e, ZCTX(_("RES^Lowest")), "3"); + e.addValue(e, ZCTX(_("RES^Very low")), "2"); + e.addValue(e, ZCTX(_("RES^Low")), "1"); + e.addValue(e, ZCTX(_("RES^Normal")), "0"); + e.addValue(e, ZCTX(_("RES^Good")), "-1"); + e.addValue(e, ZCTX(_("RES^Best")), "-2"); + e.configureXonoticTextSliderValues(e); + setDependent(e, "r_showsurfaces", 0, 0); + me.TR(me); + me.TDempty(me, 0.2); + { + // detect texture compression method + float f; + f = updateCompression(); + switch(f) + { + case 0: + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression"))); + e.disabled = 1; // just show the checkbox anyway, but with no ability to control it + break; + case 1: + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression"))); + setDependent(e, "r_showsurfaces", 0, 0); + break; + case 2: + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression"))); + setDependent(e, "r_showsurfaces", 0, 0); + makeMulti(e, "gl_texturecompression"); + break; + } + } + me.TR(me); + if(cvar("developer")) + { + me.TDempty(me, 0.2); + me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(3, 0, "r_showsurfaces", _("Show surfaces"))); + } + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticCheckBox(1, "mod_q3bsp_nolightmaps", _("Use lightmaps"))); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_deluxemapping", _("Deluxe mapping"))); + setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_gloss", _("Gloss"))); + setDependentAND3(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0, "r_glsl_deluxemapping", 1, 1); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping", _("Offset mapping"))); + setDependent(e, "vid_gl20", 1, 1); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping"))); + setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_water", _("Reflections:"))); + setDependent(e, "vid_gl20", 1, 1); + me.TD(me, 1, 2, e = makeXonoticTextSlider("r_water_resolutionmultiplier")); + e.addValue(e, _("Blurred"), "0.25"); + e.addValue(e, ZCTX(_("REFL^Good")), "0.5"); + e.addValue(e, _("Sharp"), "1"); + e.configureXonoticTextSliderValues(e); + setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_decals", _("Decals"))); + me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models"))); + setDependent(e, "cl_decals", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:"))); + setDependent(e, "cl_decals", 1, 1); + me.TD(me, 1, 2, e = makeXonoticSlider(200, 500, 20, "r_drawdecals_drawdistance")); + setDependent(e, "cl_decals", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:"))); + setDependent(e, "cl_decals", 1, 1); + me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_fadetime")); + setDependent(e, "cl_decals", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Damage effects:"))); + me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect")); - e.addValue(e, _("Disabled"), "0"); ++ e.addValue(e, ZCTX(_("DMGFX^Disabled")), "0"); + e.addValue(e, _("Skeletal"), "1"); - e.addValue(e, _("All"), "2"); ++ e.addValue(e, ZCTX(_("DMGFX^All")), "2"); + e.configureXonoticTextSliderValues(e); + + me.gotoRC(me, 1.25, 3.2); me.setFirstColumn(me, me.currentColumn); + me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "r_coronas", "0", _("No dynamic lighting"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "gl_flashblend", string_null, _("Fake corona lighting"))); + makeMulti(e, "r_coronas"); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting"))); + makeMulti(e, "r_coronas"); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_dlight_shadows", _("Shadows"))); + setDependent(e, "r_shadow_realtime_dlight", 1, 1); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_shadow_realtime_world", _("Realtime world lighting"))); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_world_shadows", _("Shadows"))); + setDependent(e, "r_shadow_realtime_world", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_shadow_usenormalmap", _("Use normal maps"))); + setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows"))); + setDependentWeird(e, someShadowCvarIsEnabled); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", _("Fade corona according to visibility"))); + setDependent(e, "r_coronas", 1, 1); + me.TR(me); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_bloom", _("Bloom"))); + me.TD(me, 1, 2, e = makeXonoticCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", _("Extra postprocessing effects"))); + makeMulti(e, "hud_powerup"); + setDependent(e, "vid_gl20", 1, 1); + me.TR(me); + s = makeXonoticSlider(0.1, 1, 0.1, "r_motionblur"); + me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:"))); + if(s.value != e.savedValue) + e.savedValue = 0.4; // default + me.TD(me, 1, 2, s); + me.TR(me); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_particles", _("Particles"))); + me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_spawn_point_particles", _("Spawnpoint effects"))); + makeMulti(e, "cl_spawn_event_particles"); + setDependent(e, "cl_particles", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Quality:"))); + setDependent(e, "cl_particles", 1, 1); + me.TD(me, 1, 2, e = makeXonoticParticlesSlider()); + setDependent(e, "cl_particles", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:"))); + setDependent(e, "cl_particles", 1, 1); + me.TD(me, 1, 2, e = makeXonoticSlider(200, 500, 20, "r_drawparticles_drawdistance")); + setDependent(e, "cl_particles", 1, 1); + + me.gotoRC(me, me.rows - 1, 0); + me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY)); + } + #endif diff --cc qcsrc/menu/xonotic/dialog_settings_game_hud.qc index 000000000,fc7e3a136..bb0587184 mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_hud.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_hud.qc @@@ -1,0 -1,173 +1,173 @@@ + #ifdef INTERFACE + CLASS(XonoticGameHUDSettingsTab) EXTENDS(XonoticTab) + //METHOD(XonoticGameHUDSettingsTab, toString, string(entity)) + METHOD(XonoticGameHUDSettingsTab, fill, void(entity)) + METHOD(XonoticGameHUDSettingsTab, showNotify, void(entity)) + ATTRIB(XonoticGameHUDSettingsTab, title, string, _("HUD")) + ATTRIB(XonoticGameHUDSettingsTab, intendedWidth, float, 0.9) + ATTRIB(XonoticGameHUDSettingsTab, rows, float, 13) + ATTRIB(XonoticGameHUDSettingsTab, columns, float, 6.2) + ENDCLASS(XonoticGameHUDSettingsTab) + entity makeXonoticGameHUDSettingsTab(); + void HUDSetup_Start(entity me, entity btn); + #endif + + #ifdef IMPLEMENTATION + void HUDSetup_Check_Gamestatus(entity me, entity btn) + { + if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, ask the player if they want to start one anyway + { + DialogOpenButton_Click(me, main.hudconfirmDialog); + } + else // already in a match, lets just cut to the point and open up the hud editor directly + { + HUDSetup_Start(me, btn); + } + } + void XonoticGameHUDSettingsTab_showNotify(entity me) + { + loadAllCvars(me); + } + entity makeXonoticGameHUDSettingsTab() + { + entity me; + me = spawnXonoticGameHUDSettingsTab(); + me.configureDialog(me); + return me; + } + + void XonoticGameHUDSettingsTab_fill(entity me) + { + entity e; + + // todo: + // threshold: hud_damage_pain_threshold_lower_health + // scoreboard_alpha* + + //me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Scoreboard"))); + //me.TR(me); + // me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:"))); + // me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "scoreboard_alpha_bg")); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fading speed:"))); + me.TD(me, 1, 2, e = makeXonoticScoreboardFadeTimeSlider()); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Side padding:"))); + me.TD(me, 1, 2, e = makeXonoticSlider(0.05, 0.3, 0.01, "scoreboard_offset_left")); + makeMulti(e, "scoreboard_offset_right"); + + me.TR(me); + //me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "scoreboard_respawntime_decimals", _("Show decimals in respawn countdown"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "scoreboard_accuracy", _("Show accuracy underneath scoreboard"))); + + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Waypoints"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Display waypoint markers for objectives on the map"))); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:"))); + setDependent(e, "cl_hidewaypoints", 0, 0); + me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.05, "g_waypointsprite_alpha")); + setDependent(e, "cl_hidewaypoints", 0, 0); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fontsize:"))); + setDependent(e, "cl_hidewaypoints", 0, 0); + me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "g_waypointsprite_fontsize")); + setDependent(e, "cl_hidewaypoints", 0, 0); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Edge offset:"))); + setDependent(e, "cl_hidewaypoints", 0, 0); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 0.3, 0.01, "g_waypointsprite_edgeoffset_bottom")); + makeMulti(e, "g_waypointsprite_edgeoffset_top g_waypointsprite_edgeoffset_left g_waypointsprite_edgeoffset_right"); + setDependent(e, "cl_hidewaypoints", 0, 0); + + me.TR(me); + //me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(0.25, 1, "g_waypointsprite_crosshairfadealpha", _("Fade when near the crosshair"))); + setDependent(e, "cl_hidewaypoints", 0, 0); + + #if 0 + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Damage"))); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Overlay:"))); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage")); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Factor:"))); + setDependent(e, "hud_damage", 0.001, 100); + me.TD(me, 1, 2, e = makeXonoticSlider(0.025, 0.1, 0.025, "hud_damage_factor")); + setDependent(e, "hud_damage", 0.001, 100); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Fade rate:"))); + setDependent(e, "hud_damage", 0.001, 100); + me.TD(me, 1, 2, e = makeXonoticSlider(0.25, 1, 0.05, "hud_damage_fade_rate")); + setDependent(e, "hud_damage", 0.001, 100); + me.TR(me); + #endif + + me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Player Names"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_shownames", _("Show names above players"))); + + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Alpha:"))); + setDependent(e, "hud_shownames", 1, 1); + me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.05, "hud_shownames_alpha")); + setDependent(e, "hud_shownames", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Fontsize:"))); + setDependent(e, "hud_shownames", 1, 1); + me.TD(me, 1, 2, e = makeXonoticSlider(5, 16, 1, "hud_shownames_fontsize")); + setDependent(e, "hud_shownames", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Max distance:"))); + setDependent(e, "hud_shownames", 1, 1); + me.TD(me, 1, 2, e = makeXonoticSlider(2000, 10000, 500, "hud_shownames_maxdistance")); + setDependent(e, "hud_shownames", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Decolorize:"))); + setDependent(e, "hud_shownames", 1, 1); + me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_shownames_decolorize")); - e.addValue(e, ZCTX(_("Never")), "0"); - e.addValue(e, ZCTX(_("Teamplay")), "1"); - e.addValue(e, ZCTX(_("Always")), "2"); ++ e.addValue(e, _("Never"), "0"); ++ e.addValue(e, _("Teamplay"), "1"); ++ e.addValue(e, _("Always"), "2"); + e.configureXonoticTextSliderValues(e); + setDependent(e, "hud_shownames", 1, 1); + + me.TR(me); + //me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(25, 0, "hud_shownames_crosshairdistance", _("Only when near crosshair"))); + setDependent(e, "hud_shownames", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "hud_shownames_status", _("Display health and armor"))); + setDependent(e, "hud_shownames", 1, 1); + + me.TR(me); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage overlay:"))); + me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage")); + me.TR(me); + me.TR(me); + me.TDempty(me, 0.5); + me.TD(me, 1, 2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0')); + e.onClick = HUDSetup_Check_Gamestatus; + e.onClickEntity = me; + // TODO: show hud config name with text here + } + #endif diff --cc qcsrc/menu/xonotic/dialog_settings_game_hudconfirm.qc index 000000000,7749a148d..9f327c3f5 mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_hudconfirm.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_hudconfirm.qc @@@ -1,0 -1,40 +1,40 @@@ + #ifdef INTERFACE + CLASS(XonoticHUDConfirmDialog) EXTENDS(XonoticDialog) + METHOD(XonoticHUDConfirmDialog, fill, void(entity)) + ATTRIB(XonoticHUDConfirmDialog, title, string, _("Enter HUD editor")) + ATTRIB(XonoticHUDConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM) + ATTRIB(XonoticHUDConfirmDialog, intendedWidth, float, 0.5) + ATTRIB(XonoticHUDConfirmDialog, rows, float, 4) + ATTRIB(XonoticHUDConfirmDialog, columns, float, 2) + ENDCLASS(XonoticHUDConfirmDialog) + #endif + + #ifdef IMPLEMENTATION + void HUDSetup_Start(entity me, entity btn) + { + if (!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) + localcmd("map hudsetup/hudsetup", "\n"); + else + localcmd("togglemenu 0\n"); + + localcmd("_hud_configure 1", "\n"); + } + + void XonoticHUDConfirmDialog_fill(entity me) + { + entity e; + + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("In order for the HUD editor to show, you must first be in game."))); + me.TR(me); + me.TD(me, 1, 2, e = makeXonoticTextLabel(0.5, _("Do you wish to start a local game to set up the HUD?"))); + me.TR(me); + me.TR(me); - me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("HDCNFRM^Yes")), '1 0 0')); ++ me.TD(me, 1, 1, e = makeXonoticButton(_("Yes"), '1 0 0')); + e.onClick = HUDSetup_Start; + e.onClickEntity = me; - me.TD(me, 1, 1, e = makeXonoticButton(ZCTX(_("HDCNFRM^No")), '0 1 0')); ++ me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0')); + e.onClick = Dialog_Close; + e.onClickEntity = me; + } + #endif diff --cc qcsrc/menu/xonotic/dialog_settings_game_messages.qc index 000000000,f1707bd3f..034608d09 mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_messages.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_messages.qc @@@ -1,0 -1,119 +1,119 @@@ + #ifdef INTERFACE + CLASS(XonoticGameMessageSettingsTab) EXTENDS(XonoticTab) + //METHOD(XonoticGameWeaponsSettingsTab, toString, string(entity)) + METHOD(XonoticGameMessageSettingsTab, fill, void(entity)) + METHOD(XonoticGameMessageSettingsTab, showNotify, void(entity)) + ATTRIB(XonoticGameMessageSettingsTab, title, string, _("Messages")) + ATTRIB(XonoticGameMessageSettingsTab, intendedWidth, float, 0.9) + ATTRIB(XonoticGameMessageSettingsTab, rows, float, 13) + ATTRIB(XonoticGameMessageSettingsTab, columns, float, 6) + ATTRIB(XonoticGameMessageSettingsTab, weaponsList, entity, NULL) + ENDCLASS(XonoticGameMessageSettingsTab) + entity makeXonoticGameMessageSettingsTab(); + #endif + + #ifdef IMPLEMENTATION + void XonoticGameMessageSettingsTab_showNotify(entity me) + { + loadAllCvars(me); + } + entity makeXonoticGameMessageSettingsTab() + { + entity me; + me = spawnXonoticGameMessageSettingsTab(); + me.configureDialog(me); + return me; + } + + void XonoticGameMessageSettingsTab_fill(entity me) + { + entity e; + + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Frag Information"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "notification_show_sprees", _("Display information about killing sprees"))); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "notification_show_sprees_info_specialonly", _("Only display sprees if they are achievements"))); + makeMulti(e, "notification_show_sprees_center_specialonly"); + setDependent(e, "notification_show_sprees", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "notification_show_sprees_center", _("Show spree information in centerprints"))); + setDependent(e, "notification_show_sprees", 1, 1); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(3, 0, "notification_show_sprees_info", _("Show spree information in death messages"))); + setDependent(e, "notification_show_sprees", 1, 1); + #if 0 + me.TR(me); + me.TDempty(me, 0.1); + me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Sprees in info messages:"))); + setDependent(e, "notification_show_sprees", 1, 1); + me.TD(me, 1, 2, e = makeXonoticTextSlider("notification_show_sprees_info")); - e.addValue(e, ZCTX(_("Disabled")), "0"); - e.addValue(e, ZCTX(_("Target")), "1"); - e.addValue(e, ZCTX(_("Attacker")), "2"); - e.addValue(e, ZCTX(_("Both")), "3"); ++ e.addValue(e, ZCTX(_("SPREES^Disabled")), "0"); ++ e.addValue(e, _("Target"), "1"); ++ e.addValue(e, _("Attacker"), "2"); ++ e.addValue(e, ZCTX(_("SPREES^Both")), "3"); + e.configureXonoticTextSliderValues(e); + setDependent(e, "notification_show_sprees", 1, 1); + #endif + me.TR(me); + me.TDempty(me, 0.4); + me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "notification_show_sprees_info_newline", _("Print on a seperate line"))); + setDependent(e, "notification_show_sprees", 1, 1); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "notification_CHOICE_FRAG", _("Add extra frag information to centerprint when available"))); + makeMulti(e, "notification_CHOICE_FRAGGED notification_CHOICE_TYPEFRAG notification_CHOICE_TYPEFRAGGED"); + e.sendCvars = true; + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "notification_show_location", _("Add frag location to death messages when available"))); + + me.gotoRC(me, 9, 0); me.setFirstColumn(me, me.currentColumn); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Gamemode Settings"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "notification_CHOICE_CTF_CAPTURE_TIME_RED", _("Display capture times in Capture The Flag"))); + makeMulti(e, "notification_CHOICE_CTF_CAPTURE_TIME_BLUE notification_CHOICE_CTF_CAPTURE_BROKEN_RED notification_CHOICE_CTF_CAPTURE_BROKEN_BLUE notification_CHOICE_CTF_CAPTURE_UNBROKEN_RED notification_CHOICE_CTF_CAPTURE_UNBROKEN_BLUE "); + e.sendCvars = true; + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "notification_CHOICE_CTF_PICKUP_ENEMY", _("Display name of flag stealer in Capture The Flag"))); + makeMulti(e, "notification_CHOICE_CTF_PICKUP_TEAM"); + e.sendCvars = true; + + me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(4, 1, "con_notify", _("Display console messages in the top left corner"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "notification_allow_chatboxprint", _("Display all info messages in the chatbox"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 1, "notification_INFO_QUIT_DISCONNECT", _("Display player statuses in the chatbox"))); + makeMulti(e, "notification_INFO_QUIT_KICK_IDLING notification_INFO_JOIN_CONNECT_TEAM_BLUE notification_INFO_JOIN_CONNECT_TEAM_PINK notification_INFO_JOIN_CONNECT_TEAM_RED notification_INFO_JOIN_CONNECT_TEAM_YELLOW"); + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "notification_CENTER_POWERUP_INVISIBILITY", _("Powerup notifications"))); + makeMulti(e, "notification_CENTER_POWERUP_SHIELD notification_CENTER_POWERUP_SPEED notification_CENTER_POWERUP_STRENGTH notification_CENTER_POWERDOWN_INVISIBILITY notification_CENTER_POWERDOWN_SHIELD notification_CENTER_POWERDOWN_SPEED notification_CENTER_POWERDOWN_STRENGTH notification_CENTER_SUPERWEAPON_BROKEN notification_CENTER_SUPERWEAPON_LOST notification_CENTER_SUPERWEAPON_PICKUP notification_INFO_POWERUP_INVISIBILITY notification_INFO_POWERUP_SHIELD notification_INFO_POWERUP_SPEED notification_INFO_POWERUP_STRENGTH"); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "notification_CENTER_ITEM_WEAPON_DONTHAVE", _("Weapon centerprint notifications"))); + makeMulti(e, "notification_CENTER_ITEM_WEAPON_DROP notification_CENTER_ITEM_WEAPON_GOT notification_CENTER_ITEM_WEAPON_NOAMMO notification_CENTER_ITEM_WEAPON_PRIMORSEC notification_CENTER_ITEM_WEAPON_UNAVAILABLE"); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "notification_INFO_ITEM_WEAPON_DONTHAVE", _("Weapon info message notifications"))); + makeMulti(e, "notification_INFO_ITEM_WEAPON_DROP notification_INFO_ITEM_WEAPON_GOT notification_INFO_ITEM_WEAPON_NOAMMO notification_INFO_ITEM_WEAPON_PRIMORSEC notification_INFO_ITEM_WEAPON_UNAVAILABLE"); + + me.gotoRC(me, 9, 3.2); me.setFirstColumn(me, me.currentColumn); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Announcers"))); + #if 0 + // there's just not enough room for this, and it's not important enough to justify... + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "notification_ANNCE_NUM_RESPAWN_1", _("Respawn countdown sounds"))); + makeMulti(e, "notification_ANNCE_NUM_RESPAWN_2 notification_ANNCE_NUM_RESPAWN_3 notification_ANNCE_NUM_RESPAWN_4 notification_ANNCE_NUM_RESPAWN_5 notification_ANNCE_NUM_RESPAWN_6 notification_ANNCE_NUM_RESPAWN_7 notification_ANNCE_NUM_RESPAWN_8 notification_ANNCE_NUM_RESPAWN_9 notification_ANNCE_NUM_RESPAWN_10"); + #endif + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(1, 0, "notification_ANNCE_KILLSTREAK_03", _("Killstreak sounds"))); + makeMulti(e, "notification_ANNCE_KILLSTREAK_05 notification_ANNCE_KILLSTREAK_10 notification_ANNCE_KILLSTREAK_15 notification_ANNCE_KILLSTREAK_20 notification_ANNCE_KILLSTREAK_25 notification_ANNCE_KILLSTREAK_30"); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(1, 0, "notification_ANNCE_ACHIEVEMENT_AIRSHOT", _("Achievement sounds"))); + makeMulti(e, "notification_ANNCE_ACHIEVEMENT_AMAZING notification_ANNCE_ACHIEVEMENT_AWESOME notification_ANNCE_ACHIEVEMENT_BOTLIKE notification_ANNCE_ACHIEVEMENT_ELECTROBITCH notification_ANNCE_ACHIEVEMENT_IMPRESSIVE notification_ANNCE_ACHIEVEMENT_YODA"); + } + #endif diff --cc qcsrc/menu/xonotic/dialog_settings_input.qc index 000000000,0c454d3bc..b4ac61348 mode 000000,100644..100644 --- a/qcsrc/menu/xonotic/dialog_settings_input.qc +++ b/qcsrc/menu/xonotic/dialog_settings_input.qc @@@ -1,0 -1,116 +1,116 @@@ + #ifdef INTERFACE + CLASS(XonoticInputSettingsTab) EXTENDS(XonoticTab) + METHOD(XonoticInputSettingsTab, fill, void(entity)) + ATTRIB(XonoticInputSettingsTab, title, string, _("Input")) + ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9) + ATTRIB(XonoticInputSettingsTab, rows, float, 15.5) + ATTRIB(XonoticInputSettingsTab, columns, float, 6.2) // added extra .2 for center space + ENDCLASS(XonoticInputSettingsTab) + entity makeXonoticInputSettingsTab(); + #endif + + #ifdef IMPLEMENTATION + entity makeXonoticInputSettingsTab() + { + entity me; + me = spawnXonoticInputSettingsTab(); + me.configureDialog(me); + return me; + } + + void CheckBox_Click_Redisplay(entity me, entity checkbox) + { + CheckBox_Click(me, checkbox); + cmd("\ndefer 0.2 \"togglemenu 1\"\n"); + //m_display(); + } + void XonoticInputSettingsTab_fill(entity me) + { + entity e; + entity kb = makeXonoticKeyBinder(); + + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Key Bindings"))); + me.TR(me); + me.TD(me, me.rows - 3, 3, kb); + me.gotoRC(me, me.rows - 2, 0); + me.TD(me, 1, 1, e = makeXonoticButton(_("Change key..."), '0 0 0')); + e.onClick = KeyBinder_Bind_Change; + e.onClickEntity = kb; + kb.keyGrabButton = e; + me.TD(me, 1, 1, e = makeXonoticButton(_("Edit..."), '0 0 0')); + e.onClick = KeyBinder_Bind_Edit; + e.onClickEntity = kb; + kb.userbindEditButton = e; + kb.userbindEditDialog = main.userbindEditDialog; + main.userbindEditDialog.keybindBox = kb; + me.TD(me, 1, 1, e = makeXonoticButton(_("Clear"), '0 0 0')); + e.onClick = KeyBinder_Bind_Clear; + e.onClickEntity = kb; + kb.clearButton = e; + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticButton(_("Reset all"), '0 0 0')); + e.onClick = KeyBinder_Bind_Reset_All; + e.onClickEntity = kb; + + me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Mouse"))); + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Sensitivity:"))); + me.TD(me, 1, 2, e = makeXonoticSlider(1, 32, 0.2, "sensitivity")); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "m_filter", _("Smooth aiming"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(1.022, "m_pitch", _("Invert aiming"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "menu_mouse_absolute", _("Use system mouse positioning"))); + makeMulti(e, "hud_cursormode"); + e.onClick = CheckBox_Click_Redisplay; + e.onClickEntity = e; + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "m_accelerate", _("Enable built in mouse acceleration"))); + me.TR(me); + if(cvar_type("vid_dgamouse") & CVAR_TYPEFLAG_ENGINE) + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_dgamouse", _("Disable system mouse acceleration"))); + else if(cvar_type("apple_mouse_noaccel") & CVAR_TYPEFLAG_ENGINE) + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "apple_mouse_noaccel", _("Disable system mouse acceleration"))); + else + { + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, string_null, _("Disable system mouse acceleration"))); + e.disabled = 1; // the option is never available in this case, just there for show + } + + me.TR(me); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticHeaderLabel(_("Other"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_closeontoggleconsole", _("Pressing \"enter console\" key also closes it"))); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_movement_track_canjump", _("Automatically repeat jumping if holding jump"))); + e.sendCvars = true; + me.TR(me); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Jetpack on jump:"))); + me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_jetpack_jump")); - e.addValue(e, _("Disabled"), "0"); ++ e.addValue(e, ZCTX(_("JPJUMP^Disabled")), "0"); + e.addValue(e, _("Air only"), "1"); - e.addValue(e, _("All"), "2"); ++ e.addValue(e, ZCTX(_("JPJUMP^All")), "2"); + e.configureXonoticTextSliderValues(e); + e.sendCvars = true; + me.TR(me); + if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE) + { + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joy_enable", _("Use joystick input"))); + setDependent(e, "joy_detected", 1, 10000000); + } + else if(cvar_type("joystick") & CVAR_TYPEFLAG_ENGINE) + { + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joystick", _("Use joystick input"))); + setDependent(e, "joy_detected", 1, 10000000); + } + else + { + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, string_null, _("Use joystick input"))); + e.disabled = 1; // the option is never available in this case, just there for show + } + } + #endif