Skip to content

Commit 7e4400a

Browse files
committed
Added Steam COP video and gameplay settings scripts
1 parent eb54dac commit 7e4400a

File tree

3 files changed

+293
-0
lines changed

3 files changed

+293
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
class "opt_gameplay" (CUIWindow)
2+
3+
function opt_gameplay:__init() super()
4+
end
5+
6+
function opt_gameplay:__finalize()
7+
8+
end
9+
10+
function opt_gameplay:InitControls(x, y, xml, handler)
11+
12+
self:SetWndPos(vector2():set(x,y))
13+
self:SetWndSize(vector2():set(738,416))
14+
self:SetAutoDelete(true)
15+
16+
-- self.bk = xml:InitFrame("frame_gameplay", self)
17+
18+
xml:InitStatic("tab_gameplay:cap_difficulty", self)
19+
xml:InitStatic("tab_gameplay:cap_check_tips", self)
20+
xml:InitStatic("tab_gameplay:cap_check_crosshair", self)
21+
xml:InitStatic("tab_gameplay:cap_check_dyn_crosshair", self)
22+
xml:InitStatic("tab_gameplay:cap_check_show_weapon", self)
23+
xml:InitStatic("tab_gameplay:cap_check_dist", self)
24+
xml:InitStatic("tab_gameplay:cap_check_important_save", self)
25+
xml:InitStatic("tab_gameplay:cap_check_crouch_toggle", self)
26+
xml:InitStatic("tab_gameplay:cap_check_hud_draw", self)
27+
28+
xml:InitCheck("tab_gameplay:check_tips", self)
29+
xml:InitCheck("tab_gameplay:check_crosshair", self)
30+
xml:InitCheck("tab_gameplay:check_dyn_crosshair", self)
31+
xml:InitCheck("tab_gameplay:check_show_weapon", self)
32+
xml:InitCheck("tab_gameplay:check_dist", self)
33+
xml:InitCheck("tab_gameplay:check_important_save", self)
34+
xml:InitCheck("tab_gameplay:check_crouch_toggle", self)
35+
xml:InitCheck("tab_gameplay:check_hud_draw", self)
36+
xml:InitComboBox("tab_gameplay:list_difficulty", self)
37+
38+
local btn
39+
btn = xml:Init3tButton ("tab_gameplay:btn_check_updates", self)
40+
handler:Register (btn, "btn_check_updates")
41+
end
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
class "opt_video" (CUIWindow)
2+
3+
function opt_video:__init() super()
4+
end
5+
6+
function opt_video:__finalize()
7+
8+
end
9+
10+
function opt_video:InitControls(x, y, xml, handler)
11+
12+
self:SetWndPos(vector2():set(x,y))
13+
self:SetWndSize(vector2():set(738,416))
14+
self:SetAutoDelete(true)
15+
16+
-- self.bk = xml:InitFrame ("frame", self)
17+
18+
xml:InitStatic ("tab_video:cap_fullscreen", self)
19+
xml:InitCheck ("tab_video:check_fullscreen", self)
20+
21+
xml:InitStatic ("tab_video:cap_brightness", self)
22+
xml:InitTrackBar ("tab_video:track_brightness", self)
23+
24+
xml:InitStatic ("tab_video:cap_contrast", self)
25+
xml:InitTrackBar ("tab_video:track_contrast", self)
26+
27+
xml:InitStatic ("tab_video:cap_gamma", self)
28+
xml:InitTrackBar ("tab_video:track_gamma", self)
29+
30+
xml:InitStatic ("tab_video:cap_resolution", self)
31+
xml:InitComboBox ("tab_video:list_resolution", self)
32+
33+
xml:InitStatic ("tab_video:cap_preset", self)
34+
handler.combo_preset = xml:InitComboBox("tab_video:list_presets", self)
35+
handler:Register (handler.combo_preset, "combo_preset")
36+
37+
xml:InitStatic ("tab_video:cap_renderer", self)
38+
handler.combo_renderer = xml:InitComboBox("tab_video:list_renderer", self)
39+
handler:Register (handler.combo_renderer, "combo_renderer")
40+
41+
btn = xml:Init3tButton ("tab_video:btn_advanced", self)
42+
handler:Register (btn, "btn_advanced_graphic")
43+
end
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
--[[
2+
r1 = 0
3+
r2a = 1
4+
r2 = 2
5+
r2.5 = 3
6+
r3 = 4
7+
r4 = 5
8+
Команда називається r2_ssao. Для DX10 і DX11 потрібно додати нову опцію - st_opt_ultra, але лише коли r2_ssao_mode==hdao.
9+
]]
10+
class "opt_video_adv" (CUIWindow)
11+
function opt_video_adv:__init() super()
12+
end
13+
14+
function opt_video_adv:__finalize()
15+
end
16+
17+
function all_modes(render_id)
18+
return true
19+
end
20+
21+
function mode_1(render_id)
22+
return render_id==0
23+
end
24+
25+
function mode_ge_2a(render_id)
26+
return render_id>=1
27+
end
28+
29+
function mode_ge_2(render_id)
30+
return render_id>=2
31+
end
32+
33+
function mode_ge_25(render_id)
34+
return render_id>=3
35+
end
36+
37+
function mode_less_3(render_id)
38+
return render_id<4
39+
end
40+
41+
function mode_ge_3(render_id)
42+
return render_id>=4
43+
end
44+
45+
function mode_4(render_id)
46+
return render_id==5
47+
end
48+
49+
function opt_video_adv:InitControls(x, y, xml, handler)
50+
local ctl
51+
local _st
52+
53+
self:SetWndPos(vector2():set(x,y))
54+
self:SetWndSize(vector2():set(738,416))
55+
self:SetAutoDelete(true)
56+
57+
self.scroll_v = xml:InitScrollView("video_adv:scroll_v", self)
58+
handler.scroll_v = self.scroll_v
59+
60+
_st = xml:InitStatic("video_adv:templ_item", nil)
61+
xml:InitStatic("video_adv:cap_vis_dist", _st)
62+
xml:InitTrackBar("video_adv:track_vis_dist", _st)
63+
table.insert(handler.m_preconditions, {func=all_modes, control=_st})
64+
65+
_st = xml:InitStatic("video_adv:templ_item", nil)
66+
xml:InitStatic("video_adv:cap_geometry_lod", _st)
67+
xml:InitTrackBar("video_adv:track_geometry_lod", _st)
68+
table.insert(handler.m_preconditions, {func=all_modes, control=_st})
69+
70+
_st = xml:InitStatic("video_adv:templ_item", nil)
71+
xml:InitStatic("video_adv:cap_texture_lod", _st)
72+
ctl = xml:InitTrackBar("video_adv:track_texture_lod", _st)
73+
handler.texture_lod_track = ctl
74+
table.insert(handler.m_preconditions, {func=all_modes, control=_st})
75+
76+
_st = xml:InitStatic("video_adv:templ_item", nil)
77+
xml:InitStatic("video_adv:cap_aniso", _st)
78+
xml:InitTrackBar("video_adv:track_aniso", _st)
79+
table.insert(handler.m_preconditions, {func=all_modes, control=_st})
80+
81+
_st = xml:InitStatic("video_adv:templ_item", nil)
82+
xml:InitStatic("video_adv:cap_ssample", _st)
83+
ctl = xml:InitTrackBar("video_adv:track_ssample", _st)
84+
table.insert(handler.m_preconditions, {func=mode_less_3, control=_st})
85+
86+
_st = xml:InitStatic("video_adv:templ_item", nil)
87+
xml:InitStatic("video_adv:cap_ssample", _st)
88+
ctl = xml:InitComboBox("video_adv:combo_ssample", _st)
89+
table.insert(handler.m_preconditions, {func=mode_ge_3, control=_st})
90+
91+
_st = xml:InitStatic("video_adv:templ_item", nil)
92+
xml:InitStatic("video_adv:cap_detail_density", _st)
93+
xml:InitTrackBar("video_adv:track_detail_density", _st)
94+
table.insert(handler.m_preconditions, {func=all_modes, control=_st})
95+
96+
97+
_st = xml:InitStatic("video_adv:templ_item", nil)
98+
xml:InitStatic("video_adv:cap_r2_sun", _st)
99+
ctl = xml:InitCheck("video_adv:check_r2_sun", _st)
100+
table.insert(handler.m_preconditions, {func=mode_ge_2, control=_st})
101+
102+
_st = xml:InitStatic("video_adv:templ_item", nil)
103+
xml:InitStatic("video_adv:cap_light_distance", _st)
104+
ctl = xml:InitTrackBar("video_adv:track_light_distance", _st)
105+
table.insert(handler.m_preconditions, {func=mode_ge_2a, control=_st})
106+
107+
_st = xml:InitStatic("video_adv:templ_item", nil)
108+
xml:InitStatic("video_adv:cap_particles_distance", _st)
109+
ctl = xml:InitTrackBar("video_adv:track_particles_distance", _st)
110+
table.insert(handler.m_preconditions, {func=mode_ge_2a, control=_st})
111+
112+
_st = xml:InitStatic("video_adv:templ_item", nil)
113+
xml:InitStatic("video_adv:cap_npc_torch", _st)
114+
xml:InitCheck("video_adv:check_npc_torch", _st)
115+
table.insert(handler.m_preconditions, {func=all_modes, control=_st})
116+
117+
-- r1_detail_textures r1 only
118+
_st = xml:InitStatic("video_adv:templ_item", nil)
119+
xml:InitStatic("video_adv:cap_r1_detail_textures", _st)
120+
ctl = xml:InitCheck("video_adv:check_r1_detail_textures", _st)
121+
table.insert(handler.m_preconditions, {func=mode_1, control=_st})
122+
123+
-- r2_detail_bump =>r2
124+
_st = xml:InitStatic("video_adv:templ_item", nil)
125+
xml:InitStatic("video_adv:cap_r2_detail_bump", _st)
126+
ctl = xml:InitCheck("video_adv:check_r2_detail_bump", _st)
127+
table.insert(handler.m_preconditions, {func=mode_ge_2, control=_st})
128+
129+
-- r2_steep_parallax >r2
130+
_st = xml:InitStatic("video_adv:templ_item", nil)
131+
xml:InitStatic("video_adv:cap_r2_steep_parallax", _st)
132+
ctl = xml:InitCheck("video_adv:check_r2_steep_parallax", _st)
133+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
134+
135+
_st = xml:InitStatic("video_adv:templ_item", nil)
136+
xml:InitStatic("video_adv:cap_r2_sun_quality", _st)
137+
ctl = xml:InitComboBox("video_adv:list_r2_sun_quality", _st)
138+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
139+
140+
_st = xml:InitStatic("video_adv:templ_item", nil)
141+
xml:InitStatic("video_adv:cap_sun_shafts", _st)
142+
ctl = xml:InitComboBox("video_adv:combo_sun_shafts", _st)
143+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
144+
145+
_st = xml:InitStatic("video_adv:templ_item", nil)
146+
_st:SetWndSize(vector2():set(_st:GetWidth(), 106))
147+
xml:InitStatic("video_adv:cap_ao", _st)
148+
ctl = xml:InitTab("video_adv:radio_tab_ao_options", _st)
149+
handler.tab_ao_opt = ctl
150+
handler:Register(ctl, "tab_ao_opt")
151+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
152+
153+
_st = xml:InitStatic("video_adv:templ_item", nil)
154+
xml:InitStatic("video_adv:cap_ssao", _st)
155+
ctl = xml:InitComboBox("video_adv:combo_ssao", _st)
156+
handler.combo_ssao = ctl
157+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
158+
159+
_st = xml:InitStatic("video_adv:templ_item", nil)
160+
xml:InitStatic("video_adv:cap_soft_water", _st)
161+
ctl = xml:InitCheck("video_adv:check_soft_water", _st)
162+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
163+
164+
_st = xml:InitStatic("video_adv:templ_item", nil)
165+
xml:InitStatic("video_adv:cap_soft_particles", _st)
166+
ctl = xml:InitCheck("video_adv:check_soft_particles", _st)
167+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
168+
169+
_st = xml:InitStatic("video_adv:templ_item", nil)
170+
xml:InitStatic("video_adv:cap_dof", _st)
171+
ctl = xml:InitCheck("video_adv:check_dof", _st)
172+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
173+
174+
_st = xml:InitStatic("video_adv:templ_item", nil)
175+
xml:InitStatic("video_adv:cap_volumetric_light", _st)
176+
ctl = xml:InitCheck("video_adv:check_volumetric_light", _st)
177+
table.insert(handler.m_preconditions, {func=mode_ge_25, control=_st})
178+
179+
-- r3_dynamic_wet_surfaces >r25
180+
_st = xml:InitStatic("video_adv:templ_item", nil)
181+
xml:InitStatic("video_adv:cap_r3_dynamic_wet_surfaces", _st)
182+
ctl = xml:InitCheck ("video_adv:check_r3_dynamic_wet_surfaces", _st)
183+
table.insert(handler.m_preconditions, {func=mode_ge_3, control=_st})
184+
185+
-- r3_volumetric_smoke >r25
186+
_st = xml:InitStatic("video_adv:templ_item", nil)
187+
xml:InitStatic("video_adv:cap_r3_volumetric_smoke", _st)
188+
ctl = xml:InitCheck("video_adv:check_r3_volumetric_smoke", _st)
189+
table.insert(handler.m_preconditions, {func=mode_ge_3, control=_st})
190+
191+
-- r4_enable_tessellation only r4
192+
_st = xml:InitStatic("video_adv:templ_item", nil)
193+
xml:InitStatic("video_adv:cap_r4_tessellation", _st)
194+
ctl = xml:InitCheck("video_adv:check_r4_tessellation", _st)
195+
table.insert(handler.m_preconditions, {func=mode_4, control=_st})
196+
---------
197+
_st = xml:InitStatic("video_adv:templ_item", nil)
198+
xml:InitStatic("video_adv:cap_vsync", _st)
199+
xml:InitCheck("video_adv:check_vsync", _st)
200+
table.insert(handler.m_preconditions, {func=all_modes, control=_st})
201+
202+
_st = xml:InitStatic("video_adv:templ_item", nil)
203+
xml:InitStatic("video_adv:cap_60hz", _st)
204+
xml:InitCheck("video_adv:check_60hz", _st)
205+
table.insert(handler.m_preconditions, {func=all_modes, control=_st})
206+
207+
btn = xml:Init3tButton("video_adv:btn_to_simply", self)
208+
handler:Register(btn, "btn_simply_graphic")
209+
end

0 commit comments

Comments
 (0)