Exemplo n.º 1
0
 def UpdateProbeState(self):
     if self.destroyed:
         self.updateStateTimer = None
         return
     probe = self.sr.node.probe
     if probe.expiry is None:
         expiryText = localization.GetByLabel('UI/Generic/None')
     else:
         expiry = max(0L, long(probe.expiry) - blue.os.GetSimTime())
         if expiry <= 0:
             expiryText = localization.GetByLabel(
                 'UI/Inflight/Scanner/Expired')
         elif expiry >= const.MIN:
             expiryText = localization.formatters.FormatTimeIntervalShortWritten(
                 expiry, showFrom='day', showTo='minute')
         else:
             expiryText = localization.formatters.FormatTimeIntervalShortWritten(
                 expiry, showFrom='day', showTo='second')
     self.probeExpiry.text = expiryText
     if probe.state == const.probeStateInactive:
         self.opacity = 0.5
     else:
         self.opacity = 1.0
     if probe.scanRange < const.AU:
         probeScanRangeText = FmtDist(probe.scanRange, maxdemicals=2)
     else:
         probeScanRangeText = FmtDist(probe.scanRange, maxdemicals=0)
     self.probeScanRange.text = probeScanRangeText
Exemplo n.º 2
0
 def UpdateDynamicValues(self):
     if self.destroyed:
         return
     bracket = self.GetBracket()
     if not bracket or bracket.destroyed:
         self.dynamicsUpdateTimer = None
         return
     distance = None
     if getattr(bracket, 'showDistance', 1):
         distance = bracket.GetDistance()
         if distance:
             if not self.isCompact:
                 self.distanceLabel.text = FmtDist(distance)
     rightAligned = self.mainLabel.align != uiconst.CENTERLEFT
     fleetBroadcastType = getattr(bracket, 'fleetBroadcastType', None)
     if fleetBroadcastType:
         if fleetBroadcastType != self.fleetBroadcastType:
             self.fleetBroadcastType = fleetBroadcastType
             icon = fleetbr.types[fleetBroadcastType]['smallIcon']
             if not self.fleetBroadcastSprite:
                 self.fleetBroadcastSprite = Sprite(
                     parent=self.mainLabel,
                     pos=(0, 0, 16, 16),
                     state=uiconst.UI_NORMAL,
                     align=uiconst.CENTERLEFT,
                     idx=0)
                 self.fleetBroadcastSprite.DelegateEvents(self)
             self.fleetBroadcastSprite.LoadIcon(icon)
         if rightAligned:
             self.mainLabel.SetSideMargins(0, 18)
             self.fleetBroadcastSprite.align = uiconst.CENTERRIGHT
         else:
             self.mainLabel.SetSideMargins(18, 0)
     elif self.fleetBroadcastSprite:
         self.fleetBroadcastSprite.Close()
         self.fleetBroadcastSprite = None
         self.fleetBroadcastType = None
         self.mainLabel.SetSideMargins()
     tagAndTargetStr = getattr(bracket, 'tagAndTargetStr', None)
     subinfoString = None
     if hasattr(bracket, 'GetSubLabelCallback'):
         subinfoCallback = bracket.GetSubLabelCallback()
         if subinfoCallback:
             subinfoString = subinfoCallback()
     combinedString = ''
     if rightAligned:
         combinedString = '<right>'
     combinedString += bracket.displayName
     if self.isCompact and distance:
         combinedString += ' ' + FmtDist(distance)
     if subinfoString or tagAndTargetStr:
         combinedString += '<br>'
         if tagAndTargetStr:
             combinedString += '<b>' + tagAndTargetStr + '</b>'
         if subinfoString:
             if tagAndTargetStr:
                 combinedString += '  '
             combinedString += '[' + subinfoString + ']'
     self.mainLabel.text = combinedString
     self.iconParent.height = max(MINENTRYHEIGHT, self.mainLabel.height)
Exemplo n.º 3
0
 def GetOptimalRangeText(self, typeID, optimalRange, falloff):
     if optimalRange <= 0:
         return ('', '')
     formattedOptimalRAnge = FmtDist(optimalRange)
     if sm.GetService('clientDogmaStaticSvc').TypeHasEffect(
             typeID, const.effectLauncherFitted):
         rangeText = localization.GetByLabel(
             'UI/Inflight/ModuleRacks/MaxRange',
             maxRange=formattedOptimalRAnge)
     elif sm.GetService('clientDogmaStaticSvc').TypeHasEffect(
             typeID, const.effectTurretFitted):
         if falloff > 1:
             rangeText = localization.GetByLabel(
                 'UI/Inflight/ModuleRacks/OptimalRangeAndFalloff',
                 optimalRange=formattedOptimalRAnge,
                 falloffPlusOptimal=FmtDist(falloff + optimalRange))
         else:
             rangeText = localization.GetByLabel(
                 'UI/Inflight/ModuleRacks/OptimalRange',
                 optimalRange=formattedOptimalRAnge)
     elif evetypes.GetGroupID(typeID) == const.groupSmartBomb:
         rangeText = localization.GetByLabel(
             'UI/Inflight/ModuleRacks/AreaOfEffect',
             range=formattedOptimalRAnge)
     elif falloff > 1:
         rangeText = localization.GetByLabel(
             'UI/Inflight/ModuleRacks/RangeWithFalloff',
             optimalRange=formattedOptimalRAnge,
             falloffPlusOptimal=FmtDist(falloff + optimalRange))
     else:
         rangeText = localization.GetByLabel(
             'UI/Inflight/ModuleRacks/Range',
             optimalRange=formattedOptimalRAnge)
     return (rangeText, formattedOptimalRAnge)
Exemplo n.º 4
0
 def UpdateText(self):
     context = self.previewContainer.context
     if not hasattr(context, 'typeID'):
         return
     groupID = evetypes.GetGroupID(context.typeID)
     categoryID = evetypes.GetCategoryID(context.typeID)
     title = evetypes.GetName(context.typeID)
     if hasattr(context, 'itemID'):
         bp = sm.GetService('michelle').GetBallpark()
         if bp:
             slim = bp.GetInvItem(context.itemID)
             if slim:
                 title = slim.name
     self.title.text = title
     subtitle = ''
     if categoryID != invconst.categoryApparel:
         scene = self.previewContainer.sceneContainer.scene
         model = first_or_default(getattr(scene, 'objects', []), None)
         if model:
             radius = round(model.GetBoundingSphereRadius() * 2, 0)
             if groupID in invconst.turretModuleGroups or groupID in invconst.turretAmmoGroups:
                 subtitle = localization.GetByLabel(
                     'UI/Preview/ShipSubLabelNoRace',
                     groupName=evetypes.GetGroupName(context.typeID),
                     length=FmtDist(radius))
             else:
                 raceID = evetypes.GetRaceID(context.typeID)
                 race = cfg.races.Get(
                     raceID) if raceID in cfg.races else None
                 if race is None:
                     subtitle = localization.GetByLabel(
                         'UI/Preview/ShipSubLabelNoRace',
                         groupName=evetypes.GetGroupName(context.typeID),
                         length=FmtDist(radius))
                 else:
                     raceName = localization.GetByMessageID(race.raceNameID)
                     subtitle = localization.GetByLabel(
                         'UI/Preview/ShipSubLabel',
                         raceName=raceName,
                         groupName=evetypes.GetGroupName(context.typeID),
                         length=FmtDist(radius))
     self.subtitle.text = subtitle
     if categoryID == invconst.categoryApparel:
         self.descCont.Show()
         description = evetypes.GetDescription(context.typeID) or ''
         description = re.sub('<b>|</b>|\\r', '', description)
         description = re.sub('\\n', '<br>', description)
         self.desc.text = description
Exemplo n.º 5
0
 def GetCopyData(cls, node):
     return '<t>'.join([
         node.result.id, node.scanGroupName, node.groupName, node.typeName,
         localization.GetByLabel('UI/Common/Percentage',
                                 percentage=node.result.certainty * 100),
         FmtDist(node.distance)
     ])
Exemplo n.º 6
0
 def GetHint(self):
     node = self.sr.node
     return '%s %s %s %s %s' % (FmtDist(
         node.distance), node.result.id, node.scanGroupName, node.groupName,
                                localization.GetByLabel(
                                    'UI/Common/Percentage',
                                    percentage=node.result.certainty * 100))
Exemplo n.º 7
0
 def GetAttributeInfo(godmaService, typeID, attributes, instance,
                      localization):
     value = godmaService.GetTypeAttribute2(
         typeID, dogmaconst.attributeMaxTractorVelocity)
     maxTractorVelocity = GetFormattedAttributeAndValue(
         dogmaconst.attributeMaxTractorVelocity, value)
     attributeEntries = [
         EntryData(
             'Header',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/AutoTractorBeam/InfoAttributesHeader'
             )),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/AutoTractorBeam/MaxRangeLabel'
             ),
             FmtDist(attributes.maxRange),
             iconID=RANGE_ICON),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/AutoTractorBeam/CycleTimeSecondsLabel'
             ),
             FmtTimeInterval(attributes.cycleTimeSeconds * SEC,
                             breakAt='sec'),
             iconID=CYCLE_TIME_ICON),
         DogmaEntryData('LabelTextSides', maxTractorVelocity)
     ]
     return attributeEntries
Exemplo n.º 8
0
 def GetAttributeInfo(godmaService, typeID, attributes, instance,
                      localization):
     cargoCapacity = GetFormattedAttributeAndValue(
         attributeCapacity, types.GetCapacity(typeID))
     attributeEntries = [
         EntryData(
             'Header',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/CargoBay/InfoAttributesHeader'
             )),
         DogmaEntryData('LabelTextSides', cargoCapacity),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/CargoBay/AccessRangeLabel'),
             FmtDist(attributes.accessRange),
             iconID=RANGE_ICON),
         EntryData('LabelTextSides',
                   localization.GetByLabel(
                       'UI/Inflight/SpaceComponents/CargoBay/AllowUserAdd'),
                   FmtYesNo(attributes.allowUserAdd),
                   iconID=0),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/CargoBay/AllowFreeForAll'),
             FmtYesNo(attributes.allowFreeForAll),
             iconID=0)
     ]
     return attributeEntries
Exemplo n.º 9
0
 def GetLabelText(self):
     labelText = sm.GetService('scanSvc').GetProbeLabel(
         self.probeData.probeID)
     distance = self.GetDistance()
     if distance is not None:
         labelText += ' ' + FmtDist(distance)
     return labelText
Exemplo n.º 10
0
 def GetLabelText(self):
     scanSvc = sm.GetService('scanSvc')
     displayName = scanSvc.GetDisplayName(self.resultData)
     labelText = '%s %s' % (self.resultData.id, displayName)
     distance = self.GetDistance()
     if distance is not None:
         labelText += ' ' + FmtDist(distance)
     return labelText
Exemplo n.º 11
0
 def SetWarpSpeedText(self):
     baseWarpSpeedInfo = self.controller.GetBaseWarpSpeed()
     warpSpeedMultiplierInfo = self.controller.GetWarpSpeedMultiplier()
     distValue = baseWarpSpeedInfo.value * warpSpeedMultiplierInfo.value * appConst.AU
     text = GetByLabel('UI/Fitting/FittingWindow/WarpSpeed',
                       distText=FmtDist(distValue, 2))
     coloredText = GetColoredText(
         isBetter=warpSpeedMultiplierInfo.isBetterThanBefore, text=text)
     self.SetLabel(dogmaConst.attributeBaseWarpSpeed, coloredText)
Exemplo n.º 12
0
 def UpdateDynamicValues(self):
     if self.destroyed:
         return
     bracket = self.GetBracket()
     if not bracket or bracket.destroyed:
         self.dynamicsUpdateTimer = None
         return
     distance = None
     if getattr(bracket, 'showDistance', 1):
         distance = bracket.GetDistance()
         if distance:
             if not self.isCompact:
                 self.distanceLabel.text = FmtDist(distance)
     rightAligned = self.mainLabel.align != uiconst.CENTERLEFT
     combinedString = ''
     if rightAligned:
         combinedString = '<right>'
     combinedString += self.GetDisplayName()
     if self.isCompact and distance:
         combinedString += ' ' + FmtDist(distance)
     self.mainLabel.text = combinedString
     self.iconParent.height = max(MINENTRYHEIGHT, self.mainLabel.height)
Exemplo n.º 13
0
 def SetAgilityText(self, shipID):
     agility = GetShipAttribute(shipID, dogmaConst.attributeAgility)
     agilityText = GetByLabel('UI/Fitting/FittingWindow/InertiaModifier',
                              value=agility)
     self.SetLabel(dogmaConst.attributeAgility, agilityText)
     baseWarpSpeed = GetShipAttribute(shipID,
                                      dogmaConst.attributeBaseWarpSpeed)
     warpSpeedMultiplier = GetShipAttribute(
         shipID, dogmaConst.attributeWarpSpeedMultiplier)
     baseWarpSpeedText = GetByLabel(
         'UI/Fitting/FittingWindow/WarpSpeed',
         distText=FmtDist(baseWarpSpeed * warpSpeedMultiplier * appConst.AU,
                          2))
     self.SetLabel(dogmaConst.attributeBaseWarpSpeed, baseWarpSpeedText)
Exemplo n.º 14
0
 def GetAttributeInfo(godmaService, typeID, attributes, instance,
                      localization):
     maxMassData = GetFormattedAttributeAndValue(attributeMass,
                                                 attributes.maxShipMass)
     maxMassData.displayName = localization.GetByLabel(
         'UI/Inflight/SpaceComponents/MicroJumpDriver/MaxShipMass')
     durationData = GetFormattedAttributeAndValue(
         attributeDuration, attributes.spoolUpDurationMillisec)
     attributeEntries = [
         EntryData(
             'Header',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/MicroJumpDriver/InfoAttributesHeader'
             )),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/MicroJumpDriver/InteractionRange'
             ),
             FmtDist(attributes.interactionRange),
             iconID=RANGE_ICON),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/MicroJumpDriver/JumpDistance'
             ),
             FmtDist(microJumpDriveDistance),
             iconID=RANGE_ICON),
         DogmaEntryData('LabelTextSides', durationData),
         DogmaEntryData(
             'LabelTextSides',
             GetDogmaAttributeAndValue(
                 godmaService, typeID,
                 attributeSignatureRadiusBonusPercent)),
         DogmaEntryData('LabelTextSides', maxMassData)
     ]
     return attributeEntries
Exemplo n.º 15
0
 def GetAttributeInfo(godmaService, typeID, attributes, instance,
                      localization):
     attributeEntries = [
         EntryData(
             'Header',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/Fitting/InfoAttributesHeader')
         ),
         EntryData('LabelTextSides',
                   localization.GetByLabel(
                       'UI/Inflight/SpaceComponents/Fitting/DistanceLabel'),
                   FmtDist(attributes.range),
                   iconID=RANGE_ICON)
     ]
     return attributeEntries
Exemplo n.º 16
0
    def UpdateLabel(self):
        if self.lastRoundedDistance is None:
            self.UpdateSiteLabel()
        try:
            distance = self.GetDistance()
            roundedDistance = RoundedDistance(distance)
            if self.lastRoundedDistance != roundedDistance:
                self.distanceLabel.SetText(FmtDist(distance, 1))
                self.lastRoundedDistance = roundedDistance
        except InvalidClientStateError:
            self.labelUpdateTimer = None

        totalLabelWidth = self.codeLabel.width + self.distanceLabel.width + DISTANCE_CELL_SPACING
        self.labelContainer.opacity = 1.0
        self.labelContainer.width = max(MIN_LABEL_SIZE, totalLabelWidth)
Exemplo n.º 17
0
 def GetAttributeInfo(godmaService, typeID, attributes, instance,
                      localization):
     attributeEntries = [
         EntryData(
             'Header',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/Scoop/InfoAttributesHeader')),
         EntryData('LabelTextSides',
                   localization.GetByLabel(
                       'UI/Inflight/SpaceComponents/Scoop/RangeLabel'),
                   FmtDist(
                       getattr(attributes, 'range',
                               maxCargoContainerTransferDistance)),
                   iconID=RANGE_ICON)
     ]
     return attributeEntries
Exemplo n.º 18
0
 def GetAttributeInfo(godmaService, typeID, attributes, instance,
                      localization):
     attributeEntries = [
         EntryData(
             'Header',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/BountyEscrow/InfoAttributesHeader'
             )),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/BountyEscrow/AccessRangeLabel'
             ),
             FmtDist(attributes.accessRange),
             iconID=RANGE_ICON),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/BountyEscrow/DurationLabel'),
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/BountyEscrow/DurationValue',
                 duration=long(attributes.unlockDelay * SEC)),
             iconID=TIMER_ICON),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/BountyEscrow/TakePercentageLabel'
             ),
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/BountyEscrow/TakePercentageValue',
                 takePercentage=long(attributes.takePercentage)),
             iconID=CYCLE_TIME_ICON),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/BountyEscrow/LoyaltyPointsLabel'
             ),
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/BountyEscrow/LoyaltyPointsValue',
                 lpBase=float(attributes.lpBase * 100.0)),
             iconID=CYCLE_TIME_ICON)
     ]
     return attributeEntries
Exemplo n.º 19
0
 def _UpdateSpeedTooltip(self, tooltipPanel):
     if tooltipPanel.destroyed:
         self._speedTooltipUpdate = None
         return
     if not self.controller.IsLoaded():
         self._speedTooltipUpdate = None
         return
     if self.controller.IsInWarp():
         fmtSpeed = FmtDist(self.controller.GetSpeed(), 2)
         tooltipPanel._valueLabelSpeed.text = '%s/s' % fmtSpeed
         tooltipPanel._setSpeedValue.text = GetByLabel(
             'UI/Inflight/CanNotChangeSpeedWhileWarping')
     else:
         fmtSpeed = self.controller.GetSpeedFormatted()
         tooltipPanel._valueLabelSpeed.text = fmtSpeed
         portion = self.GetCurrMouseSpeedPortion()
         speed = self.controller.GetSpeedAtFormatted(portion)
         tooltipPanel._setSpeedValue.text = GetByLabel(
             'UI/Inflight/ClickToSetSpeedTo', speed=speed)
Exemplo n.º 20
0
    def __init__(self, parentTransform = None, rangeSteps = None, contextScaling = 1.0):
        rangeCircles = trinity.EveTransform()
        rangeCircles.name = 'RangeIndicator'
        if parentTransform:
            parentTransform.children.append(rangeCircles)
        self.rootTransform = rangeCircles
        self.contextScaling = contextScaling
        rangeSteps = rangeSteps or self.defaultRangeSteps
        prevRadius = None
        color = self.circleColor
        for i, radius in enumerate(rangeSteps):
            drawRadius = radius * self.contextScaling
            if i == 0:
                label = GetByLabel('UI/Inflight/Scanner/UnitAU')
            else:
                if radius >= const.AU:
                    label = FmtAmt(radius / const.AU)
                else:
                    label = FmtDist(radius, maxdemicals=0)
                baseAngle = math.pi / 2
                circum = drawRadius * baseAngle
                gapSize = 0.8 / circum
                gapAngle = gapSize * baseAngle
                for startAngle in (0.0,
                 math.pi * 0.5,
                 math.pi,
                 math.pi * 1.5):
                    lineSet = mapViewUtil.CreatePlanarLineSet()
                    rangeCircles.children.append(lineSet)
                    lineIDs = mapViewUtil.DrawCircularArc(lineSet, (0.0, 0.0, 0.0), drawRadius, startAngle=startAngle + gapAngle, angle=baseAngle - gapAngle * 2, lineWidth=0.1, startColor=color, endColor=color)
                    if prevRadius:
                        cos = math.cos(startAngle)
                        sin = math.sin(startAngle)
                        p1 = ((prevRadius - 0.5) * sin, 0.0, (prevRadius - 0.5) * cos)
                        p2 = ((drawRadius + 0.5) * sin, 0.0, (drawRadius + 0.5) * cos)
                        lineID = lineSet.AddStraightLine(p1, color, p2, color, 0.02)
                    lineSet.SubmitChanges()

                prevRadius = drawRadius
            self.AddRangeLabel(label, drawRadius)

        lineSet.SubmitChanges()
Exemplo n.º 21
0
 def GetAttributeInfo(godmaService, typeID, attributes, instance,
                      localization):
     attributeEntries = [
         EntryData(
             'Header',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/Deploy/InfoAttributesHeader')
         ),
         EntryData('LabelTextSides',
                   localization.GetByLabel(
                       'UI/Inflight/SpaceComponents/Deploy/DeployAtRange'),
                   FmtDist(attributes.deployAtRange),
                   iconID=RANGE_ICON),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/Deploy/MinDistanceFromOwnGroup',
                 groupName=evetypes.GetGroupName(typeID)),
             FmtDist(attributes.minDistanceFromOwnGroup),
             iconID=RANGE_ICON),
         EntryData(
             'LabelTextSides',
             localization.GetByLabel(
                 'UI/Inflight/SpaceComponents/Deploy/MinDistanceFromControlTower',
                 groupName=evetypes.GetGroupNameByGroup(groupControlTower)),
             FmtDist(attributes.minDistanceFromControlTower),
             iconID=RANGE_ICON)
     ]
     if hasattr(attributes, 'maxDistanceFromControlTower'):
         attributeEntries.append(
             EntryData(
                 'LabelTextSides',
                 localization.GetByLabel(
                     'UI/Inflight/SpaceComponents/Deploy/MaxDistanceFromControlTower',
                     groupName=evetypes.GetGroupNameByGroup(
                         groupControlTower)),
                 FmtDist(attributes.maxDistanceFromControlTower),
                 iconID=RANGE_ICON))
     if hasattr(attributes, 'minDistanceFromStargatesAndStations'):
         attributeEntries.append(
             EntryData(
                 'LabelTextSides',
                 localization.GetByLabel(
                     'UI/Inflight/SpaceComponents/Deploy/MinDistanceFromStargatesAndStations',
                     stargateGroupName=evetypes.GetGroupNameByGroup(
                         groupStargate),
                     stationGroupName=evetypes.GetGroupNameByGroup(
                         groupStation)),
                 FmtDist(attributes.minDistanceFromStargatesAndStations),
                 iconID=RANGE_ICON))
     if hasattr(attributes, 'minDistanceFromWormhole'):
         attributeEntries.append(
             EntryData(
                 'LabelTextSides',
                 localization.GetByLabel(
                     'UI/Inflight/SpaceComponents/Deploy/MinDistanceFromWormhole',
                     wormholeGroupName=evetypes.GetGroupNameByGroup(
                         groupWormhole)),
                 FmtDist(attributes.minDistanceFromStargatesAndStations),
                 iconID=RANGE_ICON))
     if getattr(attributes, 'disallowInWormholeSpace', True):
         attributeEntries.append(
             EntryData(
                 'LabelTextSides',
                 localization.GetByLabel(
                     'UI/Inflight/SpaceComponents/Deploy/DisallowedFromWormholeSpace'
                 ),
                 '',
                 iconID=BANNED_ICON))
     return attributeEntries
Exemplo n.º 22
0
 def GetLabelText(self):
     displayName = self.GetDisplayText()
     distance = self.GetDistance()
     if distance is not None:
         displayName += ' ' + FmtDist(distance)
     return displayName
Exemplo n.º 23
0
    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:
                    typeinfo = cfg.invtypes.Get(slimItem.typeID)
                    entryname = GetSlimItemName(slimItem)
                    itemID = slimItem.itemID
                    typeID = slimItem.typeID
                    if not entryname:
                        entryname = typeinfo.Group().name
                elif celestialRec:
                    typeinfo = cfg.invtypes.Get(celestialRec.typeID)
                    if typeinfo.groupID == const.groupHarvestableCloud:
                        entryname = GetByLabel('UI/Inventory/SlimItemNames/SlimHarvestableCloud', typeinfo.name)
                    elif typeinfo.categoryID == const.categoryAsteroid:
                        entryname = GetByLabel('UI/Inventory/SlimItemNames/SlimAsteroid', typeinfo.name)
                    else:
                        entryname = cfg.evelocations.Get(celestialRec.id).name
                    if not entryname:
                        entryname = typeinfo.name
                    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 = cfg.invtypes.Get(typeID).groupID
                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, typeinfo.name, diststr)
                data.entryName = entryname
                data.typeName = typeinfo.name
                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)
Exemplo n.º 24
0
 def GetAttributeInfo(godmaService, typeID, attributes, instance, localization):
     attributeEntries = [EntryData('Header', localization.GetByLabel('UI/Inflight/SpaceComponents/AutoLooter/InfoAttributesHeader')), EntryData('LabelTextSides', localization.GetByLabel('UI/Inflight/SpaceComponents/AutoLooter/RangeLabel'), FmtDist(getattr(attributes, 'range', maxCargoContainerTransferDistance)), iconID=RANGE_ICON), EntryData('LabelTextSides', localization.GetByLabel('UI/Inflight/SpaceComponents/AutoLooter/CycleTimeSecondsLabel'), FmtTimeInterval(long(attributes.cycleTimeSeconds * SEC), breakAt='sec'), iconID=CYCLE_TIME_ICON)]
     return attributeEntries
Exemplo n.º 25
0
 def Load(self, node):
     if node.selected:
         self.Select()
     else:
         self.Deselect()
     newResult = False
     if hasattr(node, 'newResult'):
         if node.newResult:
             newResult = True
     normalColor, hiColor, loColor = self.red, self.redHi, self.redLo
     if 0.25 < node.result.certainty <= 0.75:
         normalColor, hiColor, loColor = self.orange, self.orangeHi, self.orangeLo
     if node.result.certainty > 0.75:
         normalColor, hiColor, loColor = self.green, self.greenHi, self.greenLo
     newCert = node.result.certainty
     oldCert = node.result.prevCertainty
     certChange = newCert - oldCert
     signalText = ''
     from eve.client.script.ui.control.entries import IsResultWithinWarpDistance
     if node.result.isPerfect and IsResultWithinWarpDistance(
             node.result) and InShipInSpace():
         if not self.warpButton:
             self.warpButton = ButtonIcon(
                 name='warpButton',
                 func=self.WarpToAction,
                 parent=self.signalColumn,
                 align=uiconst.CENTERRIGHT,
                 width=22,
                 left=6,
                 iconSize=22,
                 texturePath='res:/UI/Texture/Icons/44_32_18.png',
                 hint=localization.GetByLabel('UI/Commands/WarpTo'))
             if newResult:
                 uicore.animations.SpGlowFadeIn(self.warpButton.icon,
                                                glowFactor=1,
                                                glowColor=(0.8, 0.8, 0.8,
                                                           0.6),
                                                glowExpand=0,
                                                duration=1,
                                                loops=3)
     else:
         signalText = localization.GetByLabel('UI/Common/Percentage',
                                              percentage=newCert * 100)
     if newCert or oldCert:
         if certChange > 0:
             baseProportion = oldCert
             changeProportion = certChange
             changeColor = hiColor
         else:
             changeProportion = min(newCert, abs(certChange))
             baseProportion = max(0.0, newCert - changeProportion)
             changeColor = loColor
         graphData = []
         graphData.append(('base', baseProportion, normalColor))
         graphData.append(('change', changeProportion, changeColor))
         self.statusBar.LoadGraphData(graphData, animateIn=True)
     self.distanceColumn.label.text = FmtDist(node.distance)
     self.idColumn.label.text = node.result.id
     self.nameColumn.label.text = node.displayName
     self.groupColumn.label.text = node.groupName
     self.signalColumn.label.text = signalText
     if newResult:
         node.newResult = False
     self.OnColumnResize(node.columnWidths)