mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Disable game bar and header on Android (#7940)
This commit is contained in:
parent
08884d258b
commit
0c6933bdf7
@ -15,14 +15,18 @@
|
|||||||
--with this program; if not, write to the Free Software Foundation, Inc.,
|
--with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
local function current_game()
|
|
||||||
|
local enable_gamebar = PLATFORM ~= "Android"
|
||||||
|
local current_game, singleplayer_refresh_gamebar
|
||||||
|
if enable_gamebar then
|
||||||
|
function current_game()
|
||||||
local last_game_id = core.settings:get("menu_last_game")
|
local last_game_id = core.settings:get("menu_last_game")
|
||||||
local game, index = pkgmgr.find_by_gameid(last_game_id)
|
local game, index = pkgmgr.find_by_gameid(last_game_id)
|
||||||
|
|
||||||
return game
|
return game
|
||||||
end
|
end
|
||||||
|
|
||||||
local function singleplayer_refresh_gamebar()
|
function singleplayer_refresh_gamebar()
|
||||||
|
|
||||||
local old_bar = ui.find_by_name("game_button_bar")
|
local old_bar = ui.find_by_name("game_button_bar")
|
||||||
|
|
||||||
@ -84,6 +88,11 @@ local function singleplayer_refresh_gamebar()
|
|||||||
btnbar:add_button(btn_name, text, image, tooltip)
|
btnbar:add_button(btn_name, text, image, tooltip)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
function current_game()
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function get_formspec(tabview, name, tabdata)
|
local function get_formspec(tabview, name, tabdata)
|
||||||
local retval = ""
|
local retval = ""
|
||||||
@ -282,7 +291,9 @@ local function main_button_handler(this, fields, name, tabdata)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function on_change(type, old_tab, new_tab)
|
local on_change
|
||||||
|
if enable_gamebar then
|
||||||
|
function on_change(type, old_tab, new_tab)
|
||||||
local buttonbar = ui.find_by_name("game_button_bar")
|
local buttonbar = ui.find_by_name("game_button_bar")
|
||||||
|
|
||||||
if ( buttonbar == nil ) then
|
if ( buttonbar == nil ) then
|
||||||
@ -306,6 +317,7 @@ local function on_change(type, old_tab, new_tab)
|
|||||||
mm_texture.update(new_tab,nil)
|
mm_texture.update(new_tab,nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user