Skip to content

Commit a1baafb

Browse files
authored
improve: client_options with tibia 13 styles (#821)
1 parent 24d2fe3 commit a1baafb

28 files changed

+1217
-92
lines changed

data/images/ui/button-grey-down.png

5.75 KB
Loading

data/images/ui/button-grey-up.png

5.96 KB
Loading
124 Bytes
Loading

data/images/ui/icon-arrow.png

147 Bytes
Loading

data/images/ui/icon-arrow7x7-down.png

102 Bytes
Loading
113 Bytes
Loading
4.73 KB
Loading
4.96 KB
Loading
2.36 KB
Loading
2.34 KB
Loading

modules/client_options/data_options.lua

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
return {
22
vsync = {
33
value = true,
4-
action = function(value, options, controller, panels, extraWidgets, extraWidgets)
4+
action = function(value, options, controller, panels, extraWidgets)
55
g_window.setVerticalSync(value)
66
end
77
},
@@ -96,7 +96,7 @@ return {
9696
value = true,
9797
action = function(value, options, controller, panels, extraWidgets)
9898
panels.gameMapPanel:setDrawLights(value and options.ambientLight.value < 100)
99-
panels.graphicsPanel:recursiveGetChildById('ambientLight'):setEnabled(value)
99+
panels.graphicsEffectsPanel:recursiveGetChildById('ambientLight'):setEnabled(value)
100100
end
101101
},
102102
limitVisibleDimension = {
@@ -114,7 +114,7 @@ return {
114114
ambientLight = {
115115
value = 0,
116116
action = function(value, options, controller, panels, extraWidgets)
117-
panels.graphicsPanel:recursiveGetChildById('ambientLight'):setText(string.format('Ambient light: %s%%', value))
117+
panels.graphicsEffectsPanel:recursiveGetChildById('ambientLight'):setText(string.format('Ambient light: %s%%', value))
118118
panels.gameMapPanel:setMinimumAmbientLight(value / 100)
119119
panels.gameMapPanel:setDrawLights(options.enableLights.value)
120120
end
@@ -158,13 +158,13 @@ return {
158158
turnDelay = {
159159
value = 50,
160160
action = function(value, options, controller, panels, extraWidgets)
161-
panels.controlPanel:recursiveGetChildById('turnDelay'):setText(string.format('Turn delay: %sms', value))
161+
panels.generalPanel:recursiveGetChildById('turnDelay'):setText(string.format('Turn delay: %sms', value))
162162
end
163163
},
164164
hotkeyDelay = {
165165
value = 70,
166166
action = function(value, options, controller, panels, extraWidgets)
167-
panels.controlPanel:recursiveGetChildById('hotkeyDelay'):setText(string.format('Hotkey delay: %sms', value))
167+
panels.generalPanel:recursiveGetChildById('hotkeyDelay'):setText(string.format('Hotkey delay: %sms', value))
168168
end
169169
},
170170
crosshair = {
@@ -177,7 +177,7 @@ return {
177177
end
178178

179179
panels.gameMapPanel:setCrosshairTexture(newValue and crossPath .. newValue or nil)
180-
panels.generalPanel:recursiveGetChildById('crosshair'):setCurrentOptionByData(newValue, true)
180+
panels.interface:recursiveGetChildById('crosshair'):setCurrentOptionByData(newValue, true)
181181
end
182182
},
183183
enableHighlightMouseTarget = {
@@ -196,7 +196,7 @@ return {
196196
shadowFloorIntensity = {
197197
value = 30,
198198
action = function(value, options, controller, panels, extraWidgets)
199-
panels.graphicsPanel:recursiveGetChildById('shadowFloorIntensity'):setText(string.format(
199+
panels.graphicsEffectsPanel:recursiveGetChildById('shadowFloorIntensity'):setText(string.format(
200200
'Shadow floor Intensity: %s%%', value))
201201
panels.gameMapPanel:setShadowFloorIntensity(1 - (value / 100))
202202
end
@@ -223,16 +223,16 @@ return {
223223
value = 1,
224224
action = function(value, options, controller, panels, extraWidgets)
225225
panels.gameMapPanel:setFloorViewMode(value)
226-
panels.graphicsPanel:recursiveGetChildById('floorViewMode'):setCurrentOptionByData(value, true)
226+
panels.graphicsEffectsPanel:recursiveGetChildById('floorViewMode'):setCurrentOptionByData(value, true)
227227

228228
local fadeMode = value == 1
229-
panels.graphicsPanel:recursiveGetChildById('floorFading'):setEnabled(fadeMode)
229+
panels.graphicsEffectsPanel:recursiveGetChildById('floorFading'):setEnabled(fadeMode)
230230
end
231231
},
232232
floorFading = {
233233
value = 500,
234234
action = function(value, options, controller, panels, extraWidgets)
235-
panels.graphicsPanel:recursiveGetChildById('floorFading'):setText(string.format('Floor Fading: %s ms', value))
235+
panels.graphicsEffectsPanel:recursiveGetChildById('floorFading'):setText(string.format('Floor Fading: %s ms', value))
236236
panels.gameMapPanel:setFloorFading(tonumber(value))
237237
end
238238
},
@@ -242,7 +242,7 @@ return {
242242
if g_game.isUsingProtobuf() then
243243
value = true
244244
elseif g_app.isEncrypted() then
245-
local asyncWidget = panels.generalPanel:recursiveGetChildById('asyncTxtLoading')
245+
local asyncWidget = panels.graphicsPanel:recursiveGetChildById('asyncTxtLoading')
246246
asyncWidget:setEnabled(false)
247247
asyncWidget:setChecked(false)
248248
return
@@ -260,7 +260,7 @@ return {
260260
value = value / 2
261261
end
262262
g_app.setCreatureInformationScale(math.max(value + 0.5, 1))
263-
panels.consolePanel:recursiveGetChildById('creatureInformationScale'):setText(string.format(
263+
panels.interfaceHUD:recursiveGetChildById('creatureInformationScale'):setText(string.format(
264264
'Creature Information Scale: %sx', math.max(value + 0.5, 1)))
265265
end
266266
},
@@ -273,7 +273,7 @@ return {
273273
value = value / 2
274274
end
275275
g_app.setStaticTextScale(math.max(value + 0.5, 1))
276-
panels.consolePanel:recursiveGetChildById('staticTextScale'):setText(string.format('Message Scale: %sx',
276+
panels.interfaceHUD:recursiveGetChildById('staticTextScale'):setText(string.format('Message Scale: %sx',
277277
math.max(value + 0.5, 1)))
278278
end
279279
},
@@ -286,7 +286,7 @@ return {
286286
value = value / 2
287287
end
288288
g_app.setAnimatedTextScale(math.max(value + 0.5, 1))
289-
panels.consolePanel:recursiveGetChildById('animatedTextScale'):setText(
289+
panels.interfaceHUD:recursiveGetChildById('animatedTextScale'):setText(
290290
tr('Animated Message Scale: %sx', math.max(value + 0.5, 1)))
291291
end
292292
},
@@ -332,14 +332,14 @@ return {
332332
value = 100,
333333
action = function(value, options, controller, panels, extraWidgets)
334334
g_client.setEffectAlpha(value / 100)
335-
panels.consolePanel:recursiveGetChildById('setEffectAlphaScroll'):setText(tr('Opacity Effect: %s%%', value))
335+
panels.graphicsEffectsPanel:recursiveGetChildById('setEffectAlphaScroll'):setText(tr('Opacity Effect: %s%%', value))
336336
end
337337
},
338338
setMissileAlphaScroll = {
339339
value = 100,
340340
action = function(value, options, controller, panels, extraWidgets)
341341
g_client.setMissileAlpha(value / 100)
342-
panels.consolePanel:recursiveGetChildById('setMissileAlphaScroll'):setText(tr('Opacity Missile: %s%%', value))
342+
panels.graphicsEffectsPanel:recursiveGetChildById('setMissileAlphaScroll'):setText(tr('Opacity Missile: %s%%', value))
343343
end
344344
},
345345
distFromCenScrollbar = {

0 commit comments

Comments
 (0)