mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Fix Enter key after creating a new world (#12997)
Prevents Enter key or "double-click" event to play the world just after creating a new world
This commit is contained in:
parent
2f9f0c0900
commit
a2a280691c
2 changed files with 17 additions and 0 deletions
|
@ -352,6 +352,12 @@ local function create_world_buttonhandler(this, fields)
|
|||
if fields["world_create_confirm"] or
|
||||
fields["key_enter"] then
|
||||
|
||||
if fields["key_enter"] then
|
||||
-- HACK: This timestamp prevents double-triggering when pressing Enter on an input box
|
||||
-- and releasing it on a button[] or textlist[] due to instant formspec updates.
|
||||
this.parent.dlg_create_world_closed_at = core.get_us_time()
|
||||
end
|
||||
|
||||
local worldname = fields["te_world_name"]
|
||||
local game, _ = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue