Add a button to show the top menu when it's hidden
This commit is contained in:
parent
483988f814
commit
68371c98d4
|
@ -177,9 +177,11 @@ function toggle()
|
||||||
menu:hide()
|
menu:hide()
|
||||||
modules.client_background.getBackground():addAnchor(AnchorTop, 'parent', AnchorTop)
|
modules.client_background.getBackground():addAnchor(AnchorTop, 'parent', AnchorTop)
|
||||||
modules.game_interface.getRootPanel():addAnchor(AnchorTop, 'parent', AnchorTop)
|
modules.game_interface.getRootPanel():addAnchor(AnchorTop, 'parent', AnchorTop)
|
||||||
|
modules.game_interface.getShowTopMenuButton():show()
|
||||||
else
|
else
|
||||||
menu:show()
|
menu:show()
|
||||||
modules.client_background.getBackground():addAnchor(AnchorTop, 'topMenu', AnchorBottom)
|
modules.client_background.getBackground():addAnchor(AnchorTop, 'topMenu', AnchorBottom)
|
||||||
modules.game_interface.getRootPanel():addAnchor(AnchorTop, 'topMenu', AnchorBottom)
|
modules.game_interface.getRootPanel():addAnchor(AnchorTop, 'topMenu', AnchorBottom)
|
||||||
|
modules.game_interface.getShowTopMenuButton():hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,6 +5,7 @@ gameMapPanel = nil
|
||||||
gameRightPanel = nil
|
gameRightPanel = nil
|
||||||
gameLeftPanel = nil
|
gameLeftPanel = nil
|
||||||
gameBottomPanel = nil
|
gameBottomPanel = nil
|
||||||
|
showTopMenuButton = nil
|
||||||
logoutButton = nil
|
logoutButton = nil
|
||||||
mouseGrabberWidget = nil
|
mouseGrabberWidget = nil
|
||||||
countWindow = nil
|
countWindow = nil
|
||||||
|
@ -55,6 +56,11 @@ function init()
|
||||||
logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'),
|
logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'),
|
||||||
'/images/topbuttons/logout', tryLogout, true)
|
'/images/topbuttons/logout', tryLogout, true)
|
||||||
|
|
||||||
|
showTopMenuButton = gameMapPanel:getChildById('showTopMenuButton')
|
||||||
|
showTopMenuButton.onClick = function()
|
||||||
|
modules.client_topmenu.toggle()
|
||||||
|
end
|
||||||
|
|
||||||
setupViewMode(0)
|
setupViewMode(0)
|
||||||
|
|
||||||
bindKeys()
|
bindKeys()
|
||||||
|
@ -800,6 +806,10 @@ function getBottomPanel()
|
||||||
return gameBottomPanel
|
return gameBottomPanel
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function getShowTopMenuButton()
|
||||||
|
return showTopMenuButton
|
||||||
|
end
|
||||||
|
|
||||||
function onLeftPanelVisibilityChange(leftPanel, visible)
|
function onLeftPanelVisibilityChange(leftPanel, visible)
|
||||||
if not visible and g_game.isOnline() then
|
if not visible and g_game.isOnline() then
|
||||||
local children = leftPanel:getChildren()
|
local children = leftPanel:getChildren()
|
||||||
|
|
|
@ -32,6 +32,14 @@ UIWidget
|
||||||
anchors.bottom: gameBottomPanel.top
|
anchors.bottom: gameBottomPanel.top
|
||||||
focusable: false
|
focusable: false
|
||||||
|
|
||||||
|
Button
|
||||||
|
id: showTopMenuButton
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
!text: tr('Show Top Menu')
|
||||||
|
height: 32
|
||||||
|
visible: false
|
||||||
|
|
||||||
GameBottomPanel
|
GameBottomPanel
|
||||||
id: gameBottomPanel
|
id: gameBottomPanel
|
||||||
anchors.left: gameLeftPanel.right
|
anchors.left: gameLeftPanel.right
|
||||||
|
|
Loading…
Reference in New Issue