Client Upload Part 2

RD Core / Commit #5

Commit Client Upload Part 2

Alex Alex committed 19/10/2026 00:06 main Patch
1,244 files +271,215 -0
A RD_Client/modules/client_options/interface.otui +222-0 View file
@@ -0,0 +1,222 @@
1+OptionPanel
2+
3+ OptionCheckBox
4+ id: actionBar
5+ margin: 0 0 0 8
6+
7+ UILabel
8+ id: label
9+ anchors.left: parent.left
10+ anchors.verticalCenter: parent.verticalCenter
11+ size: 275 30
12+ !text: tr("Show action bar (spells)")
13+ text-offset: 0 5
14+ font: poppins-14-px
15+
16+ OptionCheckBox
17+ id: showPing
18+ margin: 27 0 0 8
19+
20+ UILabel
21+ id: label
22+ anchors.left: parent.left
23+ anchors.verticalCenter: parent.verticalCenter
24+ size: 275 30
25+ !text: tr('Show connection ping')
26+ !tooltip: tr('Display connection speed to the server (milliseconds)')
27+ text-offset: 0 5
28+ font: poppins-14-px
29+
30+ OptionCheckBox
31+ id: displayShadows
32+ margin: 27 0 0 8
33+
34+ UILabel
35+ id: label
36+ anchors.left: parent.left
37+ anchors.verticalCenter: parent.verticalCenter
38+ size: 275 30
39+ !text: tr('Display creature shadows')
40+ text-offset: 0 5
41+ font: poppins-14-px
42+
43+ OptionCheckBox
44+ id: displayNames
45+ margin: 27 0 0 8
46+
47+ UILabel
48+ id: label
49+ anchors.left: parent.left
50+ anchors.verticalCenter: parent.verticalCenter
51+ size: 275 30
52+ !text: tr('Display creature names')
53+ text-offset: 0 5
54+ font: poppins-14-px
55+
56+ OptionCheckBox
57+ id: displayHealth
58+ margin: 27 0 0 8
59+
60+ UILabel
61+ id: label
62+ anchors.left: parent.left
63+ anchors.verticalCenter: parent.verticalCenter
64+ size: 275 30
65+ !text: tr('Display creature health bars')
66+ text-offset: 0 5
67+ font: poppins-14-px
68+
69+ OptionCheckBox
70+ id: displayHealthOnTop
71+ margin: 27 0 0 8
72+ $mobile:
73+ visible: false
74+
75+ UILabel
76+ id: label
77+ anchors.left: parent.left
78+ anchors.verticalCenter: parent.verticalCenter
79+ size: 275 30
80+ !text: tr('Display creature health bars above texts')
81+ text-offset: 0 5
82+ font: poppins-14-px
83+
84+ OptionCheckBox
85+ id: hidePlayerBars
86+ margin: 27 0 0 8
87+
88+ UILabel
89+ id: label
90+ anchors.left: parent.left
91+ anchors.verticalCenter: parent.verticalCenter
92+ size: 275 30
93+ !text: tr('Show player health bar')
94+ text-offset: 0 5
95+ font: poppins-14-px
96+
97+ OptionCheckBox
98+ id: topHealtManaBar
99+ margin: 27 0 0 8
100+
101+ UILabel
102+ id: label
103+ anchors.left: parent.left
104+ anchors.verticalCenter: parent.verticalCenter
105+ size: 275 30
106+ !text: tr('Show player top health and mana bar')
107+ text-offset: 0 5
108+ font: poppins-14-px
109+
110+ OptionCheckBox
111+ id: showHealthManaCircle
112+ margin: 27 0 0 8
113+ $mobile:
114+ visible: false
115+
116+ UILabel
117+ id: label
118+ anchors.left: parent.left
119+ anchors.verticalCenter: parent.verticalCenter
120+ size: 275 30
121+ !text: tr('Show health and mana circle')
122+ text-offset: 0 5
123+ font: poppins-14-px
124+
125+ OptionCheckBox
126+ id: highlightThingsUnderCursor
127+ margin: 27 0 0 8
128+
129+ UILabel
130+ id: label
131+ anchors.left: parent.left
132+ anchors.verticalCenter: parent.verticalCenter
133+ size: 275 30
134+ !text: tr('Highlight things under cursor')
135+ text-offset: 0 5
136+ font: poppins-14-px
137+
138+ Label
139+ margin-top: 3
140+ id: crosshairLabel
141+ margin: 27 0 0 8
142+ !text: tr("Crosshair")
143+ font: poppins-14-px
144+
145+ OptionComboBox
146+ id: crosshair
147+ margin: 2 0 0 2
148+ color: white
149+ text-offset: 18 0
150+ image-source: settings/combobox
151+ image-size: 200 40
152+ opacity: 0.5
153+ font: poppins-14-px
154+ @onMousePress: |
155+ addEvent(function()
156+ local menuStyle = self:getStyleName()
157+ if self:getStyleName() == 'OptionComboBox' then menuStyle = 'ComboBox' end
158+ local menu
159+ if self.menuScroll then
160+ menu = g_ui.createWidget(''..menuStyle..'PopupScrollMenu')
161+ menu:setHeight(self.menuHeight)
162+ if self.menuScrollStep > 0 then
163+ menu:setScrollbarStep(self.menuScrollStep)
164+ end
165+ else
166+ menu = g_ui.createWidget(''..menuStyle..'PopupMenu')
167+ end
168+ menu:setId(self:getId() .. 'PopupMenu')
169+ for i,v in ipairs(self.options) do
170+ menu:addOption(v.text, function() self:setCurrentOption(v.text) end)
171+ end
172+ menu:setWidth(self:getWidth())
173+ menu:display({ x = self:getX(), y = self:getY() + self:getHeight() })
174+ connect(menu, { onDestroy = function() self:setOn(false) end })
175+ self:setOn(true)
176+ menu:setWidth(200)
177+ menu:setImageSource('settings/comboboxActive')
178+ menu:setFont('poppins-14-px')
179+ end)
180+ @onOptionChange: modules.client_options.setOption(self:getId(), self.currentIndex)
181+ @onSetup: |
182+ self:addOption("None")
183+ self:addOption("Default")
184+ self:addOption("Full")
185+
186+ Label
187+ id: floorFadingLabel
188+ font: poppins-14-px
189+ margin: 6 0 0 8
190+
191+ UIWidget
192+ id: floorFadingBG
193+ height: 15
194+ font: poppins-14-px
195+ text: Floor Fading
196+ text-align: left
197+ text-offset: 4 0
198+
199+ OptionScrollbar
200+ id: floorFading
201+ anchors.verticalCenter: parent.verticalCenter
202+ anchors.horizontalCenter: parent.horizontalCenter
203+ margin: 0 0 0 105
204+ width: 220
205+ minimum: 0
206+ maximum: 2000
207+
208+ Label
209+ id: floorFadingLabelBG
210+ anchors.top: parent.top
211+ anchors.right: parent.right
212+ width: 50
213+ margin: 0 13 0 0
214+ font: poppins-14-px
215+ color: #77f558
216+
217+ Label
218+ id: floorFadingLabel2
219+ margin-top: 6
220+ margin: 5 0 0 8
221+ !text: (tr('Floor fading doesn\'t work with enabled light'))
222+ font: poppins-14-px
A RD_Client/modules/client_options/options.lua +449-0 View file
@@ -0,0 +1,449 @@
1+local defaultOptions = {
2+ layout = DEFAULT_LAYOUT, -- set in init.lua
3+ vsync = true,
4+ showFps = true,
5+ showPing = true,
6+ fullscreen = false,
7+ classicView = false,--not g_app.isMobile(),
8+ cacheMap = g_app.isMobile(),
9+ classicControl = not g_app.isMobile(),
10+ smartWalk = true,
11+ autoChaseOverride = true,
12+ showStatusMessagesInConsole = true,
13+ showEventMessagesInConsole = true,
14+ showInfoMessagesInConsole = true,
15+ showTimestampsInConsole = true,
16+ showLevelsInConsole = true,
17+ showPrivateMessagesInConsole = true,
18+ showPrivateMessagesOnScreen = true,
19+ rightPanels = 4,
20+ leftPanels = 0,
21+ containerPanel = 8,
22+ backgroundFrameRate = 60,
23+ enableAudio = true,
24+ enableMusicSound = true,
25+ musicSoundVolume = 50,
26+ botSoundVolume = 100,
27+ enableLights = true,
28+ floorFading = 500,
29+ crosshair = 0,
30+ ambientLight = 36,
31+ optimizationLevel = 1,
32+ displayNames = true,
33+ displayShadows = true,
34+ displayHealth = true,
35+ displayMana = false,
36+ displayHealthOnTop = false,
37+ showHealthManaCircle = false,
38+ hidePlayerBars = true,
39+ highlightThingsUnderCursor = false,
40+ topHealtManaBar = true,
41+ displayText = true,
42+ dontStretchShrink = false,
43+ turnDelay = 30,
44+ hotkeyDelay = 30,
45+ animatedTextScale = 0,
46+ missilesOpacity = 0,
47+ effectsOpacity = 0,
48+ wsadWalking = false,
49+ walkFirstStepDelay = 200,
50+ walkTurnDelay = 100,
51+ walkStairsDelay = 50,
52+ walkTeleportDelay = 200,
53+ walkCtrlTurnDelay = 150,
54+
55+ actionBar = true
56+}
57+
58+local optionsWindow
59+--local optionsButton
60+optionsTabBar = nil
61+local options = {}
62+local extraOptions = {}
63+local generalPanel
64+local interfacePanel
65+local consolePanel
66+local graphicsPanel
67+local soundPanel
68+extrasPanel = nil
69+local audioButton
70+
71+function init()
72+ -- Clear the retired Dash option, including values saved by older clients.
73+ g_settings.set('dash', false)
74+ g_game.setMaxPreWalkingSteps(1)
75+ for k,v in pairs(defaultOptions) do
76+ g_settings.setDefault(k, v)
77+ options[k] = v
78+ end
79+ for _, v in ipairs(g_extras.getAll()) do
80+ extraOptions[v] = g_extras.get(v)
81+ g_settings.setDefault("extras_" .. v, extraOptions[v])
82+ end
83+
84+
85+ optionsWindow = g_ui.displayUI('options')
86+ optionsWindow:hide()
87+
88+ optionsTabBar = optionsWindow:getChildById('optionsTabBar')
89+ optionsTabBar:setContentWidget(optionsWindow:getChildById('optionsTabContent'))
90+
91+ g_keyboard.bindKeyDown('Ctrl+Shift+F', function() toggleOption('fullscreen') end)
92+ g_keyboard.bindKeyDown('Ctrl+N', toggleDisplays)
93+
94+ generalPanel = g_ui.loadUI('game')
95+ optionsTabBar:addTab(tr('Game'), generalPanel, '/modules/client_options/settings/iconpanel')
96+
97+ interfacePanel = g_ui.loadUI('interface')
98+ optionsTabBar:addTab(tr('Interface'), interfacePanel, '/modules/client_options/settings/iconpanel')
99+
100+ consolePanel = g_ui.loadUI('console')
101+ optionsTabBar:addTab(tr('Console'), consolePanel, '/modules/client_options/settings/iconpanel')
102+
103+ graphicsPanel = g_ui.loadUI('graphics')
104+ optionsTabBar:addTab(tr('Graphics'), graphicsPanel, '/modules/client_options/settings/iconpanel')
105+
106+ audioPanel = g_ui.loadUI('audio')
107+ optionsTabBar:addTab(tr('Audio'), audioPanel, '/modules/client_options/settings/iconpanel')
108+
109+ extrasPanel = g_ui.createWidget('OptionPanel')
110+ for _, v in ipairs(g_extras.getAll()) do
111+ local extrasButton = g_ui.createWidget('OptionCheckBox')
112+ extrasButton:setId(v)
113+ extrasButton:setText(g_extras.getDescription(v))
114+ extrasPanel:addChild(extrasButton)
115+ end
116+ --[[if not g_game.getFeature(GameNoDebug) and not g_app.isMobile() then
117+ optionsTabBar:addTab(tr('Extras'), extrasPanel, '/images/optionstab/extras')
118+ end]]--
119+
120+ --optionsButton = modules.client_topmenu.addLeftButton('optionsButton', tr('Options'), '/images/topbuttons/options', toggle)
121+ audioButton = modules.client_topmenu.addLeftButton('audioButton', tr('Audio'), '/images/topbuttons/audio', function() toggleOption('enableAudio') end)
122+ audioButton:hide()
123+ if g_app.isMobile() then
124+ audioButton:hide()
125+ end
126+
127+ addEvent(function() setup() end)
128+
129+ connect(g_game, { onGameStart = online,
130+ onGameEnd = offline })
131+end
132+
133+function terminate()
134+ disconnect(g_game, { onGameStart = online,
135+ onGameEnd = offline })
136+
137+ g_keyboard.unbindKeyDown('Ctrl+Shift+F')
138+ g_keyboard.unbindKeyDown('Ctrl+N')
139+ optionsWindow:destroy()
140+ --optionsButton:destroy()
141+ audioButton:destroy()
142+end
143+
144+function setup()
145+ -- load options
146+ for k,v in pairs(defaultOptions) do
147+ if type(v) == 'boolean' then
148+ setOption(k, g_settings.getBoolean(k), true)
149+ elseif type(v) == 'number' then
150+ setOption(k, g_settings.getNumber(k), true)
151+ elseif type(v) == 'string' then
152+ setOption(k, g_settings.getString(k), true)
153+ end
154+ end
155+
156+ for _, v in ipairs(g_extras.getAll()) do
157+ g_extras.set(v, g_settings.getBoolean("extras_" .. v))
158+ local widget = extrasPanel:recursiveGetChildById(v)
159+ if widget then
160+ widget:setChecked(g_extras.get(v))
161+ end
162+ end
163+
164+ if g_game.isOnline() then
165+ online()
166+ end
167+end
168+
169+function toggle()
170+ if optionsWindow:isVisible() then
171+ hide()
172+ else
173+ show()
174+ end
175+end
176+
177+function show()
178+ optionsWindow:show()
179+ optionsWindow:raise()
180+ optionsWindow:focus()
181+ if modules.game_console then
182+ modules.game_console.manageButton('settingsButton', true)
183+ end
184+end
185+
186+function hide()
187+ optionsWindow:hide()
188+ if modules.game_console then
189+ modules.game_console.manageButton('settingsButton', false)
190+ end
191+end
192+
193+function toggleDisplays()
194+ if options['displayNames'] and options['displayHealth'] and options['displayMana'] then
195+ setOption('displayNames', false)
196+ elseif options['displayHealth'] then
197+ setOption('displayHealth', false)
198+ setOption('displayMana', false)
199+ else
200+ if not options['displayNames'] and not options['displayHealth'] then
201+ setOption('displayNames', true)
202+ else
203+ setOption('displayHealth', true)
204+ setOption('displayMana', true)
205+ end
206+ end
207+end
208+
209+function toggleOption(key)
210+ setOption(key, not getOption(key))
211+end
212+
213+function setOption(key, value, force)
214+ if extraOptions[key] ~= nil then
215+ g_extras.set(key, value)
216+ g_settings.set("extras_" .. key, value)
217+ if key == "debugProxy" and modules.game_proxy then
218+ if value then
219+ modules.game_proxy.show()
220+ else
221+ modules.game_proxy.hide()
222+ end
223+ end
224+ return
225+ end
226+
227+ if modules.game_interface == nil then
228+ return
229+ end
230+
231+ if not force and options[key] == value then return end
232+ local gameMapPanel = modules.game_interface.getMapPanel()
233+
234+ if key == 'vsync' then
235+ g_window.setVerticalSync(value)
236+ elseif key == 'showFps' then
237+ if g_game.isOnline() then
238+ modules.client_topmenu.setFpsVisible(value)
239+ if modules.game_stats and modules.game_stats.ui.fps then
240+ modules.game_stats.ui.fps:setVisible(value)
241+ end
242+ end
243+ elseif key == 'showPing' then
244+ modules.client_topmenu.setPingVisible(value)
245+ if modules.game_stats and modules.game_stats.ui.ping then
246+ modules.game_stats.ui.ping:setVisible(value)
247+ end
248+ elseif key == 'fullscreen' then
249+ g_window.setFullscreen(value)
250+ elseif key == 'enableAudio' then
251+ if g_sounds ~= nil then
252+ g_sounds.setAudioEnabled(value)
253+ end
254+ if value then
255+ audioButton:setIcon('/images/topbuttons/audio')
256+ else
257+ audioButton:setIcon('/images/topbuttons/audio_mute')
258+ end
259+ elseif key == 'enableMusicSound' then
260+ if g_sounds ~= nil then
261+ g_sounds.getChannel(SoundChannels.Music):setEnabled(value)
262+ end
263+ elseif key == 'musicSoundVolume' then
264+ if g_sounds ~= nil then
265+ g_sounds.getChannel(SoundChannels.Music):setGain(value/100)
266+ end
267+ audioPanel:getChildById('musicSoundVolumeBG'):getChildById('musicSoundVolumeLabelBG'):setText(tr('%d', value))
268+ local valueScroll = ((value*200)/100)
269+ audioPanel:getChildById('musicSoundVolumeBG'):getChildById('musicSoundVolume'):getChildById('activeScroll'):setWidth(valueScroll)
270+ elseif key == 'botSoundVolume' then
271+ if g_sounds ~= nil then
272+ g_sounds.getChannel(SoundChannels.Bot):setGain(value/100)
273+ end
274+ audioPanel:getChildById('botSoundVolumeBG'):getChildById('botSoundVolumeLabelBG'):setText(tr('%d', value))
275+ local valueScroll = ((value*200)/100)
276+ audioPanel:getChildById('botSoundVolumeBG'):getChildById('botSoundVolume'):getChildById('activeScroll'):setWidth(valueScroll)
277+ elseif key == 'showHealthManaCircle' then
278+ if modules.game_healthinfo then
279+ if modules.game_healthinfo.healthCircle then
280+ modules.game_healthinfo.healthCircle:setVisible(value)
281+ end
282+ if modules.game_healthinfo.healthCircleFront then
283+ modules.game_healthinfo.healthCircleFront:setVisible(value)
284+ end
285+ if modules.game_healthinfo.manaCircle then
286+ modules.game_healthinfo.manaCircle:setVisible(value)
287+ end
288+ if modules.game_healthinfo.manaCircleFront then
289+ modules.game_healthinfo.manaCircleFront:setVisible(value)
290+ end
291+ end
292+ elseif key == 'backgroundFrameRate' then
293+ local text, v = value, value
294+ if value <= 0 or value >= 201 then text = 'max' v = 60 end -- Limitamos a 60 FPS máximo para proteger la GPU
295+ graphicsPanel:getChildById('backgroundFrameRateBG'):getChildById('backgroundFrameRateLabelBG'):setText(tr('%s', text))
296+ local valueScroll = ((value*200)/201)
297+ graphicsPanel:getChildById('backgroundFrameRateBG'):getChildById('backgroundFrameRate'):getChildById('activeScroll'):setWidth(valueScroll)
298+ g_app.setMaxFps(v)
299+ elseif key == 'enableLights' then
300+ gameMapPanel:setDrawLights(value and options['ambientLight'] < 100)
301+ graphicsPanel:getChildById('ambientLightBG'):getChildById('ambientLight'):setEnabled(value)
302+ elseif key == 'floorFading' then
303+ gameMapPanel:setFloorFading(value)
304+ interfacePanel:getChildById('floorFadingBG'):getChildById('floorFadingLabelBG'):setText(tr('%s ms', value))
305+ local valueScroll = ((value*200)/2000)
306+ interfacePanel:getChildById('floorFadingBG'):getChildById('floorFading'):getChildById('activeScroll'):setWidth(valueScroll)
307+ elseif key == 'crosshair' then
308+ if value == 1 then
309+ gameMapPanel:setCrosshair("")
310+ elseif value == 2 then
311+ gameMapPanel:setCrosshair("/images/crosshair/default.png")
312+ elseif value == 3 then
313+ gameMapPanel:setCrosshair("/images/crosshair/full.png")
314+ end
315+ elseif key == 'ambientLight' then
316+ graphicsPanel:getChildById('ambientLightBG'):getChildById('ambientLightLabelBG'):setText(tr('%s%%', value))
317+ gameMapPanel:setMinimumAmbientLight(value/100)
318+ gameMapPanel:setDrawLights(options['enableLights'] and value < 100)
319+ local valueScroll = ((value*200)/100)
320+ graphicsPanel:getChildById('ambientLightBG'):getChildById('ambientLight'):getChildById('activeScroll'):setWidth(valueScroll)
321+ elseif key == 'missilesOpacity' then
322+ graphicsPanel:getChildById('missilesOpacityBG'):getChildById('missilesOpacityLabelBG'):setText(tr('%s%%', value))
323+ local valueScroll = ((value*200)/100)
324+ graphicsPanel:getChildById('missilesOpacityBG'):getChildById('missilesOpacity'):getChildById('activeScroll'):setWidth(valueScroll)
325+ setMissilesOpacity(1 - value / 100)
326+ elseif key == 'effectsOpacity' then
327+ graphicsPanel:getChildById('effectsOpacityBG'):getChildById('effectsOpacityLabelBG'):setText(tr('%s%%', value))
328+ local valueScroll = ((value*200)/100)
329+ graphicsPanel:getChildById('effectsOpacityBG'):getChildById('effectsOpacity'):getChildById('activeScroll'):setWidth(valueScroll)
330+ if g_map and g_map.setEffectsOpacity then
331+ g_map.setEffectsOpacity(1 - value / 100)
332+ end
333+ elseif key == 'optimizationLevel' then
334+ g_adaptiveRenderer.setLevel(value - 2)
335+ elseif key == 'displayNames' then
336+ gameMapPanel:setDrawNames(value)
337+ elseif key == 'displayShadows' then
338+ if modules.game_creatureinfo and modules.game_creatureinfo.refreshShadows then
339+ scheduleEvent(function() modules.game_creatureinfo.refreshShadows(value) end, 10)
340+ end
341+ elseif key == 'displayHealth' then
342+ gameMapPanel:setDrawHealthBars(value)
343+ elseif key == 'displayMana' then
344+ gameMapPanel:setDrawManaBar(value)
345+ elseif key == 'displayHealthOnTop' then
346+ gameMapPanel:setDrawHealthBarsOnTop(value)
347+ elseif key == 'hidePlayerBars' then
348+ gameMapPanel:setDrawPlayerBars(value)
349+ elseif key == 'topHealtManaBar' then
350+ if modules.game_healthinfo then
351+ if modules.game_healthinfo.topHealthBar then
352+ modules.game_healthinfo.topHealthBar:setVisible(value)
353+ end
354+ if modules.game_healthinfo.topManaBar then
355+ modules.game_healthinfo.topManaBar:setVisible(value)
356+ end
357+ end
358+ elseif key == 'displayText' then
359+ gameMapPanel:setDrawTexts(value)
360+ elseif key == 'dontStretchShrink' then
361+ addEvent(function()
362+ modules.game_interface.updateStretchShrink()
363+ end)
364+ elseif key == 'wsadWalking' then
365+ if modules.game_console then
366+ modules.game_console.toggleChatByOptions(value)
367+ end
368+ end
369+
370+ -- change value for keybind updates
371+ for _,panel in pairs(optionsTabBar:getTabsPanel()) do
372+ local widget = panel:recursiveGetChildById(key)
373+ if widget then
374+ if widget:getStyle().__class == 'UICheckBox' then
375+ widget:setChecked(value)
376+ elseif widget:getStyle().__class == 'UIScrollBar' then
377+ widget:setValue(value)
378+ elseif widget:getStyle().__class == 'UIComboBox' then
379+ if type(value) == "string" then
380+ widget:setCurrentOption(value, true)
381+ break
382+ end
383+ if value == nil or value < 1 then
384+ value = 1
385+ end
386+ if widget.currentIndex ~= value then
387+ widget:setCurrentIndex(value, true)
388+ end
389+ end
390+ break
391+ end
392+ end
393+
394+ g_settings.set(key, value)
395+ options[key] = value
396+
397+ if key == 'classicView' or key == 'rightPanels' or key == 'leftPanels' or key == 'cacheMap' then
398+ modules.game_interface.refreshViewMode()
399+ elseif key == 'actionBar' then
400+ if modules.game_menu and modules.game_menu.setHudActionBarEnabled then
401+ modules.game_menu.setHudActionBarEnabled(value)
402+ end
403+ if modules.game_spellbar and modules.game_spellbar.setBarEnabled then
404+ modules.game_spellbar.setBarEnabled(value)
405+ end
406+ end
407+end
408+
409+function getOption(key)
410+ return options[key]
411+end
412+
413+function addTab(name, panel, icon)
414+ optionsTabBar:addTab(name, panel, icon)
415+end
416+
417+function addButton(name, func, icon)
418+ optionsTabBar:addButton(name, func, icon)
419+end
420+
421+-- hide/show
422+
423+function online()
424+ setLightOptionsVisibility(not g_game.getFeature(GameForceLight))
425+ audioButton:show()
426+end
427+
428+function offline()
429+ setLightOptionsVisibility(true)
430+ audioButton:hide()
431+end
432+
433+-- classic view
434+
435+-- graphics
436+function setLightOptionsVisibility(value)
437+ graphicsPanel:getChildById('enableLights'):setEnabled(value)
438+ graphicsPanel:getChildById('ambientLightBG'):getChildById('ambientLightLabelBG'):setEnabled(value)
439+ graphicsPanel:getChildById('ambientLightBG'):getChildById('ambientLight'):setEnabled(value)
440+ interfacePanel:getChildById('floorFadingBG'):getChildById('floorFading'):setEnabled(value)
441+ interfacePanel:getChildById('floorFadingLabel'):setEnabled(value)
442+ interfacePanel:getChildById('floorFadingLabel2'):setEnabled(value)
443+end
444+
445+-- Definición de la función setMissilesOpacity
446+function setMissilesOpacity(opacity)
447+ -- Lógica para establecer la opacidad de los misiles
448+ print("Opacidad de misiles establecida a " .. opacity)
449+end
A RD_Client/modules/client_options/options.otmod +9-0 View file
@@ -0,0 +1,9 @@
1+Module
2+ name: client_options
3+ description: Create the options window
4+ author: edubart, BeniS
5+ website: https://github.com/edubart/otclient
6+ sandboxed: true
7+ scripts: [ options ]
8+ @onLoad: init()
9+ @onUnload: terminate()
A RD_Client/modules/client_options/options.otui +271-0 View file
@@ -0,0 +1,271 @@
1+TabBarVerticalButton < UIButton
2+ size: 290 40
3+ color: #aaaaaa
4+ anchors.left: parent.left
5+ anchors.right: parent.right
6+ image-source: settings/bgitemselect
7+ image-border: 5
8+ image-offset-y: 5
9+ text-align: Top-Left
10+ text-offset: 20 17
11+ font: poppins-14-px
12+ icon-align: right
13+ icon-offset-x: -15
14+ icon-offset-y: 5
15+ icon-clip: 0 0 25 25
16+ $first:
17+ anchors.top: parent.top
18+ $!first:
19+ anchors.top: prev.bottom
20+ margin-top: 11
21+ $hover !checked:
22+ icon-clip: 0 0 25 25
23+ $disabled:
24+ icon-clip: 0 0 25 25
25+ image-source: settings/bgitemselect
26+ $checked:
27+ icon-clip: 0 25 25 25
28+ image-source: settings/bgitemselectactive
29+ color: #ffffff
30+ $on !checked:
31+ color: #A6AAB2
32+
33+OptionCheckBox < UICheckBox
34+ size: 34 22
35+ text-align: center
36+ text-offset: 105 -2
37+ !text: tr('Off')
38+ font: poppins-14-px
39+ color: #dfdfdf
40+ image-color: #dfdfdfff
41+ image-rect: 0 0 34 22
42+ image-source: /modules/client_options/settings/checkbox
43+ image-offset: 275 0
44+ change-cursor-image: true
45+ cursor: pointer
46+ @onCheckChange: modules.client_options.setOption(self:getId(), self:isChecked())
47+
48+ $hover !disabled:
49+ color: #ffffff
50+
51+ $!checked:
52+ image-source: /modules/client_options/settings/checkbox
53+ !text: tr('Off')
54+ color: #ffffff
55+
56+ $hover !checked:
57+ image-source: /modules/client_options/settings/checkbox
58+
59+ $checked:
60+ image-source: /modules/client_options/settings/checkboxactive
61+ !text: tr('On')
62+ color: #77f558
63+
64+ $hover checked:
65+ image-source: /modules/client_options/settings/checkboxactive
66+
67+ $disabled:
68+ image-color: #dfdfdf88
69+ color: #dfdfdf88
70+ opacity: 0.8
71+ change-cursor-image: false
72+
73+ScrollBarSliderBG < UIButton
74+ id: sliderButton
75+ anchors.centerIn: parent
76+ size: 22 22
77+ image-source: settings/cursorslider
78+
79+OptionScrollbarBG < UIScrollBar
80+ orientation: horizontal
81+ height: 10
82+ width: 39
83+ image-source: settings/bgslider
84+ image-size: 210 10
85+ image-offset-x: 20
86+
87+ $disabled:
88+ color: #bbbbbb88
89+
90+ UIButton
91+ id: decrementButton
92+ anchors.top: parent.top
93+ anchors.left: parent.left
94+ image-source: /images/ui/scrollbar
95+ image-clip: 0 39 13 13
96+ image-color: #ffffffff
97+ size: 13 13
98+ visible: false
99+ enable: false
100+ $hover:
101+ image-clip: 13 39 13 13
102+ $pressed:
103+ image-clip: 26 39 13 13
104+ $disabled:
105+ image-color: #ffffff66
106+
107+ UIButton
108+ id: incrementButton
109+ anchors.bottom: parent.bottom
110+ anchors.right: parent.right
111+ size: 13 13
112+ visible: false
113+ enable: false
114+ image-source: /images/ui/scrollbar
115+ image-clip: 0 52 13 13
116+ image-color: #ffffffff
117+ $hover:
118+ image-clip: 13 52 13 13
119+ $pressed:
120+ image-clip: 26 52 13 13
121+ $disabled:
122+ image-color: #ffffff66
123+
124+ UIWidget
125+ id: activeScroll
126+ anchors.left: parent.left
127+ margin-left: 10
128+ height: 10
129+ image-source: settings/bgslideractive
130+ phantom: true
131+
132+ ScrollBarSliderBG
133+
134+ ScrollBarValueLabel
135+
136+OptionScrollbar < OptionScrollbarBG
137+ step: 1
138+ @onValueChange: modules.client_options.setOption(self:getId(), self:getValue())
139+
140+OptionComboBox < ComboBox
141+ font: verdana-11px-antialised
142+ color: #dfdfdf
143+ size: 200 40
144+ text-offset: 3 0
145+ text-align: left
146+ image-source: settings/combobox
147+ image-border: 3
148+ image-border-right: 19
149+ image-clip: 0 0 200 40
150+
151+ $hover !disabled:
152+ image-clip: 0 41 200 40
153+
154+ $on:
155+ image-clip: 0 82 200 40
156+
157+ $disabled:
158+ color: #dfdfdf88
159+ opacity: 0.8
160+
161+OptionPanel < Panel
162+ layout:
163+ type: verticalBox
164+
165+TabBarVertical < UITabBar
166+ width: 290
167+
168+ ScrollableFlatPanel
169+ id: buttonsPanel
170+ anchors.top: parent.top
171+ anchors.left: parent.left
172+ anchors.right: scrollBar.left
173+ anchors.bottom: parent.bottom
174+ vertical-scrollbar: scrollBar
175+ margin-right: 1
176+ image-source:
177+
178+ VerticalScrollBar
179+ id: scrollBar
180+ anchors.top: parent.top
181+ anchors.bottom: parent.bottom
182+ anchors.right: parent.right
183+ step: 16
184+ pixels-scroll: true
185+ $!on:
186+ width: 0
187+
188+UIWindow
189+ id: optionsWindow
190+ anchors.horizontalCenter: parent.horizontalCenter
191+ anchors.verticalCenter: parent.verticalCenter
192+ !text: tr('Options')
193+ text-align: Top-Left
194+ text-offset: 42 15
195+ font: poppins-14-px
196+ size: 910 704
197+ image-source: settings/background
198+ image-border-top: 6
199+ image-border-bottom: 6
200+ $mobile:
201+ size: 490 360
202+
203+ UIWidget
204+ id: optionsIcon
205+ anchors.left: parent.left
206+ anchors.top: parent.top
207+ margin: 10 0 0 15
208+ image-source: settings/options
209+
210+ Label
211+ id: optionsKey
212+ anchors.left: parent.left
213+ anchors.top: parent.top
214+ margin: 15 0 0 91
215+ color: #77f558
216+ font: poppins-14-px
217+ text: (O)
218+
219+ UIWidget
220+ id: optionsEdgeHorizontal
221+ anchors.left: parent.left
222+ anchors.right: parent.right
223+ anchors.top: parent.top
224+ height: 2
225+ margin: 46 0 0 0
226+ image-source: settings/edge_top
227+
228+ UIWidget
229+ id: optionsEdgeVertical
230+ anchors.horizontalCenter: parent.horizontalCenter
231+ anchors.top: optionsEdgeHorizontal.bottom
232+ anchors.bottom: parent.bottom
233+ width: 2
234+ margin: 0 123 0 0
235+ image-source: settings/edgevertical
236+
237+ @onEnter: modules.client_options.hide()
238+ @onEscape: modules.client_options.hide()
239+
240+ TabBarVertical
241+ id: optionsTabBar
242+ anchors.top: parent.top
243+ anchors.left: parent.left
244+ anchors.bottom: parent.bottom
245+ margin: 62 0 0 22
246+
247+ Panel
248+ id: optionsTabContent
249+ anchors.top: optionsTabBar.top
250+ anchors.left: optionsTabBar.right
251+ anchors.right: parent.right
252+ anchors.bottom: optionsTabBar.bottom
253+ margin-left: 43
254+ margin-top: 10
255+
256+ UIButton
257+ anchors.right: parent.right
258+ anchors.top: parent.top
259+ size: 25 25
260+ margin: 12 20 0 0
261+ image-source: settings/close_button
262+
263+ $hover !checked:
264+ image-source: settings/close_button_active
265+
266+ $pressed:
267+ image-source: settings/close_button_active
268+
269+ @onClick: |
270+ g_settings.save()
271+ modules.client_options.hide()
A RD_Client/modules/client_options/settings/attached_background.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/background.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/backgroundPanel.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/bgitemselect.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/bgitemselectactive.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/bgslider.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/bgslideractive.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/channel_change_icon.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/checkbox.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/checkboxactive.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/close_button.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/close_button_active.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/combobox.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/comboboxactive.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/cursorslider.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/edgevertical.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/edge_bottom.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/edge_top.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/hotkeys/category_column_bg.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/hotkeys/category_item_bg.png +0-0 View file
Binary file not shown.
A RD_Client/modules/client_options/settings/hotkeys/category_item_key_bg.png +0-0 View file
Binary file not shown.
Top