X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_settings_effects.qc;h=9841f66ff3f83313b093daa686083838b0e8b967;hp=9089691590d6ccfaef63f852905c163ee6754040;hb=ae458cf44e1264534a20514f2f451c3d06ff135b;hpb=c89dfaa4d0342b98c320621557973a65114fbdf4 diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.qc b/qcsrc/menu/xonotic/dialog_settings_effects.qc index 908969159..9841f66ff 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.qc +++ b/qcsrc/menu/xonotic/dialog_settings_effects.qc @@ -1,16 +1,17 @@ -#ifndef DIALOG_SETTINGS_EFFECTS_H -#define DIALOG_SETTINGS_EFFECTS_H -#include "tab.qc" -CLASS(XonoticEffectsSettingsTab, XonoticTab) - METHOD(XonoticEffectsSettingsTab, fill, void(entity)); - 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 +#include "dialog_settings_effects.qh" + +#include "slider_picmip.qh" +#include "slider_sbfadetime.qh" +#include "weaponslist.qh" +#include "keybinder.qh" +#include "commandbutton.qh" +#include "textlabel.qh" +#include "checkbox.qh" +#include "textslider.qh" +#include "slider.qh" +#include "radiobutton.qh" +#include "checkbox_slider_invalid.qh" -#ifdef IMPLEMENTATION entity makeXonoticEffectsSettingsTab() { entity me; @@ -33,24 +34,37 @@ float someShadowCvarIsEnabled(entity box) void XonoticEffectsSettingsTab_fill(entity me) { entity e, s; + entity effectsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY); + effectsApplyButton.disableOnClick = true; float n; me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:"))); - n = 5 + 2 * !!cvar("developer"); - if(cvar("developer")) + n = 5 + 2 * boolean(cvar("developer") > 0); + if(cvar("developer") > 0) + { me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0)); + e.applyButton = effectsApplyButton; + } me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Low")), '0 0 0', "exec effects-low.cfg", 0)); + e.applyButton = effectsApplyButton; me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Medium")), '0 0 0', "exec effects-med.cfg", 0)); + e.applyButton = effectsApplyButton; me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Normal")), '0 0 0', "exec effects-normal.cfg", 0)); + e.applyButton = effectsApplyButton; me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^High")), '0 0 0', "exec effects-high.cfg", 0)); + e.applyButton = effectsApplyButton; me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0)); - if(cvar("developer")) + e.applyButton = effectsApplyButton; + if(cvar("developer") > 0) + { me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0)); + e.applyButton = effectsApplyButton; + } me.gotoRC(me, 1.25, 0); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Geometry detail:"))); me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_subdivisions_tolerance", - _("Change the smoothness of the curves on the map (default: normal)"))); + _("Change the smoothness of the curves on the map"))); e.addValue(e, ZCTX(_("DET^Lowest")), "16"); e.addValue(e, ZCTX(_("DET^Low")), "8"); e.addValue(e, ZCTX(_("DET^Normal")), "4"); @@ -58,6 +72,7 @@ void XonoticEffectsSettingsTab_fill(entity me) e.addValue(e, ZCTX(_("DET^Best")), "2"); e.addValue(e, ZCTX(_("DET^Insane")), "1"); e.configureXonoticTextSliderValues(e); + e.applyButton = effectsApplyButton; me.TR(me); me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player detail:"))); me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_playerdetailreduction")); @@ -67,11 +82,12 @@ void XonoticEffectsSettingsTab_fill(entity me) e.addValue(e, ZCTX(_("PDET^Good")), "1"); e.addValue(e, ZCTX(_("PDET^Best")), "0"); e.configureXonoticTextSliderValues(e); + e.applyButton = effectsApplyButton; 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")) + if(cvar("developer") > 0) e.addValue(e, ZCTX(_("RES^Leet")), "1337"); e.addValue(e, ZCTX(_("RES^Lowest")), "3"); e.addValue(e, ZCTX(_("RES^Very low")), "2"); @@ -81,6 +97,7 @@ void XonoticEffectsSettingsTab_fill(entity me) e.addValue(e, ZCTX(_("RES^Best")), "-2"); e.configureXonoticTextSliderValues(e); setDependent(e, "r_showsurfaces", 0, 0); + e.applyButton = effectsApplyButton; me.TR(me); me.TDempty(me, 0.2); { @@ -92,47 +109,52 @@ void XonoticEffectsSettingsTab_fill(entity me) 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 + e.applyButton = effectsApplyButton; 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); + e.applyButton = effectsApplyButton; 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"); + e.applyButton = effectsApplyButton; break; } } me.TR(me); - if(cvar("developer")) + me.TDempty(me, 0.2); + me.TD(me, 1, 1, e = makeXonoticCheckBoxEx_T(1, 0, "r_sky", _("Show skyboxes"), _("Disable skyboxes for performance and visibility"))); + if(cvar("developer") > 0) { - me.TDempty(me, 0.2); - me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx_T(3, 0, "r_showsurfaces", _("Show surfaces"), - _("Disable textures completely for very slow hardware. This gives a huge performance boost, but looks very ugly. (default: disabled)"))); + me.TD(me, 1, 1, e = makeXonoticCheckBoxEx_T(3, 0, "r_showsurfaces", _("Show surfaces"), + _("Disable textures completely for very slow hardware. This gives a huge performance boost, but looks very ugly."))); } me.TR(me); me.TD(me, 1, 1, e = makeXonoticCheckBox_T(1, "mod_q3bsp_nolightmaps", _("Use lightmaps"), - _("Use high resolution lightmaps, which will look pretty but use up some extra video memory (default: enabled)"))); + _("Use high resolution lightmaps, which will look pretty but use up some extra video memory"))); + e.applyButton = effectsApplyButton; me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_deluxemapping", _("Deluxe mapping"), - _("Use per-pixel lighting effects (default: enabled)"))); + _("Use per-pixel lighting effects"))); setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0); me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_gloss", _("Gloss"), - _("Enable the use of glossmaps on textures supporting it (default: enabled)"))); + _("Enable the use of glossmaps on textures supporting it"))); 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_T(0, "r_glsl_offsetmapping", _("Offset mapping"), - _("Offset mapping effect that will make textures with bumpmaps appear like they \"pop out\" of the flat 2D surface (default: disabled)"))); + _("Offset mapping effect that will make textures with bumpmaps appear like they \"pop out\" of the flat 2D surface"))); setDependent(e, "vid_gl20", 1, 1); me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping"), - _("Higher quality offset mapping, which also has a huge impact on performance (default: disabled)"))); + _("Higher quality offset mapping, which also has a huge impact on performance"))); setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1); me.TR(me); me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_water", _("Reflections:"), - _("Reflection and refraction quality, has a huge impact on performance on maps with reflecting surfaces (default: disabled)"))); + _("Reflection and refraction quality, has a huge impact on performance on maps with reflecting surfaces"))); setDependent(e, "vid_gl20", 1, 1); me.TD(me, 1, 2, e = makeXonoticTextSlider_T("r_water_resolutionmultiplier", - _("Resolution of reflections/refractions (default: good)"))); + _("Resolution of reflections/refractions"))); e.addValue(e, _("Blurred"), "0.25"); e.addValue(e, ZCTX(_("REFL^Good")), "0.5"); e.addValue(e, _("Sharp"), "1"); @@ -140,7 +162,7 @@ void XonoticEffectsSettingsTab_fill(entity me) setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1); me.TR(me); me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "cl_decals", _("Decals"), - _("Enable decals (bullet holes and blood) (default: enabled)"))); + _("Enable decals (bullet holes and blood)"))); me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models"))); setDependent(e, "cl_decals", 1, 1); me.TR(me); @@ -148,14 +170,14 @@ void XonoticEffectsSettingsTab_fill(entity me) me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:"))); setDependent(e, "cl_decals", 1, 1); me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 500, 20, "r_drawdecals_drawdistance", - _("Decals further away than this will not be drawn (default: 300)"))); + _("Decals further away than this will not be drawn"))); 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_T(1, 20, 1, "cl_decals_fadetime", - _("Time in seconds before decals fade away (default: 2)"))); + _("Time in seconds before decals fade away"))); setDependent(e, "cl_decals", 1, 1); me.TR(me); me.TDempty(me, 0.2); @@ -168,42 +190,42 @@ void XonoticEffectsSettingsTab_fill(entity me) me.gotoRC(me, 1.25, 3.2); me.setFirstColumn(me, me.currentColumn); me.TD(me, 1, 3, e = makeXonoticRadioButton_T(1, "r_coronas", "0", _("No dynamic lighting"), - _("Enable corona flares around certain lights (default: enabled)"))); + _("Enable corona flares around certain lights"))); me.TR(me); me.TD(me, 1, 3, e = makeXonoticRadioButton_T(1, "gl_flashblend", string_null, _("Fake corona lighting"), - _("Enable faster but uglier dynamic lights by rendering bright coronas instead of real dynamic lights (default: disabled)"))); + _("Enable faster but uglier dynamic lights by rendering bright coronas instead of real dynamic lights"))); makeMulti(e, "r_coronas"); me.TR(me); me.TD(me, 1, 2, e = makeXonoticRadioButton_T(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting"), - _("Enable rendering of dynamic lights such as explosions and rocket lights (default: enabled)"))); + _("Enable rendering of dynamic lights such as explosions and rocket lights"))); makeMulti(e, "r_coronas"); me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_dlight_shadows", _("Shadows"), - _("Enable rendering of shadows from dynamic lights (default: disabled)"))); + _("Enable rendering of shadows from dynamic lights"))); setDependent(e, "r_shadow_realtime_dlight", 1, 1); me.TR(me); me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_world", _("Realtime world lighting"), - _("Enable rendering of full realtime world lighting on maps that support it. Note that this might have a big impact on performance. (default: disabled)"))); + _("Enable rendering of full realtime world lighting on maps that support it. Note that this might have a big impact on performance."))); me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_shadow_realtime_world_shadows", _("Shadows"), - _("Enable rendering of shadows from realtime world lights (default: disabled)"))); + _("Enable rendering of shadows from realtime world lights"))); setDependent(e, "r_shadow_realtime_world", 1, 1); me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 1.8, e = makeXonoticCheckBox_T(0, "r_shadow_usenormalmap", _("Use normal maps"), - _("Enable use of directional shading on textures (default: enabled)"))); + _("Enable use of directional shading on textures"))); 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_T(0, "r_coronas_occlusionquery", _("Fade corona according to visibility"), - _("Fade coronas according to visibility (default: enabled)"))); + _("Fade coronas according to visibility"))); setDependent(e, "r_coronas", 1, 1); me.TR(me); me.TR(me); me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "r_bloom", _("Bloom"), - _("Enable bloom effect, which brightens the neighboring pixels of very bright pixels. Has a big impact on performance. (default: disabled)"))); + _("Enable bloom effect, which brightens the neighboring pixels of very bright pixels. Has a big impact on performance."))); me.TD(me, 1, 2, e = makeXonoticCheckBoxEx_T(0.5, 0, "hud_postprocessing_maxbluralpha", _("Extra postprocessing effects"), - _("Enables special postprocessing effects for when damaged or under water or using a powerup (default: disabled)"))); + _("Enables special postprocessing effects for when damaged or under water or using a powerup"))); makeMulti(e, "hud_powerup"); setDependent(e, "vid_gl20", 1, 1); me.TR(me); @@ -216,24 +238,25 @@ void XonoticEffectsSettingsTab_fill(entity me) 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"))); + me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "cl_spawn_point_particles", _("Spawnpoint effects"), + _("Particles effects at all spawn points and whenever a player spawns"))); 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()); + me.TD(me, 1, 2, e = makeXonoticSlider_T(0, 3.0, 0.25, "cl_particles_quality", + _("Multiplier for amount of particles. Less means less particles, which in turn gives for better performance"))); 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_T(200, 500, 20, "r_drawparticles_drawdistance", - _("Particles further away than this will not be drawn (default: 1000)"))); + me.TD(me, 1, 2, e = makeXonoticSlider_T(200, 3000, 200, "r_drawparticles_drawdistance", + _("Particles further away than this will not be drawn"))); 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)); + me.TD(me, 1, me.columns, effectsApplyButton); } -#endif