2 CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab)
3 METHOD(XonoticEffectsSettingsTab, fill, void(entity))
4 ATTRIB(XonoticEffectsSettingsTab, title, string, _("Effects"))
5 ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
6 ATTRIB(XonoticEffectsSettingsTab, rows, float, 17)
7 ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
8 ENDCLASS(XonoticEffectsSettingsTab)
9 entity makeXonoticEffectsSettingsTab();
10 float updateCompression();
14 entity makeXonoticEffectsSettingsTab()
17 me = spawnXonoticEffectsSettingsTab();
18 me.configureDialog(me);
22 float someShadowCvarIsEnabled(entity box)
24 if(cvar("r_shadow_realtime_dlight"))
25 if(cvar("r_shadow_realtime_dlight_shadows"))
27 if(cvar("r_shadow_realtime_world"))
28 if(cvar("r_shadow_realtime_world_shadows"))
33 void XonoticEffectsSettingsTab_fill(entity me)
38 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:")));
39 n = 5 + 2 * !!cvar("developer");
41 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^OMG!")), '1 0 1', "exec effects-omg.cfg", 0));
42 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Low")), '0 0 0', "exec effects-low.cfg", 0));
43 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Medium")), '0 0 0', "exec effects-med.cfg", 0));
44 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Normal")), '0 0 0', "exec effects-normal.cfg", 0));
45 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^High")), '0 0 0', "exec effects-high.cfg", 0));
46 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultra")), '0 0 0', "exec effects-ultra.cfg", 0));
48 me.TD(me, 1, 5 / n, e = makeXonoticCommandButton(ZCTX(_("PRE^Ultimate")), '0.5 0 0', "exec effects-ultimate.cfg", 0));
52 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Geometry detail:")));
53 me.TD(me, 1, 2, e = makeXonoticTextSlider("r_subdivisions_tolerance"));
54 e.addValue(e, ZCTX(_("DET^Lowest")), "16");
55 e.addValue(e, ZCTX(_("DET^Low")), "8");
56 e.addValue(e, ZCTX(_("DET^Normal")), "4");
57 e.addValue(e, ZCTX(_("DET^Good")), "3");
58 e.addValue(e, ZCTX(_("DET^Best")), "2");
59 e.addValue(e, ZCTX(_("DET^Insane")), "1");
60 e.configureXonoticTextSliderValues(e);
62 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player detail:")));
63 me.TD(me, 1, 2, e = makeXonoticSlider(4, 0, -0.1, "cl_playerdetailreduction"));
65 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Texture resolution:")));
66 setDependent(e, "r_showsurfaces", 0, 0);
67 me.TD(me, 1, 2, e = makeXonoticPicmipSlider());
69 e.addValue(e, ZCTX(_("RES^Leet")), "1337");
70 e.addValue(e, ZCTX(_("RES^Lowest")), "3");
71 e.addValue(e, ZCTX(_("RES^Very low")), "2");
72 e.addValue(e, ZCTX(_("RES^Low")), "1");
73 e.addValue(e, ZCTX(_("RES^Normal")), "0");
74 e.addValue(e, ZCTX(_("RES^Good")), "-1");
75 e.addValue(e, ZCTX(_("RES^Best")), "-2");
76 e.configureXonoticTextSliderValues(e);
77 setDependent(e, "r_showsurfaces", 0, 0);
81 // detect texture compression method
83 f = updateCompression();
87 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
88 e.disabled = 1; // just show the checkbox anyway, but with no ability to control it
91 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
92 setDependent(e, "r_showsurfaces", 0, 0);
95 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
96 setDependent(e, "r_showsurfaces", 0, 0);
97 makeMulti(e, "gl_texturecompression");
102 if(cvar("developer"))
105 me.TD(me, 1, 2.8, e = makeXonoticCheckBoxEx(3, 0, "r_showsurfaces", _("Show surfaces")));
108 me.TD(me, 1, 1, e = makeXonoticCheckBox(1, "mod_q3bsp_nolightmaps", _("Use lightmaps")));
109 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_deluxemapping", _("Deluxe mapping")));
110 setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
111 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_gloss", _("Gloss")));
112 setDependentAND3(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0, "r_glsl_deluxemapping", 1, 1);
114 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping", _("Offset mapping")));
115 setDependent(e, "vid_gl20", 1, 1);
116 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping")));
117 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
119 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_water", _("Reflections:")));
120 setDependent(e, "vid_gl20", 1, 1);
121 me.TD(me, 1, 2, e = makeXonoticTextSlider("r_water_resolutionmultiplier"));
122 e.addValue(e, _("Blurred"), "0.25");
123 e.addValue(e, ZCTX(_("REFL^Good")), "0.5");
124 e.addValue(e, _("Sharp"), "1");
125 e.configureXonoticTextSliderValues(e);
126 setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
129 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Particles quality:")));
130 me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 1.0, 0.1, "cl_particles_quality"));
132 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Particles distance:")));
133 me.TD(me, 1, 2, e = makeXonoticSlider(500, 2000, 100, "r_drawparticles_drawdistance"));
135 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage effects:")));
136 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect"));
137 e.addValue(e, ZCTX(_("DMGPRTCLS^Disabled")), "0");
138 e.addValue(e, ZCTX(_("DMGPRTCLS^Skeletal")), "1");
139 e.addValue(e, ZCTX(_("DMGPRTCLS^All")), "2");
140 e.configureXonoticTextSliderValues(e);
142 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_spawn_point_particles", _("Particle effects for spawnpoints")));
143 makeMulti(e, "cl_spawn_event_particles");
145 me.gotoRC(me, 2, 3.2); me.setFirstColumn(me, me.currentColumn);
146 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "r_coronas", "0", _("No dynamic lighting")));
148 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "gl_flashblend", string_null, _("Fake corona lighting")));
149 makeMulti(e, "r_coronas");
151 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting")));
152 makeMulti(e, "r_coronas");
153 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_dlight_shadows", _("Shadows")));
154 setDependent(e, "r_shadow_realtime_dlight", 1, 1);
156 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_shadow_realtime_world", _("Realtime world lighting")));
157 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_world_shadows", _("Shadows")));
158 setDependent(e, "r_shadow_realtime_world", 1, 1);
161 me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_shadow_usenormalmap", _("Use normal maps")));
162 setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1);
163 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows")));
164 setDependentWeird(e, someShadowCvarIsEnabled);
167 me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", _("Fade corona according to visibility")));
168 setDependent(e, "r_coronas", 1, 1);
171 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_bloom", _("Bloom")));
172 me.TD(me, 1, 2, e = makeXonoticCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", _("Extra postprocessing effects")));
173 makeMulti(e, "hud_powerup");
174 setDependent(e, "vid_gl20", 1, 1);
176 s = makeXonoticSlider(0.1, 1, 0.1, "r_motionblur");
177 me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:")));
178 if(s.value != e.savedValue)
179 e.savedValue = 0.4; // default
183 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_decals", _("Decals")));
184 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
185 setDependent(e, "cl_decals", 1, 1);
188 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
189 setDependent(e, "cl_decals", 1, 1);
190 me.TD(me, 1, 2, e = makeXonoticSlider(200, 500, 20, "r_drawdecals_drawdistance"));
191 setDependent(e, "cl_decals", 1, 1);
194 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
195 setDependent(e, "cl_decals", 1, 1);
196 me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_fadetime"));
197 setDependent(e, "cl_decals", 1, 1);
199 me.gotoRC(me, me.rows - 1, 0);
200 me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));