Changes/Fixes to Channels/Hotkeys/Inventory Slots.

- Fixed issue with opening multiple instances of the same message channels (will focus the channel if already exists).
- Added tooltip to the 'Clear message window' button.
- Added keyboard Up/Down press for hotkeys.
- Added inventory slots/images.
- Started on adding soul
This commit is contained in:
BeniS
2012-07-11 00:15:31 +12:00
parent 77648a2ffa
commit 82233dc655
17 changed files with 140 additions and 54 deletions

View File

@@ -35,10 +35,13 @@ local hotkeyColors = {
-- public functions
function HotkeysManager.init()
hotkeysWindow = g_ui.displayUI('hotkeys_manager.otui')
local hotkeyListPanel = hotkeysWindow:getChildById('currentHotkeys')
hotkeysWindow:setVisible(false)
hotkeysButton = TopMenu.addGameButton('hotkeysButton', tr('Hotkeys') .. ' (Ctrl+K)', '/game_hotkeys/icon.png', HotkeysManager.toggle)
g_keyboard.bindKeyDown('Ctrl+K', HotkeysManager.toggle)
g_keyboard.bindKeyPress('Down', function() hotkeyListPanel:focusNextChild(KeyboardFocusReason) end, hotkeysWindow)
g_keyboard.bindKeyPress('Up', function() hotkeyListPanel:focusPreviousChild(KeyboardFocusReason) end, hotkeysWindow)
currentHotkeysList = hotkeysWindow:getChildById('currentHotkeys')
currentItemPreview = hotkeysWindow:getChildById('itemPreview')
@@ -102,6 +105,9 @@ function HotkeysManager.terminate()
hotkeysManagerLoaded = false
g_keyboard.unbindKeyDown('Ctrl+K')
g_keyboard.unbindKeyPress('Down', function() channelListPanel:focusNextChild(KeyboardFocusReason) end, channelsWindow)
g_keyboard.unbindKeyPress('Up', function() channelListPanel:focusPreviousChild(KeyboardFocusReason) end, channelsWindow)
HotkeysManager.save()
currentHotkeysList = nil