Keep g_settings as a 'static' variable rather than a direct object.

This commit is contained in:
BenDol
2014-04-01 16:51:38 +13:00
parent b295053662
commit 79ee0e34ea
18 changed files with 174 additions and 99 deletions

View File

@@ -145,7 +145,7 @@ end
function load(forceDefaults)
hotkeysManagerLoaded = false
local hotkeySettings = g_settings:getNode('game_hotkeys')
local hotkeySettings = g_settings.getNode('game_hotkeys')
local hotkeys = {}
if not table.empty(hotkeySettings) then hotkeys = hotkeySettings end
@@ -192,7 +192,7 @@ function reload()
end
function save()
local hotkeySettings = g_settings:getNode('game_hotkeys') or {}
local hotkeySettings = g_settings.getNode('game_hotkeys') or {}
local hotkeys = hotkeySettings
if perServer then
@@ -223,8 +223,8 @@ function save()
end
hotkeyList = hotkeys
g_settings:setNode('game_hotkeys', hotkeySettings)
g_settings:save()
g_settings.setNode('game_hotkeys', hotkeySettings)
g_settings.save()
end
function loadDefautComboKeys()