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, _("Playermodel LOD:")));
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 me.TD(me, 1, 2, e = makeXonoticPicmipSlider());
68 e.addValue(e, ZCTX(_("RES^Leet")), "1337");
69 e.addValue(e, ZCTX(_("RES^Lowest")), "3");
70 e.addValue(e, ZCTX(_("RES^Very low")), "2");
71 e.addValue(e, ZCTX(_("RES^Low")), "1");
72 e.addValue(e, ZCTX(_("RES^Normal")), "0");
73 e.addValue(e, ZCTX(_("RES^Good")), "-1");
74 e.addValue(e, ZCTX(_("RES^Best")), "-2");
75 e.configureXonoticTextSliderValues(e);
78 // detect texture compression method
80 f = updateCompression();
86 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
89 me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
90 makeMulti(e, "gl_texturecompression");
95 me.TD(me, 1, 1, e = makeXonoticCheckBox(1, "mod_q3bsp_nolightmaps", _("Use lightmaps")));
96 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_deluxemapping", _("Deluxe mapping")));
97 setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
98 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_gloss", _("Gloss")));
99 setDependentAND3(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0, "r_glsl_deluxemapping", 1, 1);
102 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Particles quality:")));
103 me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 1.0, 0.1, "cl_particles_quality"));
105 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Particles distance:")));
106 me.TD(me, 1, 2, e = makeXonoticSlider(500, 2000, 100, "r_drawparticles_drawdistance"));
108 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage effects:")));
109 me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_damageeffect"));
110 e.addValue(e, ZCTX(_("DMGPRTCLS^Disabled")), "0");
111 e.addValue(e, ZCTX(_("DMGPRTCLS^Skeletal")), "1");
112 e.addValue(e, ZCTX(_("DMGPRTCLS^All")), "2");
113 e.configureXonoticTextSliderValues(e);
116 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "cl_decals", _("Decals")));
117 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "cl_decals_models", _("Decals on models")));
118 setDependent(e, "cl_decals", 1, 1);
121 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Distance:")));
122 setDependent(e, "cl_decals", 1, 1);
123 me.TD(me, 1, 2, e = makeXonoticSlider(200, 500, 20, "r_drawdecals_drawdistance"));
124 setDependent(e, "cl_decals", 1, 1);
127 me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Time:")));
128 setDependent(e, "cl_decals", 1, 1);
129 me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_time"));
130 setDependent(e, "cl_decals", 1, 1);
132 me.gotoRC(me, 2, 3.2); me.setFirstColumn(me, me.currentColumn);
133 me.TD(me, 1, 1.2, e = makeXonoticCheckBox(0, "r_coronas", _("Coronas")));
134 me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", _("Use Occlusion Queries")));
136 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, string_null, string_null, _("No dynamic lighting")));
138 me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "gl_flashblend", string_null, _("Fake corona lighting")));
140 me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting")));
141 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_dlight_shadows", _("Shadows")));
142 setDependent(e, "r_shadow_realtime_dlight", 1, 1);
144 me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_shadow_realtime_world", _("Realtime world lighting")));
145 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_world_shadows", _("Shadows")));
146 setDependent(e, "r_shadow_realtime_world", 1, 1);
149 me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_shadow_usenormalmap", _("Use normal maps")));
150 setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1);
151 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows")));
152 setDependentWeird(e, someShadowCvarIsEnabled);
154 if(cvar("developer"))
155 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(3, 0, "r_showsurfaces", _("Show surfaces")));
157 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping", _("Offset mapping")));
158 setDependent(e, "vid_gl20", 1, 1);
159 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping")));
160 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
161 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_lod", _("LOD")));
162 setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
164 me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_bloom", _("Bloom")));
166 me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_water", _("Reflections:")));
167 setDependent(e, "vid_gl20", 1, 1);
168 me.TD(me, 1, 2, e = makeXonoticTextSlider("r_water_resolutionmultiplier"));
169 e.addValue(e, _("Blurred"), "0.25");
170 e.addValue(e, ZCTX(_("REFL^Good")), "0.5");
171 e.addValue(e, _("Sharp"), "1");
172 e.configureXonoticTextSliderValues(e);
173 setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
175 s = makeXonoticSlider(0.1, 1, 0.1, "r_motionblur");
176 me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:")));
177 if(s.value != e.savedValue)
178 e.savedValue = 0.4; // default
181 me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "hud_postprocessing_maxbluralpha", _("Extra postprocessing effects")));
182 makeMulti(e, "hud_powerup");
183 setDependent(e, "vid_gl20", 1, 1);
185 me.gotoRC(me, me.rows - 1, 0);
186 me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));