예제 #1
0
    def ShowMyHomeStation(self):
        if self.destroyed:
            return
        markerID = (MARKERID_MYHOME, session.charid)
        self.markersHandler.RemoveMarker(markerID)
        try:
            self.markersAlwaysVisible.remove(markerID)
        except:
            pass

        homeStationRow = sm.RemoteSvc('charMgr').GetHomeStationRow()
        homeStationID = homeStationRow.stationID
        if not homeStationID or self.destroyed:
            return
        if self.destroyed:
            return
        solarsystemID = homeStationRow.solarSystemID
        if solarsystemID != self.currentSolarsystem.solarsystemID:
            return
        if IsStation(homeStationID):
            stationInfo = self.mapSvc.GetStation(homeStationID)
            pos = (stationInfo.x, stationInfo.y, stationInfo.z)
        else:
            stationInfo = Bundle(stationID=homeStationID,
                                 stationTypeID=homeStationRow.stationTypeID)
            pos = TryGetPosFromItemID(homeStationID, solarsystemID)
        localPosition = SolarSystemPosToMapPos(pos)
        markerObject = self.markersHandler.AddSolarSystemBasedMarker(
            markerID,
            MarkerMyHome,
            stationInfo=stationInfo,
            solarSystemID=solarsystemID,
            mapPositionLocal=localPosition,
            mapPositionSolarSystem=(0, 0, 0))
        self.markersAlwaysVisible.add(markerID)
예제 #2
0
 def OnClientEvent_MoveFromCargoToHangar(self,
                                         sourceID,
                                         destinationID,
                                         destinationFlag=None):
     if sourceID > const.minFakeItem:
         self.LogAchievementEvent(eventConst.ITEMS_LOOT_CLIENT)
         return
     if session.stationid2:
         sourceLocationItem = sm.GetService('invCache').FetchItem(
             sourceID, session.stationid2)
         if not sourceLocationItem:
             return
         if sourceLocationItem.categoryID == const.categoryShip and (
                 IsStation(destinationID)
                 or destinationFlag == const.flagHangar):
             self.LogAchievementEvent(
                 eventConst.ITEMS_MOVE_FROM_CARGO_TO_HANGAR_CLIENT)
예제 #3
0
 def JumpCloneMenu(self, node):
     m = []
     validLocation = node.locationID in cfg.evelocations
     if eve.session.stationid and validLocation:
         m += [None]
         m += [(MenuLabel(
             'UI/CharacterSheet/CharacterSheetWindow/JumpCloneScroll/Jump'),
                sm.GetService('clonejump').CloneJump, (node.locationID, ))]
     if validLocation:
         m.append((MenuLabel(
             'UI/CharacterSheet/CharacterSheetWindow/JumpCloneScroll/Destroy'
         ), sm.GetService('clonejump').DestroyInstalledClone,
                   (node.jumpCloneID, )))
         if IsStation(node.locationID):
             stationInfo = sm.StartService('ui').GetStation(node.locationID)
             m += sm.StartService('menu').CelestialMenu(
                 node.locationID,
                 typeID=stationInfo.stationTypeID,
                 parentID=stationInfo.solarSystemID)
         m += [(MenuLabel('UI/Commands/SetName'), self.SetJumpCloneName,
                (node.jumpCloneID, node.cloneName))]
     return m
예제 #4
0
    def GetCurrentStationAndStationLocation(self):
        if self.stationID is None:
            return
        if not IsStation(self.stationID):
            return {
                'stationName': self.cfg.evelocations.Get(self.stationID).name,
                'orbitName': '',
                'shortOrbitName': ''
            }

        def CleanString(locationString):
            locationString = self.uiutil.StripTags(locationString,
                                                   stripOnly=['localized'])
            locationString = locationString.replace(
                self.localization.HIGHLIGHT_IMPORTANT_MARKER, '')
            return locationString

        orbitID = self.cfg.stations.Get(self.stationID).orbitID
        orbitName = self.cfg.evelocations.Get(orbitID).name
        orbitName = CleanString(orbitName)
        solarsystemName = self.cfg.evelocations.Get(self.solarSystemID).name
        solarsystemName = CleanString(solarsystemName)
        shortOrbitName = orbitName.replace(solarsystemName, '').strip()
        moonText = self.localization.GetByLabel(
            'UI/Locations/LocationMoonLong')
        shortOrbitName = shortOrbitName.replace(moonText,
                                                '').replace('  ', ' ')
        stationName = self.cfg.evelocations.Get(self.stationID).name
        stationName = CleanString(stationName)
        stationNameWithoutOrbit = stationName.replace(orbitName, '')
        stationNameWithoutOrbit = stationNameWithoutOrbit.strip(' - ')
        stationInfo = {
            'stationName': stationNameWithoutOrbit,
            'orbitName': orbitName,
            'shortOrbitName': shortOrbitName
        }
        return stationInfo
예제 #5
0
 def GetSkillLimits(self, stationID):
     return marketutil.GetSkillLimits(
         lambda: self.GetBaseTax(stationID),
         lambda typeIDs: self.GetMarketSkills(), self.GetBaseTax,
         IsStation(stationID))
예제 #6
0
 def GetBaseTax(self, stationID):
     if IsStation(stationID):
         return const.marketCommissionPercentage
     else:
         return self.GetMarketTaxAtStructure(stationID)
예제 #7
0
    def LoadPanel(self, *args):
        jumpCloneSvc = sm.GetService('clonejump')
        jumpClones = jumpCloneSvc.GetClones()
        scrolllist = []
        lastJump = jumpCloneSvc.LastCloneJumpTime()
        hoursLimit = sm.GetService('godma').GetItem(
            session.charid).cloneJumpCoolDown
        if lastJump:
            jumpTime = lastJump + hoursLimit * const.HOUR
            nextJump = jumpTime > blue.os.GetWallclockTime()
        else:
            nextJump = False
        nextAvailableLabel = GetByLabel(
            'UI/CharacterSheet/CharacterSheetWindow/JumpCloneScroll/NextCloneJump'
        )
        availableNow = GetByLabel(
            'UI/CharacterSheet/CharacterSheetWindow/JumpCloneScroll/Now')
        if nextJump:
            scrolllist.append(
                entries.Get(
                    'TextTimer', {
                        'line': 1,
                        'label': nextAvailableLabel,
                        'text': FmtDate(lastJump),
                        'iconID': const.iconDuration,
                        'countdownTime': int(jumpTime),
                        'finalText': availableNow
                    }))
        else:
            scrolllist.append(
                entries.Get(
                    'TextTimer', {
                        'line': 1,
                        'label': nextAvailableLabel,
                        'text': availableNow,
                        'iconID': const.iconDuration,
                        'countdownTime': 0
                    }))
        if jumpClones:
            d = OrderedDict([('station', {}), ('shipOrStructure', {})])
            primeLocs = []
            for jc in jumpClones:
                jumpCloneID = jc.jumpCloneID
                locationID = jc.locationID
                cloneName = jc.cloneName
                primeLocs.append(locationID)
                destinationType = 'station' if IsStation(
                    locationID) else 'shipOrStructure'
                d[destinationType][locationID] = (jumpCloneID, locationID,
                                                  cloneName)

            cfg.evelocations.Prime(primeLocs)
            for locInfo in d.itervalues():
                locIDs = locInfo.keys()
                locNames = self.GetLocNames(locIDs)
                locNames = localization.util.Sort(locNames, key=lambda x: x[0])
                for _, locationString, locationID in locNames:
                    infoForLocation = locInfo[locationID]
                    cloneName = infoForLocation[2]
                    label = '%s - %s' % (cloneName, locationString
                                         ) if cloneName else locationString
                    groupID = infoForLocation
                    data = {
                        'GetSubContent': self.GetCloneImplants,
                        'label': label,
                        'id': groupID,
                        'jumpCloneID': infoForLocation[0],
                        'locationID': infoForLocation[1],
                        'cloneName': cloneName,
                        'state': 'locked',
                        'iconMargin': 18,
                        'showicon':
                        'res:/ui/Texture/WindowIcons/jumpclones.png',
                        'sublevel': 0,
                        'MenuFunction': self.JumpCloneMenu,
                        'showlen': 0
                    }
                    scrolllist.append(entries.Get('Group', data))

        self.scroll.sr.id = 'charsheet_jumpclones'
        noClonesFoundHint = GetByLabel(
            'UI/CharacterSheet/CharacterSheetWindow/JumpCloneScroll/NoJumpClonesFound'
        )
        self.scroll.Load(contentList=scrolllist,
                         noContentHint=noClonesFoundHint)