mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 20:14:54 +02:00
Fixes! Closes #235 and more:
* Hotkeys now save by server & player rather than just player * Added double clicking to module dialog options * Fixed a bug in the modal dialog for > pv970 (protocol changed) * Fixed a login bug for pv970. WARNING: Will remove all your current hotkeys.
This commit is contained in:
@@ -91,10 +91,14 @@ function load()
|
||||
local hotkeySettings = g_settings.getNode('HotkeysManager')
|
||||
local hasCombos = false
|
||||
if not table.empty(hotkeySettings) then
|
||||
local playerHotkeySettings = hotkeySettings[g_game.getLocalPlayer():getName()]
|
||||
local serverHotkeys = hotkeySettings[G.host]
|
||||
|
||||
if not table.empty(playerHotkeySettings) then
|
||||
for k, setting in pairs(playerHotkeySettings) do
|
||||
local hotkeys
|
||||
if not table.empty(serverHotkeys) then
|
||||
hotkeys = serverHotkeys[g_game.getLocalPlayer():getName()]
|
||||
end
|
||||
if not table.empty(hotkeys) then
|
||||
for k, setting in pairs(hotkeys) do
|
||||
addKeyCombo(nil, setting.keyCombo, setting)
|
||||
hasCombos = true
|
||||
end
|
||||
@@ -109,11 +113,15 @@ end
|
||||
|
||||
function save()
|
||||
local char = g_game.getLocalPlayer():getName()
|
||||
local server = G.host
|
||||
|
||||
local hotkeySettings = g_settings.getNode('HotkeysManager') or {}
|
||||
hotkeySettings[char] = {}
|
||||
hotkeySettings[server] = {}
|
||||
hotkeySettings[server][char] = {}
|
||||
|
||||
for i=1, currentHotkeysList:getChildCount() do
|
||||
local child = currentHotkeysList:getChildByIndex(i)
|
||||
table.insert(hotkeySettings[char], {
|
||||
table.insert(hotkeySettings[server][char], {
|
||||
keyCombo = child.keyCombo,
|
||||
autoSend = child.autoSend,
|
||||
itemId = child.itemId,
|
||||
|
Reference in New Issue
Block a user