Exemple #1
0
 def GetLM(self):
     if session.solarsystemid:
         return util.Moniker(
             'jumpCloneSvc',
             (session.solarsystemid, const.groupSolarSystem))
     else:
         return util.Moniker('jumpCloneSvc',
                             (session.stationid2, const.groupStation))
    def Refresh(self, *args):
        itemID = int(self.input.GetValue())
        if itemID != self.itemID or not self.typeID:
            self.itemID = itemID
            self.typeID = None
            if eve.session.stationid:
                m = util.Moniker('i2',
                                 (eve.session.stationid, const.groupStation))
            else:
                m = util.Moniker(
                    'i2', (eve.session.solarsystemid2, const.groupSolarSystem))
            if m.IsPrimed(self.itemID):
                self.typeID = m.GetItem(self.itemID).typeID
        contentList = []
        if self.typeID:
            d = sm.GetService('info').GetAttributeDictForType(self.typeID)
            a = self.stateManager.attributesByID
            for id, baseValue in d.iteritems():
                attrName = a[id].attributeName
                try:
                    actualValue = self.stateManager.GetAttribute(
                        self.itemID, attrName)
                except:
                    sys.exc_clear()
                    actualValue = 'Unknown'

                contentList.append(
                    listentry.Get(
                        'DgmAttrEntry', {
                            'label':
                            u'%s<t>%s<t>%s<t>%s' %
                            (id, attrName, actualValue, baseValue),
                            'attributeID':
                            id,
                            'attributeName':
                            attrName,
                            'actualValue':
                            actualValue,
                            'baseValue':
                            baseValue,
                            'ShowAttribute':
                            self.ShowAttribute,
                            'itemID':
                            self.itemID
                        }))

        self.scroll.Load(contentList=contentList,
                         headers=['ID', 'Name', 'Client', 'Base'],
                         fixedEntryHeight=18)
        self.scroll.Sort('Name')
Exemple #3
0
 def OnLoadEntityScene(self, sceneID):
     if self.IsClientSideOnly(sceneID):
         return
     if sceneID not in self.remoteEntityScenes:
         remoteScene = util.Moniker('entityServer', sceneID)
         remoteScene.Bind()
         self.remoteEntityScenes[sceneID] = remoteScene
Exemple #4
0
 def ApplyAttributes(self, attributes):
     uicontrols.Window.ApplyAttributes(self, attributes)
     self.invCookie = None
     self.invReady = 0
     self.optionsByItemType = {}
     self.itemToRepairDescription = ''
     self.repairSvc = util.Moniker('repairSvc', session.stationid2)
     self.invCache = sm.GetService('invCache')
     self.SetMinSize([350, 270])
     self.SetWndIcon(self.iconNum, mainTop=-4)
     uicontrols.WndCaptionLabel(
         text=localization.GetByLabel('UI/Station/Repair/RepairFacilities'),
         parent=self.sr.topParent,
         align=uiconst.RELATIVE)
     self.scope = 'station'
     btns = uicontrols.ButtonGroup(
         btns=[(localization.GetByLabel('UI/Commands/PickNewItem'),
                self.DisplayItems, (), 84),
               (localization.GetByLabel('UI/Commands/RepairItem'),
                self.QuoteItems, (), 84),
               (localization.GetByLabel('UI/Commands/RepairAll'),
                self.DoNothing, (), 84)])
     self.sr.main.children.append(btns)
     self.sr.pickSelect = btns
     self.sr.pickBtn = self.sr.pickSelect.GetBtnByLabel(
         localization.GetByLabel('UI/Commands/PickNewItem'))
     self.sr.selBtn = self.sr.pickSelect.GetBtnByLabel(
         localization.GetByLabel('UI/Commands/RepairItem'))
     self.sr.repairAllBtn = self.sr.pickSelect.GetBtnByLabel(
         localization.GetByLabel('UI/Commands/RepairAll'))
     cont = uiprimitives.Container(name='scroll',
                                   align=uiconst.TORIGHT,
                                   parent=self.sr.topParent,
                                   left=const.defaultPadding,
                                   width=200)
     self.sr.scroll = uicontrols.Scroll(
         parent=self.sr.main,
         padding=(const.defaultPadding, const.defaultPadding,
                  const.defaultPadding, const.defaultPadding))
     self.sr.scroll.sr.minColumnWidth = {
         localization.GetByLabel('UI/Common/Type'): 30
     }
     self.sr.avgDamage = uicontrols.EveLabelSmall(text='',
                                                  parent=cont,
                                                  name='avgDamage',
                                                  left=8,
                                                  top=0,
                                                  state=uiconst.UI_NORMAL,
                                                  align=uiconst.BOTTOMRIGHT)
     self.sr.totalCost = uicontrols.EveLabelSmall(text='',
                                                  parent=cont,
                                                  name='totalCost',
                                                  left=8,
                                                  top=12,
                                                  state=uiconst.UI_NORMAL,
                                                  align=uiconst.BOTTOMRIGHT)
     uthread.new(self.DisplayItems)
Exemple #5
0
    def Refresh(self, *args):
        inputValue = self.input.GetValue()
        subLocPattern = '\\(\\d*L?, \\d*, \\d*\\)'
        subLocPart = re.match(subLocPattern, inputValue)
        if subLocPart:
            itemKey = subLocPart.group(0)
            itemID, flagID, typeID = itemKey.replace('(',
                                                     '').replace(')',
                                                                 '').split(',')
            self.itemID = (long(itemID), int(flagID), int(typeID))
            self.typeID = int(typeID)
        else:
            itemID = int(filter('0123456789'.__contains__, inputValue))
            if itemID != self.itemID or not self.typeID:
                self.itemID = itemID
                self.typeID = None
                m = util.Moniker('i2', GetLocationBindParams())
                if m.IsPrimed(self.itemID):
                    self.typeID = m.GetItem(self.itemID).typeID
        nameFilter = inputValue.replace(str(self.itemID), '').lstrip().rstrip()
        if nameFilter != self.nameFilter and (nameFilter.isalpha()
                                              or nameFilter == ''):
            self.nameFilter = nameFilter
        log.LogInfo('Refresh: itemID = %s, typeID = %s, nameFilter = %s' %
                    (self.itemID, self.typeID, self.nameFilter or 'None'))
        contentList = []
        if self.typeID:
            clientValsByAttrID = self._GetClientValsByAttrID()
            godmaValsByAttrID = self._GetGodmaValsByAttrID()
            serverValsByAttrID = self._GetServerValsByAttrID()
            baseValsByAttrID = self._GetBaseValsByAttrID()
            allMyAttribIDs = set(
                itertools.chain(clientValsByAttrID, godmaValsByAttrID,
                                serverValsByAttrID, baseValsByAttrID))
            for attrID in allMyAttribIDs:
                attrName = self.AttrName_FromID(attrID)
                if not self.nameFilter or self.nameFilter.lower(
                ) in attrName.lower():
                    contentList.append(
                        self._GetListEntryForAttr(attrID, attrName,
                                                  clientValsByAttrID,
                                                  godmaValsByAttrID,
                                                  serverValsByAttrID,
                                                  baseValsByAttrID))

        self.scroll.Load(contentList=contentList,
                         headers=[
                             'ID', 'Name', 'ClientVal', 'GodmaVal',
                             'ServerVal', 'Base'
                         ],
                         fixedEntryHeight=18)
        self.scroll.Sort('Name')
 def StartMatch(self, *args):
     selectedMatch = self.sr.matchSelect.GetValue()
     self.redTeam = selectedMatch[1]
     self.blueTeam = selectedMatch[2]
     self.matchMoniker = util.Moniker('tourneyMgr', self.solSystemSelect.GetValue())
     self.matchDetails = [-1,
      None,
      None,
      None]
     matchID, beaconIDs, captainIDs = self.matchMoniker.CreateMatch(self.sr.tourneySelect.GetValue(), selectedMatch[0], self.sr.pointsSelect.GetValue())
     self.matchDetails[0] = matchID
     self.matchDetails[3] = beaconIDs
     self.autoBanRedCharID.SetValue(str(captainIDs[0]))
     self.redTeamBanningHeader.text = 'Red Team - %s' % (self.redTeam,)
     self.autoBanBlueCharID.SetValue(str(captainIDs[1]))
     self.blueTeamBanningHeader.text = 'Blue Team - %s' % (self.blueTeam,)
     self.LookupBanChars()
Exemple #7
0
 def GetInsuranceMgr(self):
     if self.insurance is not None:
         return self.insurance
     self.insurance = util.Moniker('insuranceSvc', session.stationid2)
     self.insurance.SetSessionCheck({'stationid2': session.stationid2})
     return self.insurance
Exemple #8
0
 def InitiateUpgrade(self):
     posMgr = util.Moniker('posMgr', session.solarsystemid)
     posMgr.OnlineOrbital(self.itemID)
     self.Close()