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)
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
end

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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()