mirror of
https://github.com/edubart/otclient.git
synced 2025-11-30 23:26:51 +01:00
implement status messages
This commit is contained in:
15
modules/game/textmessage.lua
Normal file
15
modules/game/textmessage.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
local textMessageWidget
|
||||
|
||||
function Game.onTextMessage(message)
|
||||
if textMessageWidget then
|
||||
textMessageWidget:destroy()
|
||||
end
|
||||
|
||||
local newTextMessageWidget = loadUI('/game/ui/textmessage.otui', Game.gameMapUi)
|
||||
time = #message * 75
|
||||
newTextMessageWidget:setText(message)
|
||||
scheduleEvent(function()
|
||||
newTextMessageWidget:destroy()
|
||||
end, time)
|
||||
textMessageWidget = newTextMessageWidget
|
||||
end
|
||||
Reference in New Issue
Block a user