mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Merge 2f3cf6b1f0
into 499f2284bd
This commit is contained in:
commit
ad0a719736
3 changed files with 16 additions and 5 deletions
|
@ -222,10 +222,18 @@ local function set_tab_by_name(self, name)
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
local function hide_tabview(self)
|
local function hide_tabview(self, hide_header)
|
||||||
self.hidden=true
|
self.hidden=true
|
||||||
|
self.hide_header = hide_header
|
||||||
|
|
||||||
--call on_change as we're not gonna show self tab any longer
|
if hide_header == nil then hide_header = true end
|
||||||
|
|
||||||
|
-- hide the menu header image as well
|
||||||
|
if hide_header and mm_game_theme and mm_game_theme.clear_single then
|
||||||
|
mm_game_theme.clear_single("header")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- call on_change as we're not gonna show self tab any longer
|
||||||
if self.tablist[self.last_tab_index].on_change ~= nil then
|
if self.tablist[self.last_tab_index].on_change ~= nil then
|
||||||
self.tablist[self.last_tab_index].on_change("LEAVE",
|
self.tablist[self.last_tab_index].on_change("LEAVE",
|
||||||
self.current_tab, nil)
|
self.current_tab, nil)
|
||||||
|
@ -289,6 +297,7 @@ function tabview_create(name, size, tabheaderpos)
|
||||||
self.tablist = {}
|
self.tablist = {}
|
||||||
|
|
||||||
self.autosave_tab = false
|
self.autosave_tab = false
|
||||||
|
self.hide_header = false
|
||||||
|
|
||||||
ui.add(self)
|
ui.add(self)
|
||||||
return self
|
return self
|
||||||
|
|
|
@ -51,6 +51,8 @@ function mm_game_theme.set_game(gamedetails)
|
||||||
assert(gamedetails ~= nil)
|
assert(gamedetails ~= nil)
|
||||||
|
|
||||||
if mm_game_theme.gameid == gamedetails.id then
|
if mm_game_theme.gameid == gamedetails.id then
|
||||||
|
-- still restore header in case it was cleared
|
||||||
|
mm_game_theme.set_game_single("header", gamedetails)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
mm_game_theme.gameid = gamedetails.id
|
mm_game_theme.gameid = gamedetails.id
|
||||||
|
|
|
@ -402,7 +402,7 @@ local function main_button_handler(this, fields, name, tabdata)
|
||||||
this.dlg_create_world_closed_at = 0
|
this.dlg_create_world_closed_at = 0
|
||||||
local create_world_dlg = create_create_world_dlg()
|
local create_world_dlg = create_create_world_dlg()
|
||||||
create_world_dlg:set_parent(this)
|
create_world_dlg:set_parent(this)
|
||||||
this:hide()
|
this:hide(false)
|
||||||
create_world_dlg:show()
|
create_world_dlg:show()
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -418,7 +418,7 @@ local function main_button_handler(this, fields, name, tabdata)
|
||||||
local index = menudata.worldlist:get_raw_index(selected)
|
local index = menudata.worldlist:get_raw_index(selected)
|
||||||
local delete_world_dlg = create_delete_world_dlg(world.name,index)
|
local delete_world_dlg = create_delete_world_dlg(world.name,index)
|
||||||
delete_world_dlg:set_parent(this)
|
delete_world_dlg:set_parent(this)
|
||||||
this:hide()
|
this:hide(false)
|
||||||
delete_world_dlg:show()
|
delete_world_dlg:show()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -435,7 +435,7 @@ local function main_button_handler(this, fields, name, tabdata)
|
||||||
|
|
||||||
if (configdialog ~= nil) then
|
if (configdialog ~= nil) then
|
||||||
configdialog:set_parent(this)
|
configdialog:set_parent(this)
|
||||||
this:hide()
|
this:hide(false)
|
||||||
configdialog:show()
|
configdialog:show()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue