Exemple #1
0
 def __init__(self, surfacePoint, pinKv, transform):
     SpherePinStack.__init__(self, surfacePoint, RADIUS_PINEXTENDED)
     self.pinKv = pinKv
     self.transform = transform
     conflictState = eveDustPlanetSurface.GetConflictState(
         self.pinKv.conflicts)
     self.border = self.CreateSpherePin(
         textureName='res:/UI/Texture/Planet/pin_base_y.dds',
         layer=0,
         radius=RADIUS_PINEXTENDED,
         transform=transform,
         scale=SCALE_PINBASE,
         color=(0.0, 0.0, 0.0, 0.0))
     self.border.display = False
     self.mainPin = self.CreateSpherePin(
         textureName='res:/UI/Texture/Planet/pin_base.dds',
         layer=1,
         radius=RADIUS_PIN,
         transform=transform,
         scale=SCALE_PINBASE,
         color=PINSHADE[conflictState])
     self.shadow = self.CreateSpherePin(
         textureName='res:/UI/Texture/Planet/disc_shadow.dds',
         layer=0,
         radius=RADIUS_SHADOW,
         transform=transform,
         scale=SCALE_ONGROUND,
         color=(0.0, 0.0, 0.0, 0.3))
     self.SetModel(RADIUS_PIN * 1.5)
     self.AssignIDsToPins()
     self.UIContainer = None
Exemple #2
0
 def GetMenu(self):
     menu = []
     if self.pinKv.ownerID == session.corpid:
         if eveDustPlanetSurface.GetConflictState(
                 self.pinKv.conflicts) == const.objectiveStateCeasefire:
             menu.append((uiutil.MenuLabel(
                 'UI/PI/Planet/Dust/RemoveGroundInstallation'),
                          sm.GetService('planetUI').myPinManager.RemovePin,
                          [self.pinKv.id]))
             menu.append((
                 uiutil.MenuLabel('UI/PI/Planet/Dust/UpdatePlanetControl'),
                 sm.GetService('planetUI').myPinManager.UpdatePlanetControl,
                 []))
     elif eveDustPlanetSurface.GetConflictState(
             self.pinKv.conflicts,
             session.corpid) == const.objectiveStateCeasefire:
         menu.append(
             (uiutil.MenuLabel('UI/PI/Planet/Dust/AttackInstallation'),
              sm.GetService('planetUI').myPinManager.AttackPin,
              [self.pinKv.id]))
     return menu
Exemple #3
0
 def RemovePin(self, pinID):
     if pinID in self.pins:
         if eveDustPlanetSurface.GetConflictState(
                 self.pins[pinID].pinKv.conflicts
         ) != const.objectiveStateCeasefire:
             raise UserError(
                 'CustomNotify', {
                     'notify':
                     '!__ You cannot terminate a contested ground objective! Resolve the battle first you limp-dicked cockbite!'
                 })
         sm.GetService('planetBaseSvc').RemovePlanetBase(
             self.planetUISvc.planetID, pinID)
         self.pins[pinID].Remove()
         del self.pins[pinID]
Exemple #4
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.pin = attributes.Get('pin', None)
     pad = self.pad = 3
     self.main = uiprimitives.Container(parent=self,
                                        name='main',
                                        pos=(0, 0, 0, 0),
                                        padding=(pad, pad, pad, pad),
                                        state=uiconst.UI_PICKCHILDREN,
                                        align=uiconst.TOALL)
     pad = const.defaultPadding
     self.sr.footer = uiprimitives.Container(name='footer',
                                             parent=self.main,
                                             align=uiconst.TOBOTTOM,
                                             pos=(0, 0, 0, 25),
                                             padding=(pad, pad, pad, pad))
     self.sr.underlay = uicontrols.WindowUnderlay(parent=self)
     self.sr.underlay.state = uiconst.UI_DISABLED
     self.header = self._DrawAlignTopCont(18, 'headerCont')
     self.closeBtn = uicontrols.Icon(name='close',
                                     icon='ui_38_16_220',
                                     parent=self.header,
                                     pos=(0, 0, 16, 16),
                                     align=uiconst.TOPRIGHT)
     self.closeBtn.OnClick = lambda: sm.GetService(
         'planetUI').myPinManager.PinUnselected()
     self.headerText = uicontrols.EveLabelMedium(parent=self.header,
                                                 align=uiconst.CENTER,
                                                 state=uiconst.UI_NORMAL)
     self.headerText.text = evetypes.GetName(self.pin.GetTypeID())
     uiprimitives.Line(parent=self.header, align=uiconst.TOBOTTOM)
     self.content = self._DrawAlignTopCont(180,
                                           'contentCont',
                                           padding=(4, 4, 4, 4))
     iconX = 180
     itemHeight = 2
     ownerID = self.pin.GetOwnerID()
     conflictState = eveDustPlanetSurface.GetConflictState(
         self.pin.pinKv.conflicts)
     conflictText = localization.GetByLabel(STATE_NAMES[conflictState])
     self.conflictStateLabel = uicontrols.EveLabelMedium(
         parent=self.content,
         pos=(2, itemHeight, self.default_width - 10, 16))
     self.conflictStateLabel.text = localization.GetByLabel(
         'UI/PI/Planet/Dust/ConflictState', state=conflictText)
     itemHeight += 20
     if ownerID:
         self.ownerLabel = uicontrols.EveLabelMedium(parent=self.content,
                                                     pos=(2, itemHeight,
                                                          iconX, 16))
         self.ownerLabel.text = localization.GetByLabel(
             'UI/PI/Planet/Dust/DustPinOwner', player=ownerID)
         self.ownerIcon = uiprimitives.Container(parent=self.content,
                                                 pos=(iconX, itemHeight, 64,
                                                      64),
                                                 align=uiconst.RELATIVE)
         uiutil.GetLogoIcon(itemID=ownerID,
                            parent=self.ownerIcon,
                            name='ownercorplogo',
                            acceptNone=False,
                            align=uiconst.TOALL)
         itemHeight += 68
     if ownerID == session.corpid and conflictState == const.objectiveStateCeasefire:
         uicontrols.Button(
             parent=self.sr.footer,
             label=localization.GetByLabel('UI/PI/Planet/Dust/DestroyPin'),
             func=self.Terminate)
     elif ownerID != session.corpid and eveDustPlanetSurface.GetConflictState(
             self.pin.pinKv.conflicts,
             session.corpid) == const.objectiveStateCeasefire:
         uicontrols.Button(parent=self.sr.footer,
                           label=localization.GetByLabel(
                               'UI/PI/Planet/Dust/AttackInstallation'),
                           func=self.Attack)
     dw = uicore.desktop.width
     dh = uicore.desktop.height
     self.height = self.default_height
     self.width = self.default_width
     self.left = settings.user.ui.Get('planetContPositionX',
                                      (dw - self.width) / 2)
     self.top = settings.user.ui.Get('planetContPositionY',
                                     (dh - self.height) / 2)
     if self.left < 0:
         self.left = 0
     elif self.left > dw - self.width:
         self.left = dw - self.width
     if self.top < 0:
         self.top = 0
     elif self.top > dh - self.height:
         self.top = dh - self.height
     uicls.UIEffects().MorphUI(self,
                               'opacity',
                               1.0,
                               time=250.0,
                               float=1,
                               newthread=1,
                               maxSteps=100)