X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_settings_game_crosshair.qc;h=2d30dc2448140784408a48f4ed4469a2f6622db8;hb=42eb10006aa3a7d6ac697318eb88ef5e157dfad2;hp=cee4bd5c72a68a8a8c0c3fa4b77a874c069f5e66;hpb=fc2be4c1e7547ae97301f7966333e4dc858baf92;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc b/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc index cee4bd5c7..2d30dc244 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qc @@ -1,17 +1,14 @@ -#ifndef DIALOG_SETTINGS_GAME_CROSSHAIR_H -#define DIALOG_SETTINGS_GAME_CROSSHAIR_H -#include "tab.qc" -CLASS(XonoticGameCrosshairSettingsTab, XonoticTab) - METHOD(XonoticGameCrosshairSettingsTab, fill, void(entity)) - METHOD(XonoticGameCrosshairSettingsTab, showNotify, void(entity)) - ATTRIB(XonoticGameCrosshairSettingsTab, intendedWidth, float, 0.9) - ATTRIB(XonoticGameCrosshairSettingsTab, rows, float, 13) - ATTRIB(XonoticGameCrosshairSettingsTab, columns, float, 6.2) -ENDCLASS(XonoticGameCrosshairSettingsTab) -entity makeXonoticGameCrosshairSettingsTab(); -#endif +#include "dialog_settings_game_crosshair.qh" + +#include "radiobutton.qh" +#include "crosshairpicker.qh" +#include "crosshairpreview.qh" +#include "textlabel.qh" +#include "slider.qh" +#include "colorpicker_string.qh" +#include "checkbox.qh" +#include "textslider.qh" -#ifdef IMPLEMENTATION void XonoticGameCrosshairSettingsTab_showNotify(entity me) { loadAllCvars(me); @@ -33,7 +30,8 @@ void XonoticGameCrosshairSettingsTab_fill(entity me) me.TR(me); //me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "0", _("No crosshair"))); //me.TR(me); - me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_per_weapon", string_null, _("Per weapon"))); + me.TD(me, 1, 1, e = makeXonoticRadioButton_T(3, "crosshair_per_weapon", string_null, _("Per weapon"), + _("Set a different crosshair for each weapon, good if you play without weapon models"))); makeMulti(e, "crosshair_enabled"); //me.TR(me); me.TD(me, 1, 1, e = makeXonoticRadioButton(3, "crosshair_enabled", "2", _("Custom"))); @@ -47,19 +45,19 @@ void XonoticGameCrosshairSettingsTab_fill(entity me) me.TR(me); me.TR(me); me.TDempty(me, 0.1); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair size:"))); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Size:"))); setDependent(e, "crosshair_enabled", 1, 2); me.TD(me, 1, 1.9, e = makeXonoticSlider(0.1, 1.0, 0.01, "crosshair_size")); setDependent(e, "crosshair_enabled", 1, 2); me.TR(me); me.TDempty(me, 0.1); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair alpha:"))); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Alpha:"))); setDependent(e, "crosshair_enabled", 1, 2); me.TD(me, 1, 1.9, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha")); setDependent(e, "crosshair_enabled", 1, 2); me.TR(me); me.TDempty(me, 0.1); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair color:"))); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color:"))); setDependent(e, "crosshair_enabled", 1, 2); me.TD(me, 1, 0.9, e = makeXonoticRadioButton(5, "crosshair_color_special", "1", _("Per weapon"))); setDependent(e, "crosshair_enabled", 1, 2); @@ -75,17 +73,18 @@ void XonoticGameCrosshairSettingsTab_fill(entity me) me.TR(me); me.TR(me); me.TDempty(me, 0.1); - me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_ring", _("Use rings to indicate weapon status"))); + me.TD(me, 1, 2.9, e = makeXonoticCheckBox_T(0, "crosshair_ring", _("Use rings to indicate weapon status"), "-")); makeMulti(e, "crosshair_ring_reload"); setDependent(e, "crosshair_enabled", 1, 2); - //me.TR(me); - // me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Ring size:"))); - // setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2); - // me.TD(me, 1, 2, e = makeXonoticSlider(2, 4, 0.1, "crosshair_ring_size")); - // setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2); me.TR(me); me.TDempty(me, 0.3); - me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Ring alpha:"))); + me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Size:"))); + setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2); + me.TD(me, 1, 1.8, e = makeXonoticSlider(2, 4, 0.1, "crosshair_ring_size")); + setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2); + me.TR(me); + me.TDempty(me, 0.3); + me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Alpha:"))); setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2); me.TD(me, 1, 1.8, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_ring_alpha")); setDependentAND(e, "crosshair_ring", 1, 1, "crosshair_enabled", 1, 2); @@ -95,19 +94,19 @@ void XonoticGameCrosshairSettingsTab_fill(entity me) setDependent(e, "crosshair_enabled", 1, 2); me.TR(me); me.TDempty(me, 0.1); - me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot size:"))); + me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Size:"))); setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2); me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size")); setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2); me.TR(me); me.TDempty(me, 0.1); - me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot alpha:"))); + me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Alpha:"))); setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2); me.TD(me, 1, 2, e = makeXonoticSlider(0.1, 1, 0.1, "crosshair_dot_alpha")); setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2); me.TR(me); me.TDempty(me, 0.1); - me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Dot color:"))); + me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Color:"))); setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2); me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "crosshair_dot_color_custom", "0", _("Use normal crosshair color"))); setDependentAND(e, "crosshair_dot", 1, 1, "crosshair_enabled", 1, 2); @@ -123,10 +122,22 @@ void XonoticGameCrosshairSettingsTab_fill(entity me) me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_effect_scalefade", _("Smooth effects of crosshairs"))); setDependent(e, "crosshair_enabled", 1, 2); me.TR(me); - me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed"))); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit testing:"))); + setDependent(e, "crosshair_enabled", 1, 2); + me.TD(me, 1, 2, e = makeXonoticTextSlider_T("crosshair_hittest", + _("None: do not do hit tests for the crosshair; TrueAim: blur the crosshair when there's an obstacle between your gun and the target; Enemies: also enlarge the crosshair when you would hit an enemy"))); + e.addValue(e, ZCTX(_("HTTST^Disabled")), "0"); + e.addValue(e, ZCTX(_("HTTST^TrueAim")), "1"); + e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25"); + e.configureXonoticTextSliderValues(e); + setDependent(e, "crosshair_enabled", 1, 2); + me.TR(me); + me.TDempty(me, 0.1); + me.TD(me, 1, 2.9, e = makeXonoticCheckBox(0, "crosshair_hittest_blur", _("Blur crosshair if the shot is obstructed"))); setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2); me.TR(me); - me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(1.25, 0, "crosshair_hittest_scale", _("Enlarge crosshair if targeting an enemy"))); + me.TDempty(me, 0.1); + me.TD(me, 1, 2.9, e = makeXonoticCheckBoxEx(1.25, 0, "crosshair_hittest_scale", _("Enlarge crosshair if targeting an enemy"))); setDependentAND(e, "crosshair_hittest", 1, 100, "crosshair_enabled", 1, 2); me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "crosshair_hitindication", _("Animate crosshair when hitting an enemy"))); @@ -134,20 +145,4 @@ void XonoticGameCrosshairSettingsTab_fill(entity me) me.TR(me); me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.25, 0, "crosshair_pickup", _("Animate crosshair when picking up an item"))); setDependent(e, "crosshair_enabled", 1, 2); - /*me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit testing:"))); - me.TD(me, 1, 2, e = makeXonoticTextSlider("crosshair_hittest")); - e.addValue(e, ZCTX(_("HTTST^Disabled")), "0"); - e.addValue(e, ZCTX(_("HTTST^TrueAim")), "1"); - e.addValue(e, ZCTX(_("HTTST^Enemies")), "1.25"); - e.configureXonoticTextSliderValues(e); - setDependent(e, "crosshair_enabled", 1, 2);*/ - - /*me.TR(me); - - me.gotoRC(me, me.rows - 1, 0); - me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0')); - e.onClick = Dialog_Close; - e.onClickEntity = me;*/ } -#endif