From 882b7ec026645343dcfe05e3882344ba2974fb2f Mon Sep 17 00:00:00 2001 From: Andre Ricca da Costa Date: Fri, 3 Feb 2012 04:20:58 -0200 Subject: [PATCH] double click funcionalities and some fixes --- modules/client_entergame/characterlist.lua | 3 +++ modules/game_console/console.lua | 4 ++++ modules/game_inventory/inventory.lua | 4 +++- modules/game_skills/skills.lua | 2 ++ modules/game_viplist/viplist.lua | 3 +++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/client_entergame/characterlist.lua b/modules/client_entergame/characterlist.lua index 71e7ee8a..2a9691fb 100644 --- a/modules/client_entergame/characterlist.lua +++ b/modules/client_entergame/characterlist.lua @@ -73,9 +73,12 @@ function CharacterList.create(characters, premDays) local label = createWidget('CharacterListLabel', characterList) label:setText(characterName .. ' (' .. worldName .. ')') + label:setPhantom(false) label.characterName = characterName label.worldHost = worldHost label.worldPort = worldIp + + connect(label, { onMouseDoubleClick = function () CharacterList.doLogin() return true end } ) if i == 1 or Settings.get('lastUsedCharacter') == characterName then focusLabel = label diff --git a/modules/game_console/console.lua b/modules/game_console/console.lua index 06fabb85..c1ea6c6b 100644 --- a/modules/game_console/console.lua +++ b/modules/game_console/console.lua @@ -127,6 +127,10 @@ function Console.addChannel(name, id) end function Console.addPrivateText(text, speaktype, name) + if speaktype.speakType == SpeakPrivateNpcToPlayer then + name = 'NPCs' + end + local privateTab = Console.getTab(name) if privateTab == nil then if Options.showPrivateMessagesInConsole then diff --git a/modules/game_inventory/inventory.lua b/modules/game_inventory/inventory.lua index 08129f14..b6a0a1eb 100644 --- a/modules/game_inventory/inventory.lua +++ b/modules/game_inventory/inventory.lua @@ -7,11 +7,13 @@ local inventoryButton -- public functions function Inventory.create() inventoryWindow = displayUI('inventory.otui', { parent = Game.gameRightPanel }) - inventoryButton = TopMenu.addGameButton('inventoryButton', 'Skills (Ctrl+I)', 'inventory.png', Inventory.toggle) + inventoryButton = TopMenu.addGameButton('inventoryButton', 'Inventory (Ctrl+I)', 'inventory.png', Inventory.toggle) inventoryButton:setOn(true) + Hotkeys.bindKeyDown('Ctrl+I', Inventory.toggle) end function Inventory.destroy() + Hotkeys.unbindKeyDown('Ctrl+I') inventoryWindow:destroy() inventoryWindow = nil inventoryButton:destroy() diff --git a/modules/game_skills/skills.lua b/modules/game_skills/skills.lua index 46350e54..0ddab36e 100644 --- a/modules/game_skills/skills.lua +++ b/modules/game_skills/skills.lua @@ -45,9 +45,11 @@ function Skills.create() skillsWindow = displayUI('skills.otui', { parent = Game.gameRightPanel }) skillsWindow:hide() skillsButton = TopMenu.addGameButton('skillsButton', 'Skills (Ctrl+S)', '/core_styles/icons/skills.png', Skills.toggle) + Hotkeys.bindKeyDown('Ctrl+S', Skills.toggle) end function Skills.destroy() + Hotkeys.unbindKeyDown('Ctrl+S') skillsButton:destroy() skillsButton = nil skillsWindow:destroy() diff --git a/modules/game_viplist/viplist.lua b/modules/game_viplist/viplist.lua index ac496c3c..20cf000d 100644 --- a/modules/game_viplist/viplist.lua +++ b/modules/game_viplist/viplist.lua @@ -55,6 +55,9 @@ function VipList.onAddVip(id, name, online) label.vipOnline = online + label:setPhantom(false) + connect(label, { onMouseDoubleClick = function () Game.openPrivateChannel(label:getText()) return true end } ) + local nameLower = name:lower() local childrenCount = vipList:getChildCount()