mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-06-10 01:40:43 +00:00
Fix mini panel not moving back on panel close button pressed
This commit is contained in:
parent
f83c74ffde
commit
7dd00645cd
|
@ -565,7 +565,6 @@ func (g *GameControls) clearLeftScreenSide() {
|
||||||
g.PartyPanel.Close()
|
g.PartyPanel.Close()
|
||||||
g.questLog.Close()
|
g.questLog.Close()
|
||||||
g.hud.skillSelectMenu.ClosePanels()
|
g.hud.skillSelectMenu.ClosePanels()
|
||||||
g.hud.miniPanel.SetMovedRight(false)
|
|
||||||
g.updateLayout()
|
g.updateLayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -573,7 +572,6 @@ func (g *GameControls) clearRightScreenSide() {
|
||||||
g.inventory.Close()
|
g.inventory.Close()
|
||||||
g.skilltree.Close()
|
g.skilltree.Close()
|
||||||
g.hud.skillSelectMenu.ClosePanels()
|
g.hud.skillSelectMenu.ClosePanels()
|
||||||
g.hud.miniPanel.SetMovedLeft(false)
|
|
||||||
g.updateLayout()
|
g.updateLayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -592,7 +590,6 @@ func (g *GameControls) openLeftPanel(panel Panel) {
|
||||||
|
|
||||||
if !isOpen {
|
if !isOpen {
|
||||||
panel.Open()
|
panel.Open()
|
||||||
g.hud.miniPanel.SetMovedRight(true)
|
|
||||||
g.updateLayout()
|
g.updateLayout()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -606,7 +603,6 @@ func (g *GameControls) openRightPanel(panel Panel) {
|
||||||
|
|
||||||
if !isOpen {
|
if !isOpen {
|
||||||
panel.Open()
|
panel.Open()
|
||||||
g.hud.miniPanel.SetMovedLeft(true)
|
|
||||||
g.updateLayout()
|
g.updateLayout()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -728,10 +724,13 @@ func (g *GameControls) updateLayout() {
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case isRightPanelOpen == isLeftPanelOpen:
|
case isRightPanelOpen == isLeftPanelOpen:
|
||||||
|
g.hud.miniPanel.ResetPosition()
|
||||||
g.mapRenderer.ViewportDefault()
|
g.mapRenderer.ViewportDefault()
|
||||||
case isRightPanelOpen:
|
case isRightPanelOpen:
|
||||||
|
g.hud.miniPanel.SetMovedRight(true)
|
||||||
g.mapRenderer.ViewportToLeft()
|
g.mapRenderer.ViewportToLeft()
|
||||||
case isLeftPanelOpen:
|
case isLeftPanelOpen:
|
||||||
|
g.hud.miniPanel.SetMovedLeft(true)
|
||||||
g.mapRenderer.ViewportToRight()
|
g.mapRenderer.ViewportToRight()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,6 +331,16 @@ func (m *miniPanel) SetMovedLeft(moveLeft bool) {
|
||||||
m.movedLeft = moveLeft
|
m.movedLeft = moveLeft
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *miniPanel) ResetPosition() {
|
||||||
|
if m.movedLeft {
|
||||||
|
m.undoMoveLeft()
|
||||||
|
m.movedLeft = false
|
||||||
|
} else if m.movedRight {
|
||||||
|
m.undoMoveRight()
|
||||||
|
m.movedRight = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (m *miniPanel) SetMovedRight(moveRight bool) {
|
func (m *miniPanel) SetMovedRight(moveRight bool) {
|
||||||
if m.movedRight == moveRight {
|
if m.movedRight == moveRight {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user