double click funcionalities and some fixes

This commit is contained in:
Andre Ricca da Costa 2012-02-03 04:20:58 -02:00
parent 1340699b01
commit 882b7ec026
5 changed files with 15 additions and 1 deletions

View File

@ -73,10 +73,13 @@ function CharacterList.create(characters, premDays)
local label = createWidget('CharacterListLabel', characterList) local label = createWidget('CharacterListLabel', characterList)
label:setText(characterName .. ' (' .. worldName .. ')') label:setText(characterName .. ' (' .. worldName .. ')')
label:setPhantom(false)
label.characterName = characterName label.characterName = characterName
label.worldHost = worldHost label.worldHost = worldHost
label.worldPort = worldIp label.worldPort = worldIp
connect(label, { onMouseDoubleClick = function () CharacterList.doLogin() return true end } )
if i == 1 or Settings.get('lastUsedCharacter') == characterName then if i == 1 or Settings.get('lastUsedCharacter') == characterName then
focusLabel = label focusLabel = label
end end

View File

@ -127,6 +127,10 @@ function Console.addChannel(name, id)
end end
function Console.addPrivateText(text, speaktype, name) function Console.addPrivateText(text, speaktype, name)
if speaktype.speakType == SpeakPrivateNpcToPlayer then
name = 'NPCs'
end
local privateTab = Console.getTab(name) local privateTab = Console.getTab(name)
if privateTab == nil then if privateTab == nil then
if Options.showPrivateMessagesInConsole then if Options.showPrivateMessagesInConsole then

View File

@ -7,11 +7,13 @@ local inventoryButton
-- public functions -- public functions
function Inventory.create() function Inventory.create()
inventoryWindow = displayUI('inventory.otui', { parent = Game.gameRightPanel }) 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) inventoryButton:setOn(true)
Hotkeys.bindKeyDown('Ctrl+I', Inventory.toggle)
end end
function Inventory.destroy() function Inventory.destroy()
Hotkeys.unbindKeyDown('Ctrl+I')
inventoryWindow:destroy() inventoryWindow:destroy()
inventoryWindow = nil inventoryWindow = nil
inventoryButton:destroy() inventoryButton:destroy()

View File

@ -45,9 +45,11 @@ function Skills.create()
skillsWindow = displayUI('skills.otui', { parent = Game.gameRightPanel }) skillsWindow = displayUI('skills.otui', { parent = Game.gameRightPanel })
skillsWindow:hide() skillsWindow:hide()
skillsButton = TopMenu.addGameButton('skillsButton', 'Skills (Ctrl+S)', '/core_styles/icons/skills.png', Skills.toggle) skillsButton = TopMenu.addGameButton('skillsButton', 'Skills (Ctrl+S)', '/core_styles/icons/skills.png', Skills.toggle)
Hotkeys.bindKeyDown('Ctrl+S', Skills.toggle)
end end
function Skills.destroy() function Skills.destroy()
Hotkeys.unbindKeyDown('Ctrl+S')
skillsButton:destroy() skillsButton:destroy()
skillsButton = nil skillsButton = nil
skillsWindow:destroy() skillsWindow:destroy()

View File

@ -55,6 +55,9 @@ function VipList.onAddVip(id, name, online)
label.vipOnline = online label.vipOnline = online
label:setPhantom(false)
connect(label, { onMouseDoubleClick = function () Game.openPrivateChannel(label:getText()) return true end } )
local nameLower = name:lower() local nameLower = name:lower()
local childrenCount = vipList:getChildCount() local childrenCount = vipList:getChildCount()