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, _("Texture resolution:")));
63 me.TD(me, 1, 2, e = makeXonoticPicmipSlider());
65 e.addValue(e, ZCTX(_("RES^Leet")), "1337");
66 e.addValue(e, ZCTX(_("RES^Lowest")), "3");
67 e.addValue(e, ZCTX(_("RES^Very low")), "2");
68 e.addValue(e, ZCTX(_("RES^Low")), "1");
69 e.addValue(e, ZCTX(_("RES^Normal")), "0");
70 e.addValue(e, ZCTX(_("RES^Good")), "-1");
71 e.addValue(e, ZCTX(_("RES^Best")), "-2");
72 e.configureXonoticTextSliderValues(e);
76 // detect texture compression method
78 f = updateCompression();
84 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
87 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
88 makeMulti(e, "gl_texturecompression");
93 me.TD(me, 1, 1, e = makeXonoticCheckBox(1, "mod_q3bsp_nolightmaps", _("Use lightmaps")));
94 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_deluxemapping", _("Deluxe mapping")));
95 setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
96 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_gloss", _("Gloss")));
97 setDependentAND3(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0, "r_glsl_deluxemapping", 1, 1);
100 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Particles quality:")));
101 me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 1.0, 0.1, "cl_particles_quality"));
103 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Particles distance:")));
104 me.TD(me, 1, 2, e = makeXonoticSlider(500, 2000, 100, "r_drawparticles_drawdistance"));
106 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage effects:")));
107 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect"));
108 e.addValue(e, ZCTX(_("DMGPRTCLS^Disabled")), "0");
109 e.addValue(e, ZCTX(_("DMGPRTCLS^Skeletal")), "1");
110 e.addValue(e, ZCTX(_("DMGPRTCLS^All")), "2");
111 e.configureXonoticTextSliderValues(e);
114 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_decals", _("Decals")));
115 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
116 setDependent(e, "cl_decals", 1, 1);
119 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
120 setDependent(e, "cl_decals", 1, 1);
121 me.TD(me, 1, 2, e = makeXonoticSlider(200, 500, 20, "r_drawdecals_drawdistance"));
122 setDependent(e, "cl_decals", 1, 1);
125 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
126 setDependent(e, "cl_decals", 1, 1);
127 me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_time"));
128 setDependent(e, "cl_decals", 1, 1);
130 me.gotoRC(me, 2, 3.2); me.setFirstColumn(me, me.currentColumn);
131 me.TD(me, 1, 1.2, e = makeXonoticCheckBox(0, "r_coronas", _("Coronas")));
132 me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", _("Use Occlusion Queries")));
134 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, string_null, string_null, _("No dynamic lighting")));
136 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "gl_flashblend", string_null, _("Fake corona lighting")));
138 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting")));
139 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_dlight_shadows", _("Shadows")));
140 setDependent(e, "r_shadow_realtime_dlight", 1, 1);
142 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_shadow_realtime_world", _("Realtime world lighting")));
143 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_world_shadows", _("Shadows")));
144 setDependent(e, "r_shadow_realtime_world", 1, 1);
147 me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_shadow_usenormalmap", _("Use normal maps")));
148 setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1);
149 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows")));
150 setDependentWeird(e, someShadowCvarIsEnabled);
152 if(cvar("developer"))
153 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(3, 0, "r_showsurfaces", _("Show surfaces")));
155 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping", _("Offset mapping")));
156 setDependent(e, "vid_gl20", 1, 1);
157 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping")));
158 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
159 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_lod", _("LOD")));
160 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
162 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_bloom", _("Bloom")));
164 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_water", _("Reflections:")));
165 setDependent(e, "vid_gl20", 1, 1);
166 me.TD(me, 1, 2, e = makeXonoticTextSlider("r_water_resolutionmultiplier"));
167 e.addValue(e, _("Blurred"), "0.25");
168 e.addValue(e, ZCTX(_("REFL^Good")), "0.5");
169 e.addValue(e, _("Sharp"), "1");
170 e.configureXonoticTextSliderValues(e);
171 setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
173 s = makeXonoticSlider(0.1, 1, 0.1, "r_motionblur");
174 me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:")));
175 if(s.value != e.savedValue)
176 e.savedValue = 0.4; // default
179 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", _("Extra postprocessing effects")));
180 makeMulti(e, "hud_powerup");
181 setDependent(e, "vid_gl20", 1, 1);
183 me.gotoRC(me, me.rows - 1, 0);
184 me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));