mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
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
This commit is contained in:
parent
18fe277d94
commit
f969a91c0a
4 changed files with 100 additions and 93 deletions
|
@ -74,6 +74,7 @@ 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("srv_worlds")))
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -83,14 +84,17 @@ local function main_button_handler(this, fields, name, tabdata)
|
|||
|
||||
if fields["cb_creative_mode"] then
|
||||
core.setting_set("creative_mode", fields["cb_creative_mode"])
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_enable_damage"] then
|
||||
core.setting_set("enable_damage", fields["cb_enable_damage"])
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["cb_server_announce"] then
|
||||
core.setting_set("server_announce", fields["cb_server_announce"])
|
||||
return true
|
||||
end
|
||||
|
||||
if fields["start_server"] ~= nil or
|
||||
|
@ -111,9 +115,11 @@ local function main_button_handler(this, fields, name, tabdata)
|
|||
|
||||
--update last game
|
||||
local world = menudata.worldlist:get_raw_element(gamedata.selected_world)
|
||||
|
||||
local game,index = gamemgr.find_by_gameid(world.gameid)
|
||||
core.setting_set("menu_last_game",game.id)
|
||||
core.start()
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue