mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
fix possible lua errors
This commit is contained in:
@@ -24,9 +24,14 @@ function Options.changeOption(key, status)
|
||||
if key == 'vsync' then
|
||||
g_window.setVerticalSync(status)
|
||||
elseif key == 'showfps' then
|
||||
addEvent(function() rootWidget:recursiveGetChildById('frameCounter'):setVisible(status) end)
|
||||
addEvent(function()
|
||||
local frameCounter = rootWidget:recursiveGetChildById('frameCounter')
|
||||
if frameCounter then frameCounter:setVisible(status) end
|
||||
end)
|
||||
elseif key == 'fullscreen' then
|
||||
addEvent(function() g_window.setFullscreen(status) end)
|
||||
addEvent(function()
|
||||
g_window.setFullscreen(status)
|
||||
end)
|
||||
end
|
||||
Settings.set(key, status)
|
||||
Options[key] = status
|
||||
|
Reference in New Issue
Block a user