Rename partyScreen->partyPanel
This commit is contained in:
parent
d67454140a
commit
0de3aeabd3
|
@ -246,7 +246,7 @@ const (
|
|||
|
||||
Frame = "/data/global/ui/PANEL/800borderframe.dc6"
|
||||
InventoryCharacterPanel = "/data/global/ui/PANEL/invchar6.DC6"
|
||||
PartyScreen = "/data/global/ui/MENU/party.dc6"
|
||||
PartyPanel = "/data/global/ui/MENU/party.dc6"
|
||||
HeroStatsPanelStatsPoints = "/data/global/ui/PANEL/skillpoints.dc6"
|
||||
HeroStatsPanelSocket = "/data/global/ui/PANEL/levelsocket.dc6"
|
||||
InventoryWeaponsTab = "/data/global/ui/PANEL/invchar6Tab.DC6"
|
||||
|
|
|
@ -173,7 +173,7 @@ func NewGameControls(
|
|||
|
||||
heroStatsPanel := NewHeroStatsPanel(asset, ui, hero.Name(), hero.Class, l, hero.Stats)
|
||||
|
||||
partyScreen := NewPartyScreen(asset, ui, hero.Name(), hero.Class, l, hero.Stats)
|
||||
partyPanel := NewPartyPanel(asset, ui, hero.Name(), hero.Class, l, hero.Stats)
|
||||
|
||||
questLog := NewQuestLog(asset, ui, l, audioProvider, hero.Act)
|
||||
|
||||
|
@ -207,7 +207,7 @@ func NewGameControls(
|
|||
inventory: inventory,
|
||||
skilltree: skilltree,
|
||||
heroStatsPanel: heroStatsPanel,
|
||||
partyScreen: partyScreen,
|
||||
partyPanel: partyPanel,
|
||||
questLog: questLog,
|
||||
HelpOverlay: helpOverlay,
|
||||
keyMap: keyMap,
|
||||
|
@ -277,7 +277,7 @@ type GameControls struct {
|
|||
hud *HUD
|
||||
skilltree *skillTree
|
||||
heroStatsPanel *HeroStatsPanel
|
||||
partyScreen *PartyScreen
|
||||
partyPanel *PartyPanel
|
||||
questLog *QuestLog
|
||||
HelpOverlay *HelpOverlay
|
||||
bottomMenuRect *d2geom.Rectangle
|
||||
|
@ -366,7 +366,7 @@ func (g *GameControls) OnKeyDown(event d2interface.KeyEvent) bool {
|
|||
g.toggleInventoryPanel()
|
||||
case d2enum.TogglePartyPanel:
|
||||
if !g.isSinglePlayer {
|
||||
g.togglePartyScreen()
|
||||
g.togglePartyPanel()
|
||||
}
|
||||
case d2enum.ToggleSkillTreePanel:
|
||||
g.toggleSkilltreePanel()
|
||||
|
@ -560,7 +560,7 @@ func (g *GameControls) OnMouseButtonDown(event d2interface.MouseEvent) bool {
|
|||
|
||||
func (g *GameControls) clearLeftScreenSide() {
|
||||
g.heroStatsPanel.Close()
|
||||
g.partyScreen.Close()
|
||||
g.partyPanel.Close()
|
||||
g.questLog.Close()
|
||||
g.hud.skillSelectMenu.ClosePanels()
|
||||
g.hud.miniPanel.SetMovedRight(false)
|
||||
|
@ -614,8 +614,8 @@ func (g *GameControls) toggleHeroStatsPanel() {
|
|||
g.openLeftPanel(g.heroStatsPanel)
|
||||
}
|
||||
|
||||
func (g *GameControls) togglePartyScreen() {
|
||||
g.openLeftPanel(g.partyScreen)
|
||||
func (g *GameControls) togglePartyPanel() {
|
||||
g.openLeftPanel(g.partyPanel)
|
||||
}
|
||||
|
||||
func (g *GameControls) onCloseHeroStatsPanel() {
|
||||
|
@ -679,7 +679,7 @@ func (g *GameControls) Load() {
|
|||
g.inventory.Load()
|
||||
g.skilltree.load()
|
||||
g.heroStatsPanel.Load()
|
||||
g.partyScreen.Load()
|
||||
g.partyPanel.Load()
|
||||
g.questLog.Load()
|
||||
g.HelpOverlay.Load()
|
||||
|
||||
|
@ -688,7 +688,7 @@ func (g *GameControls) Load() {
|
|||
|
||||
miniPanelActions := &miniPanelActions{
|
||||
characterToggle: g.toggleHeroStatsPanel,
|
||||
partyToggle: g.togglePartyScreen,
|
||||
partyToggle: g.togglePartyPanel,
|
||||
inventoryToggle: g.toggleInventoryPanel,
|
||||
skilltreeToggle: g.toggleSkilltreePanel,
|
||||
menuToggle: g.openEscMenu,
|
||||
|
@ -730,7 +730,7 @@ func (g *GameControls) updateLayout() {
|
|||
}
|
||||
|
||||
func (g *GameControls) isLeftPanelOpen() bool {
|
||||
return g.heroStatsPanel.IsOpen() || g.partyScreen.IsOpen() || g.questLog.IsOpen() || g.inventory.moveGoldPanel.IsOpen()
|
||||
return g.heroStatsPanel.IsOpen() || g.partyPanel.IsOpen() || g.questLog.IsOpen() || g.inventory.moveGoldPanel.IsOpen()
|
||||
}
|
||||
|
||||
func (g *GameControls) isRightPanelOpen() bool {
|
||||
|
|
|
@ -15,10 +15,10 @@ import (
|
|||
)
|
||||
|
||||
const ( // for the dc6 frames
|
||||
partyScreenTopLeft = iota
|
||||
partyScreenTopRight
|
||||
partyScreenBottomLeft
|
||||
partyScreenBottomRight
|
||||
partyPanelTopLeft = iota
|
||||
partyPanelTopRight
|
||||
partyPanelBottomLeft
|
||||
partyPanelBottomRight
|
||||
)
|
||||
|
||||
/*
|
||||
|
@ -57,7 +57,7 @@ const (
|
|||
*/
|
||||
|
||||
const (
|
||||
partyScreenCloseButtonX, partyScreenCloseButtonY = 358, 453
|
||||
partyPanelCloseButtonX, partyPanelCloseButtonY = 358, 453
|
||||
)
|
||||
|
||||
/*
|
||||
|
@ -97,16 +97,16 @@ type StatsPanelLabels struct {
|
|||
*/
|
||||
|
||||
// NewHeroStatsPanel creates a new hero status panel
|
||||
func NewPartyScreen(asset *d2asset.AssetManager,
|
||||
func NewPartyPanel(asset *d2asset.AssetManager,
|
||||
ui *d2ui.UIManager,
|
||||
heroName string,
|
||||
heroClass d2enum.Hero,
|
||||
l d2util.LogLevel,
|
||||
heroState *d2hero.HeroStatsState) *PartyScreen {
|
||||
heroState *d2hero.HeroStatsState) *PartyPanel {
|
||||
originX := 0
|
||||
originY := 0
|
||||
|
||||
hsp := &PartyScreen{
|
||||
hsp := &PartyPanel{
|
||||
asset: asset,
|
||||
uiManager: ui,
|
||||
originX: originX,
|
||||
|
@ -125,7 +125,7 @@ func NewPartyScreen(asset *d2asset.AssetManager,
|
|||
}
|
||||
|
||||
// HeroStatsPanel represents the hero status panel
|
||||
type PartyScreen struct {
|
||||
type PartyPanel struct {
|
||||
asset *d2asset.AssetManager
|
||||
uiManager *d2ui.UIManager
|
||||
panel *d2ui.Sprite
|
||||
|
@ -146,7 +146,7 @@ type PartyScreen struct {
|
|||
}
|
||||
|
||||
// Load the data for the hero status panel
|
||||
func (s *PartyScreen) Load() {
|
||||
func (s *PartyPanel) Load() {
|
||||
var err error
|
||||
|
||||
s.panelGroup = s.uiManager.NewWidgetGroup(d2ui.RenderPriorityHeroStatsPanel)
|
||||
|
@ -154,7 +154,7 @@ func (s *PartyScreen) Load() {
|
|||
frame := s.uiManager.NewUIFrame(d2ui.FrameLeft)
|
||||
s.panelGroup.AddWidget(frame)
|
||||
|
||||
s.panel, err = s.uiManager.NewSprite(d2resource.PartyScreen, d2resource.PaletteSky)
|
||||
s.panel, err = s.uiManager.NewSprite(d2resource.PartyPanel, d2resource.PaletteSky)
|
||||
if err != nil {
|
||||
s.Error(err.Error())
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ func (s *PartyScreen) Load() {
|
|||
|
||||
closeButton := s.uiManager.NewButton(d2ui.ButtonTypeSquareClose, "")
|
||||
closeButton.SetVisible(false)
|
||||
closeButton.SetPosition(partyScreenCloseButtonX, partyScreenCloseButtonY)
|
||||
closeButton.SetPosition(partyPanelCloseButtonX, partyPanelCloseButtonY)
|
||||
closeButton.OnActivated(func() { s.Close() })
|
||||
s.panelGroup.AddWidget(closeButton)
|
||||
|
||||
|
@ -253,12 +253,12 @@ func (s *HeroStatsPanel) setLayout() {
|
|||
*/
|
||||
|
||||
// IsOpen returns true if the hero status panel is open
|
||||
func (s *PartyScreen) IsOpen() bool {
|
||||
func (s *PartyPanel) IsOpen() bool {
|
||||
return s.isOpen
|
||||
}
|
||||
|
||||
// Toggle toggles the visibility of the hero status panel
|
||||
func (s *PartyScreen) Toggle() {
|
||||
func (s *PartyPanel) Toggle() {
|
||||
if s.isOpen {
|
||||
s.Close()
|
||||
} else {
|
||||
|
@ -267,13 +267,13 @@ func (s *PartyScreen) Toggle() {
|
|||
}
|
||||
|
||||
// Open opens the hero status panel
|
||||
func (s *PartyScreen) Open() {
|
||||
func (s *PartyPanel) Open() {
|
||||
s.isOpen = true
|
||||
s.panelGroup.SetVisible(true)
|
||||
}
|
||||
|
||||
// Close closed the hero status panel
|
||||
func (s *PartyScreen) Close() {
|
||||
func (s *PartyPanel) Close() {
|
||||
s.isOpen = false
|
||||
s.panelGroup.SetVisible(false)
|
||||
}
|
||||
|
@ -294,17 +294,17 @@ func (s *HeroStatsPanel) Advance(elapsed float64) {
|
|||
}
|
||||
*/
|
||||
|
||||
func (s *PartyScreen) renderStaticMenu(target d2interface.Surface) {
|
||||
func (s *PartyPanel) renderStaticMenu(target d2interface.Surface) {
|
||||
s.renderStaticPanelFrames(target)
|
||||
}
|
||||
|
||||
// nolint:dupl // see quest_log.go.renderStaticPanelFrames comment
|
||||
func (s *PartyScreen) renderStaticPanelFrames(target d2interface.Surface) {
|
||||
func (s *PartyPanel) renderStaticPanelFrames(target d2interface.Surface) {
|
||||
frames := []int{
|
||||
partyScreenTopLeft,
|
||||
partyScreenTopRight,
|
||||
partyScreenBottomRight,
|
||||
partyScreenBottomLeft,
|
||||
partyPanelTopLeft,
|
||||
partyPanelTopRight,
|
||||
partyPanelBottomRight,
|
||||
partyPanelBottomLeft,
|
||||
}
|
||||
|
||||
currentX := s.originX + statsPanelOffsetX
|
Loading…
Reference in New Issue