fix motd box issues
This commit is contained in:
parent
e9d69b7980
commit
841769cc7d
|
@ -75,7 +75,7 @@ function CharacterList.create(characters, premDays)
|
||||||
label.worldHost = worldHost
|
label.worldHost = worldHost
|
||||||
label.worldPort = worldIp
|
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)
|
characterList:focusChild(label, ActiveFocusReason)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,6 +4,7 @@ EnterGame = { }
|
||||||
local password
|
local password
|
||||||
local loadBox
|
local loadBox
|
||||||
local enterGameWindow
|
local enterGameWindow
|
||||||
|
local hideCharlist = false
|
||||||
|
|
||||||
-- private functions
|
-- private functions
|
||||||
local function onError(protocol, error)
|
local function onError(protocol, error)
|
||||||
|
@ -14,16 +15,24 @@ end
|
||||||
|
|
||||||
local function onMotd(protocol, motd)
|
local function onMotd(protocol, motd)
|
||||||
loadBox:destroy()
|
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))
|
local motdMessage = string.sub(motd, string.find(motd, "\n") + 1, string.len(motd))
|
||||||
if motdNumber ~= Configs.get("motd") then
|
if motdNumber ~= tonumber(Configs.get("motd")) then
|
||||||
displayInfoBox("Message of the day", motdMessage)
|
hideCharlist = true
|
||||||
|
local motdBox = displayInfoBox("Message of the day", motdMessage)
|
||||||
|
motdBox.onOk = function()
|
||||||
|
CharacterList.show()
|
||||||
|
end
|
||||||
Configs.set("motd", motdNumber)
|
Configs.set("motd", motdNumber)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onCharacterList(protocol, characters, premDays)
|
local function onCharacterList(protocol, characters, premDays)
|
||||||
CharacterList.create(characters, premDays)
|
CharacterList.create(characters, premDays)
|
||||||
|
if hideCharlist then
|
||||||
|
CharacterList.hide()
|
||||||
|
hideCharlist = false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- public functions
|
-- public functions
|
||||||
|
|
|
@ -34,7 +34,6 @@ MainWindow
|
||||||
Account Status:
|
Account Status:
|
||||||
Free Account
|
Free Account
|
||||||
font: helvetica-11px-bold
|
font: helvetica-11px-bold
|
||||||
color: #33cc66
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: next.top
|
anchors.bottom: next.top
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <execinfo.h>
|
|
||||||
|
|
||||||
struct X11PlatformPrivate {
|
struct X11PlatformPrivate {
|
||||||
Display *display;
|
Display *display;
|
||||||
|
@ -72,11 +71,12 @@ Platform g_platform;
|
||||||
|
|
||||||
#ifdef HANDLE_EXCEPTIONS
|
#ifdef HANDLE_EXCEPTIONS
|
||||||
|
|
||||||
|
#include <csignal>
|
||||||
|
#include <execinfo.h>
|
||||||
|
|
||||||
#define MAX_BACKTRACE_DEPTH 128
|
#define MAX_BACKTRACE_DEPTH 128
|
||||||
#define DEMANGLE_BACKTRACE_SYMBOLS
|
#define DEMANGLE_BACKTRACE_SYMBOLS
|
||||||
|
|
||||||
#include <csignal>
|
|
||||||
|
|
||||||
void crashHandler(int signum, siginfo_t* info, void* secret)
|
void crashHandler(int signum, siginfo_t* info, void* secret)
|
||||||
{
|
{
|
||||||
logError("Application crashed");
|
logError("Application crashed");
|
||||||
|
|
Loading…
Reference in New Issue