def GetSquadronAction(self, tubeFlagID): tubeStatus = self.shipFighterState.GetTubeStatus(tubeFlagID) stateText = LABEL_BY_STATE[tubeStatus.statusID] if session.stationid2: stateColor = Color(*COLOR_OPEN) else: stateColor = Color(*COLOR_BY_STATE[tubeStatus.statusID]) stateColor.a = 0.8 return (stateText, stateColor)
def UpdateStatusUI(self, tubeStatus): stateText = LABEL_BY_STATE[tubeStatus.statusID] self.tubeStatusLabel.text = GetByLabel(stateText) if self.ShouldShowStationUI(): stateColor = Color(*COLOR_OPEN) else: stateColor = Color(*COLOR_BY_STATE[tubeStatus.statusID]) self.leftTube.SetRGBA(*stateColor.GetRGBA()) self.rightTube.SetRGBA(*stateColor.GetRGBA()) stateColor.a = 0.8 self.tubeStatusLabel.SetTextColor(stateColor.GetRGBA())
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.controller = SquadronMgmtController() self.shipFighterState = GetShipFighterState() self.tubeFlagID = attributes.tubeFlagID self.leftTube = Sprite( parent=self, texturePath= 'res:/UI/Texture/classes/CarrierBay/tubeSideElement.png', align=uiconst.TOLEFT_NOPUSH, width=15) self.rightTube = Sprite( parent=self, texturePath= 'res:/UI/Texture/classes/CarrierBay/tubeSideElementRIGHT.png', align=uiconst.TORIGHT_NOPUSH, width=15) inSpaceCont = Container(parent=self, height=86, align=uiconst.TOTOP) inSpaceCont.OnDropData = self.OnDropToSpace inSpaceCont.GetMenu = self.GetMenu self.squadronNumber = SquadronNumber(parent=inSpaceCont, top=1, left=1) self.squadronNumber.SetText(self.tubeFlagID) self.inStationCont = Container(parent=inSpaceCont, align=uiconst.TOALL) cantLaunchIcon = Sprite( parent=self.inStationCont, width=44, height=44, align=uiconst.CENTER, texturePath='res:/UI/Texture/classes/CarrierBay/unableToLaunch.png' ) self.stateCont = Container(parent=self, height=24, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) self.stateContBG = Fill(bgParent=self.stateCont, color=(0, 0, 0, 0)) deckCont = Container(parent=self, height=86, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) deckCont.OnDropData = self.OnDropToTube deckCont.GetMenu = self.GetMenu self.tubeStatusLabel = EveHeaderSmall(parent=self.stateCont, align=uiconst.CENTER, text='') self.loadingGauge = Gauge(parent=self.stateCont, align=uiconst.CENTERBOTTOM, backgroundColor=(0, 0, 0, 1), color=(0.2, 0.2, 0.2, 0.5), padLeft=1, padRight=1, top=1, width=75, value=0.0) self.loadingGauge.display = False spaceColor = Color(*COLOR_INSPACE) spaceColor.a = 1.0 self.launchIcon = ButtonIcon( parent=inSpaceCont, align=uiconst.CENTER, width=86, height=86, iconSize=44, texturePath='res:/UI/Texture/classes/CarrierBay/tubeLaunch_Up.png', downTexture= 'res:/UI/Texture/classes/CarrierBay/tubeLaunch_Down.png', hoverTexture= 'res:/UI/Texture/classes/CarrierBay/tubeLaunch_Over.png', iconColor=spaceColor.GetRGBA(), showGlow=False) self.launchIcon.OnClick = self.LaunchFightersFromTube self.launchIcon.OnDropData = self.OnDropToSpace returnColor = Color(*COLOR_RETURNING) returnColor.a = 1.0 self.scoopIcon = ButtonIcon( parent=deckCont, align=uiconst.CENTER, width=86, height=86, iconSize=44, texturePath='res:/UI/Texture/classes/CarrierBay/tubeRecall_Up.png', downTexture= 'res:/UI/Texture/classes/CarrierBay/tubeRecall_Down.png', hoverTexture= 'res:/UI/Texture/classes/CarrierBay/tubeRecall_Over.png', iconColor=returnColor.GetRGBA(), showGlow=False) self.scoopIcon.OnClick = self.RecallFighterToTube self.scoopIcon.OnDropData = self.OnDropToTube self.landingStrip = LandingStrip(parent=deckCont) self.landingStrip.display = False self.emptyTubeIcon = ButtonIcon( parent=deckCont, align=uiconst.CENTER, width=44, height=44, iconSize=44, texturePath='res:/UI/Texture/classes/CarrierBay/tubeOpen_Up.png', downTexture='res:/UI/Texture/classes/CarrierBay/tubeOpen_Down.png', hoverTexture='res:/UI/Texture/classes/CarrierBay/tubeOpen_Over.png', showGlow=False) self.emptyTubeIcon.OnDropData = self.OnDropToTube self.squadronInSpace = FightersHealthGauge(name='squadronInSpace', parent=inSpaceCont, align=uiconst.CENTER, width=86, height=86, state=TUBE_STATE_INSPACE, tubeFlagID=self.tubeFlagID) self.squadronInSpace.display = False self.squadronInSpace.GetMenu = self.GetMenu self.squadronInTube = FightersHealthGauge(name='squadronInTube', parent=deckCont, align=uiconst.CENTER, width=86, height=86, state=TUBE_STATE_READY, tubeFlagID=self.tubeFlagID) self.squadronInTube.OnDropData = self.OnDropToTube self.squadronInTube.display = False self.squadronInTube.GetMenu = self.GetMenu self.launchingStrip = LaunchingStrip(parent=inSpaceCont) self.launchingStrip.display = False self.UpdateLaunchTubeContentUI() self.UpdateLaunchTubeStateUI() self.UpdateInSpaceUI() self.shipFighterState.signalOnFighterTubeStateUpdate.connect( self.OnFighterTubeStateUpdate) self.shipFighterState.signalOnFighterTubeContentUpdate.connect( self.OnFighterTubeContentUpdate) self.shipFighterState.signalOnFighterInSpaceUpdate.connect( self.OnFighterInSpaceUpdate)