summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-05-15 16:38:19 +0200
committersfan5 <sfan5@live.de>2020-05-17 21:37:01 +0200
commit11723cffe011e99c1092388958fb1a047ab1c09c (patch)
tree0a38f434c15893ba01bfa5ca80708780bcfead60 /builtin
parent52430d34d33f0ae3ff188a009307bf0a86048dfe (diff)
downloadminetest-11723cffe011e99c1092388958fb1a047ab1c09c.tar.gz
minetest-11723cffe011e99c1092388958fb1a047ab1c09c.tar.bz2
minetest-11723cffe011e99c1092388958fb1a047ab1c09c.zip
builtin: Move common/async_event.lua to mainmenu/async_event.lua
It only works in the context of the mainmenu.
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/async_event.lua (renamed from builtin/common/async_event.lua)10
-rw-r--r--builtin/mainmenu/init.lua4
2 files changed, 2 insertions, 12 deletions
diff --git a/builtin/common/async_event.lua b/builtin/mainmenu/async_event.lua
index 988af79b9..04bfb78d6 100644
--- a/builtin/common/async_event.lua
+++ b/builtin/mainmenu/async_event.lua
@@ -8,15 +8,7 @@ local function handle_job(jobid, serialized_retval)
core.async_jobs[jobid] = nil
end
-if core.register_globalstep then
- core.register_globalstep(function(dtime)
- for i, job in ipairs(core.get_finished_jobs()) do
- handle_job(job.jobid, job.retval)
- end
- end)
-else
- core.async_event_handler = handle_job
-end
+core.async_event_handler = handle_job
function core.handle_async(func, parameter, callback)
-- Serialize function
diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua
index 130c3e73c..c17e79270 100644
--- a/builtin/mainmenu/init.lua
+++ b/builtin/mainmenu/init.lua
@@ -20,20 +20,18 @@ mt_color_blue = "#6389FF"
mt_color_green = "#72FF63"
mt_color_dark_green = "#25C191"
---for all other colors ask sfan5 to complete his work!
-
local menupath = core.get_mainmenu_path()
local basepath = core.get_builtin_path()
local menustyle = core.settings:get("main_menu_style")
defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" ..
DIR_DELIM .. "pack" .. DIR_DELIM
-dofile(basepath .. "common" .. DIR_DELIM .. "async_event.lua")
dofile(basepath .. "common" .. DIR_DELIM .. "filterlist.lua")
dofile(basepath .. "fstk" .. DIR_DELIM .. "buttonbar.lua")
dofile(basepath .. "fstk" .. DIR_DELIM .. "dialog.lua")
dofile(basepath .. "fstk" .. DIR_DELIM .. "tabview.lua")
dofile(basepath .. "fstk" .. DIR_DELIM .. "ui.lua")
+dofile(menupath .. DIR_DELIM .. "async_event.lua")
dofile(menupath .. DIR_DELIM .. "common.lua")
dofile(menupath .. DIR_DELIM .. "pkgmgr.lua")
dofile(menupath .. DIR_DELIM .. "textures.lua")