def MakeKillDragObject(self, notification):
     fakeNode = KeyVal()
     kmID, kmHash = KillMailBaseFormatter.GetKillMailIDandHash(notification.data)
     theRealKm = sm.RemoteSvc('warStatisticMgr').GetKillMail(kmID, kmHash)
     fakeNode.mail = theRealKm
     fakeNode.__guid__ = 'listentry.KillMail'
     return [fakeNode]
Пример #2
0
    def GetSovereigntyStructuresInfoForAlliance(self):
        if session.allianceid is None:
            return
        allianceSvc = sm.GetService('alliance')
        alliance = allianceSvc.GetMoniker()
        tcuRows, iHubRows, stationRows, campaignScores = alliance.GetAllianceSovereigntyStructuresInfo()
        scoresPerStructure = defaultdict(dict)
        for campaignScore in campaignScores:
            scoresPerStructure[campaignScore.sourceItemID][campaignScore.teamID] = campaignScore.score

        structuresPerSolarsystem = defaultdict(list)
        rowsPerType = [(tcuRows, typeTerritorialClaimUnit), (iHubRows, typeInfrastructureHub), (stationRows, typeOutpostConstructionPlatform)]
        for structureRows, structureType in rowsPerType:
            for structureRow in structureRows:
                structureInfo = KeyVal({'itemID': structureRow.structureID,
                 'typeID': structureType,
                 'campaignState': None,
                 'vulnerabilityState': None,
                 'defenseMultiplier': 1.0})
                if structureRow.campaignStartTime and structureRow.campaignEventType:
                    structureInfo.campaignState = (structureRow.campaignEventType,
                     session.allianceid,
                     structureRow.campaignStartTime,
                     scoresPerStructure[structureRow.structureID])
                    structureInfo.defenseMultiplier = structureRow.campaignOccupancyLevel
                elif structureRow.vulnerableStartTime and structureRow.vulnerableEndTime:
                    structureInfo.vulnerabilityState = (structureRow.vulnerableStartTime, structureRow.vulnerableEndTime)
                    structureInfo.defenseMultiplier = structureRow.vulnerabilityOccupancyLevel
                structuresPerSolarsystem[structureRow.solarSystemID].append(structureInfo)

        return structuresPerSolarsystem
 def MakeCharacterDragObject(self, charid):
     typeID = cfg.eveowners.Get(charid).typeID
     fakeNode = KeyVal()
     fakeNode.charID = charid
     fakeNode.info = cfg.eveowners.Get(charid)
     fakeNode.itemID = charid
     fakeNode.__guid__ = 'listentry.User'
     return [fakeNode]
Пример #4
0
 def AddCheckBox(self, config, scrolllist, group = None, usecharsettings = 0, sublevel = 0):
     cfgname, retval, desc, default = config
     data = KeyVal()
     data.label = desc
     data.checked = default
     data.cfgname = cfgname
     data.retval = retval
     data.group = group
     data.sublevel = sublevel
     data.OnChange = self.CheckBoxChange
     data.usecharsettings = usecharsettings
     data.hideLines = True
     if scrolllist is not None:
         scrolllist.append(listentry.Get('Checkbox', data=data))
     else:
         return listentry.Get('Checkbox', data=data)
 def LoadContent(self):
     if self.contentLoaded:
         return
     self.contentLoaded = True
     self.filler = Frame(name='myFrame', bgParent=self, texturePath='res:/UI/Texture/classes/Notifications/historyBackReadUp.png', cornerSize=6, offset=-5)
     self.leftContainer = Container(name='leftContainer', width=40, padding=(5, 5, 10, 5), parent=self, align=uiconst.TOLEFT)
     self.rightContainer = ContainerAutoSize(name='rightContainer', width=MAINAREA_WIDTH, parent=self, align=uiconst.TOLEFT)
     self.titleLabel = EveLabelMedium(name='subject', parent=self.rightContainer, align=uiconst.TOTOP, text=self.title, padding=TITLE_PADDING, bold=True)
     if self.subtext:
         self.subtextLabel = EveLabelMedium(name='subtext', parent=self.rightContainer, align=uiconst.TOTOP, text=self.subtext, padding=SUBTEXT_PADDING)
     if self.notification:
         texture = self.GetTexturePathForNotification(self.notification.typeID)
     else:
         texture = 'res:/ui/Texture/WindowIcons/bountyoffice.png'
     self.imageSprite = Sprite(name='MySprite', parent=self.leftContainer, texturePath=texture, align=uiconst.TOPLEFT, width=40, height=40)
     self.characterSprite = Sprite(name='CharacterSprite', parent=self.leftContainer, texturePath=texture, align=uiconst.TOPLEFT, width=40, height=40, state=uiconst.UI_HIDDEN)
     if self.created:
         timeinterval = max(blue.os.GetWallclockTime() - self.created, 0)
         createdText = localization.GetByLabel('Notifications/NotificationWidget/NotificationTimeAgo', time=timeinterval)
         self.timeLabel = EveLabelSmall(name='timeLabel', parent=self.rightContainer, align=uiconst.TOTOP, color=(0.5, 0.5, 0.5), padding=TIMETEXT_PADDING)
         self.timeLabel.text = createdText
     notification = self.notification
     if notification.typeID in [notificationConst.notificationTypeKillReportFinalBlow, notificationConst.notificationTypeKillReportVictim]:
         shipTypeID = KillMailFinalBlowFormatter.GetVictimShipTypeID(notification.data)
         if shipTypeID is not None:
             parentContainer = self.leftContainer
             Icon(parent=parentContainer, align=uiconst.TOPRIGHT, size=40, typeID=shipTypeID)
             shipTechIcon = Sprite(name='techIcon', parent=parentContainer, width=16, height=16, idx=0)
             uiUtils.GetTechLevelIcon(shipTechIcon, 0, shipTypeID)
             self.imageSprite.GetDragData = lambda *args: self.MakeKillDragObject(notification)
     if self.ShouldDisplayPortrait(notification):
         item = cfg.eveowners.Get(notification.senderID)
         if item.IsCharacter():
             sm.GetService('photo').GetPortrait(notification.senderID, 128, self.characterSprite)
             if notification.typeID in notificationConst.notificationShowStanding:
                 charinfo = item
                 self.imageSprite.GetMenu = lambda : sm.GetService('menu').GetMenuFormItemIDTypeID(notification.senderID, charinfo.typeID)
                 self.imageSprite.GetDragData = lambda *args: self.MakeCharacterDragObject(notification.senderID)
                 charData = KeyVal()
                 charData.charID = notification.senderID
                 charData.charinfo = charinfo
                 AddAndSetFlagIconFromData(charData, parentCont=self.leftContainer, top=self.characterSprite.height - 10)
         else:
             self.corpLogo = GetLogoIcon(itemID=notification.senderID, parent=self.leftContainer, align=uiconst.TOPLEFT, size=40, state=uiconst.UI_DISABLED, ignoreSize=True)
         self.characterSprite.state = uiconst.UI_NORMAL
Пример #6
0
    def ShowOffices(self):
        if self.selectedGroupButtonID != OFFICESPANEL:
            return
        self.LoadButtons()
        corpsWithOffices = sm.GetService('corp').GetCorporationsWithOfficesAtStation()
        cfg.corptickernames.Prime([ c.corporationID for c in corpsWithOffices ])
        scrolllist = []
        for corp in corpsWithOffices:
            data = KeyVal()
            data.corpName = corp.corporationName
            data.corpID = corp.corporationID
            data.corporation = corp
            scrolllist.append((data.corpName.lower(), GetListEntry('OfficeEntry', data=data)))

        scrolllist = SortListOfTuples(scrolllist)
        numUnrentedOffices = self.GetNumberOfUnrentedOffices()
        availOfficesLabel = localization.GetByLabel('UI/Station/Lobby/NumAvailableOffices', numOffices=numUnrentedOffices)
        scrolllist.insert(0, GetListEntry('Header', {'label': availOfficesLabel}))
        if not self.destroyed:
            self.officesScroll.Load(contentList=scrolllist)
Пример #7
0
def GetScrollListFromTypeList(invTypeIDs, sublevel, onDropDataFunc):
    subList = []
    for invTypeID in invTypeIDs:
        data = KeyVal()
        data.label = evetypes.GetName(invTypeID)
        data.sublevel = sublevel + 1
        data.ignoreRightClick = 1
        data.showinfo = 1
        data.typeID = invTypeID
        data.OnDropData = onDropDataFunc
        data.OnDblClick = (TryFitModule, invTypeID)
        subList.append((evetypes.GetName(invTypeID), listentry.Get('GenericMarketItem', data=data)))

    subList = [ item[1] for item in Sort(subList, key=lambda x: x[0]) ]
    return subList
    def GetSolarSystemInfo(self, solarSystemID):
        contentList = []
        data = KeyVal()
        data.label = self.GetSystemNameText(solarSystemID)
        headerEntry = listentry.Get(decoClass=SystemNameHeader, data=data)
        contentList.append(headerEntry)
        sovStructuresInfo = self.sovSvc.GetSovStructuresInfoForSolarSystem(solarSystemID)
        structureInfosByTypeID = GetSovStructureInfoByTypeID(sovStructuresInfo)
        tcuInfo = structureInfosByTypeID[typeTerritorialClaimUnit]
        isCapital = tcuInfo.get('isCapital', False)
        sovInfo = self.sovSvc.GetSovInfoForSolarsystem(solarSystemID, isCapital)
        multiplierInfo = self.GetMultiplierInfo(sovInfo, isCapital)
        statusEntry = listentry.Get(entryType=None, data=multiplierInfo, decoClass=SovSystemStatusEntry)
        contentList.append(statusEntry)
        if sovStructuresInfo:
            for structureTypeID, structureInfo in structureInfosByTypeID.iteritems():
                if not structureInfo.get('itemID', None):
                    continue
                entryData = KeyVal(structureInfo=structureInfo)
                structureEntry = listentry.Get(entryType=None, data=entryData, decoClass=SovStructureStatusEntry)
                contentList.append(structureEntry)

        return contentList
Пример #9
0
    def ShowInfo(self, args):
        parsedArgs = self.ParseShowInfo(args)
        if not parsedArgs:
            return
        typeID, itemID, data = parsedArgs
        categoryID = evetypes.GetCategoryID(typeID)
        if categoryID == const.categoryAbstract:
            abstractinfo = KeyVal()
            if typeID == const.typeCertificate:
                abstractinfo.certificateID = itemID
            sm.GetService('info').ShowInfo(typeID, itemID, abstractinfo=abstractinfo)
        elif categoryID == const.categoryBlueprint and data:
            try:
                copy, runs, material, productivity = data
                abstractinfo = KeyVal(categoryID=const.categoryBlueprint, runs=int(runs), isCopy=bool(int(copy)), productivityLevel=int(productivity), materialLevel=int(material))
                if itemID == 0:
                    itemID = None
                sm.GetService('info').ShowInfo(typeID, itemID, abstractinfo=abstractinfo)
            except:
                log.LogInfo('Could not convert blueprint extra data to valid parameters', data)

        else:
            sm.GetService('info').ShowInfo(typeID, itemID)
Пример #10
0
 def GetDragData(self, *args):
     if self and not self.destroyed:
         fakeNode = KeyVal()
         fakeNode.charID = self.charID
         fakeNode.typeID = self.info.typeID
         fakeNode.info = self.info
         fakeNode.itemID = self.itemID
         fakeNode.__guid__ = 'listentry.User'
         return [fakeNode]
     else:
         return []
Пример #11
0
    def GetLegendEntries(self, data):
        legendList = sm.GetService('starmap').GetLegend(data.key)
        legendList.sort()
        scrolllist = []
        for legendItem in legendList:
            kv = KeyVal()
            kv.label = legendItem.caption
            kv.key = data.key
            kv.editable = False
            kv.selectable = True
            kv.hilightable = False
            kv.legend = legendItem
            scrolllist.append(listentry.Get('LegendEntry', data=kv))

        return scrolllist
Пример #12
0
    def GetSubContent(self, data, *args):
        scrolllist = []
        for typeID, quantity in data.groupItems.iteritems():
            data = KeyVal()
            data.label = '%s<t>%s' % (evetypes.GetName(typeID), quantity)
            data.typeID = typeID
            data.GetMenu = self.OnGetEntryMenu
            data.itemID = None
            data.getIcon = 1
            scrolllist.append(listentry.Get('Item', data=data))

        return scrolllist
Пример #13
0
 def GetDragData(self):
     ret = KeyVal(nodeType='AccessGroupEntry',
                  groupID=self.groupID,
                  label=self.sr.node.groupInfo.name)
     return [ret]
Пример #14
0
 def LoadActivity(self, activityID):
     """
     Loads the scroll area with the skill and material requirements for this activity.
     TODO: Add time information.
     """
     settings.char.ui.Set('blueprintShowInfoActivityID', activityID)
     self.job = industry.Job(self.bpData, activityID)
     self.activityNameLabel.text = self.job.activity.GetHint()
     entries = []
     entries.append(
         listentry.Get(
             decoClass=listentry.LabelTextSides,
             data=KeyVal(
                 line=1,
                 label=localization.GetByLabel('UI/Industry/TimePerRun'),
                 text=self.job.GetJobTimeLeftLabel())))
     if self.job.activityID == industry.COPYING:
         entries.append(
             listentry.Get(decoClass=listentry.LabelTextSides,
                           data=KeyVal(
                               line=1,
                               label=localization.GetByLabel(
                                   'UI/Industry/MaxRunsPerCopy'),
                               text=self.bpData.maxProductionLimit)))
     if self.job.activityID == industry.INVENTION:
         entries.append(
             listentry.Get(decoClass=listentry.LabelTextSides,
                           data=KeyVal(
                               line=1,
                               label=localization.GetByLabel(
                                   'UI/Industry/JobSuccessProbability'),
                               text='%s%%' % (self.job.probability * 100))))
     entries.append(
         listentry.Get(decoClass=listentry.Group,
                       data=KeyVal(GetSubContent=self.LoadOutcome,
                                   label=self.GetOutcomeCaption(),
                                   groupItems=self.job.products,
                                   id='outcome',
                                   showicon='hide',
                                   showlen=False,
                                   state='locked',
                                   BlockOpenWindow=True)))
     entries.append(
         listentry.Get(
             decoClass=listentry.Group,
             data=KeyVal(
                 GetSubContent=self.LoadSkills,
                 label=localization.GetByLabel(
                     'UI/Industry/RequiredSkills'),
                 groupItems=[(skill.typeID, skill.level, skill.GetHint())
                             for skill in self.job.required_skills],
                 id='skills',
                 showicon='hide',
                 noItemText=localization.GetByLabel('UI/Common/None'),
                 state='locked',
                 BlockOpenWindow=True)))
     materialsData = self.job.GetMaterialsByGroups()
     entries.append(
         listentry.Get(
             decoClass=listentry.Group,
             data=KeyVal(
                 GetSubContent=self.LoadMaterialGroups,
                 label=localization.GetByLabel(
                     'UI/Industry/RequiredInputMaterials'),
                 groupItems=materialsData,
                 id='materialGroups',
                 showicon='hide',
                 noItemText=localization.GetByLabel('UI/Common/None'),
                 state='locked',
                 BlockOpenWindow=True)))
     self.scroll.Load(contentList=entries)
Пример #15
0
 def PrimeJumpData(self, fromSolarSystemID, toSolarSystemID, jumpType):
     jumpInfo = KeyVal()
     jumpInfo.jumpType = jumpType
     jumpInfo.fromSolarSystemID = fromSolarSystemID
     jumpInfo.toSolarSystemID = toSolarSystemID
     return jumpInfo
Пример #16
0
    def ReloadDashboard(self):
        self.scroll.Clear()
        self.sortedScrollNodes = []
        structuresPerSolarsystem = self.sovSvc.GetSovereigntyStructuresInfoForAlliance(
        )
        indexData = self.sovSvc.GetAllDevelopmentIndicesMapped()
        cfg.evelocations.Prime(structuresPerSolarsystem.keys())
        cfg.evelocations.Prime({
            cfg.mapSystemCache.Get(solarsystemID).constellationID
            for solarsystemID in structuresPerSolarsystem
        })
        cfg.evelocations.Prime({
            cfg.mapSystemCache.Get(solarsystemID).regionID
            for solarsystemID in structuresPerSolarsystem
        })
        myCapitalSystemID = self.sovSvc.GetMyCapitalSystem()
        GetAutopilotJumpCount = sm.GetService(
            'clientPathfinderService').GetAutopilotJumpCount
        GetIndexLevel = self.sovSvc.GetIndexLevel
        GetLocation = cfg.evelocations.Get
        batchSize = 5
        batchList = []
        for solarsystemID, structures in structuresPerSolarsystem.iteritems():
            if not self.IncludesTCU(structures):
                continue
            systemIndexInfo = indexData.get(solarsystemID, None)
            if systemIndexInfo:
                militaryIndexLevel = GetIndexLevel(
                    systemIndexInfo[const.attributeDevIndexMilitary],
                    const.attributeDevIndexMilitary).level
                industrialIndexLevel = GetIndexLevel(
                    systemIndexInfo[const.attributeDevIndexIndustrial],
                    const.attributeDevIndexIndustrial).level
                strategicIndexLevel = GetIndexLevel(
                    systemIndexInfo[const.attributeDevIndexSovereignty],
                    const.attributeDevIndexSovereignty).level
            else:
                militaryIndexLevel = 0
                industrialIndexLevel = 0
                strategicIndexLevel = 0
            solarSystemMapSystemCache = cfg.mapSystemCache.Get(solarsystemID)
            constellationID = solarSystemMapSystemCache.constellationID
            regionID = solarSystemMapSystemCache.regionID
            jumpCount = GetAutopilotJumpCount(session.solarsystemid2,
                                              solarsystemID)
            solarsystemSortingString = GetLocation(solarsystemID).name.lower()
            constellationSortingString = GetLocation(
                constellationID).name.lower()
            regionSortingString = cfg.evelocations.Get(regionID).name.lower()
            isCapital = myCapitalSystemID == solarsystemID
            multiplier = 1 / GetOccupancyMultiplier(
                militaryIndexLevel, industrialIndexLevel, strategicIndexLevel,
                isCapital)
            sortValues = [
                solarsystemSortingString, constellationSortingString,
                regionSortingString, jumpCount, multiplier,
                strategicIndexLevel, militaryIndexLevel, industrialIndexLevel
            ]
            searchValue = '%s %s %s' % (solarsystemSortingString,
                                        constellationSortingString,
                                        regionSortingString)
            if isCapital:
                searchValue += ' %s' % GetByLabel(
                    'UI/Sovereignty/CurrentCapital').lower()
            entryData = KeyVal(isCapital=isCapital,
                               devIndexes=(militaryIndexLevel,
                                           industrialIndexLevel,
                                           strategicIndexLevel),
                               multiplier=multiplier,
                               jumpCount=jumpCount,
                               solarSystemID=solarsystemID,
                               constellationID=constellationID,
                               regionID=regionID,
                               columnWidths=self.columnWidths,
                               sortValues=sortValues,
                               height=self.entryClass.ENTRYHEIGHT,
                               fixedHeight=self.entryClass.ENTRYHEIGHT,
                               searchValue=searchValue)
            entry = listentry.Get(data=entryData, decoClass=self.entryClass)
            batchList.append(entry)
            if len(batchList) == batchSize:
                self.AddBatchToScroll(batchList)
                batchList = []
                blue.pyos.BeNice(100)
                if self.destroyed:
                    return

        if batchList:
            self.AddBatchToScroll(batchList)
        else:
            self.UpdateScrollList()
Пример #17
0
 def GetScrollEntry(self, label, returnValue, hint = None, icon = None, indentLevel = None):
     if not hint and self.hints:
         hint = self.hints.get(label, '')
     data = KeyVal()
     data.OnClick = self.OnEntryClick
     data.data = (label, returnValue)
     data.label = unicode(label)
     data.fontStyle = self.fontStyle
     data.fontFamily = self.fontFamily
     data.fontPath = self.fontPath
     data.fontsize = self.fontsize
     data.shadow = (self.shadow,)
     data.decoClass = self.GetEntryClass()
     data.hideLines = True
     data.icon = icon
     data.indentLevel = indentLevel
     data.hint = hint
     if returnValue == self.selectedValue:
         data.isSelected = True
     return (data, returnValue)
    def ShowDirectionalSearchResult(self, *args):
        self.listtype = 'location'
        scrolllist = []
        if self.scanresult and len(self.scanresult):
            myball = None
            ballpark = sm.GetService('michelle').GetBallpark()
            if ballpark:
                myball = ballpark.GetBall(eve.session.shipid)
            prime = []
            for result in self.scanresult:
                slimItem, ball, celestialRec = result
                if not slimItem and celestialRec:
                    prime.append(celestialRec.id)

            if prime:
                cfg.evelocations.Prime(prime)
            for slimItem, ball, celestialRec in self.scanresult:
                if self is None or self.destroyed:
                    return
                if slimItem:
                    typeName = evetypes.GetName(slimItem.typeID)
                    entryname = GetSlimItemName(slimItem)
                    itemID = slimItem.itemID
                    typeID = slimItem.typeID
                    if not entryname:
                        entryname = evetypes.GetGroupName(slimItem.typeID)
                elif celestialRec:
                    typeName = evetypes.GetName(celestialRec.typeID)
                    if evetypes.GetGroupID(celestialRec.typeID) == const.groupHarvestableCloud:
                        entryname = GetByLabel('UI/Inventory/SlimItemNames/SlimHarvestableCloud', typeName)
                    elif evetypes.GetCategoryID(celestialRec.typeID) == const.categoryAsteroid:
                        entryname = GetByLabel('UI/Inventory/SlimItemNames/SlimAsteroid', typeName)
                    else:
                        entryname = cfg.evelocations.Get(celestialRec.id).name
                    if not entryname:
                        entryname = typeName
                    itemID = celestialRec.id
                    typeID = celestialRec.typeID
                else:
                    continue
                if ball is not None:
                    dist = ball.surfaceDist
                    diststr = FmtDist(dist, maxdemicals=1)
                else:
                    dist = 0
                    diststr = '-'
                groupID = evetypes.GetGroupID(typeID)
                if not eve.session.role & (service.ROLE_GML | service.ROLE_WORLDMOD):
                    if groupID == const.groupCloud:
                        continue
                data = KeyVal()
                data.label = '%s<t>%s<t>%s' % (entryname, typeName, diststr)
                data.entryName = entryname
                data.typeName = typeName
                data.Set('sort_%s' % GetByLabel('UI/Common/Distance'), dist)
                data.columnID = 'directionalResultGroupColumn'
                data.result = result
                data.itemID = itemID
                data.typeID = typeID
                data.GetMenu = self.DirectionalResultMenu
                scrolllist.append(listentry.Get('DirectionalScanResults', data=data))
                blue.pyos.BeNice()

        if not len(scrolllist):
            data = KeyVal()
            data.label = GetByLabel('UI/Inflight/Scanner/DirectionalNoResult')
            data.hideLines = 1
            scrolllist.append(listentry.Get('Generic', data=data))
            headers = []
        else:
            headers = [GetByLabel('UI/Common/Name'), GetByLabel('UI/Common/Type'), GetByLabel('UI/Common/Distance')]
        self.sr.dirscroll.Load(contentList=scrolllist, headers=headers)
Пример #19
0
 def GetBookmark(self, ids, itemID, typeID):
     x, y, z, agentIDString, locationNumber, locationType = (float(ids[2]),
      float(ids[3]),
      float(ids[4]),
      ids[5],
      int(ids[6]),
      ids[7])
     agentIDList = [ int(s) for s in agentIDString.split(',') ]
     bookmark = KeyVal()
     bookmark.ownerID = eve.session.charid
     bookmark.itemID = itemID
     bookmark.typeID = typeID
     bookmark.flag = None
     bookmark.memo = ''
     bookmark.created = blue.os.GetWallclockTime()
     bookmark.x = x
     bookmark.y = y
     bookmark.z = z
     bookmark.locationID = itemID
     bookmark.agentID = agentIDList[0]
     bookmark.referringAgentID = agentIDList[1] if len(agentIDList) == 2 else None
     bookmark.locationNumber = locationNumber
     bookmark.locationType = locationType
     if bookmark.locationType == 'dungeon' or bookmark.locationType == 'agenthomebase':
         bookmark.deadspace = 1
     return bookmark
Пример #20
0
 def OnClick(self):
     sm.GetService('info').ShowInfo(self.typeID, self.itemID, abstractinfo=KeyVal(bpData=self.bpData))
Пример #21
0
 def GetMenu(self):
     return sm.GetService('menu').GetMenuFormItemIDTypeID(self.itemID, self.typeID, ignoreMarketDetails=0, abstractInfo=KeyVal(bpData=self.bpData))
Пример #22
0
 def MakeSampleData(self):
     from utillib import KeyVal
     msg = KeyVal({'senderName': 'SampleSender',
      'subject': 'sampleSubject'})
     return NewMailFormatter.MakeData(msg)
Пример #23
0
def GetCombatEntries(recent, filterText=''):
    showAsCondensed = settings.user.ui.Get('charsheet_condensedcombatlog', 0)
    if showAsCondensed:
        headers = [
            GetByLabel('UI/Common/Date'),
            GetByLabel('UI/Common/Type'),
            GetByLabel('UI/Common/Name'),
            GetByLabel('UI/Common/Corporation'),
            GetByLabel('UI/Common/Alliance'),
            GetByLabel('UI/Common/Faction')
        ]
    else:
        headers = []
    primeEveOwners = set()
    primeEveLocations = set()
    primeCorps = set()
    primeAlliances = set()
    ret = []
    unknownShipLabel = GetByLabel(
        'UI/CharacterSheet/CharacterSheetWindow/KillsTabs/UnknownShip')
    unknownNameLabel = GetByLabel(
        'UI/CharacterSheet/CharacterSheetWindow/KillsTabs/UnknownName')
    unknownCorporationLabel = GetByLabel(
        'UI/CharacterSheet/CharacterSheetWindow/KillsTabs/UnknownCorporation')
    unknownAllianceLabel = GetByLabel(
        'UI/CharacterSheet/CharacterSheetWindow/KillsTabs/UnknownAlliance')
    unknownFactionLabel = GetByLabel(
        'UI/CharacterSheet/CharacterSheetWindow/KillsTabs/UnknownFaction')
    for kill in recent:
        primeEveLocations.add(kill.solarSystemID)
        primeEveLocations.add(kill.moonID)
        primeEveOwners.add(kill.victimCharacterID)
        primeEveOwners.add(kill.victimCorporationID)
        primeCorps.add(kill.victimCorporationID)
        primeEveOwners.add(kill.victimAllianceID)
        primeAlliances.add(kill.victimAllianceID)
        primeEveOwners.add(kill.victimFactionID)
        primeEveOwners.add(kill.finalCharacterID)
        primeEveOwners.add(kill.finalCorporationID)
        primeCorps.add(kill.finalCorporationID)
        primeEveOwners.add(kill.finalAllianceID)
        primeAlliances.add(kill.finalAllianceID)
        primeEveOwners.add(kill.finalFactionID)

    cfg.eveowners.Prime(filter(None, primeEveOwners))
    cfg.evelocations.Prime(filter(None, primeEveLocations))
    cfg.corptickernames.Prime(filter(None, primeCorps))
    cfg.allianceshortnames.Prime(filter(None, primeAlliances))

    def GetOwnerName(ownerID):
        owner = cfg.eveowners.GetIfExists(ownerID)
        return getattr(owner, 'name', '')

    def GetTypeName(typeID):
        try:
            return evetypes.GetName(typeID)
        except evetypes.TypeNotFoundException:
            return ''

    def FilterOut(kill):
        if not filterText:
            return False
        if GetTypeName(kill.victimShipTypeID).lower().find(filterText) >= 0:
            return False
        for ownerID in [
                kill.victimCharacterID, kill.victimCorporationID,
                kill.victimAllianceID
        ]:
            ownerName = GetOwnerName(ownerID)
            if ownerName.lower().find(filterText) >= 0:
                return False

        return True

    for kill in recent:
        if FilterOut(kill):
            continue
        if showAsCondensed:
            data = KeyVal()
            timeOfKill = FmtDate(kill.killTime)
            shipOfCharacterKilled = GetTypeName(
                kill.victimShipTypeID) or unknownShipLabel
            characterKilled = GetOwnerName(
                kill.victimCharacterID) or unknownNameLabel
            corporationOfCharacterKilled = GetOwnerName(
                kill.victimCorporationID) or unknownCorporationLabel
            allianceOfCharacterKilled = GetOwnerName(
                kill.victimAllianceID) or unknownAllianceLabel
            factionOfCharacterKilled = GetOwnerName(
                kill.victimFactionID) or unknownFactionLabel
            labelList = [
                timeOfKill, shipOfCharacterKilled, characterKilled,
                corporationOfCharacterKilled, allianceOfCharacterKilled,
                factionOfCharacterKilled
            ]
            data.label = '<t>'.join(labelList)
            data.GetMenu = GetCombatMenu
            data.OnDblClick = (GetCombatDblClick, data)
            data.kill = kill
            data.mail = kill
            ret.append(entries.Get('KillMailCondensed', data=data))
        else:
            ret.append(entries.Get('KillMail', {'mail': kill}))

    return (ret, headers)
Пример #24
0
    def ReloadDashboard(self, *args):
        self.scroll.Clear()
        self.sortedScrollNodes = []
        structuresPerSolarsystem = sm.GetService(
            'sov').GetSovereigntyStructuresInfoForAlliance()
        cfg.evelocations.Prime(structuresPerSolarsystem.keys())
        cfg.evelocations.Prime({
            cfg.mapSystemCache.Get(solarsystemID).constellationID
            for solarsystemID in structuresPerSolarsystem
        })
        cfg.evelocations.Prime({
            cfg.mapSystemCache.Get(solarsystemID).regionID
            for solarsystemID in structuresPerSolarsystem
        })
        GetAutopilotJumpCount = sm.GetService(
            'clientPathfinderService').GetAutopilotJumpCount
        batchSize = 5
        batchList = []
        for solarsystemID, structures in structuresPerSolarsystem.iteritems():
            solarSystemMapSystemCache = cfg.mapSystemCache.Get(solarsystemID)
            constellationID = solarSystemMapSystemCache.constellationID
            regionID = solarSystemMapSystemCache.regionID
            jumpCount = GetAutopilotJumpCount(session.solarsystemid2,
                                              solarsystemID)
            solarsystemSortingString = cfg.evelocations.Get(
                solarsystemID).name.lower()
            constellationSortingString = cfg.evelocations.Get(
                constellationID).name.lower()
            regionSortingString = cfg.evelocations.Get(regionID).name.lower()
            for structureInfo in structures:
                structureStatusString, timeString = GetStructureStatusString(
                    structureInfo, getTimeString=True)
                structureStatusString = structureStatusString.lower()
                sortValues = [
                    solarsystemSortingString, constellationSortingString,
                    regionSortingString, jumpCount,
                    structureInfo.defenseMultiplier, structureInfo.typeID,
                    structureStatusString, timeString
                ]
                structureInfo.solarSystemID = solarsystemID
                structureInfo.constellationID = constellationID
                structureInfo.regionID = regionID
                entryData = KeyVal(
                    jumpCount=jumpCount,
                    structureInfo=structureInfo,
                    solarSystemID=solarsystemID,
                    constellationID=constellationID,
                    regionID=regionID,
                    columnWidths=self.columnWidths,
                    sortValues=sortValues,
                    height=self.entryClass.ENTRYHEIGHT,
                    fixedHeight=self.entryClass.ENTRYHEIGHT,
                    searchValue='%s %s %s %s %s' %
                    (solarsystemSortingString, constellationSortingString,
                     regionSortingString, structureStatusString,
                     timeString.lower()))
                entry = listentry.Get(data=entryData,
                                      decoClass=self.entryClass)
                batchList.append(entry)
                if len(batchList) == batchSize:
                    self.AddBatchToScroll(batchList)
                    batchList = []
                    blue.pyos.BeNice(100)
                    if self.destroyed:
                        return

        if batchList:
            self.AddBatchToScroll(batchList)
        else:
            self.UpdateScrollList()
Пример #25
0
    def ShowMySkillHistory(self):
        def GetPts(lvl):
            return charskills.GetSPForLevelRaw(stc, lvl)

        self.topCont.Hide()
        self.scroll.sr.id = 'charsheet_skillhistory'
        rs = sm.GetService('skills').GetSkillHistory()
        scrolllist = []
        actions = {
            const.skillEventClonePenalty:
            GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillClonePenalty'
            ),
            const.skillEventTrainingStarted:
            GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillTrainingStarted'
            ),
            const.skillEventTrainingComplete:
            GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillTrainingComplete'
            ),
            const.skillEventTrainingCancelled:
            GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillTrainingCanceled'
            ),
            const.skillEventGMGive:
            GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/GMGiveSkill'
            ),
            const.skillEventQueueTrainingCompleted:
            GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillTrainingComplete'
            ),
            const.skillEventFreeSkillPointsUsed:
            GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillPointsApplied'
            ),
            const.skillEventSkillExtracted:
            GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillLevelExtracted'
            )
        }
        for r in rs:
            skill = sm.GetService('skills').GetSkill(r.skillTypeID)
            if skill:
                stc = skill.skillRank
                levels = [
                    0,
                    GetPts(1),
                    GetPts(2),
                    GetPts(3),
                    GetPts(4),
                    GetPts(5)
                ]
                level = 5
                for i in range(len(levels)):
                    if levels[i] > r.absolutePoints:
                        level = i - 1
                        break

                data = KeyVal()
                data.label = FmtDate(r.logDate, 'ls') + '<t>'
                data.label += evetypes.GetName(r.skillTypeID) + '<t>'
                data.label += actions.get(
                    r.eventTypeID, GetByLabel('UI/Generic/Unknown')) + '<t>'
                data.label += FormatNumeric(level)
                data.Set('sort_%s' % GetByLabel('UI/Common/Date'), r.logDate)
                data.id = r.skillTypeID
                data.level = level
                data.GetMenu = self.GetItemMenu
                data.MenuFunction = self.GetItemMenu
                data.OnDblClick = (self.DblClickShowInfo, data)
                addItem = entries.Get('Generic', data=data)
                scrolllist.append(addItem)

        self.scroll.Load(
            contentList=scrolllist,
            headers=[
                GetByLabel('UI/Common/Date'),
                GetByLabel(
                    'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/Skill'),
                GetByLabel(
                    'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/Action'),
                GetByLabel(
                    'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/Level')
            ],
            noContentHint=GetByLabel(
                'UI/CharacterSheet/CharacterSheetWindow/SkillTabs/NoRecordsFound'
            ),
            reversesort=True)
Пример #26
0
 def AddCheckBox(self, config, scrolllist, group = None, usecharsettings = 0, sublevel = 0):
     cfgname, retval, desc, default = config
     data = KeyVal()
     data.label = desc
     data.checked = default
     data.cfgname = cfgname
     data.retval = retval
     data.group = group
     data.sublevel = sublevel
     data.OnChange = self.CheckBoxChange
     data.usecharsettings = usecharsettings
     data.hideLines = True
     if scrolllist is not None:
         scrolllist.append(listentry.Get('Checkbox', data=data))
     else:
         return listentry.Get('Checkbox', data=data)
Пример #27
0
def TryFit(invItems, shipID=None):
    if not shipID:
        shipID = GetActiveShip()
        if not shipID:
            return
    godma = sm.services['godma']
    invCache = sm.GetService('invCache')
    shipInv = invCache.GetInventoryFromId(shipID,
                                          locationID=session.stationid2)
    godmaSM = godma.GetStateManager()
    useRigs = None
    charges = set()
    drones = []
    subSystemGroupIDs = set()
    for invItem in invItems[:]:
        if IsFittingModule(invItem.categoryID):
            moduleEffects = cfg.dgmtypeeffects.get(invItem.typeID, [])
            for mEff in moduleEffects:
                if mEff.effectID == const.effectRigSlot:
                    if useRigs is None:
                        useRigs = True if RigFittingCheck(invItem) else False
                    if not useRigs:
                        invItems.remove(invItem)
                        invCache.UnlockItem(invItem.itemID)
                        break

        if invItem.categoryID == const.categorySubSystem:
            if invItem.groupID in subSystemGroupIDs:
                invItems.remove(invItem)
            else:
                subSystemGroupIDs.add(invItem.groupID)
        elif invItem.categoryID == const.categoryCharge:
            charges.add(invItem)
            invItems.remove(invItem)
        elif invItem.categoryID == const.categoryDrone:
            drones.append(invItem)
            invItems.remove(invItem)

    if len(invItems) > 0:
        shipInv.moniker.MultiAdd([invItem.itemID for invItem in invItems],
                                 invItems[0].locationID,
                                 flag=const.flagAutoFit)
    if charges:
        shipStuff = shipInv.List()
        shipStuff.sort(key=lambda r: (r.flagID, isinstance(r.itemID, tuple)))
        loadedSlots = set()
    if drones:
        invCtrl.ShipDroneBay(shipID or GetActiveShip()).AddItems(drones)
    dogmaLocation = sm.GetService('clientDogmaIM').GetDogmaLocation()
    shipDogmaItem = dogmaLocation.dogmaItems.get(shipID, None)
    loadedSomething = False
    for DBRowInvItem in charges:
        invItem = KeyVal(DBRowInvItem)
        chargeDgmType = godmaSM.GetType(invItem.typeID)
        isCrystalOrScript = invItem.groupID in cfg.GetCrystalGroups()
        for row in shipStuff:
            if row in loadedSlots:
                continue
            if not IsShipFittingFlag(row.flagID):
                continue
            if dogmaLocation.IsInWeaponBank(
                    row.locationID,
                    row.itemID) and dogmaLocation.IsModuleSlave(
                        row.itemID, row.locationID):
                continue
            if row.categoryID == const.categoryCharge:
                continue
            moduleDgmType = godmaSM.GetType(row.typeID)
            desiredSize = getattr(moduleDgmType, 'chargeSize', None)
            for x in xrange(1, 5):
                chargeGroup = getattr(moduleDgmType, 'chargeGroup%d' % x,
                                      False)
                if not chargeGroup:
                    continue
                if chargeDgmType.groupID != chargeGroup:
                    continue
                if desiredSize and getattr(chargeDgmType, 'chargeSize',
                                           -1) != desiredSize:
                    continue
                for i, squatter in enumerate(
                    [i for i in shipStuff if i.flagID == row.flagID]):
                    if isCrystalOrScript and i > 0:
                        break
                    if shipDogmaItem is None:
                        continue
                    subLocation = dogmaLocation.GetSubLocation(
                        shipID, squatter.flagID)
                    if subLocation is None:
                        continue
                    chargeVolume = chargeDgmType.volume * dogmaLocation.GetAttributeValue(
                        subLocation, const.attributeQuantity)
                    if godmaSM.GetType(row.typeID).capacity <= chargeVolume:
                        break
                else:
                    moduleCapacity = godmaSM.GetType(row.typeID).capacity
                    numCharges = moduleCapacity / chargeDgmType.volume
                    subLocation = dogmaLocation.GetSubLocation(
                        shipID, row.flagID)
                    if subLocation:
                        numCharges -= dogmaLocation.GetAttributeValue(
                            subLocation, const.attributeQuantity)
                    dogmaLocation.LoadAmmoToModules(shipID, [row.itemID],
                                                    invItem.typeID,
                                                    invItem.itemID,
                                                    invItem.locationID)
                    loadedSomething = True
                    invItem.stacksize -= numCharges
                    loadedSlots.add(row)
                    blue.pyos.synchro.SleepWallclock(100)
                    break

            else:
                continue

            if invItem.stacksize <= 0:
                break
        else:
            if not loadedSomething:
                uicore.Message('NoSuitableModules')
Пример #28
0
 def GetDragData(self, *args):
     entry = KeyVal()
     entry.fleet = self.fleet
     entry.__guid__ = 'listentry.FleetFinderEntry'
     return [entry]
Пример #29
0
    def LoadComposition(self):
        fleetSvc = sm.GetService('fleet')
        if not fleetSvc.IsCommanderOrBoss():
            raise UserError('FleetNotCommanderOrBoss')
        scrolllist = []
        composition = fleetSvc.GetFleetComposition()
        fleetHierarchy = fleetSvc.GetFleetHierarchy()
        fleetPositionText = localization.GetByLabel(
            'UI/Fleet/FleetWindow/FleetPosition')
        for kv in composition:
            blue.pyos.BeNice()
            member = fleetSvc.GetMemberInfo(kv.characterID, fleetHierarchy)
            if not fleetSvc.IsMySubordinate(
                    kv.characterID) and not fleetSvc.IsBoss():
                continue
            data = KeyVal()
            charName = localization.GetByLabel('UI/Common/CharacterNameLabel',
                                               charID=kv.characterID)
            locationName = localization.GetByLabel('UI/Common/LocationDynamic',
                                                   location=kv.solarSystemID)
            if kv.stationID:
                locationName = '%s %s' % (
                    locationName,
                    localization.GetByLabel('UI/Fleet/FleetComposition/Docked')
                )
            if kv.shipTypeID is not None:
                shipTypeName = evetypes.GetName(kv.shipTypeID)
                shipGroupName = evetypes.GetGroupName(kv.shipTypeID)
            else:
                shipTypeName = ''
                shipGroupName = ''
            if kv.skills:
                skillLevels = localization.GetByLabel(
                    'UI/Fleet/FleetComposition/SkillLevels',
                    skillLevelA=kv.skills[2],
                    skillLevelB=kv.skills[1],
                    skillLevelC=kv.skills[0])
                data.hint = localization.GetByLabel(
                    'UI/Fleet/FleetComposition/SkillsHint',
                    skillTypeA=kv.skillIDs[2],
                    skillLevelA=kv.skills[2],
                    skillTypeB=kv.skillIDs[1],
                    skillLevelB=kv.skills[1],
                    skillTypeC=kv.skillIDs[0],
                    skillLevelC=kv.skills[0])
            else:
                skillLevels = ''
            if not member.wingName:
                fleetPosition = ''
                positionSortValue = (None, None)
            elif not member.squadName:
                fleetPosition = member.wingName
                positionSortValue = (fleetPosition, None)
            else:
                fleetPosition = '%s / %s ' % (member.wingName,
                                              member.squadName)
                positionSortValue = (member.wingName, member.squadName)
            data.label = '<t>'.join([
                charName, locationName, shipTypeName, shipGroupName,
                member.roleName, skillLevels, fleetPosition
            ])
            data.GetMenu = self.OnCompositionEntryMenu
            data.cfgname = charName
            data.retval = None
            data.charID = kv.characterID
            data.shipTypeID = kv.shipTypeID
            data.solarSystemID = kv.solarSystemID
            data.info = cfg.eveowners.Get(kv.characterID)
            data.Set('sort_%s' % fleetPositionText, positionSortValue)
            scrolllist.append(listentry.Get('FleetCompositionEntry',
                                            data=data))

        self.counterLabel.text = localization.GetByLabel(
            'UI/Fleet/FleetComposition/PilotsSelected',
            numSelected=0,
            numTotalPilots=len(scrolllist))
        self.sr.scrollBroadcasts.sr.id = 'scrollComposition'
        headers = [
            localization.GetByLabel('UI/Common/Name'),
            localization.GetByLabel('UI/Common/Location'),
            localization.GetByLabel('UI/Fleet/FleetComposition/ShipType'),
            localization.GetByLabel('UI/Fleet/FleetComposition/ShipGroup'),
            localization.GetByLabel('UI/Fleet/FleetComposition/FleetRole'),
            localization.GetByLabel('UI/Fleet/FleetComposition/FleetSkills'),
            fleetPositionText
        ]
        self.sr.scrollBroadcasts.Load(headers=headers, contentList=scrolllist)
Пример #30
0
import localization
import eve.common.script.paperDoll.paperDollDefinitions as pdDef
import eve.common.script.paperDoll.paperDollDataManagement as pdDM
from utillib import KeyVal

FACIAL_POSE_PARAMETERS = KeyVal(PortraitPoseNumber='PortraitPoseNumber',
                                HeadLookTarget='HeadLookTarget',
                                HeadTilt='HeadTilt',
                                OrientChar='OrientChar',
                                BrowLeftCurl='BrowLeftCurl',
                                BrowLeftTighten='BrowLeftTighten',
                                BrowLeftUpDown='BrowLeftUpDown',
                                BrowRightCurl='BrowRightCurl',
                                BrowRightTighten='BrowRightTighten',
                                BrowRightUpDown='BrowRightUpDown',
                                EyeClose='EyeClose',
                                EyesLookVertical='EyesLookVertical',
                                EyesLookHorizontal='EyesLookHorizontal',
                                SquintLeft='SquintLeft',
                                SquintRight='SquintRight',
                                JawSideways='JawSideways',
                                JawUp='JawUp',
                                PuckerLips='PuckerLips',
                                FrownLeft='FrownLeft',
                                FrownRight='FrownRight',
                                SmileLeft='SmileLeft',
                                SmileRight='SmileRight')


def CreateRandomDoll(gender, bloodline, doll=None):
    ml = pdDM.ModifierLoader()
    blue.synchro.Yield()
Пример #31
0
 def GetScrollEntry(self,
                    label,
                    returnValue,
                    hint=None,
                    icon=None,
                    indentLevel=None):
     if not hint and self.hints:
         hint = self.hints.get(label, '')
     data = KeyVal()
     data.OnClick = self.OnEntryClick
     data.data = (label, returnValue)
     data.label = unicode(label)
     data.fontStyle = self.fontStyle
     data.fontFamily = self.fontFamily
     data.fontPath = self.fontPath
     data.fontsize = self.fontsize
     data.shadow = (self.shadow, )
     data.decoClass = self.GetEntryClass()
     data.hideLines = True
     data.icon = icon
     data.indentLevel = indentLevel
     data.hint = hint
     if returnValue == self.selectedValue:
         data.isSelected = True
     return (data, returnValue)
Пример #32
0
def GetFittingDragData():
    fittingSvc = sm.StartService('fittingSvc')
    fitting = KeyVal()
    fitting.shipTypeID, fitting.fitData = fittingSvc.GetFittingDictForActiveShip()
    fitting.fittingID = None
    fitting.description = ''
    fitting.name = cfg.evelocations.Get(GetActiveShip()).locationName
    fitting.ownerID = 0
    entry = KeyVal()
    entry.fitting = fitting
    entry.label = fitting.name
    entry.displayText = fitting.name
    entry.__guid__ = 'listentry.FittingEntry'
    return [entry]
Пример #33
0
 def GetDragData(self):
     return [KeyVal(itemID=self.itemID, __guid__='xtriui.TypeIcon', typeID=self.invType.typeID, isReprocessingItem=True)]
Пример #34
0
 def GetDragData(self):
     return [KeyVal(__guid__='uicls.GenericDraggableForTypeID', typeID=self.typeID, label=cfg.invtypes.Get(self.typeID).name, bpData=self.bpData)]
Пример #35
0
 def GetFilterConfig(self):
     return KeyVal(iconPath=self.filterIconPath,
                   label=self.filterLabel,
                   enabled=self.IsFilterEnabled(),
                   color=self.color.GetRGB(),
                   siteType=self.siteType)
Пример #36
0
def GetFittingDragData():
    fittingSvc = sm.StartService('fittingSvc')
    fitting = KeyVal()
    fitting.shipTypeID, fitting.fitData = fittingSvc.GetFittingDictForCurrentFittingWindowShip(
    )
    fitting.fittingID = None
    fitting.description = ''
    fitting.name = cfg.evelocations.Get(GetActiveShip()).locationName
    fitting.ownerID = 0
    if fittingSvc.IsShipSimulated():
        fitting.name = '.simulated %s' % evetypes.GetName(fitting.shipTypeID)
    else:
        fitting.name = cfg.evelocations.Get(GetActiveShip()).locationName
    entry = KeyVal()
    entry.fitting = fitting
    entry.label = fitting.name
    entry.displayText = fitting.name
    entry.__guid__ = 'listentry.FittingEntry'
    return [entry]
Пример #37
0
def GetStateFlagFromData(data):
    charID = getattr(data, 'charID', 0)
    if charID == session.charid:
        return
    fakeSlimItem = KeyVal()
    fakeSlimItem.ownerID = charID
    fakeSlimItem.charID = charID
    fakeSlimItem.corpID = data.Get('corpID', 0)
    fakeSlimItem.allianceID = data.Get('allianceID', 0)
    fakeSlimItem.warFactionID = data.Get('warFactionID', 0)
    if getattr(data, 'bounty', None):
        if data.bounty.bounty > 0.0:
            fakeSlimItem.bounty = data.bounty
    fakeSlimItem.groupID = data.Get('groupID', inventoryConst.groupCharacter)
    fakeSlimItem.categoryID = data.Get('categoryID', inventoryConst.categoryOwner)
    fakeSlimItem.securityStatus = data.Get('securityStatus', None)
    flag = sm.GetService('state').CheckStates(fakeSlimItem, 'flag')
    return flag