Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/modules/client_options/game.otui b/modules/client_options/game.otui
- index 63d73613..2e3918c2 100644
- --- a/modules/client_options/game.otui
- +++ b/modules/client_options/game.otui
- @@ -27,6 +27,10 @@ Panel
- !text: tr('Show left panel')
- OptionCheckBox
- + id: showExtraRightPanel
- + !text: tr('Show an extra right panel')
- +
- + OptionCheckBox
- id: displayNames
- !text: tr('Display creature names')
- diff --git a/modules/client_options/options.lua b/modules/client_options/options.lua
- index 9ca73fa2..7182f7f3 100644
- --- a/modules/client_options/options.lua
- +++ b/modules/client_options/options.lua
- @@ -15,6 +15,10 @@ local defaultOptions = {
- showPrivateMessagesInConsole = true,
- showPrivateMessagesOnScreen = true,
- showLeftPanel = false,
- +
- +showExtraRightPanel
- +
- + = false,
- foregroundFrameRate = 61,
- backgroundFrameRate = 201,
- painterEngine = 0,
- @@ -198,6 +202,8 @@ function setOption(key, value, force)
- audioPanel:getChildById('musicSoundVolumeLabel'):setText(tr('Music volume: %d', value))
- elseif key == 'showLeftPanel' then
- modules.game_interface.getLeftPanel():setOn(value)
- + elseif key == 'showExtraRightPanel' then
- + modules.game_interface.getRightExtraPanel():setOn(value)
- elseif key == 'backgroundFrameRate' then
- local text, v = value, value
- if value <= 0 or value >= 201 then text = 'max' v = 0 end
- diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua
- index 09930e27..1f7aaa36 100644
- --- a/modules/game_interface/gameinterface.lua
- +++ b/modules/game_interface/gameinterface.lua
- @@ -4,6 +4,9 @@ gameRootPanel = nil
- gameMapPanel = nil
- gameRightPanel = nil
- gameLeftPanel = nil
- +
- +
- +gameExtraRightPanel = nil
- gameBottomPanel = nil
- logoutButton = nil
- mouseGrabberWidget = nil
- @@ -41,6 +44,7 @@ function init()
- gameRootPanel:lower()
- gameRootPanel.onGeometryChange = updateStretchShrink
- gameRootPanel.onFocusChange = stopSmartWalk
- + gameRootPanel.onDrop = checkMiniWindowDrops
- mouseGrabberWidget = gameRootPanel:getChildById('mouseGrabber')
- mouseGrabberWidget.onMouseRelease = onMouseGrabberRelease
- @@ -49,8 +53,10 @@ function init()
- gameMapPanel = gameRootPanel:getChildById('gameMapPanel')
- gameRightPanel = gameRootPanel:getChildById('gameRightPanel')
- gameLeftPanel = gameRootPanel:getChildById('gameLeftPanel')
- +
- +
- + gameExtraRightPanel = gameRootPanel:getChildById('gameExtraRightPanel')
- gameBottomPanel = gameRootPanel:getChildById('gameBottomPanel')
- - connect(gameLeftPanel, { onVisibilityChange = onLeftPanelVisibilityChange })
- logoutButton = modules.client_topmenu.addLeftButton('logoutButton', tr('Exit'),
- '/images/topbuttons/logout', tryLogout, true)
- @@ -59,6 +65,8 @@ function init()
- bindKeys()
- + connect(rootWidget, {onDrop = checkMiniWindowDrops})
- +
- if g_game.isOnline() then
- show()
- end
- @@ -791,6 +799,10 @@ function getLeftPanel()
- return gameLeftPanel
- end
- +function getRightExtraPanel()
- + return gameExtraRightPanel
- +end
- +
- function getBottomPanel()
- return gameBottomPanel
- end
- @@ -866,3 +878,18 @@ end
- function limitZoom()
- limitedZoom = true
- end
- +
- +function checkMiniWindowDrops(widget, draggedWidget, mousePos)
- + if draggedWidget:getClassName() == 'UIMiniWindow' then
- + local middle = g_window.getWidth() / 2
- + local moveToLeft = mousePos.x < middle
- + if moveToLeft and gameLeftPanel:isVisible() then
- + gameLeftPanel:onDrop(draggedWidget, mousePos)
- + elseif not moveToLeft and gameExtraRightPanel:isVisible() then
- + gameExtraRightPanel:onDrop(draggedWidget, mousePos)
- + elseif not moveToLeft and gameRightPanel:isVisible() then
- + gameRightPanel:onDrop(draggedWidget, mousePos)
- + end
- + end
- +end
- +
- diff --git a/modules/game_interface/gameinterface.otui b/modules/game_interface/gameinterface.otui
- index 9196a223..ca4e7afe 100644
- --- a/modules/game_interface/gameinterface.otui
- +++ b/modules/game_interface/gameinterface.otui
- @@ -53,11 +53,23 @@ UIWidget
- visible: false
- GameSidePanel
- - id: gameRightPanel
- + id: gameExtraRightPanel
- anchors.right: parent.right
- anchors.top: parent.top
- anchors.bottom: parent.bottom
- focusable: false
- + visible: true
- + on: true
- + $!on:
- + width: 0
- + visible: false
- +
- + GameSidePanel
- + id: gameRightPanel
- + anchors.right: prev.left
- + anchors.top: parent.top
- + anchors.bottom: parent.bottom
- + focusable: false
- on: true
- Splitter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement