mirror of
https://github.com/edubart/otclient.git
synced 2025-12-26 17:57:11 +01:00
fix motd box issues
This commit is contained in:
@@ -4,6 +4,7 @@ EnterGame = { }
|
||||
local password
|
||||
local loadBox
|
||||
local enterGameWindow
|
||||
local hideCharlist = false
|
||||
|
||||
-- private functions
|
||||
local function onError(protocol, error)
|
||||
@@ -14,16 +15,24 @@ end
|
||||
|
||||
local function onMotd(protocol, motd)
|
||||
loadBox:destroy()
|
||||
local motdNumber = string.sub(motd, 0, string.find(motd, "\n"))
|
||||
local motdNumber = tonumber(string.sub(motd, 0, string.find(motd, "\n")))
|
||||
local motdMessage = string.sub(motd, string.find(motd, "\n") + 1, string.len(motd))
|
||||
if motdNumber ~= Configs.get("motd") then
|
||||
displayInfoBox("Message of the day", motdMessage)
|
||||
if motdNumber ~= tonumber(Configs.get("motd")) then
|
||||
hideCharlist = true
|
||||
local motdBox = displayInfoBox("Message of the day", motdMessage)
|
||||
motdBox.onOk = function()
|
||||
CharacterList.show()
|
||||
end
|
||||
Configs.set("motd", motdNumber)
|
||||
end
|
||||
end
|
||||
|
||||
local function onCharacterList(protocol, characters, premDays)
|
||||
CharacterList.create(characters, premDays)
|
||||
if hideCharlist then
|
||||
CharacterList.hide()
|
||||
hideCharlist = false
|
||||
end
|
||||
end
|
||||
|
||||
-- public functions
|
||||
|
||||
Reference in New Issue
Block a user