protocol 860 fixes

This commit is contained in:
Eduardo Bart
2012-01-08 18:11:50 -02:00
parent e46f5fcb69
commit 23ebcd9048
7 changed files with 88 additions and 60 deletions

View File

@@ -1,22 +1,27 @@
Chat = {}
-- private variables
--[[
local SpeakTypes = {
say = { color = },
whisper = { color = },
yell,
monsterSay,
npcToPlayer,
cgannelYellow,
channelWhite,
channelRed,
channelOrange,
private,
playerToNpc,
broadcast,
privateRed
}
]]--
local chatPanel
local chatBuffer
-- private functions
local function onCreatureSpeak(name, level, msgtype, message)
style = 'ChatLabel'
if name and level > 0 then
message = name .. ' [' .. level .. ']: ' .. message
style = 'YellowChatLabel'
end
local label = createWidget(style)
label:setText(message)
chatBuffer:addChild(label)
end
-- public functions
function Chat.create()
chatPanel = displayUI('chat.otui', { parent = Game.gameBottomPanel } )
@@ -29,6 +34,17 @@ function Chat.destroy()
end
-- hooked events
local function onCreatureSpeak(name, level, msgtype, message)
style = 'ChatLabel'
if name and level > 0 then
message = name .. ' [' .. level .. ']: ' .. message
style = 'YellowChatLabel'
end
local label = createWidget(style)
label:setText(message)
chatBuffer:addChild(label)
end
connect(Game, { onLogin = Chat.create,
onLogout = Chat.destroy,