From: FruitieX Date: Tue, 12 Oct 2010 15:47:03 +0000 (+0300) Subject: new crosshairs by unfa, add an optional centered dot for each of them (toggleable... X-Git-Tag: xonotic-v0.1.0preview~307^2~25^2~1^2~5^2~3 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=f6da8001c7d20985eec828353e332f4e8ff918aa new crosshairs by unfa, add an optional centered dot for each of them (toggleable via player setup menu), do some general cleanups in the player setup tab --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e00da32085..457505dd21 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -87,7 +87,15 @@ _cl_color 102 _cl_name Player _cl_playermodel models/player/umbra.iqm _cl_playerskin 0 -crosshair 1 +seta crosshair 6 +seta crosshair_color_red 0 +seta crosshair_color_green 0.2 +seta crosshair_color_blue 0.8 +seta crosshair_alpha 1 +seta crosshair_size 0.5 +seta crosshair_dot 1 +seta crosshair_dot_alpha 1 +seta crosshair_dot_size 1 seta crosshair_per_weapon 0 "when 1, each gun will display a different crosshair" seta crosshair_color_override 0 "when 1, crosshair_color_* overrides the per-weapon color" seta crosshair_effect_speed -1 "how fast (in seconds) some crosshair effects should take place, 0 = instant, -1 = 2x weapon switch time" diff --git a/gfx/crosshair1.tga b/gfx/crosshair1.tga new file mode 100644 index 0000000000..d6c09e9b50 Binary files /dev/null and b/gfx/crosshair1.tga differ diff --git a/gfx/crosshair10.tga b/gfx/crosshair10.tga index e9648b1e62..e7b5774e6f 100644 Binary files a/gfx/crosshair10.tga and b/gfx/crosshair10.tga differ diff --git a/gfx/crosshair11.tga b/gfx/crosshair11.tga index 8718e907fc..d1486adbe1 100644 Binary files a/gfx/crosshair11.tga and b/gfx/crosshair11.tga differ diff --git a/gfx/crosshair12.tga b/gfx/crosshair12.tga index 4edabeaaaf..95892abd6c 100644 Binary files a/gfx/crosshair12.tga and b/gfx/crosshair12.tga differ diff --git a/gfx/crosshair13.tga b/gfx/crosshair13.tga index 4a546781fa..e9f17a796c 100644 Binary files a/gfx/crosshair13.tga and b/gfx/crosshair13.tga differ diff --git a/gfx/crosshair2.tga b/gfx/crosshair2.tga new file mode 100644 index 0000000000..4e2bd7950b Binary files /dev/null and b/gfx/crosshair2.tga differ diff --git a/gfx/crosshair3.tga b/gfx/crosshair3.tga new file mode 100644 index 0000000000..db5f2cc958 Binary files /dev/null and b/gfx/crosshair3.tga differ diff --git a/gfx/crosshair4.tga b/gfx/crosshair4.tga new file mode 100644 index 0000000000..2c4f312d47 Binary files /dev/null and b/gfx/crosshair4.tga differ diff --git a/gfx/crosshair5.tga b/gfx/crosshair5.tga new file mode 100644 index 0000000000..905045f22c Binary files /dev/null and b/gfx/crosshair5.tga differ diff --git a/gfx/crosshair6.tga b/gfx/crosshair6.tga new file mode 100644 index 0000000000..b005d9643a Binary files /dev/null and b/gfx/crosshair6.tga differ diff --git a/gfx/crosshair7.tga b/gfx/crosshair7.tga index dc7fe43db4..64f6d5d07a 100644 Binary files a/gfx/crosshair7.tga and b/gfx/crosshair7.tga differ diff --git a/gfx/crosshair8.tga b/gfx/crosshair8.tga index 06028298fa..df9e414f7c 100644 Binary files a/gfx/crosshair8.tga and b/gfx/crosshair8.tga differ diff --git a/gfx/crosshair9.tga b/gfx/crosshair9.tga index 75e033960f..a1e76940a7 100644 Binary files a/gfx/crosshair9.tga and b/gfx/crosshair9.tga differ diff --git a/gfx/crosshairdot.tga b/gfx/crosshairdot.tga new file mode 100644 index 0000000000..a2ffef2b79 Binary files /dev/null and b/gfx/crosshairdot.tga differ diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 6fc94ca434..157b68d007 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -893,7 +893,12 @@ void CSQC_UpdateView(float w, float h) { CROSSHAIR_DO_BLUR(CROSSHAIR_DRAW_RING, wcross_resolution, wcross_name, wcross_alpha); } + CROSSHAIR_DRAW(wcross_resolution, wcross_name, wcross_alpha * f); + + if(cvar("crosshair_dot")) + CROSSHAIR_DRAW(wcross_resolution * cvar("crosshair_dot_size"), "gfx/crosshairdot.tga", wcross_alpha * f * cvar("crosshair_dot_alpha")); + wcross_name_alpha_goal_prev = f; } } diff --git a/qcsrc/menu/xonotic/crosshairbutton.c b/qcsrc/menu/xonotic/crosshairbutton.c index b290f3d218..a6608a7d7d 100644 --- a/qcsrc/menu/xonotic/crosshairbutton.c +++ b/qcsrc/menu/xonotic/crosshairbutton.c @@ -8,6 +8,7 @@ CLASS(XonoticCrosshairButton) EXTENDS(RadioButton) ATTRIB(XonoticCrosshairButton, useDownAsChecked, float, 1) ATTRIB(XonoticCrosshairButton, src3, string, string_null) + ATTRIB(XonoticCrosshairButton, src4, string, string_null) ATTRIB(XonoticCrosshairButton, cvarName, string, string_null) ATTRIB(XonoticCrosshairButton, cvarValueFloat, float, 0) @@ -33,6 +34,7 @@ void XonoticCrosshairButton_configureXonoticCrosshairButton(entity me, float the me.configureRadioButton(me, string_null, me.fontSize, me.image, theGroup, 0); me.srcMulti = 1; me.src3 = strzone(strcat("/gfx/crosshair", ftos(me.cvarValueFloat))); + me.src4 = "/gfx/crosshairdot"; } void XonoticCrosshairButton_setChecked(entity me, float val) { @@ -76,12 +78,14 @@ void XonoticCrosshairButton_draw(entity me) sz = draw_PictureSize(me.src3); sz = globalToBoxSize(sz, draw_scale); - sz = sz * cvar("crosshair_size"); + sz = (2 * '1 1 0' + sz * cvar("crosshair_size")) * 0.1; // (2 * '1 1 0' + ...) * 0.1 here to make visible size changes happen also at bigger sizes if(sz_x > 0.95) sz = sz * (0.95 / sz_x); if(sz_y > 0.95) sz = sz * (0.95 / sz_y); draw_Picture('0.5 0.5 0' - 0.5 * sz, me.src3, sz, rgb, a); + if(cvar("crosshair_dot")) + draw_Picture('0.5 0.5 0' - 0.5 * sz * cvar("crosshair_dot_size"), me.src4, sz * cvar("crosshair_dot_size"), rgb, a * cvar("crosshair_dot_alpha")); } #endif diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c index 754da256a9..16ca36ff0e 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c @@ -84,7 +84,7 @@ void XonoticPlayerSettingsTab_fill(entity me) } me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Field of View:")); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Field of view:")); me.TD(me, 1, 2, e = makeXonoticSlider(60, 130, 1, "fov")); me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Damage kick:")); @@ -92,11 +92,9 @@ void XonoticPlayerSettingsTab_fill(entity me) me.TR(me); sl = makeXonoticSlider(0.45, 0.75, 0.01, "cl_bobcycle"); me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, sl, "View bobbing:")); - me.TD(me, 1, 2, sl); - - me.TR(me); + me.TD(me, 1, 2, sl); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Zoom Factor:")); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Zoom factor:")); me.TD(me, 1, 2, e = makeXonoticSlider(2, 16, 0.5, "cl_zoomfactor")); me.TR(me); sl = makeXonoticSlider(1, 8, 0.5, "cl_zoomspeed"); @@ -111,39 +109,55 @@ void XonoticPlayerSettingsTab_fill(entity me) e0.allowCut = 1; me.TR(me); me.TR(me); - me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "crosshair_per_weapon", "Per weapon crosshairs")); - me.TD(me, 1, 1.3, e = makeXonoticCheckBox(1, "crosshair_color_override", "& crosshair colors")); + me.TD(me, 1, 0.75, e = makeXonoticTextLabel(0, "Crosshair:")); + me.TD(me, 1, 1.00, e = makeXonoticCheckBox(0, "crosshair_per_weapon", "Per weapon")); + me.TD(me, 1, 1.25, e = makeXonoticCheckBox(1, "crosshair_color_override", "& Per weapon colors")); setDependent(e, "crosshair_per_weapon", 1, 1); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair:")); + me.TDempty(me, 0.5); for(i = 1; i <= 10; ++i) { me.TDNoMargin(me, 1, 2 / 10, e = makeXonoticCrosshairButton(3, i), '1 1 0'); setDependent(e, "crosshair_per_weapon", 0, 0); } me.TR(me); - me.TDempty(me, 1); + me.TDempty(me, 0.5); for(i = 11; i <= 20; ++i) { me.TDNoMargin(me, 1, 2 / 10, e = makeXonoticCrosshairButton(3, i), '1 1 0'); setDependent(e, "crosshair_per_weapon", 0, 0); } me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair Size:")); - me.TD(me, 1, 2, e = makeXonoticSlider(0.40, 2, 0.05, "crosshair_size")); + me.TDempty(me, 0.2); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair size:")); + me.TD(me, 1, 1.8, e = makeXonoticSlider(0.10, 1.5, 0.05, "crosshair_size")); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair Alpha:")); - me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_alpha")); + me.TDempty(me, 0.2); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair alpha:")); + me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.1, "crosshair_color_alpha")); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair Red:")); - me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_red")); + me.TDempty(me, 0.2); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair red:")); + me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_red")); setDependentOR(e, "crosshair_per_weapon", 0, 0, "crosshair_color_override", 1, 1); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair Green:")); - me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_green")); + me.TDempty(me, 0.2); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair green:")); + me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_green")); setDependentOR(e, "crosshair_per_weapon", 0, 0, "crosshair_color_override", 1, 1); me.TR(me); - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair Blue:")); - me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_blue")); + me.TDempty(me, 0.2); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair blue:")); + me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.01, "crosshair_color_blue")); setDependentOR(e, "crosshair_per_weapon", 0, 0, "crosshair_color_override", 1, 1); + me.TR(me); + me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", "Enable centered dot")); + me.TR(me); + me.TDempty(me, 0.2); + me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Size:")); + me.TD(me, 1, 0.9, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size")); + setDependent(e, "crosshair_dot", 1, 1); + me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Alpha:")); + me.TD(me, 1, 0.9, e = makeXonoticSlider(0.10, 1, 0.1, "crosshair_dot_alpha")); + setDependent(e, "crosshair_dot", 1, 1); me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Hit test:")); me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "crosshair_hittest", "0", "None")); @@ -157,13 +171,13 @@ void XonoticPlayerSettingsTab_fill(entity me) me.TDempty(me, 0.5); me.TR(me); me.TDempty(me, 0.4); - me.TD(me, 1, 2.2, e = makeXonoticButton("HUD Setup", '0 0 0')); + me.TD(me, 1, 2.2, e = makeXonoticButton("Enter HUD editor", '0 0 0')); e.onClick = HUDSetup_Join_Click; e.onClickEntity = me; me.TDempty(me, 0.5); me.TR(me); #ifdef ALLOW_FORCEMODELS - me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Force Models:")); + me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Force models:")); me.TD(me, 1, 2/3, e = makeXonoticRadioButton(2, string_null, string_null, "None")); me.TD(me, 1, 2/3, e = makeXonoticRadioButton(2, "cl_forceplayermodelsfromxonotic", string_null, "Custom")); me.TD(me, 1, 2/3, e = makeXonoticRadioButton(2, "cl_forceplayermodels", string_null, "All"));