Mainmenu: update

master
Maksim 2020-06-28 22:38:29 +02:00
parent e87932470f
commit eeb50936d6
7 changed files with 27 additions and 2 deletions

View File

@ -78,7 +78,7 @@ local function get_formspec(self)
if not self.hidden and (self.parent == nil or not self.parent.hidden) then
local name = self.tablist[self.last_tab_index].name
local tabname = (name == "local" or name == "online") and name
local tabname = (name == "local" or name == "online" or name == "hosting") and name
if self.parent == nil then
local tsize = self.tablist[self.last_tab_index].tabsize or

View File

@ -31,6 +31,12 @@ end
local function delete_world_buttonhandler(this, fields)
if fields["world_delete_confirm"] then
if this.data.callback then
this:delete()
this.data.callback()
return true
end
if this.data.delete_index > 0 and
this.data.delete_index <= #menudata.worldlist:get_raw_list() then
core.delete_world(this.data.delete_index)
@ -62,3 +68,13 @@ function create_delete_world_dlg(name_to_del, index_to_del)
return retval
end
function create_custom_delete_dlg(name_to_del, callback)
assert(name_to_del ~= nil and type(name_to_del) == "string" and name_to_del ~= "")
assert(type(callback) == "function")
local retval = create_delete_world_dlg(name_to_del, -1, nil)
retval.data.callback = callback
return retval
end

View File

@ -58,6 +58,12 @@ if not mobile then
end
tabs.credits = dofile(menupath .. DIR_DELIM .. "tab_credits.lua")
local hpath = menupath .. DIR_DELIM .. "tab_hosting.lua"
local hosting = io.open(hpath, "r")
if hosting then
tabs.hosting = dofile(hpath)
io.close(hosting)
end
tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua")
tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua")
@ -97,6 +103,9 @@ local function init_globals()
tv_main:add(tabs.local_game)
tv_main:add(tabs.play_online)
if tabs.hosting then
tv_main:add(tabs.hosting)
end
if not mobile then
tv_main:add(tabs.settings)
@ -121,7 +130,7 @@ end
core.set_clouds(false)
-- mm_texture.set_dirt_bg()
core.set_background("background", defaulttexturedir .. "bg.png", true, 256)
core.set_background("background", defaulttexturedir .. "bg.png", true, 256)
-- core.sound_play("main_menu", true)
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
textures/base/btn_play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

BIN
textures/base/server_on.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B