From 841769cc7d3bf4e2abcb2aa0a837c43fc40b8f55 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Mon, 31 Oct 2011 15:56:00 -0200 Subject: [PATCH] fix motd box issues --- modules/mainmenu/characterlist.lua | 2 +- modules/mainmenu/entergame.lua | 15 ++++++++++++--- modules/mainmenu/ui/charlist.otui | 1 - src/framework/platform/x11platform.cpp | 6 +++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/mainmenu/characterlist.lua b/modules/mainmenu/characterlist.lua index 0e9c5e98..096729b7 100644 --- a/modules/mainmenu/characterlist.lua +++ b/modules/mainmenu/characterlist.lua @@ -75,7 +75,7 @@ function CharacterList.create(characters, premDays) label.worldHost = worldHost label.worldPort = worldIp - if i == 0 or Configs.get('lastUsedCharacter') == characterName then + if i == 1 or Configs.get('lastUsedCharacter') == characterName then characterList:focusChild(label, ActiveFocusReason) end end diff --git a/modules/mainmenu/entergame.lua b/modules/mainmenu/entergame.lua index 15e5d454..e9a49aac 100644 --- a/modules/mainmenu/entergame.lua +++ b/modules/mainmenu/entergame.lua @@ -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 diff --git a/modules/mainmenu/ui/charlist.otui b/modules/mainmenu/ui/charlist.otui index 789c3673..cf0a2102 100644 --- a/modules/mainmenu/ui/charlist.otui +++ b/modules/mainmenu/ui/charlist.otui @@ -34,7 +34,6 @@ MainWindow Account Status: Free Account font: helvetica-11px-bold - color: #33cc66 anchors.left: parent.left anchors.right: parent.right anchors.bottom: next.top diff --git a/src/framework/platform/x11platform.cpp b/src/framework/platform/x11platform.cpp index de87d4cd..2aa31325 100644 --- a/src/framework/platform/x11platform.cpp +++ b/src/framework/platform/x11platform.cpp @@ -33,7 +33,6 @@ #include #include -#include struct X11PlatformPrivate { Display *display; @@ -72,11 +71,12 @@ Platform g_platform; #ifdef HANDLE_EXCEPTIONS +#include +#include + #define MAX_BACKTRACE_DEPTH 128 #define DEMANGLE_BACKTRACE_SYMBOLS -#include - void crashHandler(int signum, siginfo_t* info, void* secret) { logError("Application crashed");