From f969a91c0a7d6527721f985d657908a20e97c32d Mon Sep 17 00:00:00 2001 From: sapier Date: Sun, 18 May 2014 19:40:02 +0200 Subject: Fix a bunch of small bugs due to mainmenu cleanup Fix doubleclick not working in singleplayer Fix of by one issue on accessing raw list Fix this->self Fix copy&paste error for scroll button --- builtin/mainmenu/tab_singleplayer.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'builtin/mainmenu/tab_singleplayer.lua') diff --git a/builtin/mainmenu/tab_singleplayer.lua b/builtin/mainmenu/tab_singleplayer.lua index 244221c37..1eab94da3 100644 --- a/builtin/mainmenu/tab_singleplayer.lua +++ b/builtin/mainmenu/tab_singleplayer.lua @@ -112,9 +112,8 @@ local function main_button_handler(this, fields, name, tabdata) if event.type == "CHG" then core.setting_set("mainmenu_last_selected_world", menudata.worldlist:get_raw_index(core.get_textlist_index("sp_worlds"))) + return true end - - return true end if menu_handle_key_up_down(fields,"sp_worlds","mainmenu_last_selected_world") then @@ -135,9 +134,11 @@ local function main_button_handler(this, fields, name, tabdata) world_doubleclick or fields["key_enter"] then local selected = core.get_textlist_index("sp_worlds") + if selected ~= nil then - gamedata.selected_world = menudata.worldlist:get_raw_index(selected) - gamedata.singleplayer = true + gamedata.selected_world = menudata.worldlist:get_raw_index(selected) + gamedata.singleplayer = true + core.start() end return true -- cgit v1.2.3