diff --git a/game/engines/default/engine/PlayerProfile.lua b/game/engines/default/engine/PlayerProfile.lua index 05b2d057e70f93ad88ded25a36d73fbba0021f6a..19e3ae2c7f3b9eedf3d18c3d9291077e1db2d0ad 100644 --- a/game/engines/default/engine/PlayerProfile.lua +++ b/game/engines/default/engine/PlayerProfile.lua @@ -327,10 +327,11 @@ end -- Events from the profile thread ----------------------------------------------------------------------- -function _M:waitEvent(name, cb) +function _M:waitEvent(name, cb, wait_max) -- Wait anwser, this blocks thegame but cant really be avoided :/ local stop = false local first = true + local tries = 0 while not stop do if not first then core.display.forceRedraw() @@ -349,6 +350,8 @@ function _M:waitEvent(name, cb) evt = core.profile.popEvent() end first = false + tries = tries + 1 + if wait_max and tries * 50 > wait_max then break end end end diff --git a/game/engines/default/engine/UserChat.lua b/game/engines/default/engine/UserChat.lua index c903371426edbfa778cfb89104752051df2e1bb4..f019a51b9d1e9f792da1b1d94c8bbbfe703e2c59 100644 --- a/game/engines/default/engine/UserChat.lua +++ b/game/engines/default/engine/UserChat.lua @@ -101,11 +101,9 @@ function _M:event(e) self.channels[e.channel].users[user.login] = { login=user.login, name=user.name, - cur_char=user.cur_char and user.cur_char.title or "unknown", - module=user.cur_char and user.cur_char.module or "unknown", - valid=user.cur_char and user.cur_char.valid and "validate" or "not validated", - char_link=user.cur_char and user.char_link, - profile=user.cur_char and user.profile, + current_char=user.current_char and user.current_char.title or "unknown", + module=user.current_char and user.current_char.module or "unknown", + valid=user.current_char and user.current_char.valid and "validate" or "not validated", } end self.channels_changed = true @@ -170,7 +168,7 @@ function _M:showUserInfo(login) core.profile.pushOrder(string.format("o='ChatUserInfo' login=%q", login)) local data = nil - profile:waitEvent("UserInfo", function(e) data=e.data end) + profile:waitEvent("UserInfo", function(e) data=e.data end, 5000) game:unregisterDialog(popup) if not data then diff --git a/game/engines/default/engine/dialogs/UserInfo.lua b/game/engines/default/engine/dialogs/UserInfo.lua index 43610f3fd07882838145850678d2b12716099574..954bdc1379e90a532c5f49cf934920f37cf8ecc1 100644 --- a/game/engines/default/engine/dialogs/UserInfo.lua +++ b/game/engines/default/engine/dialogs/UserInfo.lua @@ -34,7 +34,7 @@ function _M:init(data) if data.char_link then str:add({"font","italic"},{"color","LIGHT_BLUE"},data.current_char.title or "unknown",{"font","normal"},{"color","LAST"},true) else - str:add(data.current_char or "unknown",true) + str:add(data.current_char.title or "unknown",true) end str:add({"color","ANTIQUE_WHITE"}, "Game: ", {"color", "LAST"}, data.current_char.module or "unknown", true) str:add({"color","ANTIQUE_WHITE"}, "Validation: ", {"color", "LAST"}, data.current_char.valid and "Game has been validated by the server" or "Game is not validated by the server", true) diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 79ee7658030ae70990fa89ce25eb2efd438ca7b8..67b8ed341b886a0f43c33537f257de1b1be4e14d 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -1156,10 +1156,7 @@ function _M:setupMouse(reset) -- Chat tooltips profile.chat:onMouse(function(user, button, event) local str = tstring{{"color","GOLD"}, {"font","bold"}, user.name, {"color","LAST"}, {"font","normal"}, true} - str:add({"color","ANTIQUE_WHITE"}, "Playing: ", {"color", "LAST"}, user.current_char,true) - if user.char_link then - str:add({"font","italic"},{"color","LIGHT_BLUE"},user.char_link,{"font","normal"},{"color","LAST"},true) - end + str:add({"color","ANTIQUE_WHITE"}, "Playing: ", {"color", "LAST"}, user.current_char, true) str:add({"color","ANTIQUE_WHITE"}, "Game: ", {"color", "LAST"}, user.module, "(", user.valid, ")",true) self.tooltip:displayAtMap(nil, nil, self.w, self.h, str) diff --git a/src/profile.c b/src/profile.c index 158fce1bc6987a9de70599e6293b9160bbd79807..071e1a66c2ae2fe29cca0133281f508e5c015572 100644 --- a/src/profile.c +++ b/src/profile.c @@ -35,7 +35,7 @@ int push_order(lua_State *L) { size_t len; const char *code = luaL_checklstring(L, 1, &len); - printf("[profile order] %s\n", code); +// printf("[profile order] %s\n", code); profile_queue *q = malloc(sizeof(profile_queue)); char *d = calloc(len, sizeof(char)); @@ -67,7 +67,6 @@ int pop_order(lua_State *L) if (q) { -// printf("[profile event] POP %s\n", q->payload); lua_pushlstring(L, q->payload, q->payload_len); free(q->payload); free(q); @@ -82,7 +81,7 @@ int push_event(lua_State *L) { size_t len; const char *code = luaL_checklstring(L, 1, &len); - printf("[profile event] %s\n", code); +// printf("[profile event] %s\n", code); profile_queue *q = malloc(sizeof(profile_queue)); char *d = calloc(len, sizeof(char)); @@ -114,6 +113,7 @@ int pop_event(lua_State *L) if (q) { +// printf("[profile event] POP %s\n", q->payload); lua_pushlstring(L, q->payload, q->payload_len); free(q->payload); free(q);