tibia-client/modules/client_options/options.lua

34 lines
874 B
Lua

Options = {}
function Options.load()
local booleanOptions = { vsync = true,
showfps = true,
fullscreen = false }
for k,v in pairs(booleanOptions) do
Settings.setDefault(k, v)
Options.changeOption(k, Settings.getBoolean(k))
end
end
function Options.show()
displayUI('options.otui', { locked = true })
end
function Options.openWebpage()
displayErrorBox("Error", "Not implemented yet")
end
-- private functions
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)
elseif key == 'fullscreen' then
addEvent(function() g_window.setFullscreen(status) end)
end
Settings.set(key, status)
Options[key] = status
end