Beispiel #1
0
 def OnOpenView(self):
     self.ResetSelf()
     self.state = uiconst.UI_HIDDEN
     self.hudContainer = Container(name='hudContainer', parent=self, controller=self.controller, align=uiconst.CENTERBOTTOM, width=SHIP_UI_WIDTH, height=SHIP_UI_HEIGHT)
     self.overlayContainer = Container(parent=self.hudContainer, name='overlayContainer', pos=(0, 0, 256, 256), align=uiconst.CENTER, state=uiconst.UI_PICKCHILDREN, idx=0)
     self.ConstructOverlayContainer()
     if IsControllingStructure():
         shipShape = StructureHUDShape(parent=self.hudContainer, align=uiconst.CENTER)
     else:
         shipShape = HUDShape(parent=self.hudContainer, align=uiconst.CENTER)
     self.shipuiMainShape = shipShape.shipuiMainShape
     self.capacitorContainer = CapacitorContainer(parent=self.hudContainer, align=uiconst.CENTER, top=-1, controller=self.controller)
     self.capacitorContainer.OnMouseDown = (self.OnShipMouseDown, self.capacitorContainer)
     self.capacitorContainer.OnMouseUp = (self.OnShipMouseUp, self.capacitorContainer)
     self.capacitorContainer.OnClick = self.OnToggleShipSelected
     heatPicker = Container(name='heatPicker', parent=self.hudContainer, align=uiconst.CENTER, width=160, height=160, pickRadius=43, state=uiconst.UI_NORMAL)
     self.heatGauges = HeatGauges(parent=heatPicker, align=uiconst.CENTERTOP, controller=self.controller)
     self.hpGauges = HPGauges(name='healthGauges', parent=self.hudContainer, align=uiconst.CENTER, pos=(0, -37, 148, 74), controller=self.controller)
     if IsControllingStructure():
         ReleaseControlBtn(parent=self.hudContainer, top=29, align=uiconst.CENTERBOTTOM, itemID=self.controller.GetItemID(), func=sm.GetService('structureControl').Alight)
     else:
         self.speedGauge = SpeedGauge(parent=self.hudContainer, top=29, align=uiconst.CENTERBOTTOM, controller=self.controller)
     self.compass = Compass(parent=self.hudContainer, pickRadius=-1)
     self.shipSelectHilight = Container(name='navSelectHilight', parent=self.compass, align=uiconst.CENTER, state=uiconst.UI_DISABLED, width=206, height=206)
     self.ringSprite = Sprite(bgParent=self.shipSelectHilight, texturePath='res:/UI/Texture/classes/ShipUI/Fighters/selectionRingLarge.png')
     self.bracketSprite = Sprite(bgParent=self.shipSelectHilight, texturePath='res:/UI/Texture/classes/ShipUI/Fighters/selectionBracketLarge.png')
     self.shipSelectHilight.display = False
     self.slotsContainer = SlotsContainer(parent=self.hudContainer, pos=(SLOTS_CONTAINER_LEFT,
      SLOTS_CONTAINER_TOP,
      SLOTS_CONTAINER_WIDTH,
      SLOTS_CONTAINER_HEIGHT), align=uiconst.CENTERLEFT, state=uiconst.UI_PICKCHILDREN, controller=self.controller)
     self.stanceButtons = StanceButtons(parent=self.hudContainer, pos=(SLOTS_CONTAINER_LEFT + 8,
      1,
      40,
      120), name='stanceButtons', align=uiconst.CENTERLEFT, state=uiconst.UI_PICKCHILDREN, buttonSize=36)
     self.hudButtons = HudButtonsCont(parent=self.hudContainer, align=uiconst.CENTERRIGHT, left=690, top=15)
     self.ewarCont = EwarContainer(parent=self, align=uiconst.CENTERBOTTOM, top=SHIP_UI_HEIGHT, height=EWAR_CONTAINER_HEIGHT, width=EWAR_CONTAINER_WIDTH)
     self.sr.shipAlertContainer = ShipAlertContainer(parent=self.hudContainer)
     self.sr.indicationContainer = Container(parent=self.hudContainer, name='indicationContainer', align=uiconst.CENTERTOP, pos=(0, 0, 400, 50))
     self.sr.safetyButton = SafetyButton(parent=self.overlayContainer, left=40, top=28)
     self.ConstructReadoutCont()
     self.settingsMenu = UtilMenu(menuAlign=uiconst.BOTTOMLEFT, parent=self.optionsCont, align=uiconst.TOPLEFT, GetUtilMenu=self.GetHUDOptionMenu, pos=(0, 0, 16, 16), texturePath='res:/UI/Texture/Icons/73_16_50.png', hint=GetByLabel('UI/Inflight/Options'))
     self.moduleToggleBtn = ButtonIcon(name='moduleToggleBtn', parent=self.moduleToggleCont, align=uiconst.TOPLEFT, width=24, height=24, iconSize=24, texturePath='res:/UI/Texture/classes/ShipUI/Fighters/toggleModules_Up.png', downTexture='res:/UI/Texture/classes/ShipUI/Fighters/toggleModules_Down.png', hoverTexture='res:/UI/Texture/classes/ShipUI/Fighters/toggleModules_Over.png', func=self.OnToggleHudModules)
     self.moduleToggleBtn.display = False
     self.DrawFighters()
     self.hudContainer.state = uiconst.UI_PICKCHILDREN
     self.UpdatePosition()
     self.shipuiReady = True
     self.SetupShip()
Beispiel #2
0
 def ConstructInventoryIcons(self):
     cargoDroneCont = ContainerAutoSize(name='cargoDroneCont',
                                        parent=self.overlayCont,
                                        align=uiconst.BOTTOMLEFT,
                                        width=110,
                                        left=const.defaultPadding,
                                        top=4)
     if IsControllingStructure():
         cargoSlot = CargoStructureAmmoBay(name='structureCargoSlot',
                                           parent=cargoDroneCont,
                                           align=uiconst.TOTOP,
                                           height=32,
                                           controller=self.controller)
         SetFittingTooltipInfo(cargoSlot, 'StructureAmmoHold')
     else:
         cargoSlot = CargoCargoSlots(name='cargoSlot',
                                     parent=cargoDroneCont,
                                     align=uiconst.TOTOP,
                                     height=32,
                                     controller=self.controller)
         SetFittingTooltipInfo(cargoSlot, 'CargoHold')
     self.fighterAndDroneCont = Container(name='fighterAndDroneCont',
                                          parent=cargoDroneCont,
                                          align=uiconst.TOTOP,
                                          height=32)
     self.ContructDroneAndFighterIcons()
Beispiel #3
0
 def GetMenuData(self):
     capInfo = self.GetSingleMenuPanelInfo({'label': 'UI/Fitting/FittingWindow/Capacitor',
      'content': self.capacitorStatsParent,
      'callback': self.LoadCapacitorStats,
      'maxHeight': 60,
      'headerContent': self.capacitorStatsParent.headerParent,
      'expandedByDefault': True})
     offenseInfo = self.GetSingleMenuPanelInfo({'label': 'UI/Fitting/FittingWindow/Offense',
      'content': self.offenseStatsParent,
      'callback': self.LoadOffenseStats,
      'maxHeight': 56,
      'headerContent': self.offenseStatsParent.headerParent})
     defenseInfo = self.GetSingleMenuPanelInfo({'label': 'UI/Fitting/FittingWindow/Defense',
      'content': self.defenceStatsParent,
      'callback': self.LoadDefenceStats,
      'maxHeight': 150,
      'headerContent': self.defenceStatsParent.headerParent})
     targetingInfo = self.GetSingleMenuPanelInfo({'label': 'UI/Fitting/FittingWindow/Targeting',
      'content': self.targetingStatsParent,
      'callback': self.LoadTargetingStats,
      'maxHeight': 84,
      'headerContent': self.targetingStatsParent.headerParent})
     menuData = [capInfo,
      offenseInfo,
      defenseInfo,
      targetingInfo]
     if not IsControllingStructure():
         navigationInfo = self.GetSingleMenuPanelInfo({'label': 'UI/Fitting/FittingWindow/Navigation',
          'content': self.navigationStatsParent,
          'callback': self.LoadNavigationStats,
          'maxHeight': 84,
          'headerContent': self.navigationStatsParent.headerParent})
         menuData.append(navigationInfo)
     return menuData
Beispiel #4
0
 def SetButtonState(self):
     if settings.user.ui.Get('hudButtonsExpanded', 1):
         self.hudButtons.state = uiconst.UI_PICKCHILDREN
         if IsControllingStructure():
             self.hudButtons.autopilotBtn.Disable()
         else:
             self.hudButtons.autopilotBtn.Enable()
     else:
         self.hudButtons.state = uiconst.UI_HIDDEN
Beispiel #5
0
 def ConstructOverlayContainer(self):
     self.toggleLeftBtn = Sprite(parent=self.overlayContainer, name='expandBtnLeft', pos=(56, 122, 28, 28), align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL, texturePath='res:/UI/Texture/classes/ShipUI/expandBtnLeft.png')
     self.toggleLeftBtn.OnClick = self.ToggleHudButtons
     hudButtonsExpanded = settings.user.ui.Get('hudButtonsExpanded', 1)
     self.toggleLeftBtn.hint = [GetByLabel('UI/Inflight/ShowButtons'), GetByLabel('UI/Inflight/HideButtons')][hudButtonsExpanded]
     self.optionsCont = Container(parent=self.overlayContainer, name='optionsCont', pos=(190, 190, 16, 16), align=uiconst.TOPLEFT, state=uiconst.UI_PICKCHILDREN)
     self.moduleToggleCont = Container(parent=self.overlayContainer, name='moduleToggleCont', pos=(206, 170, 24, 24), align=uiconst.TOPLEFT, state=uiconst.UI_PICKCHILDREN)
     if not IsControllingStructure():
         self.stopButton = StopButton(parent=self.overlayContainer, align=uiconst.TOPLEFT, controller=self.controller, left=75, top=155)
         self.maxspeedButton = MaxSpeedButton(parent=self.overlayContainer, align=uiconst.TOPLEFT, controller=self.controller, left=168, top=155)
Beispiel #6
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.controller = attributes.controller
     self.controller.on_new_itemID.connect(self.OnNewItemID)
     self.controller.on_stats_changed.connect(self.UpdateStats)
     self.controller.on_name_changed.connect(self.UpdateShipName)
     self.controller.on_item_ghost_fitted.connect(self.UpdateStats)
     self.ConstructNameCaption()
     self.ConstructStoredFittingsButtons()
     self.CreateCapacitorPanel()
     self.CreateOffensePanel()
     self.CreateDefensePanel()
     self.CreateTargetingPanel()
     if not IsControllingStructure():
         self.CreateNavigationPanel()
     self.CreateExpandableMenus()
     uthread.new(self.UpdateStats)
 def UnfitModule(self, *args):
     module = self.GetModule()
     if module is None:
         return
     parentID = self.GetParentID()
     if parentID is None:
         return
     if IsControllingStructure():
         questionPath = GetRemoveServiceConfirmationQuestion(
             self.GetModuleTypeID())
         ret = eve.Message(questionPath, buttons=uiconst.YESNO)
         if ret != uiconst.ID_YES:
             return
         invCache = sm.GetService('invCache')
         shipInv = invCache.GetInventoryFromId(
             parentID, locationID=session.structureid)
         shipInv.Add(self.GetModuleID(),
                     parentID,
                     qty=None,
                     flag=const.flagHangar)
Beispiel #8
0
    def GetShipMenu(self, *args):
        if self.controller.GetItemID() is None:
            return []
        if self.controller.IsSimulated():
            return sm.GetService('menu').GetMenuFormItemIDTypeID(
                None,
                typeID=self.controller.GetTypeID(),
                ignoreMarketDetails=False)
        if IsControllingStructure():
            return sm.GetService('menu').CelestialMenu(session.structureid)
        if session.stationid or session.structureid:
            hangarInv = sm.GetService('invCache').GetInventory(
                const.containerHangar)
            hangarItems = [hangarInv.GetItem()] + hangarInv.List(
                const.flagHangar)
            for each in hangarItems:
                if each and each.itemID == self.controller.GetItemID():
                    return sm.GetService('menu').InvItemMenu(each)

        elif session.solarsystemid:
            return sm.GetService('menu').CelestialMenu(session.shipid)
Beispiel #9
0
 def InitButtons(self):
     self.Flush()
     LeftSideButtonCameraTactical(parent=self, left=COL1, top=HEIGHT)
     LeftSideButtonCameraOrbit(parent=self, left=COL1, top=3 * HEIGHT)
     LeftSideButtonCameraPOV(parent=self, left=COL1, top=5 * HEIGHT)
     self.AddCargoBtn(COL2)
     LeftSideButtonTactical(parent=self, left=COL2, top=2 * HEIGHT)
     LeftSideButtonScanner(parent=self, left=COL2, top=4 * HEIGHT)
     self.autopilotBtn = LeftSideButtonAutopilot(parent=self,
                                                 left=COL2,
                                                 top=6 * HEIGHT)
     showZoomBtns = settings.user.ui.Get('showZoomBtns', 0)
     if showZoomBtns:
         LeftSideButtonZoomIn(parent=self, left=COL3, top=HEIGHT)
         LeftSideButtonZoomOut(parent=self, left=COL3, top=3 * HEIGHT)
     if IsControllingStructure():
         self.autopilotBtn.Disable()
     else:
         self.autopilotBtn.Enable()
     self.EnableAutoSize()
     self.DisableAutoSize()
Beispiel #10
0
 def MoveItemsInStructureToAssetSafetyForCharacter(self, solarSystemID,
                                                   structureID):
     if IsControllingStructure() and session.shipid == structureID:
         raise UserError('CannotPutItemsInSafetyWhileControllingStructure')
     itemsAtStructureExceptCurrentShip = [
         item for item in sm.GetService('invCache').GetInventory(
             const.containerGlobal).ListStationItems(structureID)
         if item.itemID != session.shipid
     ]
     if 0 < len(itemsAtStructureExceptCurrentShip):
         if util.IsWormholeSystem(solarSystemID):
             label = 'ConfirmAssetEjectionCharacter'
         else:
             label = 'ConfirmAssetSafetyCharacter'
         if eve.Message(label, {
                 'structureID': structureID,
                 'solarsystemID': solarSystemID
         }, uiconst.YESNO) == uiconst.ID_YES:
             sm.RemoteSvc(
                 'structureAssetSafety').MovePersonalAssetsToSafety(
                     solarSystemID, structureID)
     else:
         raise UserError('NoItemsToPutInAssetSafety')
Beispiel #11
0
 def AddCargoBtn(self, left):
     if IsControllingStructure():
         cargoClass = LeftSideButtonStructureAmmoHold
     else:
         cargoClass = LeftSideButtonCargo
     cargoClass(parent=self, left=left, top=0)
Beispiel #12
0
 def Board(self, structureID):
     if session.structureid and session.solarsystemid and structureID == session.structureid and not IsControllingStructure():
         sm.RemoteSvc('structureControl').Board(session.structureid)
 def IsControllingStructure(self):
     return IsControllingStructure()
Beispiel #14
0
 def UpdateNavigationPanel(self, multiplySpeed, typeAttributesByID):
     if not IsControllingStructure():
         self.navigationStatsParent.UpdateNavigationPanel(self.controller.GetItemID(), multiplySpeed, typeAttributesByID)