diff options
author | sapier <Sapier at GMX dot net> | 2014-05-17 15:30:26 +0200 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2014-05-17 15:32:51 +0200 |
commit | 87b4bce594689b90a44c3c11e09dc6210dcdf0b5 (patch) | |
tree | 7542d3c3693f099b1d79ff221a3aea9cc3ab3ac2 /builtin | |
parent | c3984569c06dc3c2890516e95adc38dcab9ec89a (diff) | |
download | minetest-87b4bce594689b90a44c3c11e09dc6210dcdf0b5.tar.gz minetest-87b4bce594689b90a44c3c11e09dc6210dcdf0b5.tar.bz2 minetest-87b4bce594689b90a44c3c11e09dc6210dcdf0b5.zip |
Fix singleplayer dialogs missing game customization
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/mainmenu/tab_server.lua | 1 | ||||
-rw-r--r-- | builtin/mainmenu/tab_singleplayer.lua | 22 |
2 files changed, 15 insertions, 8 deletions
diff --git a/builtin/mainmenu/tab_server.lua b/builtin/mainmenu/tab_server.lua index 1efe803b7..c1dd6f501 100644 --- a/builtin/mainmenu/tab_server.lua +++ b/builtin/mainmenu/tab_server.lua @@ -118,7 +118,6 @@ local function main_button_handler(this, fields, name, tabdata) end if fields["world_create"] ~= nil then - print("create world dialog") local create_world_dlg = create_create_world_dlg(true) create_world_dlg:set_parent(this) create_world_dlg:show() diff --git a/builtin/mainmenu/tab_singleplayer.lua b/builtin/mainmenu/tab_singleplayer.lua index 72f918806..244221c37 100644 --- a/builtin/mainmenu/tab_singleplayer.lua +++ b/builtin/mainmenu/tab_singleplayer.lua @@ -15,6 +15,13 @@ --with this program; if not, write to the Free Software Foundation, Inc., --51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +local function current_game() + local last_game_id = core.setting_get("menu_last_game") + local game, index = gamemgr.find_by_gameid(last_game_id) + + return game +end + local function singleplayer_refresh_gamebar() local old_bar = ui.find_by_name("game_button_bar") @@ -137,11 +144,11 @@ local function main_button_handler(this, fields, name, tabdata) end if fields["world_create"] ~= nil then - print("create world dialog") local create_world_dlg = create_create_world_dlg(true) create_world_dlg:set_parent(this) - create_world_dlg:show() this:hide() + create_world_dlg:show() + mm_texture.update("singleplayer",current_game()) return true end @@ -156,8 +163,9 @@ local function main_button_handler(this, fields, name, tabdata) local index = menudata.worldlist:get_raw_index(selected) local delete_world_dlg = create_delete_world_dlg(world.name,index) delete_world_dlg:set_parent(this) - delete_world_dlg:show() this:hide() + delete_world_dlg:show() + mm_texture.update("singleplayer",current_game()) end end @@ -173,8 +181,9 @@ local function main_button_handler(this, fields, name, tabdata) if (configdialog ~= nil) then configdialog:set_parent(this) - configdialog:show() this:hide() + configdialog:show() + mm_texture.update("singleplayer",current_game()) end end @@ -191,13 +200,12 @@ local function on_change(type, old_tab, new_tab) end if (type == "ENTER") then - local last_game_id = core.setting_get("menu_last_game") - local game, index = gamemgr.find_by_gameid(last_game_id) + local game = current_game() if game then menudata.worldlist:set_filtercriteria(game.id) core.set_topleft_text(game.name) - mm_texture.update(new_tab,game) + mm_texture.update("singleplayer",game) end buttonbar:show() else |