示例#1
0
 def Startup(self, *args):
     self.Flush()
     self.mainCont = Container(parent=self, align=uiconst.TOTOP, height=30)
     leftCont = Container(parent=self.mainCont,
                          align=uiconst.TOLEFT,
                          width=50)
     self.icon = Container(parent=leftCont,
                           align=uiconst.TOPLEFT,
                           pos=(3, 3, 32, 32))
     self.corpNameCont = Container(parent=self.mainCont,
                                   align=uiconst.TOTOP,
                                   height=17)
     label = GetByLabel('UI/Station/Lobby/CorpName')
     self.corpNameLabel = EveLabelSmall(text=label,
                                        parent=self.corpNameCont,
                                        left=5,
                                        top=2,
                                        state=uiconst.UI_DISABLED)
     self.corpNameText = EveLabelMedium(text='',
                                        parent=self.corpNameCont,
                                        left=5,
                                        state=uiconst.UI_NORMAL)
     LineThemeColored(parent=self, align=uiconst.TOBOTTOM)
     self.buttonCnt = Container(parent=self,
                                align=uiconst.TOTOP,
                                height=25,
                                state=uiconst.UI_PICKCHILDREN)
     self.buttonCnt.display = False
     self.infoicon = InfoIcon(left=32, top=3, parent=leftCont, idx=0)
示例#2
0
 def ConstructNameCaption(self):
     self.nameCaptionCont = Container(name='shipname', parent=self, align=uiconst.TOTOP, height=12, padBottom=6)
     self.nameCaption = EveLabelMedium(text='', parent=self.nameCaptionCont, width=250, autoFitToText=True, state=uiconst.UI_NORMAL)
     SetTooltipHeaderAndDescription(targetObject=self.nameCaption, headerText='', descriptionText=GetByLabel('Tooltips/FittingWindow/ShipName_description'))
     self.nameCaption.GetDragData = GetFittingDragData
     self.infolink = InfoIcon(left=0, top=0, parent=self.nameCaptionCont, idx=0)
     self.UpdateShipName()
示例#3
0
文件: dna.py 项目: connoryang/1v1dec
 def Setup(self, template = None, readonly = False):
     self.typeID = None
     self.readonly = readonly
     self.boven = uiprimitives.Container(name='ccip_top', parent=self, height=ICONSIZE, align=uiconst.TOTOP)
     self.toolbar = uiprimitives.Container(name='ccip_bar', parent=self.boven, left=ICONSIZE + 2, top=ICONSIZE - TOOLSIZE, height=TOOLSIZE, align=uiconst.TOPLEFT, width=240)
     uiprimitives.Container(name='ccip_push', parent=self, height=3, align=uiconst.TOTOP)
     cont = uiprimitives.Container(name='mainicon', parent=self.boven, width=ICONSIZE, align=uiconst.TOLEFT)
     self.infoframe = uicontrols.Frame(parent=cont)
     self.infoicon = infoicon = InfoIcon(left=1, top=1, parent=cont, idx=0, align=uiconst.TOPRIGHT, state=uiconst.UI_DISABLED)
     infoicon.OnClick = lambda *x: self.ShowInfo()
     self.icon = uicontrols.Icon(parent=cont)
     self.icon.OnClick = self.ShowInfo
     self.icon.LoadTexture('res:/UI/Texture/notavailable.dds')
     self.icon.width = self.icon.height = ICONSIZE
     uiprimitives.Container(name='ccip_push', parent=self.boven, width=6, align=uiconst.TOLEFT)
     cont = uiprimitives.Container(name='ccip_icon', parent=self.boven, align=uiconst.TOTOP, height=24)
     self.capt = uicontrols.CaptionLabel(text='', parent=cont)
     cont = uiprimitives.Container(name='ccip_textcont', parent=self.boven, align=uiconst.TOALL, pos=(0, 0, 0, 0))
     self.text = uicontrols.Label(text='', parent=cont, align=uiconst.TOTOP, height=self.boven.height, state=uiconst.UI_NORMAL)
     self.scroll = uicontrols.Scroll(name='ccip_top', parent=self)
     if template:
         self.Load(template)
     else:
         self.typeID = None
         self.capt.text = 'Copycat'
         self.text.text = 'Select a ship setup from the list to display details in this panel'
         self.scroll.Load(contentList=[], headers=['qty', 'name'])
 def ApplyAttributes(self, attributes):
     LayoutGridRow.ApplyAttributes(self, attributes)
     self.markerObject = attributes.markerObject
     self.icon = Sprite(pos=(0, 0, 16, 16),
                        texturePath=self.markerObject.texturePath,
                        state=uiconst.UI_DISABLED)
     self.AddCell(cellObject=self.icon, cellPadding=(3, 1, 4, 1))
     self.highLight = Fill(bgParent=self,
                           color=(1, 1, 1, 0.1),
                           state=uiconst.UI_HIDDEN)
     if self.markerObject.celestialData:
         labelText = cfg.evelocations.Get(
             self.markerObject.celestialData.itemID).name
         label = EveLabelSmall(text=labelText,
                               align=uiconst.CENTERLEFT,
                               width=150,
                               autoFitToText=True)
         self.AddCell(cellObject=label, cellPadding=(0, 1, 6, 1))
         infoIcon = InfoIcon(size=14,
                             align=uiconst.CENTERRIGHT,
                             itemID=self.markerObject.celestialData.itemID,
                             typeID=self.markerObject.celestialData.typeID)
         self.AddCell(cellObject=infoIcon, cellPadding=(0, 1, 1, 1))
     else:
         labelText = self.markerObject.hintString
         label = EveLabelSmall(text=labelText,
                               align=uiconst.CENTERLEFT,
                               width=150,
                               autoFitToText=True)
         self.AddCell(cellObject=label, cellPadding=(0, 1, 6, 1))
         self.FillRow()
示例#5
0
 def LoadLogo(self, corporationID):
     if self is None or self.destroyed:
         return
     loc = getattr(self, 'logoContainer', None)
     if loc is not None:
         uix.Flush(loc)
         uiutil.GetLogoIcon(itemID=corporationID,
                            parent=loc,
                            align=uiconst.RELATIVE,
                            name='logo',
                            state=uiconst.UI_NORMAL,
                            left=12,
                            top=3,
                            idx=0,
                            size=48,
                            ignoreSize=True)
     loc = getattr(self, 'captionContainer', None)
     if loc is not None:
         uix.Flush(loc)
         caption = uicontrols.CaptionLabel(text=localization.GetByLabel(
             'UI/Corporations/CorpUIHome/CorpNamePlaceholder',
             corpName=cfg.eveowners.Get(eve.session.corpid).ownerName),
                                           parent=loc,
                                           align=uiconst.RELATIVE,
                                           uppercase=False)
         caption.left = 0
         infoicon = InfoIcon(typeID=const.typeCorporation,
                             itemID=corporationID,
                             parent=loc,
                             left=caption.width + 4,
                             top=3,
                             state=uiconst.UI_NORMAL)
 def Startup(self, *args):
     self.sr.main = uiprimitives.Container(name='main',
                                           parent=self,
                                           align=uiconst.TOALL,
                                           pos=(0, 0, 0, 0),
                                           padding=(0, 0, 0, 0))
     self.sr.main.OnDropData = self.OnDropData
     self.sr.icons = uiprimitives.Container(name='icons',
                                            parent=self.sr.main,
                                            align=uiconst.TOLEFT,
                                            pos=(0, 0, 40, 0),
                                            padding=(1, 0, 2, 0))
     self.sr.textstuff = uiprimitives.Container(name='textstuff',
                                                parent=self.sr.main,
                                                align=uiconst.TOALL,
                                                pos=(0, 0, 0, 0),
                                                padding=(0, 0, 0, 0))
     self.sr.infoIcons = uiprimitives.Container(name='textstuff',
                                                parent=self.sr.main,
                                                align=uiconst.TORIGHT,
                                                pos=(0, 0, 20, 0),
                                                padding=(0, 0, 0, 0))
     self.sr.status = uiprimitives.Container(name='status',
                                             parent=self.sr.icons,
                                             align=uiconst.TOLEFT,
                                             pos=(0, 0, 18, 0),
                                             padding=(0, 0, 0, 0))
     self.sr.icon = uiprimitives.Container(name='icon',
                                           parent=self.sr.icons,
                                           align=uiconst.TOALL,
                                           pos=(0, 0, 0, 0),
                                           padding=(0, 0, 0, 0))
     self.sr.name = uiprimitives.Container(name='name',
                                           parent=self.sr.textstuff,
                                           align=uiconst.TOTOP,
                                           pos=(0, 0, 0, 16),
                                           padding=(0, 0, 0, 0))
     self.sr.level = uiprimitives.Container(name='level',
                                            parent=self.sr.textstuff,
                                            align=uiconst.TOALL,
                                            pos=(0, 0, 0, 0),
                                            padding=(0, 0, 0, 0))
     self.sr.nameLabel = uicontrols.EveLabelMedium(
         text='',
         parent=self.sr.name,
         align=uiconst.TOPLEFT,
         state=uiconst.UI_DISABLED,
         maxLines=1)
     self.sr.levelLabel = uicontrols.EveLabelMedium(
         text='',
         parent=self.sr.level,
         align=uiconst.TOPLEFT,
         state=uiconst.UI_DISABLED,
         maxLines=1)
     self.sr.infoicon = InfoIcon(parent=self.sr.infoIcons,
                                 idx=0,
                                 align=uiconst.CENTERRIGHT,
                                 name='infoicon')
     self.sr.infoicon.OnClick = self.ShowInfo
示例#7
0
 def AddInfoIcon(self,
                 typeID=None,
                 itemID=None,
                 align=uiconst.TOPRIGHT,
                 **keywords):
     infoIcon = InfoIcon(typeID=typeID,
                         itemID=itemID,
                         align=align,
                         left=0,
                         top=0)
     self.AddCell(infoIcon, **keywords)
     return infoIcon
示例#8
0
 def LoadOwnerInfo(self):
     parent = self.corpLogoParent
     parent.Flush()
     corpID = eve.stationItem.ownerID
     size = 128 if CheckCorpID(corpID) else 64
     logo = GetLogoIcon(itemID=corpID, parent=parent, acceptNone=False, state=uiconst.UI_DISABLED, pos=(0,
      8,
      size,
      size), align=uiconst.CENTERTOP)
     InfoIcon(typeID=const.typeCorporation, itemID=corpID, left=const.defaultPadding, top=20, align=uiconst.TOPRIGHT, parent=parent, idx=0)
     self.corpLogoParent.height = logo.top + logo.height
     if not CheckCorpID(corpID):
         self.corpName.text = '<center>' + cfg.eveowners.Get(corpID).name
         self.corpName.display = True
     else:
         self.corpName.display = False
示例#9
0
 def Layout(self):
     RaisedUnderlay(bgParent=self)
     topCont = ContainerAutoSize(parent=self,
                                 align=uiconst.TOTOP,
                                 alignMode=uiconst.TOPLEFT,
                                 top=4)
     Icon(parent=topCont,
          align=uiconst.TOPLEFT,
          top=4,
          left=4,
          typeID=invconst.typeSkillInjector,
          size=32,
          state=uiconst.UI_DISABLED)
     EveLabelMedium(parent=topCont,
                    align=uiconst.TOPLEFT,
                    top=4,
                    left=40,
                    text=evetypes.GetName(invconst.typeSkillInjector))
     self.priceLabel = EveLabelMedium(parent=topCont,
                                      align=uiconst.TOPLEFT,
                                      top=18,
                                      left=40,
                                      color=Color.GRAY4)
     InfoIcon(parent=topCont,
              align=uiconst.CENTERRIGHT,
              left=4,
              typeID=invconst.typeSkillInjector)
     ShowMarketDetailsButton(parent=topCont,
                             align=uiconst.CENTERRIGHT,
                             left=24,
                             width=16,
                             height=16,
                             typeID=invconst.typeSkillInjector)
     textCont = ContainerAutoSize(parent=self,
                                  align=uiconst.TOTOP,
                                  alignMode=uiconst.TOTOP,
                                  padding=(8, 4, 8, 4))
     self.mainLabel = EveLabelMedium(parent=textCont, align=uiconst.TOTOP)
     bottomCont = ContainerAutoSize(parent=self,
                                    align=uiconst.TOTOP,
                                    padding=(0, 0, 4, 4))
     Button(parent=bottomCont,
            align=uiconst.TOPRIGHT,
            label=localization.GetByLabel('UI/SkillTrading/Dismiss'),
            func=self.Dismiss)
示例#10
0
 def Startup(self, *args):
     self.Flush()
     main = Container(parent=self, align=uiconst.TOTOP, height=30, state=uiconst.UI_PICKCHILDREN)
     left = Container(parent=main, align=uiconst.TOLEFT, width=50, state=uiconst.UI_PICKCHILDREN)
     icon = Container(parent=left, align=uiconst.TOPLEFT, width=32, height=32, left=3, top=3, state=uiconst.UI_PICKCHILDREN)
     par = Container(parent=main, align=uiconst.TOTOP, height=17, state=uiconst.UI_PICKCHILDREN)
     label = localization.GetByLabel('UI/Station/Lobby/CorpName')
     fieldName = 'corpName'
     l = EveLabelSmall(text=label, parent=par, left=5, top=2, state=uiconst.UI_DISABLED)
     t = EveLabelMedium(text='', parent=par, left=5, state=uiconst.UI_NORMAL)
     setattr(self.sr, fieldName + '_Label', l)
     setattr(self.sr, fieldName + '_Text', t)
     setattr(self.sr, fieldName, par)
     LineThemeColored(parent=self, align=uiconst.TOBOTTOM)
     self.sr.buttonCnt = Container(parent=self, align=uiconst.TOTOP, height=25, state=uiconst.UI_HIDDEN)
     self.sr.icon = icon
     self.sr.main = main
     self.sr.infoicon = InfoIcon(left=32, top=3, parent=left, idx=0)
示例#11
0
 def Startup(self, *args):
     self.sr.label = uicontrols.EveLabelMedium(text='',
                                               parent=self,
                                               left=5,
                                               state=uiconst.UI_DISABLED,
                                               maxLines=1)
     self.sr.infoicon = InfoIcon(left=0,
                                 parent=self,
                                 idx=0,
                                 align=uiconst.CENTERRIGHT)
     self.sr.infoicon.OnClick = self.ShowInfo
     self.sr.icon = uiprimitives.Container(parent=self,
                                           width=24,
                                           height=24,
                                           left=2,
                                           top=1,
                                           align=uiconst.TOPLEFT)
     self.sr.events = ('OnClick', 'OnMouseDown', 'OnMouseUp', 'OnDblClick',
                       'OnMouseHover')
     for eventName in self.sr.events:
         setattr(self.sr, eventName, None)
示例#12
0
 def Layout(self):
     self.compactMode = False
     Frame(bgParent=self,
           texturePath='res:/UI/Texture/classes/Monetization/vignette.png',
           cornerSize=150)
     self.characters = Sprite(
         parent=self,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         left=self.CHARACTERS_LEFT,
         top=10,
         texturePath='res:/UI/Texture/classes/Monetization/characters.png',
         width=299,
         height=355)
     self.content = ContainerAutoSize(parent=self,
                                      align=uiconst.CENTER,
                                      left=self.CONTENT_LEFT,
                                      width=340)
     EveCaptionLarge(
         parent=self.content,
         align=uiconst.TOTOP,
         text=localization.GetByLabel(
             'UI/SkillQueue/MultiTrainingOverlay/MultiplePilotTraining'))
     EveLabelMedium(
         parent=self.content,
         align=uiconst.TOTOP,
         top=4,
         text=localization.GetByLabel(
             'UI/SkillQueue/MultiTrainingOverlay/MultiTrainingMessageTop'))
     itemCont = ContainerAutoSize(parent=self.content,
                                  align=uiconst.TOTOP,
                                  alignMode=uiconst.TOTOP,
                                  top=12)
     Frame(bgParent=itemCont,
           texturePath=
           'res:/UI/Texture/classes/Monetization/item_well_frame.png',
           cornerSize=2)
     itemIconCont = ContainerAutoSize(parent=itemCont,
                                      align=uiconst.TOLEFT,
                                      padding=(8, 8, 0, 8))
     Icon(parent=itemIconCont,
          align=uiconst.TOPLEFT,
          state=uiconst.UI_DISABLED,
          size=64,
          typeID=typeMultiTrainingToken)
     Sprite(parent=itemIconCont,
            align=uiconst.TOPLEFT,
            state=uiconst.UI_DISABLED,
            texturePath='res:/UI/Texture/classes/InvItem/bgNormal.png',
            width=64,
            height=64)
     EveLabelLargeBold(parent=itemCont,
                       align=uiconst.TOTOP,
                       padding=(8, 8, 24, 0),
                       text=evetypes.GetName(typeMultiTrainingToken))
     InfoIcon(parent=itemCont,
              align=uiconst.TOPRIGHT,
              top=8,
              left=8,
              typeID=typeMultiTrainingToken)
     self.estimatePriceLabel = EveLabelMedium(parent=itemCont,
                                              align=uiconst.TOTOP,
                                              padding=(8, 0, 8, 6),
                                              color=Color.GRAY5)
     buyButtonCont = FlowContainer(parent=itemCont,
                                   align=uiconst.TOTOP,
                                   padding=(8, 0, 8, 8),
                                   contentSpacing=(8, 0))
     MultiTrainingBuyButtonIsk(parent=buyButtonCont,
                               align=uiconst.NOALIGN,
                               typeID=typeMultiTrainingToken)
     MultiTrainingBuyButtonAur(parent=buyButtonCont,
                               align=uiconst.NOALIGN,
                               types=[typeMultiTrainingToken])
     EveLabelMedium(
         parent=self.content,
         align=uiconst.TOTOP,
         top=12,
         text=localization.GetByLabel(
             'UI/SkillQueue/MultiTrainingOverlay/MultiTrainingMessageBottom'
         ))
     dismissCont = FlowContainer(parent=self.content,
                                 align=uiconst.TOTOP,
                                 padding=(8, 24, 8, 0),
                                 contentAlignment=CONTENT_ALIGN_CENTER,
                                 contentSpacing=(8, 4))
     Button(parent=dismissCont,
            align=uiconst.NOALIGN,
            label=localization.GetByLabel(
                'UI/SkillQueue/MultiTrainingOverlay/Dismiss'),
            func=lambda *args: self.Dismiss())
     self.suppressCheckbox = Checkbox(
         parent=dismissCont,
         align=uiconst.NOALIGN,
         width=200,
         text=localization.GetByLabel('UI/Common/SuppressionShowMessage'),
         checked=self.suppressed,
         callback=self.OnSuppressChanged)
示例#13
0
    def DrawRightSide(self):
        self.sr.rightside = uiprimitives.Container(name='rightside', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        a = uiprimitives.Container(name='push', parent=self.sr.rightside, align=uiconst.TOTOP, height=6)
        self.sr.rightMainPanel = uiprimitives.Container(name='rightMainPanel', parent=self.sr.rightside, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        topParent = uiprimitives.Container(parent=self.sr.rightMainPanel, align=uiconst.TOTOP, height=80)
        topLeftParent = uiprimitives.Container(parent=topParent, align=uiconst.TOLEFT, width=70)
        topRightParent = uiprimitives.Container(parent=topParent, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        bottomParent = uiprimitives.Container(parent=self.sr.rightMainPanel, align=uiconst.TOALL, pos=(0, 0, 0, 0))
        uiprimitives.Container(name='push', parent=bottomParent, align=uiconst.TOTOP, height=const.defaultPadding)
        uiprimitives.Container(name='push', parent=bottomParent, align=uiconst.TOBOTTOM, height=const.defaultPadding)
        uiprimitives.Container(name='push', parent=bottomParent, align=uiconst.TOLEFT, width=const.defaultPadding)
        uiprimitives.Container(name='push', parent=bottomParent, align=uiconst.TORIGHT, width=const.defaultPadding)
        self.sr.shipIcon = uicontrols.Icon(parent=topParent, state=uiconst.UI_HIDDEN, size=64, left=const.defaultPadding, ignoreSize=True)
        self.sr.techicon = uiprimitives.Sprite(name='techIcon', parent=topParent, align=uiconst.RELATIVE, left=const.defaultPadding, width=16, height=16, idx=0)
        self.sr.dragIcon = dragIcon = FittingDraggableIcon(name='theicon', align=uiconst.TOPLEFT, parent=topParent, height=64, width=64, top=const.defaultPadding, left=const.defaultPadding)
        dragIcon.Startup(self.fitting)
        dragIcon.hint = localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/FittingIconHint')
        dragIcon.OnClick = self.ClickDragIcon
        dragIcon.state = uiconst.UI_NORMAL
        fittingNameContainer = uiprimitives.Container(parent=topRightParent, align=uiconst.TOTOP, height=20)
        self.sr.fittingName = uicontrols.SinglelineEdit(name='fittingName', parent=fittingNameContainer, align=uiconst.TOPLEFT, pos=(const.defaultPadding,
         1,
         120,
         0), maxLength=40)
        shipInfoContainer = uiprimitives.Container(parent=topRightParent, align=uiconst.TOTOP, height=20)
        self.sr.shipTypeName = uicontrols.EveLabelMedium(text='', parent=shipInfoContainer, align=uiconst.RELATIVE, state=uiconst.UI_NORMAL, left=const.defaultPadding)
        self.sr.infoicon = InfoIcon(parent=shipInfoContainer, left=1, top=0, idx=0, state=uiconst.UI_HIDDEN)
        self.sr.infoicon.OnClick = self.ShowInfo
        self.sr.radioButton = uiprimitives.Container(name='', parent=topRightParent, align=uiconst.TOPLEFT, height=50, width=100, top=fittingNameContainer.height + shipInfoContainer.height)
        radioBtns = []
        for cfgname, value, label, checked, group in [['fittingNone',
          session.charid,
          localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Personal'),
          self.ownerID == None,
          'ownership'], ['fittingOwnerCorporation',
          session.corpid,
          localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Corporation'),
          self.ownerID == session.corpid,
          'ownership']]:
            radioBtns.append(uicontrols.Checkbox(text=label, parent=self.sr.radioButton, configName=cfgname, retval=value, checked=checked, groupname=group, callback=None))

        self.sr.radioButtons = radioBtns
        self.sr.fittingDescription = uicls.EditPlainText(setvalue=None, parent=bottomParent, align=uiconst.TOALL, maxLength=400)
        self.sr.fittingInfo = uicontrols.Scroll(name='fittingInfoScroll', parent=bottomParent)
        tabs = [[localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Fittings'),
          self.sr.fittingInfo,
          self,
          None,
          self.sr.fittingInfo], [localization.GetByLabel('UI/Common/Description'),
          self.sr.fittingDescription,
          self,
          None,
          self.sr.fittingDescription]]
        self.fittingInfoTab = uicontrols.TabGroup(name='tabparent', parent=bottomParent, idx=0)
        self.fittingInfoTab.Startup(tabs, 'fittingInfoTab')
        self.sr.fittingInfo.Startup()
        saveDeleteButtons = FlowContainer(name='buttonParent', parent=self.sr.rightside, align=uiconst.TOBOTTOM, padding=6, autoHeight=True, centerContent=True, contentSpacing=uiconst.BUTTONGROUPMARGIN, idx=0)
        self.fitBtn = Button(parent=saveDeleteButtons, label=localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/Fit'), func=self.Fit, align=uiconst.NOALIGN)
        self.saveBtn = Button(parent=saveDeleteButtons, label=localization.GetByLabel('UI/Common/Buttons/Save'), func=self.Save, align=uiconst.NOALIGN)
        self.deleteBtn = Button(parent=saveDeleteButtons, label=localization.GetByLabel('UI/Common/Buttons/Delete'), func=self.Delete, align=uiconst.NOALIGN)
        if boot.region != 'optic':
            self.exportBtn = Button(parent=saveDeleteButtons, label=localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/ExportToClipboard'), func=self.ExportFittingToClipboard, align=uiconst.NOALIGN)
            self.exportBtn.hint = localization.GetByLabel('UI/Fitting/FittingWindow/FittingManagement/ExportToClipboardHint')
示例#14
0
 def _PrepareProductLabel(self):
     labelCont = LayoutGrid(align=uiconst.CENTERLEFT, columns=2)
     VgsLabelSmall(parent=labelCont, padding=(8, 0, 4, 0), text=localization.GetByLabel('UI/Contracts/ContractsWindow/TypeNameWithQuantity', typeID=self.typeID, quantity=self.quantity))
     InfoIcon(parent=labelCont, align=uiconst.CENTERLEFT, typeID=self.typeID, abstractinfo=self._GetAbstractInfo())
     return labelCont
示例#15
0
    def Draw(self):
        self.sr.main.Flush()
        if IsModularShip(self.fitting.shipTypeID):
            self.sr.headerIcon.display = False
            self.sr.caption.left = 8
        else:
            self.sr.headerIcon.display = True
            self.sr.caption.left = 20
        uiprimitives.Container(name='push',
                               parent=self.sr.main,
                               align=uiconst.TOTOP,
                               height=6)
        topParent = uiprimitives.Container(parent=self.sr.main,
                                           align=uiconst.TOTOP,
                                           height=100)
        topLeftParent = uiprimitives.Container(parent=topParent,
                                               align=uiconst.TOLEFT,
                                               width=70)
        topRightParent = uiprimitives.Container(parent=topParent,
                                                align=uiconst.TOALL,
                                                pos=(0, 0, 0, 0))
        bottomParent = uiprimitives.Container(parent=self.sr.main,
                                              align=uiconst.TOALL,
                                              pos=(0, 0, 0, 0))
        uiprimitives.Container(name='push',
                               parent=bottomParent,
                               align=uiconst.TOTOP,
                               height=const.defaultPadding)
        uiprimitives.Container(name='push',
                               parent=bottomParent,
                               align=uiconst.TOBOTTOM,
                               height=const.defaultPadding)
        uiprimitives.Container(name='push',
                               parent=bottomParent,
                               align=uiconst.TOLEFT,
                               width=const.defaultPadding)
        uiprimitives.Container(name='push',
                               parent=bottomParent,
                               align=uiconst.TORIGHT,
                               width=const.defaultPadding)
        self.sr.shipIcon = uicontrols.Icon(parent=topParent,
                                           state=uiconst.UI_HIDDEN,
                                           size=64,
                                           left=const.defaultPadding,
                                           typeID=self.fitting.shipTypeID,
                                           ignoreSize=True)
        self.sr.techicon = uiprimitives.Sprite(name='techIcon',
                                               parent=topParent,
                                               align=uiconst.RELATIVE,
                                               left=const.defaultPadding,
                                               width=16,
                                               height=16,
                                               idx=0)
        uix.GetTechLevelIcon(self.sr.techicon, 0, self.fitting.shipTypeID)
        dragIcon = FittingDraggableIcon(name='theicon',
                                        align=uiconst.TOPLEFT,
                                        parent=topParent,
                                        height=64,
                                        width=64,
                                        top=const.defaultPadding,
                                        left=const.defaultPadding)
        dragIcon.Startup(self.fitting)
        dragIcon.hint = localization.GetByLabel(
            'UI/Fitting/FittingWindow/FittingManagement/FittingIconHint')
        dragIcon.OnClick = self.ClickDragIcon
        dragIcon.state = uiconst.UI_NORMAL
        self.sr.shipIcon.state = uiconst.UI_DISABLED
        fittingNameContainer = uiprimitives.Container(parent=topRightParent,
                                                      align=uiconst.TOTOP,
                                                      height=20)
        self.sr.fittingName = uicontrols.SinglelineEdit(
            name='fittingName',
            parent=fittingNameContainer,
            align=uiconst.TOPLEFT,
            pos=(const.defaultPadding, 1, 160, 0),
            maxLength=40)
        self.sr.fittingName.SetText(self.fitting.name)
        cbText = localization.GetByLabel(
            'UI/Fitting/FittingWindow/FittingManagement/UseFittingNameForShip')
        nameCbChecked = settings.user.ui.Get('useFittingNameForShips', 0)
        self.useNameCheckBox = uicontrols.Checkbox(
            text=cbText,
            parent=topRightParent,
            align=uiconst.TOTOP,
            left=3,
            checked=nameCbChecked,
            prefstype=('user', 'ui'),
            configName='useFittingNameForShips')
        if self.truncated:
            uicontrols.EveLabelMedium(text=localization.GetByLabel(
                'UI/Fitting/FittingWindow/FittingManagement/Truncated'),
                                      parent=fittingNameContainer,
                                      left=self.sr.fittingName.width + 10,
                                      top=3,
                                      width=60,
                                      height=20,
                                      state=uiconst.UI_NORMAL)
        shipInfoContainer = uiprimitives.Container(parent=topRightParent,
                                                   align=uiconst.TOTOP,
                                                   height=20)
        shipName = evetypes.GetName(self.fitting.shipTypeID)
        self.sr.shipName = uicontrols.EveLabelMedium(text=shipName,
                                                     parent=shipInfoContainer,
                                                     align=uiconst.RELATIVE,
                                                     state=uiconst.UI_NORMAL,
                                                     left=const.defaultPadding)
        self.sr.infoicon = InfoIcon(parent=shipInfoContainer,
                                    left=1,
                                    top=0,
                                    idx=0)
        self.sr.infoicon.OnClick = self.ShowInfo
        self.sr.infoicon.left = self.sr.shipName.textwidth + 6
        topPadding = fittingNameContainer.height + shipInfoContainer.height + self.useNameCheckBox.height + 5
        self.sr.radioButton = uiprimitives.Container(name='',
                                                     parent=topRightParent,
                                                     align=uiconst.TOPLEFT,
                                                     height=50,
                                                     width=100,
                                                     top=topPadding)
        radioBtns = []
        for cfgname, value, label, checked, group in [
            [
                'fittingNone', session.charid,
                localization.GetByLabel(
                    'UI/Fitting/FittingWindow/FittingManagement/Personal'),
                True, 'ownership'
            ],
            [
                'fittingOwnerCorporation', session.corpid,
                localization.GetByLabel(
                    'UI/Fitting/FittingWindow/FittingManagement/Corporation'),
                False, 'ownership'
            ]
        ]:
            radioBtns.append(
                uicontrols.Checkbox(text=label,
                                    parent=self.sr.radioButton,
                                    configName=cfgname,
                                    retval=value,
                                    checked=checked,
                                    groupname=group,
                                    callback=None))

        self.sr.radioButtons = radioBtns
        self.sr.fittingDescription = uicls.EditPlainText(parent=bottomParent,
                                                         align=uiconst.TOALL,
                                                         maxLength=400)
        self.sr.fittingDescription.SetText(self.fitting.description)
        self.sr.fittingInfo = uicontrols.Scroll(name='fittingInfoScroll',
                                                parent=bottomParent)
        scrolllist = self.fittingSvc.GetFittingInfoScrollList(self.fitting)
        self.sr.fittingInfo.Load(contentList=scrolllist)
        tabs = [[
            localization.GetByLabel(
                'UI/Fitting/FittingWindow/FittingManagement/Fittings'),
            self.sr.fittingInfo, self, None, self.sr.fittingInfo
        ],
                [
                    localization.GetByLabel('UI/Common/Description'),
                    self.sr.fittingDescription, self, None,
                    self.sr.fittingDescription
                ]]
        self.fittingInfoTab = uicontrols.TabGroup(name='tabparent',
                                                  parent=bottomParent,
                                                  idx=0)
        self.fittingInfoTab.Startup(tabs, 'fittingInfoTab')
        saveDeleteButtons = FlowContainer(
            name='buttonParent',
            parent=self.sr.main,
            align=uiconst.TOBOTTOM,
            padding=6,
            autoHeight=True,
            centerContent=True,
            contentSpacing=uiconst.BUTTONGROUPMARGIN,
            idx=0)
        self.fitBtn = Button(
            parent=saveDeleteButtons,
            label=localization.GetByLabel(
                'UI/Fitting/FittingWindow/FittingManagement/Fit'),
            func=self.Fit,
            align=uiconst.NOALIGN)
        self.saveBtn = Button(
            parent=saveDeleteButtons,
            label=localization.GetByLabel('UI/Common/Buttons/Save'),
            func=self.Save,
            align=uiconst.NOALIGN)
        if boot.region != 'optic':
            if sm.GetService('fittingSvc').IsGhostFittingEnabled():
                self.simulateButton = Button(
                    parent=saveDeleteButtons,
                    label=localization.GetByLabel(
                        'UI/Fitting/FittingWindow/Simulate'),
                    func=self.SimulateFitting,
                    align=uiconst.NOALIGN)
            self.exportBtn = Button(
                parent=saveDeleteButtons,
                label=localization.GetByLabel(
                    'UI/Fitting/FittingWindow/FittingManagement/ExportToClipboard'
                ),
                func=self.ExportFittingToClipboard,
                align=uiconst.NOALIGN)
            self.exportBtn.hint = localization.GetByLabel(
                'UI/Fitting/FittingWindow/FittingManagement/ExportToClipboardHint'
            )
            from shipfitting.multiBuyUtil import AddBuyButton
            AddBuyButton(parent=saveDeleteButtons, fittingMgmtWnd=self)
示例#16
0
    def Startup(self, *args):
        sub = uiprimitives.Container(name='sub', parent=self)
        self.sr.inTrainingHilite = uiprimitives.Fill(parent=self,
                                                     name='inTrainingHilite',
                                                     padTop=1,
                                                     padBottom=1,
                                                     color=self.blueColor,
                                                     state=uiconst.UI_HIDDEN)
        self.sr.inTrainingHilite.SetAlpha(0.15)
        self.sr.icon = uicontrols.Icon(name='skillIcon',
                                       parent=sub,
                                       align=uiconst.TOPLEFT,
                                       top=2,
                                       size=32,
                                       width=32,
                                       height=32,
                                       ignoreSize=True)
        self.sr.icon.state = uiconst.UI_DISABLED
        self.sr.haveicon = uicontrols.Icon(name='haveIcon',
                                           parent=sub,
                                           size=16,
                                           left=20,
                                           align=uiconst.TOPRIGHT,
                                           state=uiconst.UI_HIDDEN)
        self.sr.levelParent = uiprimitives.Container(name='levelParent',
                                                     parent=sub,
                                                     align=uiconst.TORIGHT,
                                                     state=uiconst.UI_DISABLED,
                                                     padRight=18)
        self.sr.levelHeaderParent = uiprimitives.Container(
            name='levelHeaderParent',
            parent=sub,
            align=uiconst.TORIGHT,
            state=uiconst.UI_HIDDEN)
        self.sr.levels = uiprimitives.Container(name='levels',
                                                parent=self.sr.levelParent,
                                                align=uiconst.TOPLEFT,
                                                left=0,
                                                top=5,
                                                width=48,
                                                height=10)
        uicontrols.Frame(parent=self.sr.levels, color=self.whiteColor)
        for i in xrange(5):
            f = uiprimitives.Fill(parent=self.sr.levels,
                                  name='level%d' % i,
                                  align=uiconst.RELATIVE,
                                  color=(1.0, 1.0, 1.0, 0.5),
                                  left=2 + i * 9,
                                  top=2,
                                  width=8,
                                  height=6)
            setattr(self.sr, 'box_%s' % i, f)

        self.sr.progressbarparent = uiprimitives.Container(
            name='progressbarparent',
            parent=self.sr.levelParent,
            align=uiconst.TOPLEFT,
            left=0,
            top=20,
            width=48,
            height=6)
        self.sr.progressBar = uiprimitives.Fill(
            parent=self.sr.progressbarparent,
            name='progressbar',
            align=uiconst.RELATIVE,
            color=self.whiteColor,
            height=4,
            top=1,
            left=1,
            state=uiconst.UI_HIDDEN)
        uicontrols.Frame(parent=self.sr.progressbarparent)
        self.sr.levelHeader1 = uicontrols.EveLabelSmall(
            text='',
            parent=self.sr.levelHeaderParent,
            left=10,
            top=3,
            state=uiconst.UI_DISABLED,
            idx=0,
            align=uiconst.TOPRIGHT)
        self.sr.levelHeader1.name = 'levelHeader1'
        textCont = uiprimitives.Container(name='textCont',
                                          parent=sub,
                                          align=uiconst.TOALL,
                                          padLeft=32,
                                          clipChildren=1)
        self.sr.nameLevelLabel = uicontrols.EveLabelMedium(
            text='',
            parent=textCont,
            left=0,
            top=0,
            state=uiconst.UI_DISABLED,
            maxLines=1)
        self.sr.nameLevelLabel.name = 'nameLevelLabel'
        self.sr.pointsLabel = uicontrols.EveLabelMedium(
            text='',
            parent=textCont,
            left=0,
            top=16,
            state=uiconst.UI_DISABLED,
            maxLines=1)
        self.sr.pointsLabel.name = 'pointsLabel'
        self.sr.timeLeftText = uicontrols.EveHeaderSmall(
            text='',
            parent=self.sr.levelHeaderParent,
            left=10,
            top=17,
            state=uiconst.UI_DISABLED,
            idx=0,
            align=uiconst.TOPRIGHT)
        self.sr.timeLeftText.name = 'timeLeftText'
        self.sr.infoicon = InfoIcon(left=2,
                                    parent=sub,
                                    idx=0,
                                    name='infoicon',
                                    align=uiconst.CENTERRIGHT)
        self.sr.infoicon.OnClick = self.ShowInfo
        self.endOfTraining = None
示例#17
0
class OfficeEntry(SE_BaseClassCore):
    __guid__ = 'listentry.OfficeEntry'

    def Startup(self, *args):
        self.Flush()
        self.mainCont = Container(parent=self, align=uiconst.TOTOP, height=30)
        leftCont = Container(parent=self.mainCont,
                             align=uiconst.TOLEFT,
                             width=50)
        self.icon = Container(parent=leftCont,
                              align=uiconst.TOPLEFT,
                              pos=(3, 3, 32, 32))
        self.corpNameCont = Container(parent=self.mainCont,
                                      align=uiconst.TOTOP,
                                      height=17)
        label = GetByLabel('UI/Station/Lobby/CorpName')
        self.corpNameLabel = EveLabelSmall(text=label,
                                           parent=self.corpNameCont,
                                           left=5,
                                           top=2,
                                           state=uiconst.UI_DISABLED)
        self.corpNameText = EveLabelMedium(text='',
                                           parent=self.corpNameCont,
                                           left=5,
                                           state=uiconst.UI_NORMAL)
        LineThemeColored(parent=self, align=uiconst.TOBOTTOM)
        self.buttonCnt = Container(parent=self,
                                   align=uiconst.TOTOP,
                                   height=25,
                                   state=uiconst.UI_PICKCHILDREN)
        self.buttonCnt.display = False
        self.infoicon = InfoIcon(left=32, top=3, parent=leftCont, idx=0)

    def Load(self, node):
        self.sr.node = node
        data = node
        self.infoicon.UpdateInfoLink(const.typeCorporation, data.corpID)
        mainHeight = 0
        corpName = data.Get('corpName', '')
        self.corpNameText.text = corpName
        self.corpNameText.top = self.corpNameLabel.textheight
        self.corpNameCont.height = self.corpNameText.top + self.corpNameText.textheight + 2
        if self.corpNameCont.display:
            mainHeight += self.corpNameCont.height
        self.mainCont.height = mainHeight + 10
        self.icon.Flush()

        def LogoThread():
            if not self.destroyed:
                GetLogoIcon(itemID=data.corpID,
                            parent=self.icon,
                            acceptNone=False,
                            align=uiconst.TOALL)

        uthread.new(LogoThread)
        self.buttonCnt.Flush()
        if not IsNPC(node.corpID):
            buttonEntries = []
            if session.corpid != node.corpID:
                if sm.GetService('corp').GetActiveApplication(
                        node.corpID) is not None:
                    applyLabel = GetByLabel(
                        'UI/Corporations/CorpApplications/ViewApplication')
                else:
                    applyLabel = GetByLabel(
                        'UI/Corporations/CorporationWindow/Alliances/Rankings/ApplyToJoin'
                    )
                buttonEntries.append(
                    (applyLabel, sm.GetService('corp').ApplyForMembership,
                     (node.corpID, ), 80))
            self.buttonCnt.display = True
            if len(buttonEntries) > 0:
                self.buttonsGroup = ButtonGroup(btns=buttonEntries,
                                                parent=self.buttonCnt,
                                                unisize=0,
                                                line=0)
                self.buttonsGroup.top -= 1
        else:
            self.buttonCnt.display = False

    def GetHeight(self, *args):
        node, width = args
        lw, lh = EveLabelSmall.MeasureTextSize(
            text=GetByLabel('UI/Station/Lobby/CorpName'))
        tw, th = EveLabelMedium.MeasureTextSize(text=node.corpName)
        multiplier = 1
        height = 2
        height += (lh + th + 15) * multiplier
        height += 5
        if not IsNPC(node.corpID) and session.corpid != node.corpID:
            height += 30
        node.height = height
        return node.height
示例#18
0
 def ConstructLayout(self):
     if self.isConstructed:
         return
     self.isConstructed = True
     scrollContainer = ScrollContainer(name='plexScroll',
                                       parent=self,
                                       align=uiconst.TOALL,
                                       padding=(10, 10, 10, 10))
     EveLabelLargeBold(
         parent=scrollContainer,
         align=uiconst.TOTOP,
         text=GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/PlexTitle'
         ),
         padding=(10, 10, 0, 0))
     EveLabelMedium(
         parent=scrollContainer,
         align=uiconst.TOTOP,
         text=GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/PlexDescription'
         ),
         padding=(10, 2, 0, 10),
         color=Color.GRAY5)
     subscription = ContainerAutoSize(parent=scrollContainer,
                                      align=uiconst.TOTOP,
                                      alignMode=uiconst.TOTOP,
                                      state=uiconst.UI_PICKCHILDREN,
                                      bgColor=(0, 0, 0, 0.3))
     self.plexSubscriptionLabel = EveLabelMedium(parent=subscription,
                                                 align=uiconst.TOTOP,
                                                 text='',
                                                 padding=(75, 15, 0, 15))
     InfoIcon(parent=subscription,
              typeID=const.typePilotLicence,
              pos=(10, 2, 55, 55),
              texturePath='res:/UI/Texture/Icons/plex.png',
              iconOpacity=1.0)
     InfoIcon(parent=subscription,
              align=uiconst.TOPRIGHT,
              typeID=const.typePilotLicence,
              top=10,
              left=10)
     EveLabelLargeBold(
         parent=scrollContainer,
         align=uiconst.TOTOP,
         text=GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/BuyingPlexTitle'
         ),
         padding=(10, 10, 0, 0))
     EveLabelMedium(
         parent=scrollContainer,
         align=uiconst.TOTOP,
         text=GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/BuyingPlexDescription'
         ),
         padding=(10, 2, 0, 10),
         color=Color.GRAY5)
     buyButtons = FlowContainer(parent=scrollContainer,
                                align=uiconst.TOTOP,
                                contentAlignment=CONTENT_ALIGN_CENTER,
                                contentSpacing=(8, 0))
     BuyButtonIsk(parent=buyButtons,
                  align=uiconst.NOALIGN,
                  typeID=const.typePilotLicence)
     BuyButtonPlex(parent=buyButtons,
                   align=uiconst.NOALIGN,
                   logContext='CharacterSheet')
     EveLabelLargeBold(
         parent=scrollContainer,
         align=uiconst.TOTOP,
         text=GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/MultipleCharacterTitle'
         ),
         padding=(10, 25, 0, 0))
     EveLabelMedium(
         parent=scrollContainer,
         align=uiconst.TOTOP,
         text=GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/MultipleCharacterDescription'
         ),
         padding=(10, 2, 0, 10),
         color=Color.GRAY5)
     multipleQueue1 = ContainerAutoSize(parent=scrollContainer,
                                        align=uiconst.TOTOP,
                                        alignMode=uiconst.TOTOP,
                                        state=uiconst.UI_PICKCHILDREN,
                                        bgColor=(0, 0, 0, 0.3))
     self.multipleQueueLabel1 = EveLabelMediumBold(parent=multipleQueue1,
                                                   align=uiconst.TOTOP,
                                                   text='',
                                                   padding=(35, 8, 0, 8))
     self.multipleQueueExpiryLabel1 = EveLabelMediumBold(
         parent=multipleQueue1,
         align=uiconst.TOPRIGHT,
         text='',
         pos=(10, 8, 0, 0),
         color=Color.GRAY5)
     self.multipleQueueIcon1 = Icon(
         parent=multipleQueue1,
         align=uiconst.TOPLEFT,
         icon='res:/UI/Texture/Icons/additional_training_queue.png',
         pos=(10, 7, 17, 17))
     multipleQueue2 = ContainerAutoSize(parent=scrollContainer,
                                        align=uiconst.TOTOP,
                                        alignMode=uiconst.TOTOP,
                                        state=uiconst.UI_PICKCHILDREN,
                                        bgColor=(0, 0, 0, 0.3))
     self.multipleQueueLabel2 = EveLabelMediumBold(parent=multipleQueue2,
                                                   align=uiconst.TOTOP,
                                                   text='',
                                                   padding=(35, 8, 0, 8))
     self.multipleQueueExpiryLabel2 = EveLabelMediumBold(
         parent=multipleQueue2,
         align=uiconst.TOPRIGHT,
         text='',
         pos=(10, 8, 0, 0),
         color=Color.GRAY5)
     self.multipleQueueIcon2 = Icon(
         parent=multipleQueue2,
         align=uiconst.TOPLEFT,
         icon='res:/UI/Texture/Icons/additional_training_queue.png',
         pos=(10, 7, 17, 17))
     EveLabelLargeBold(
         parent=scrollContainer,
         align=uiconst.TOTOP,
         text=GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/ConvertAurumTitle'
         ),
         padding=(10, 25, 0, 0))
     EveLabelMedium(
         parent=scrollContainer,
         align=uiconst.TOTOP,
         text=GetByLabel(
             'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/ConvertAurumDescription'
         ),
         padding=(10, 2, 0, 0),
         color=Color.GRAY5)
     if boot.region != 'optic':
         EveLabelLargeBold(
             parent=scrollContainer,
             align=uiconst.TOTOP,
             text=GetByLabel(
                 'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/CharacterTransferTitle'
             ),
             padding=(10, 25, 0, 0))
         EveLabelMedium(
             parent=scrollContainer,
             align=uiconst.TOTOP,
             text=GetByLabel(
                 'UI/CharacterSheet/CharacterSheetWindow/PilotLicense/CharacterTransferDescription'
             ),
             padding=(10, 2, 0, 0),
             color=Color.GRAY5)
     FillThemeColored(parent=self,
                      colorType=uiconst.COLORTYPE_UIHILIGHT,
                      opacity=0.1)
示例#19
0
class StatsPanelGhost(Container):
    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        self.subCont = Container(parent=self, padding=(0, 0, 10, 10))
        self.controller = attributes.controller
        self.controller.on_new_itemID.connect(self.OnNewItemID)
        self.controller.on_stats_changed.connect(self.UpdateStats)
        self.controller.on_drones_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()
        self.CreateNavigationPanel()
        self.CreateDronePanel()
        self.CreateFuelPanel()
        self.CreateExpandableMenus()
        uthread.new(self.UpdateStats)

    def ConstructNameCaption(self):
        self.nameCaptionCont = Container(name='shipname',
                                         parent=self.subCont,
                                         align=uiconst.TOTOP,
                                         height=12,
                                         padBottom=6)
        self.nameCaption = EveLabelMedium(text='',
                                          parent=self.nameCaptionCont,
                                          width=250,
                                          autoFitToText=True,
                                          state=uiconst.UI_NORMAL)
        SetTooltipHeaderAndDescription(
            targetObject=self.nameCaption,
            headerText='',
            descriptionText=GetByLabel(
                'Tooltips/FittingWindow/ShipName_description'))
        self.nameCaption.GetDragData = GetFittingDragData
        self.infolink = InfoIcon(left=0,
                                 top=0,
                                 parent=self.nameCaptionCont,
                                 idx=0)
        self.UpdateShipName()

    def UpdateShipName(self):
        typeID = self.controller.GetTypeID()
        itemID = self.controller.GetItemID()
        typeName = evetypes.GetName(typeID)
        if isinstance(itemID, long):
            name = cfg.evelocations.Get(itemID).name
        else:
            name = 'simulated %s' % typeName
            itemID = None
        self.nameCaption.text = name
        self.nameCaption.tooltipPanelClassInfo.headerText = name
        oneLineHeight = self.nameCaptionCont.height
        lines = max(
            1, self.nameCaption.height / max(1, self.nameCaptionCont.height))
        margin = 3
        self.nameCaptionCont.height = lines * oneLineHeight + margin * (lines -
                                                                        1)
        self.nameCaption.hint = typeName
        self.infolink.left = self.nameCaption.textwidth + 6
        if self.infolink.left + 50 > self.nameCaptionCont.width:
            self.infolink.left = 0
            self.infolink.SetAlign(uiconst.TOPRIGHT)
        self.infolink.UpdateInfoLink(typeID, itemID)

    def ConstructStoredFittingsButtons(self):
        self.fittingSvcBtnGroup = StoredFittingsButtons(
            name='StoredFittingsButtons',
            parent=self,
            align=uiconst.TOBOTTOM,
            controller=self.controller)
        self.fittingSvcBtnGroup.HideSaveAndBrowseButtons()

    def CreateCapacitorPanel(self):
        self.capacitorStatsParent = CapacitorPanel(name='capacitorStatsParent',
                                                   controller=self.controller)
        return self.capacitorStatsParent

    def CreateOffensePanel(self):
        self.offenseStatsParent = OffensePanel(
            name='offenseStatsParent',
            tooltipName='DamagePerSecond',
            labelHint=GetByLabel('UI/Fitting/FittingWindow/ShipDpsTooltip'),
            controller=self.controller)
        return self.offenseStatsParent

    def CreateDefensePanel(self):
        self.defenceStatsParent = DefensePanel(
            name='defenceStatsParent',
            state=uiconst.UI_PICKCHILDREN,
            tooltipName='EffectiveHitPoints',
            labelHint=GetByLabel(
                'UI/Fitting/FittingWindow/EffectiveHitpoints'),
            controller=self.controller)
        return self.defenceStatsParent

    def CreateTargetingPanel(self):
        self.targetingStatsParent = TargetingPanel(
            name='targetingStatsParent',
            tooltipName='MaxTargetingRange',
            controller=self.controller)
        return self.targetingStatsParent

    def CreateNavigationPanel(self):
        self.navigationStatsParent = NavigationPanel(
            name='navigationStatsParent',
            state=uiconst.UI_PICKCHILDREN,
            tooltipName='MaximumVelocity',
            labelHint=GetByLabel('UI/Fitting/FittingWindow/MaxVelocityHint'),
            controller=self.controller)
        return self.navigationStatsParent

    def CreateDronePanel(self):
        self.droneStatsParent = DronePanel(
            name='droneStatsParent',
            tooltipName='DamagePerSecond',
            labelHint=GetByLabel('UI/Fitting/FittingWindow/ShipDpsTooltip'),
            controller=self.controller)
        return self.droneStatsParent

    def CreateFuelPanel(self):
        self.fuelStatsParent = FuelPanel(name='fuelStatsParent',
                                         tooltipName='FuelUsage',
                                         controller=self.controller)
        return self.fuelStatsParent

    def GetSingleMenuPanelInfo(self, menuDict):
        return (GetByLabel(menuDict['label']), menuDict['content'],
                menuDict['callback'], None, menuDict['maxHeight'],
                menuDict['headerContent'], False,
                menuDict.get('expandedByDefault', False))

    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':
            84,
            '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 self.controller.HasNavigationPanel():
            navigationInfo = self.GetSingleMenuPanelInfo({
                'label':
                'UI/Fitting/FittingWindow/Navigation',
                'content':
                self.navigationStatsParent,
                'callback':
                self.LoadNavigationStats,
                'maxHeight':
                84,
                'headerContent':
                self.navigationStatsParent.headerParent
            })
            menuData += [navigationInfo]
        if self.controller.HasDronePanel():
            droneInfo = self.GetSingleMenuPanelInfo({
                'label':
                'UI/Drones/Drones',
                'content':
                self.droneStatsParent,
                'callback':
                self.LoadDroneStats,
                'maxHeight':
                84,
                'headerContent':
                self.droneStatsParent.headerParent
            })
            menuData += [droneInfo]
        if self.controller.HasFuelPanel():
            fuelInfo = self.GetSingleMenuPanelInfo({
                'label':
                'UI/Fitting/FittingWindow/Fuel',
                'content':
                self.fuelStatsParent,
                'callback':
                self.LoadFuelStats,
                'maxHeight':
                60,
                'headerContent':
                self.fuelStatsParent.headerParent
            })
            menuData += [fuelInfo]
        return menuData

    def CreateExpandableMenus(self):
        em = ExpandableMenuContainer(parent=self.subCont,
                                     pos=(0, 0, 0, 0),
                                     clipChildren=True)
        em.multipleExpanded = True
        menuData = self.GetMenuData()
        em.Load(menuData=menuData, prefsKey='fittingRightside')

    def LoadDroneStats(self, initialLoad=False):
        if self.controller.HasDronePanel():
            self.droneStatsParent.LoadPanel(initialLoad=initialLoad)

    def LoadNavigationStats(self, initialLoad=False):
        if self.controller.HasNavigationPanel():
            self.navigationStatsParent.LoadPanel(initialLoad=initialLoad)

    def LoadTargetingStats(self, initialLoad=False):
        self.targetingStatsParent.LoadPanel(initialLoad=initialLoad)

    def LoadOffenseStats(self, initialLoad=False):
        self.offenseStatsParent.LoadPanel(initialLoad)

    def LoadFuelStats(self, initialLoad=False):
        if self.controller.HasFuelPanel():
            self.fuelStatsParent.LoadPanel(initialLoad=initialLoad)

    def UpdateOffenseStats(self):
        self.offenseStatsParent.UpdateOffenseStats()

    def UpdateDroneStats(self):
        if self.controller.HasDronePanel():
            self.droneStatsParent.UpdateDroneStats()

    def LoadDefenceStats(self, initialLoad=False):
        self.defenceStatsParent.LoadPanel(initialLoad)

    def LoadCapacitorStats(self, initialLoad=False):
        self.capacitorStatsParent.LoadPanel(initialLoad)

    def ExpandBestRepair(self, *args):
        self.defenceStatsParent.ExpandBestRepair(*args)

    def UpdateBestRepair(self, item, multiplyShieldCapacity,
                         multiplyShieldRecharge):
        return self.defenceStatsParent.UpdateBestRepair(
            item, multiplyShieldCapacity, multiplyShieldRecharge)

    def UpdateNavigationPanel(self):
        if self.controller.HasNavigationPanel():
            self.navigationStatsParent.UpdateNavigationPanel()

    def UpdateTargetingPanel(self):
        self.targetingStatsParent.UpdateTargetingPanel()

    def UpdateCapacitor(self):
        self.capacitorStatsParent.UpdateCapacitorPanel()

    def UpdateDefensePanel(self):
        return self.defenceStatsParent.UpdateDefensePanel()

    def UpdateFuelPanel(self):
        if self.controller.HasFuelPanel():
            self.fuelStatsParent.UpdateFuelPanel()

    def UpdateStats(self):
        item = self.controller.GetGhostFittedItem()
        typeID = self.controller.GetGhostFittedTypeID()
        self.fittingSvcBtnGroup.UpdateStripBtn(self.controller.IsSimulated())
        multiplyShieldRecharge = 1.0
        multiplyShieldCapacity = 1.0
        typeAttributesByID = {}
        if typeID:
            for attribute in cfg.dgmtypeattribs.get(typeID, []):
                typeAttributesByID[attribute.attributeID] = attribute.value

            dgmAttr = sm.GetService('godma').GetType(typeID)
            doHilite = dgmAttr.groupID not in NO_HILITE_GROUPS_DICT
            allowedAttr = dgmAttr.displayAttributes
            for attribute in allowedAttr:
                if not doHilite and attribute.attributeID not in NO_HILITE_GROUPS_DICT[
                        dgmAttr.groupID]:
                    continue
                elif attribute.attributeID == dogmaConst.attributeShieldRechargeRateMultiplier:
                    multiplyShieldRecharge = attribute.value
                elif attribute.attributeID == dogmaConst.attributeShieldCapacityMultiplier:
                    multiplyShieldCapacity *= attribute.value

        dsp = getattr(self, 'defenceStatsParent', None)
        if not dsp or dsp.destroyed:
            return
        self.UpdateDefensePanel()
        self.UpdateBestRepair(item, multiplyShieldCapacity,
                              multiplyShieldRecharge)
        self.UpdateNavigationPanel()
        self.UpdateTargetingPanel()
        self.UpdateCapacitor()
        self.UpdateOffenseStats()
        self.UpdateDroneStats()
        self.UpdateFuelPanel()

    def MaxTargetRangeBonusMultiplier(self, typeID):
        typeeffects = cfg.dgmtypeeffects.get(typeID, [])
        for effect in typeeffects:
            if effect.effectID in (
                    dogmaConst.effectShipMaxTargetRangeBonusOnline,
                    dogmaConst.effectMaxTargetRangeBonus):
                return 1

    def ArmorOrShieldMultiplier(self, typeID):
        typeeffects = cfg.dgmtypeeffects.get(typeID, [])
        for effect in typeeffects:
            if effect.effectID == dogmaConst.effectShieldResonanceMultiplyOnline:
                return 1

    def ArmorShieldStructureMultiplierPostPercent(self, typeID):
        typeeffects = cfg.dgmtypeeffects.get(typeID, [])
        ret = []
        for effect in typeeffects:
            if effect.effectID == dogmaConst.effectModifyArmorResonancePostPercent:
                ret.append('armor')
            elif effect.effectID == dogmaConst.effectModifyShieldResonancePostPercent:
                ret.append('shield')
            elif effect.effectID == dogmaConst.effectModifyHullResonancePostPercent:
                ret.append('structure')

        return ret

    def OnNewItemID(self):
        self.UpdateShipName()
        for eachPanel in [
                self.capacitorStatsParent, self.offenseStatsParent,
                self.defenceStatsParent, self.targetingStatsParent,
                self.navigationStatsParent, self.droneStatsParent
        ]:
            eachPanel.SetDogmaLocation()

        self.UpdateStats()
示例#20
0
class StatsPanel(Container):

    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 ConstructNameCaption(self):
        self.nameCaptionCont = Container(name='shipname', parent=self, align=uiconst.TOTOP, height=12, padBottom=6)
        self.nameCaption = EveLabelMedium(text='', parent=self.nameCaptionCont, width=250, autoFitToText=True, state=uiconst.UI_NORMAL)
        SetTooltipHeaderAndDescription(targetObject=self.nameCaption, headerText='', descriptionText=GetByLabel('Tooltips/FittingWindow/ShipName_description'))
        self.nameCaption.GetDragData = GetFittingDragData
        self.infolink = InfoIcon(left=0, top=0, parent=self.nameCaptionCont, idx=0)
        self.UpdateShipName()

    def UpdateShipName(self):
        typeID = self.controller.GetTypeID()
        itemID = self.controller.GetItemID()
        name = cfg.evelocations.Get(itemID).name
        typeName = evetypes.GetName(typeID)
        self.nameCaption.text = name
        self.nameCaption.tooltipPanelClassInfo.headerText = name
        oneLineHeight = self.nameCaptionCont.height
        lines = max(1, self.nameCaption.height / max(1, self.nameCaptionCont.height))
        margin = 3
        self.nameCaptionCont.height = lines * oneLineHeight + margin * (lines - 1)
        self.nameCaption.hint = typeName
        self.infolink.left = self.nameCaption.textwidth + 6
        if self.infolink.left + 50 > self.nameCaptionCont.width:
            self.infolink.left = 0
            self.infolink.SetAlign(uiconst.TOPRIGHT)
        self.infolink.UpdateInfoLink(typeID, itemID)

    def ConstructStoredFittingsButtons(self):
        self.fittingSvcBtnGroup = StoredFittingsButtons(name='StoredFittingsButtons', parent=self, align=uiconst.TOBOTTOM, controller=self.controller)

    def CreateCapacitorPanel(self):
        self.capacitorStatsParent = CapacitorPanel(name='capacitorStatsParent', controller=self.controller)
        return self.capacitorStatsParent

    def CreateOffensePanel(self):
        self.offenseStatsParent = OffensePanel(name='offenseStatsParent', tooltipName='DamagePerSecond', labelHint=GetByLabel('UI/Fitting/FittingWindow/ShipDpsTooltip'), controller=self.controller)
        return self.offenseStatsParent

    def CreateDefensePanel(self):
        self.defenceStatsParent = DefensePanel(name='defenceStatsParent', state=uiconst.UI_PICKCHILDREN, tooltipName='EffectiveHitPoints', labelHint=GetByLabel('UI/Fitting/FittingWindow/EffectiveHitpoints'), controller=self.controller)
        return self.defenceStatsParent

    def CreateTargetingPanel(self):
        self.targetingStatsParent = TargetingPanel(name='targetingStatsParent', tooltipName='MaxTargetingRange', controller=self.controller)
        return self.targetingStatsParent

    def CreateNavigationPanel(self):
        self.navigationStatsParent = NavigationPanel(name='navigationStatsParent', state=uiconst.UI_PICKCHILDREN, tooltipName='MaximumVelocity', labelHint=GetByLabel('UI/Fitting/FittingWindow/MaxVelocityHint'), controller=self.controller)
        return self.navigationStatsParent

    def GetSingleMenuPanelInfo(self, menuDict):
        return (GetByLabel(menuDict['label']),
         menuDict['content'],
         menuDict['callback'],
         None,
         menuDict['maxHeight'],
         menuDict['headerContent'],
         False,
         menuDict.get('expandedByDefault', False))

    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

    def CreateExpandableMenus(self):
        em = ExpandableMenuContainer(parent=self, pos=(0, 0, 0, 0), clipChildren=True)
        em.multipleExpanded = True
        menuData = self.GetMenuData()
        em.Load(menuData=menuData, prefsKey='fittingRightside')

    def LoadNavigationStats(self, initialLoad = False):
        self.navigationStatsParent.LoadPanel(initialLoad=initialLoad)

    def LoadTargetingStats(self, initialLoad = False):
        self.targetingStatsParent.LoadPanel(initialLoad=initialLoad)

    def LoadOffenseStats(self, initialLoad = False):
        self.offenseStatsParent.LoadPanel(initialLoad)

    def UpdateOffenseStats(self):
        self.offenseStatsParent.UpdateOffenseStats()

    def LoadDefenceStats(self, initialLoad = False):
        self.defenceStatsParent.LoadPanel(initialLoad)

    def LoadCapacitorStats(self, initialLoad = False):
        self.capacitorStatsParent.LoadPanel(initialLoad)

    def ExpandBestRepair(self, *args):
        self.defenceStatsParent.ExpandBestRepair(*args)

    def UpdateBestRepair(self, item, modulesByGroupInShip, multiplyShieldCapacity, multiplyShieldRecharge):
        return self.defenceStatsParent.UpdateBestRepair(item, modulesByGroupInShip, multiplyShieldCapacity, multiplyShieldRecharge)

    def UpdateNavigationPanel(self, multiplySpeed, typeAttributesByID):
        if not IsControllingStructure():
            self.navigationStatsParent.UpdateNavigationPanel(self.controller.GetItemID(), multiplySpeed, typeAttributesByID)

    def UpdateTargetingPanel(self, maxLockedTargetsAdd, multiplyMaxTargetRange, sensorStrengthAttrs, sensorStrengthBonus, sensorStrengthBonusAttrs, sensorStrengthPercent, sensorStrengthPercentAttrs, typeAttributesByID):
        self.targetingStatsParent.UpdateTargetingPanel(self.controller.GetItemID(), maxLockedTargetsAdd, multiplyMaxTargetRange, sensorStrengthAttrs, sensorStrengthBonus, sensorStrengthBonusAttrs, sensorStrengthPercent, sensorStrengthPercentAttrs, typeAttributesByID)

    def UpdateCapacitor(self, xtraCapacitor = 0.0, rechargeMultiply = 1.0, multiplyCapacitor = 1.0, reload = 0):
        self.capacitorStatsParent.UpdateCapacitorPanel(self.controller.GetItemID(), xtraCapacitor, rechargeMultiply, multiplyCapacitor, reload)

    def UpdateDefensePanel(self, dsp, effectiveHp, effectiveHpColor, multiplyArmor, multiplyResistance, multiplyShieldCapacity, multiplyShieldRecharge, multiplyStructure, xtraArmor, xtraShield, xtraStructure):
        return self.defenceStatsParent.UpdateDefensePanel(dsp, effectiveHp, effectiveHpColor, multiplyArmor, multiplyResistance, multiplyShieldCapacity, multiplyShieldRecharge, multiplyStructure, xtraArmor, xtraShield, xtraStructure)

    def UpdateStats(self):
        item = self.controller.GetGhostFittedItem()
        typeID = self.controller.GetGhostFittedTypeID()
        self.fittingSvcBtnGroup.UpdateStripBtn()
        xtraArmor = 0.0
        multiplyArmor = 1.0
        multiplyRecharge = 1.0
        xtraCapacitor = 0.0
        multiplyCapacitor = 1.0
        multiplyShieldRecharge = 1.0
        multiplyShieldCapacity = 1.0
        xtraShield = 0.0
        multiplyStructure = 1.0
        xtraStructure = 0.0
        multiplySpeed = 1.0
        multiplyMaxTargetRange = 1.0
        maxLockedTargetsAdd = 0.0
        multiplyResonance = {}
        multiplyResistance = {}
        sensorStrengthAttrs = [dogmaConst.attributeScanRadarStrength,
         dogmaConst.attributeScanMagnetometricStrength,
         dogmaConst.attributeScanGravimetricStrength,
         dogmaConst.attributeScanLadarStrength]
        sensorStrengthPercent = {}
        sensorStrengthPercentAttrs = [dogmaConst.attributeScanRadarStrengthBonus,
         dogmaConst.attributeScanMagnetometricStrengthBonus,
         dogmaConst.attributeScanGravimetricStrengthBonus,
         dogmaConst.attributeScanLadarStrengthBonus]
        sensorStrengthBonus = {}
        sensorStrengthBonusAttrs = [dogmaConst.attributeScanRadarStrengthPercent,
         dogmaConst.attributeScanMagnetometricStrengthPercent,
         dogmaConst.attributeScanGravimetricStrengthPercent,
         dogmaConst.attributeScanLadarStrengthPercent]
        modulesByGroupInShip = self.controller.GetFittedModulesByGroupID()
        typeAttributesByID = {}
        if typeID:
            for attribute in cfg.dgmtypeattribs.get(typeID, []):
                typeAttributesByID[attribute.attributeID] = attribute.value

            dgmAttr = sm.GetService('godma').GetType(typeID)
            asm = self.ArmorOrShieldMultiplier(typeID)
            asp = self.ArmorShieldStructureMultiplierPostPercent(typeID)
            mtr = self.MaxTargetRangeBonusMultiplier(typeID)
            doHilite = dgmAttr.groupID not in NO_HILITE_GROUPS_DICT
            allowedAttr = dgmAttr.displayAttributes
            for attribute in allowedAttr:
                if not doHilite and attribute.attributeID not in NO_HILITE_GROUPS_DICT[dgmAttr.groupID]:
                    continue
                if attribute.attributeID in sensorStrengthBonusAttrs:
                    sensorStrengthBonus[attribute.attributeID] = attribute
                elif attribute.attributeID in sensorStrengthPercentAttrs:
                    sensorStrengthPercent[attribute.attributeID] = attribute
                elif attribute.attributeID == dogmaConst.attributeCapacityBonus:
                    xtraShield += attribute.value
                elif attribute.attributeID == dogmaConst.attributeArmorHPBonusAdd:
                    xtraArmor += attribute.value
                elif attribute.attributeID == dogmaConst.attributeStructureBonus:
                    xtraStructure += attribute.value
                elif attribute.attributeID == dogmaConst.attributeCapacitorBonus:
                    xtraCapacitor += attribute.value
                elif attribute.attributeID == dogmaConst.attributeCapacitorCapacityMultiplier:
                    multiplyCapacitor *= attribute.value
                elif attribute.attributeID == dogmaConst.attributeCapacitorCapacityBonus:
                    multiplyCapacitor = 1 + attribute.value / 100
                elif attribute.attributeID == dogmaConst.attributeArmorHpBonus:
                    multiplyArmor += attribute.value / 100
                elif attribute.attributeID == dogmaConst.attributeArmorHPMultiplier:
                    multiplyArmor = attribute.value
                elif attribute.attributeID == dogmaConst.attributeMaxVelocityBonus:
                    multiplySpeed = attribute.value
                elif asm is not None and attribute.attributeID == dogmaConst.attributeEmDamageResonanceMultiplier:
                    multiplyResonance['%s_EmDamageResonance' % ['a', 's'][asm]] = attribute.value
                elif asm is not None and attribute.attributeID == dogmaConst.attributeExplosiveDamageResonanceMultiplier:
                    multiplyResonance['%s_ExplosiveDamageResonance' % ['a', 's'][asm]] = attribute.value
                elif asm is not None and attribute.attributeID == dogmaConst.attributeKineticDamageResonanceMultiplier:
                    multiplyResonance['%s_KineticDamageResonance' % ['a', 's'][asm]] = attribute.value
                elif asm is not None and attribute.attributeID == dogmaConst.attributeThermalDamageResonanceMultiplier:
                    multiplyResonance['%s_ThermalDamageResonance' % ['a', 's'][asm]] = attribute.value
                elif asp and attribute.attributeID in (dogmaConst.attributeEmDamageResistanceBonus,
                 dogmaConst.attributeExplosiveDamageResistanceBonus,
                 dogmaConst.attributeKineticDamageResistanceBonus,
                 dogmaConst.attributeThermalDamageResistanceBonus):
                    groupName = {dogmaConst.attributeEmDamageResistanceBonus: 'EmDamageResistance',
                     dogmaConst.attributeExplosiveDamageResistanceBonus: 'ExplosiveDamageResistance',
                     dogmaConst.attributeKineticDamageResistanceBonus: 'KineticDamageResistance',
                     dogmaConst.attributeThermalDamageResistanceBonus: 'ThermalDamageResistance'}.get(attribute.attributeID, '')
                    if 'armor' in asp:
                        multiplyResistance['a_%s' % groupName] = attribute.value
                    if 'shield' in asp:
                        multiplyResistance['s_%s' % groupName] = attribute.value
                    if 'structure' in asp:
                        multiplyResistance['h_%s' % groupName] = attribute.value
                elif attribute.attributeID == dogmaConst.attributeCapacitorRechargeRateMultiplier:
                    multiplyRecharge = multiplyRecharge * attribute.value
                elif attribute.attributeID == dogmaConst.attributeCapRechargeBonus:
                    multiplyRecharge = 1 + attribute.value / 100
                elif attribute.attributeID == dogmaConst.attributeShieldRechargeRateMultiplier:
                    multiplyShieldRecharge = attribute.value
                elif attribute.attributeID == dogmaConst.attributeShieldCapacityMultiplier:
                    multiplyShieldCapacity *= attribute.value
                elif attribute.attributeID == dogmaConst.attributeStructureHPMultiplier:
                    multiplyStructure = attribute.value
                elif attribute.attributeID == dogmaConst.attributeCargoCapacityMultiplier:
                    multiplyCargoCapacity = attribute.value
                elif attribute.attributeID == dogmaConst.attributeMaxTargetRangeMultiplier:
                    multiplyMaxTargetRange = attribute.value
                elif attribute.attributeID == dogmaConst.attributeMaxLockedTargetsBonus:
                    maxLockedTargetsAdd += attribute.value
                elif mtr is not None and attribute.attributeID == dogmaConst.attributeMaxTargetRangeBonus:
                    multiplyMaxTargetRange = abs(1.0 + attribute.value / 100.0)

        effectiveHp = 0.0
        effectiveHpColor = FONTCOLOR_DEFAULT2
        dsp = getattr(self, 'defenceStatsParent', None)
        if not dsp or dsp.destroyed:
            return
        effectiveHp, effectiveHpColor = self.UpdateDefensePanel(dsp, effectiveHp, effectiveHpColor, multiplyArmor, multiplyResistance, multiplyShieldCapacity, multiplyShieldRecharge, multiplyStructure, xtraArmor, xtraShield, xtraStructure)
        coloredEffeciveHpLabel = '<color=%s>' % hex(effectiveHpColor)
        coloredEffeciveHpLabel += GetByLabel('UI/Fitting/FittingWindow/ColoredEffectiveHp', color=hex(effectiveHpColor), effectiveHp=int(effectiveHp))
        coloredEffeciveHpLabel += '</color>'
        self.defenceStatsParent.statusText.text = coloredEffeciveHpLabel
        self.UpdateBestRepair(item, modulesByGroupInShip, multiplyShieldCapacity, multiplyShieldRecharge)
        self.UpdateNavigationPanel(multiplySpeed, typeAttributesByID)
        self.UpdateTargetingPanel(maxLockedTargetsAdd, multiplyMaxTargetRange, sensorStrengthAttrs, sensorStrengthBonus, sensorStrengthBonusAttrs, sensorStrengthPercent, sensorStrengthPercentAttrs, typeAttributesByID)
        self.UpdateCapacitor(xtraCapacitor, multiplyRecharge, multiplyCapacitor, reload=1)
        self.UpdateOffenseStats()

    def MaxTargetRangeBonusMultiplier(self, typeID):
        typeeffects = cfg.dgmtypeeffects.get(typeID, [])
        for effect in typeeffects:
            if effect.effectID in (dogmaConst.effectShipMaxTargetRangeBonusOnline, dogmaConst.effectMaxTargetRangeBonus):
                return 1

    def ArmorOrShieldMultiplier(self, typeID):
        typeeffects = cfg.dgmtypeeffects.get(typeID, [])
        for effect in typeeffects:
            if effect.effectID == dogmaConst.effectShieldResonanceMultiplyOnline:
                return 1

    def ArmorShieldStructureMultiplierPostPercent(self, typeID):
        typeeffects = cfg.dgmtypeeffects.get(typeID, [])
        ret = []
        for effect in typeeffects:
            if effect.effectID == dogmaConst.effectModifyArmorResonancePostPercent:
                ret.append('armor')
            elif effect.effectID == dogmaConst.effectModifyShieldResonancePostPercent:
                ret.append('shield')
            elif effect.effectID == dogmaConst.effectModifyHullResonancePostPercent:
                ret.append('structure')

        return ret

    def OnNewItemID(self):
        self.UpdateShipName()
        self.UpdateStats()