Add a button to show the top menu when it's hidden

master
Kamil Chojnowski преди 6 години
родител 483988f814
ревизия 68371c98d4

@ -177,9 +177,11 @@ function toggle()
menu:hide()
modules.client_background.getBackground():addAnchor(AnchorTop, 'parent', AnchorTop)
modules.game_interface.getRootPanel():addAnchor(AnchorTop, 'parent', AnchorTop)
modules.game_interface.getShowTopMenuButton():show()
else
menu:show()
modules.client_background.getBackground():addAnchor(AnchorTop, 'topMenu', AnchorBottom)
modules.game_interface.getRootPanel():addAnchor(AnchorTop, 'topMenu', AnchorBottom)
modules.game_interface.getShowTopMenuButton():hide()
end
end

@ -5,6 +5,7 @@ gameMapPanel = nil
gameRightPanel = nil
gameLeftPanel = nil
gameBottomPanel = nil
showTopMenuButton = nil
logoutButton = nil
mouseGrabberWidget = nil
countWindow = nil
@ -55,6 +56,11 @@ function init()
logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'),
'/images/topbuttons/logout', tryLogout, true)
showTopMenuButton = gameMapPanel:getChildById('showTopMenuButton')
showTopMenuButton.onClick = function()
modules.client_topmenu.toggle()
end
setupViewMode(0)
bindKeys()
@ -800,6 +806,10 @@ function getBottomPanel()
return gameBottomPanel
end
function getShowTopMenuButton()
return showTopMenuButton
end
function onLeftPanelVisibilityChange(leftPanel, visible)
if not visible and g_game.isOnline() then
local children = leftPanel:getChildren()

@ -32,6 +32,14 @@ UIWidget
anchors.bottom: gameBottomPanel.top
focusable: false
Button
id: showTopMenuButton
anchors.top: parent.top
anchors.left: parent.left
!text: tr('Show Top Menu')
height: 32
visible: false
GameBottomPanel
id: gameBottomPanel
anchors.left: gameLeftPanel.right

Зареждане…
Отказ
Запис