Skip to content

Commit 0a0378f

Browse files
Sokomineest31
authored andcommittedJul 2, 2015
Set server_announce to world.mt and respect modes when changing subgame
1 parent 8a85e5e commit 0a0378f

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed
 

Diff for: ‎builtin/mainmenu/common.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ function menu_worldmt(selected, setting, value)
322322
end
323323

324324
function menu_worldmt_legacy(selected)
325-
local modes_names = {"creative_mode", "enable_damage"}
325+
local modes_names = {"creative_mode", "enable_damage", "server_announce"}
326326
for _, mode_name in pairs(modes_names) do
327327
local mode_val = menu_worldmt(selected, mode_name)
328328
if mode_val ~= nil then

Diff for: ‎builtin/mainmenu/tab_server.lua

+3
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ local function main_button_handler(this, fields, name, tabdata)
103103

104104
if fields["cb_server_announce"] then
105105
core.setting_set("server_announce", fields["cb_server_announce"])
106+
local selected = core.get_textlist_index("srv_worlds")
107+
menu_worldmt(selected, "server_announce", fields["cb_server_announce"])
108+
106109
return true
107110
end
108111

Diff for: ‎builtin/mainmenu/tab_singleplayer.lua

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ local function singleplayer_refresh_gamebar()
3838
core.set_topleft_text(gamemgr.games[j].name)
3939
core.setting_set("menu_last_game",gamemgr.games[j].id)
4040
menudata.worldlist:set_filtercriteria(gamemgr.games[j].id)
41+
local index = filterlist.get_current_index(menudata.worldlist,
42+
tonumber(core.setting_get("mainmenu_last_selected_world")))
43+
local selected = core.get_textlist_index("sp_worlds")
44+
if not index or index < 1 then
45+
index = math.min(core.get_textlist_index("sp_worlds"),
46+
#menudata.worldlist:get_list())
47+
end
48+
menu_worldmt_legacy(index)
4149
return true
4250
end
4351
end

0 commit comments

Comments
 (0)
Please sign in to comment.