fix key event + run callbacks more

This commit is contained in:
m 2023-12-17 15:21:26 -06:00
parent dde3449195
commit 1d2fccdf8b
3 changed files with 9 additions and 7 deletions

View File

@ -18,9 +18,6 @@ function canasktojoin(userid)
end
history[userid] = true
game:ontimeout(function()
history[userid] = nil
end, 15000)
return true
end
@ -206,6 +203,7 @@ function addrequest(request)
invite:registerEventHandler("end_invite", function()
close()
discord.respond(request.userid, discord.reply.ignore)
history[request.userid] = nil
end)
local bar = LUI.UIImage.new({

View File

@ -143,8 +143,6 @@ namespace discord
void update_discord()
{
Discord_RunCallbacks();
// reset presence data
const auto saved_time = discord_presence.startTimestamp;
discord_presence = {};
@ -314,7 +312,13 @@ namespace discord
Discord_Initialize("947125042930667530", &handlers, 1, nullptr);
scheduler::once(download_default_avatar, scheduler::pipeline::async);
scheduler::loop(update_discord, scheduler::pipeline::async, 5s);
scheduler::once([]()
{
scheduler::once(update_discord, scheduler::pipeline::async);
scheduler::loop(update_discord, scheduler::pipeline::async, 5s);
scheduler::loop(Discord_RunCallbacks, scheduler::pipeline::async, 1s);
}, scheduler::pipeline::main);
initialized_ = true;
}

View File

@ -36,7 +36,7 @@ namespace input
void cl_key_event_stub(const int local_client_num, const int key, const int down)
{
if (game::environment::is_sp() && ui_scripting::lui_running())
if (ui_scripting::lui_running())
{
ui_scripting::notify(down ? "keydown" : "keyup",
{