def SetTargetLabel(self): obs = sm.GetService('target').IsObserving() self.label = uix.GetSlimItemName(self.slimForFlag) if self.slimForFlag.corpID: self.label = localization.GetByLabel('UI/Inflight/Target/TargetLabelWithTicker', target=uix.GetSlimItemName(self.slimForFlag), ticker=cfg.corptickernames.Get(self.slimForFlag.corpID).tickerName) if obs: self.label = sm.GetService('bracket').DisplayName(self.slimForFlag, uix.GetSlimItemName(self.slimForFlag)) self.UpdateData()
def SetTargetLabel(self): self.label = uix.GetSlimItemName(self.slimForFlag) if self.slimForFlag.corpID: self.label = localization.GetByLabel( 'UI/Inflight/Target/TargetLabelWithTicker', target=uix.GetSlimItemName(self.slimForFlag), ticker=cfg.corptickernames.Get( self.slimForFlag.corpID).tickerName) self.UpdateData()
def SetTargetLabel(self): self.label = uix.GetSlimItemName(self.slimForFlag) if self.slimForFlag.corpID: self.label = localization.GetByLabel( 'UI/Inflight/Target/TargetLabelWithTicker', target=uix.GetSlimItemName(self.slimForFlag), ticker=cfg.corptickernames.Get( self.slimForFlag.corpID).tickerName) if self.slimForFlag.corpID and self.slimForFlag.typeID and self.slimForFlag.categoryID == const.categoryShip: self.shipLabel = cfg.invtypes.Get(self.slimForFlag.typeID).name else: self.shipLabel = '' self.UpdateData()
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) shipID = attributes.shipID cargoList = attributes.cargoList bp = sm.GetService('michelle').GetBallpark() if not bp: return slimItem = bp.slimItems[shipID] shipName = uix.GetSlimItemName(slimItem) self.SetCaption( localization.GetByLabel('UI/Ship/ShipScan/ShipNameCargo', shipName=shipName, cargoListLen=len(cargoList))) self.SetMinSize([200, 200]) self.SetWndIcon(self.iconNum, mainTop=-13) self.DefineButtons(uiconst.CLOSE) self.sr.scroll = uicontrols.Scroll( parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) t = uicontrols.EveHeaderSmall( text=localization.GetByLabel('UI/Ship/ShipScan/hdrCargoScan'), parent=self.sr.topParent, left=8, state=uiconst.UI_DISABLED, align=uiconst.BOTTOMLEFT)
def ConfirmationRequest(self, targetID, msgName, actualTargetID): if self.HasConfirmation(targetID, msgName): return 1 item = self.michelle.GetItem(actualTargetID) targetName = 'your target' if item is not None: targetName = uix.GetSlimItemName(item) k = (targetID, msgName) if self.pendingConfirmations.has_key(k): return self.pendingConfirmations[k].receive() result = 0 self.pendingConfirmations[k] = uthread.Channel(('consider::ConfirmationRequest', k)) try: ret = eve.Message(msgName, {'target': targetName}, uiconst.YESNO, suppress=uiconst.ID_YES, default=uiconst.ID_NO) if ret != uiconst.ID_YES: result = 0 return 0 self.RememberConfirmation(targetID, msgName) result = 1 finally: if self.pendingConfirmations.has_key(k): while self.pendingConfirmations[k].queue: self.pendingConfirmations[k].send(result) del self.pendingConfirmations[k] return result
def initialScan(): # enumerate planets! main = __import__("__main__") ballpark = sm.GetService("michelle").GetBallpark(doWait=True) if ballpark is None: log("Can't play ball without a ballpark!") return else: ball = ballpark.GetBall(eve.session.shipid) mypos = [ball.x, ball.y, ball.z] plocs = [] planetlocs = [] itpos = [0, 0, 0, 0] for itemID in ballpark.balls.keys(): if ballpark is None: log("Ballpark disappeared while playing with balls!") break if itemID == eve.session.shipid: pass else: slimItem = ballpark.GetInvItem(itemID) ball = ballpark.GetBall(itemID) if not (ball and slimItem): pass else: blue.pyos.BeNice(100) name = uix.GetSlimItemName(slimItem) or "Some object" if slimItem.groupID == 7: dst = sqrt( pow(ball.x, 2) + pow(ball.y, 2) + pow(ball.z, 2)) itpos = [ball.x, ball.y, ball.z, dst] plocs.append(itpos) #log("item: %s - %s - %s", name, itemID, dst) maxprobes = getMaxProbes() offset = [50000000000.0, 0.0, 0.0, 0.0] planetlocs = sorted(plocs, key=lambda plocs: plocs[3], reverse=True) planetlocs.insert(0, offset) main.plocs = planetlocs main.plen = len(planetlocs) probeData = sm.GetService("scanSvc").GetProbeData() if probeData == {}: return i = 0 for key in probeData: sm.GetService("scanSvc").SetProbeDestination(key, [ planetlocs[i][0] + offset[0], planetlocs[i][1] + offset[1], planetlocs[i][2] + offset[2] ]) sm.GetService("scanSvc").SetProbeRangeStep(key, 8) i = i + 1 if (i >= len(planetlocs)): break sm.services.get('window', None).GetWindow('scanner').UpdateProbeSpheres()
def _OnSlimItemChange(self, oldSlim, newSlim): if self.itemID != oldSlim.itemID or self.destroyed: return self.itemID = newSlim.itemID self.slimItem = _weakref.ref(newSlim) if oldSlim.corpID != newSlim.corpID or oldSlim.charID != newSlim.charID: self.label = uix.GetSlimItemName(newSlim) self.UpdateData()
def SetTargetLabel(self): obs = sm.GetService('target').IsObserving() self.label = uix.GetSlimItemName(self.slimForFlag) if self.slimForFlag.corpID: self.label = localization.GetByLabel( 'UI/Inflight/Target/TargetLabelWithTicker', target=uix.GetSlimItemName(self.slimForFlag), ticker=cfg.corptickernames.Get( self.slimForFlag.corpID).tickerName) if self.slimForFlag.corpID and self.slimForFlag.typeID and self.slimForFlag.categoryID == const.categoryShip: self.shipLabel = cfg.invtypes.Get(self.slimForFlag.typeID).name else: self.shipLabel = '' if obs: self.label = sm.GetService('bracket').DisplayName( self.slimForFlag, uix.GetSlimItemName(self.slimForFlag)) self.UpdateData()
def UpdateState(self, droneState = None): michelle = sm.GetService('michelle') droneRow = michelle.GetDroneState(self.sr.node.itemID) droneActivity = michelle.GetDroneActivity(self.sr.node.itemID) if droneActivity: self.activity, self.activityID = droneActivity if droneState is None and droneRow is not None: droneState = droneRow.activityState droneStates = {entities.STATE_IDLE: 'UI/Inflight/Drone/Idle', entities.STATE_COMBAT: 'UI/Inflight/Drone/Fighting', entities.STATE_MINING: 'UI/Inflight/Drone/Mining', entities.STATE_APPROACHING: 'UI/Inflight/Drone/Approaching', entities.STATE_DEPARTING: 'UI/Inflight/Drone/ReturningToShip', entities.STATE_DEPARTING_2: 'UI/Inflight/Drone/ReturningToShip', entities.STATE_OPERATING: 'UI/Inflight/Drone/Operating', entities.STATE_PURSUIT: 'UI/Inflight/Drone/Following', entities.STATE_FLEEING: 'UI/Inflight/Drone/Fleeing', entities.STATE_ENGAGE: 'UI/Inflight/Drone/Repairing', entities.STATE_SALVAGING: 'UI/Inflight/Drone/Salvaging', None: 'UI/Inflight/Drone/NoState'} droneStateLabel = droneStates.get(droneState, 'UI/Inflight/Drone/Incapacitated') stateText = localization.GetByLabel(droneStateLabel) label = localization.GetByLabel('UI/Inflight/Drone/Label', droneType=self.sr.node.label, state=stateText) target = '' if droneState in [const.entityCombat, const.entityEngage, const.entityMining]: targetID = droneRow.targetID targetTypeName = None pilotName = None if targetID: targetSlim = michelle.GetItem(targetID) if targetSlim: if targetSlim.groupID == const.categoryShip: pilotID = michelle.GetCharIDFromShipID(targetSlim.itemID) if pilotID: pilotName = cfg.eveowners.Get(pilotID).name targetTypeName = uix.GetSlimItemName(targetSlim) if pilotName: target = pilotName elif targetTypeName: target = targetTypeName else: target = localization.GetByLabel('UI/Generic/Unknown') tooltipExtra = '' if self.sr.node.ownerID != eve.session.charid: tooltipExtra = localization.GetByLabel('UI/Inflight/Drone/OwnershipText', owner=self.sr.node.ownerID) elif self.sr.node.controllerID != eve.session.shipid: tooltipExtra = localization.GetByLabel('UI/Inflight/Drone/ControllerText', controller=self.sr.node.controllerOwnerID) elif self.activityID and self.activity: activity = '' if self.activity == 'guard': activity = localization.GetByLabel('UI/Inflight/Drone/Guarding') elif self.activity == 'assist': activity = localization.GetByLabel('UI/Inflight/Drone/Assisting') tooltipExtra = localization.GetByLabel('UI/Inflight/Drone/Activity', activity=activity, idInfo=cfg.eveowners.Get(self.activityID).name) tooltip = localization.GetByLabel('UI/Inflight/Drone/Tooltip', droneType=self.sr.node.label, state=stateText, target=target, tooltipExtra=tooltipExtra) self.sr.label.text = label self.hint = tooltip
def GetName(self): if self.name: return self.name bp = sm.GetService('michelle').GetBallpark() if bp: slimItem = bp.slimItems.get(self.itemID, None) if slimItem: return uix.GetSlimItemName(slimItem) return ''
def OnMouseHover(self, *args): return picktype, pickobject = self.GetPick() if pickobject and hasattr(pickobject, 'translationCurve') and hasattr( pickobject.translationCurve, 'id'): itemID = pickobject.translationCurve.id slimItem = uix.GetBallparkRecord(itemID) if slimItem: slimItemName = uix.GetSlimItemName(slimItem) if slimItemName: self.sr.hint = slimItemName
def FindClosestMoon(playerballID): bp = sm.StartService('michelle').GetBallpark() dist = 1e+100 closestMoonID = None for (ballID, slimItem,) in bp.slimItems.iteritems(): if (slimItem.groupID == const.groupPlanet) or (slimItem.groupID == const.groupMoon) or (slimItem.groupID == const.groupStation) or (slimItem.groupID == const.groupStargate): test = bp.DistanceBetween(playerballID, ballID) if test < dist: dist = test closestMoonID = ballID slimItem2 = bp.GetInvItem(closestMoonID) return uix.GetSlimItemName(slimItem2)
def FindClosestDestinationCelestial(playerballID): bp = sm.StartService('michelle').GetBallpark() playerball = bp.GetBall(playerballID) dist2 = 1e+100 closestcelestialID = None for (ballID, slimItem,) in bp.slimItems.iteritems(): if (slimItem.groupID == const.groupPlanet) or (slimItem.groupID == const.groupMoon) or (slimItem.groupID == const.groupStation) or (slimItem.groupID == const.groupStargate): ballcelestial = bp.GetBall(ballID) test = sqrt((playerball.gotoX-ballcelestial.x)*(playerball.gotoX-ballcelestial.x)+(playerball.gotoY-ballcelestial.y)*(playerball.gotoY-ballcelestial.y)+(playerball.gotoZ-ballcelestial.z)*(playerball.gotoZ-ballcelestial.z)) if test < dist2: dist2 = test closestcelestialID = ballID slimItem3 = bp.GetInvItem(closestcelestialID) return uix.GetSlimItemName(slimItem3)
def getName(id): if ballpark: slimItem = ballpark.GetInvItem(id) if slimItem: return uix.GetSlimItemName(slimItem) if godma: godmaItem = godma.GetItem(id) if godmaItem: invtype = cfg.invtypes.Get(godmaItem.typeID) return invtype.name typeInfo = cfg.invtypes.Get(id) if typeInfo: return typeInfo.name return repr(id)
def UpdateDisplayName(self): displayName = '' if self.itemID == session.shipid and self.slimItem: shipCategory = cfg.invgroups.Get(self.slimItem.groupID).name displayName = '<b>' + localization.GetByLabel( 'UI/Inflight/ActionButtonsYourShipWithCategory', categoryOfYourShip=shipCategory) elif self.manyItemsData and self.fallBackDisplayName: displayName = self.fallBackDisplayName elif self.slimItem: displayName = '<b>%s</b>' % uix.GetSlimItemName(self.slimItem) bp = sm.StartService('michelle').GetBallpark() if bp: ball = bp.GetBall(self.itemID) if ball: displayName += ' ' + util.FmtDist(ball.surfaceDist) elif self.bookmarkInfo: displayName = self.bookmarkInfo.memo elif self.fallBackDisplayName: displayName = self.fallBackDisplayName self.SetDisplayName(displayName)
def FindWarpDestinationBall(): bp = GetBallPark() if bp: balls = copy.copy(bp.balls) LogMessage("Copied Ballpark") else: LogMessage("Invalid Ballpark") FILE = open("D://EvE Programming/ineve/dump.txt","wt") #ballself2 = bp.GetBall(eve.session.shipid) #slimitemself2 = bp.GetInvItem(eve.session.shipid) #FILE.write(str(uix.GetSlimItemName(slimitemself2)) + " " + str(FindClosestMoon(eve.session.shipid)) + str(ballself2.surfaceDist) + " " + str(ballself2.gotoX) + "\n") foundBallID = None for ballID in balls.iterkeys(): ball = bp.GetBall(ballID) slimItem = bp.GetInvItem(ballID) if (slimItem and ball.__guid__ == "spaceObject.Ship" and ball.mode == destiny.DSTBALL_WARP): LogMessage(str(ballID) + " " + str(ball.__guid__) + " " + str(ball.surfaceDist) + str(uix.GetSlimItemName(slimItem))) #FILE.write(str(FindClosestDestinationCelestial(ballID)) + " " + str(FindClosestDestinationCelestial(eve.session.shipid)) + str(uix.GetSlimItemName(slimItem)) + " " + str(FindClosestMoon(ballID)) + " " + str(ball.surfaceDist) + "\n") FILE.write(str(FindClosestDestinationCelestial(ballID)) + " " + str(uix.GetSlimItemName(slimItem)) + " " + str(DistanceMyGotoBall(ball)) + "\n") FILE.write("Done. \n") FILE.close() return foundBallID
def OnFleetBroadcast(self, broadcastType, arg1, charID, locationID, targetID): targetName = None locationName = None ballpark = eve.LocalSvc("michelle").GetBallpark() if ballpark: slimItem = ballpark.GetInvItem(targetID) if slimItem: targetName = uix.GetSlimItemName(slimItem) else: try: location = cfg.evelocations.Get(targetID) if location: targetName = location.name except: pass try: location = cfg.evelocations.Get(locationID) if location: locationName = location.name except: pass #log("Broadcast of type %s by %s with target %s in %s", broadcastType, getCharacterName(charID), targetName, locationName) if broadcastType == "Target": flashItemColor(targetID, "Broadcast: Target") adjustPriority(targetID, int(getPref("TargetPriorityBoost", 1))) elif broadcastType == "HealArmor": flashItemColor(targetID, "Broadcast: Need Armor") self.needsReps(targetID) elif broadcastType == "HealShield": flashItemColor(targetID, "Broadcast: Need Shield") self.needsReps(targetID) elif broadcastType == "HealCapacitor": flashItemColor(targetID, "Broadcast: Need Capacitor")
def doAttack(self, idleOnly, targetID=None, dronesToAttack=[], oldTarget=None): if self.disabled: return ballpark = eve.LocalSvc("michelle").GetBallpark() timestamp = blue.os.GetTime(1) isCommonTarget = False if not targetID: targetID = self.getCommonTarget() if targetID: slimItem = ballpark.GetInvItem(targetID) if slimItem: targetName = uix.GetSlimItemName(slimItem) isCommonTarget = True if not targetID: targetID = self.selectTarget() if targetID: slimItem = ballpark.GetInvItem(targetID) if slimItem: targetName = uix.GetSlimItemName(slimItem) else: targetName = "Unknown" drones = list(self.getDronesInLocalSpace().keys()) for id in dronesToAttack: if id not in drones: drones.append(id) for id in list(drones): droneObj = self.getDroneObject(id) if ((droneObj.state == const.entityDeparting) or (droneObj.state == const.entityDeparting2) or (droneObj.state == const.entityFleeing) or (droneObj.state == const.entityPursuit)): drones.remove(id) elif ((droneObj.target == targetID) or abs(droneObj.actionTimestamp - timestamp) <= ActionThreshold): drones.remove(id) elif (idleOnly and (droneObj.state != const.entityIdle)): drones.remove(id) if len(drones): if ((len(drones) > 1) or (not self.__lastAttackOrder)): self.__lastAttackOrder = targetID entity = moniker.GetEntityAccess() if entity: if isCommonTarget: targetName += " (existing target)" oldTargetName = None if oldTarget: slimItem = ballpark.GetInvItem(oldTarget) oldTargetName = uix.GetSlimItemName(slimItem) if oldTargetName: log("%s changing target from %s to %s", ", ".join(getNamesOfIDs(drones)), oldTargetName, targetName) else: log("%s attacking %s", ", ".join(getNamesOfIDs(drones)), targetName) for id in drones: droneObj = self.getDroneObject(id) droneObj.setTarget(targetID, timestamp) droneObj.actionTimestamp = timestamp ret = entity.CmdEngage(drones, targetID)
def AddCombatMessageFromDict(self, damageMessagesArgs): hitQuality = damageMessagesArgs['hitQuality'] isBanked = damageMessagesArgs['isBanked'] if hitQuality == 0: msgKey = 'AttackMiss' elif hitQuality > 0 and hitQuality <= 6: msgKey = 'AttackHits' try: hitQualityText = self.cachedHitQualityText[hitQuality] except KeyError: hitQualityText = self.GetHitQualityMessage(hitQuality) self.cachedHitQualityText[hitQuality] = hitQualityText damageMessagesArgs['hitQualityText'] = hitQualityText else: msgKey = 'AttackHits' hitQualityText = '' damageMessagesArgs['hitQualityText'] = hitQualityText attackType = damageMessagesArgs.get('attackType', 'me') if attackType == 'otherPlayer': msgKey += 'RD' elif attackType == 'otherPlayerWeapons': msgKey += 'R' elif attackType == 'me': if isBanked: msgKey += 'Banked' else: LogError('attackType not valid! attackType = ' + attackType) return for argName in ('source', 'target', 'owner'): if argName not in damageMessagesArgs: continue slimItem = None objectName = '' typeName = '' tickerText = '' if argName == 'owner': ownerTypeID, ownerID = damageMessagesArgs[argName] if ownerTypeID != const.UE_OWNERID: continue objectID = damageMessagesArgs.get('attackerID', None) if objectID is None: continue else: objectID = damageMessagesArgs[argName] bracket = sm.GetService('bracket').GetBracket(objectID) if bracket: slimItem = bracket.slimItem else: ballpark = sm.GetService('michelle').GetBallpark() if ballpark is None: self.LogWarn( 'OnDamageMessage: No ballpark, not showing damage message.' ) return slimItem = ballpark.GetInvItem(objectID) if slimItem: objectName = uix.GetSlimItemName(slimItem) or 'Some object' if slimItem.corpID and not util.IsNPC(slimItem.corpID): typeName = cfg.invtypes.Get(slimItem.typeID).name damageMessagesArgs['typeName'] = typeName tickerText = cfg.corptickernames.Get( slimItem.corpID).tickerName damageMessagesArgs['tickerText'] = tickerText if objectName is None or not len(objectName): if argName == 'owner': continue self.LogError('Failed to display message', damageMessagesArgs) return damageMessagesArgs[argName] = objectName damageMessagesArgs['%s_ID' % argName] = objectID self.AddCombatMessage(msgKey, damageMessagesArgs)
def UpdateAll(self, updateActions=0): if not self or self.destroyed: return if eve.session.shipid in self.itemIDs: self.itemIDs.remove(eve.session.shipid) bp = sm.GetService('michelle').GetBallpark() if not self.ImVisible() or not bp or not self.itemIDs: self.sr.updateTimer = None self.FlushContent() return goForSlim = 1 slimItems = [] invItems = [] fleetMember = None for itemID in self.itemIDs: blue.pyos.BeNice() if sm.GetService('fleet').IsMember(itemID): fleetMember = cfg.eveowners.Get(itemID) break slimItem = None if goForSlim: slimItem = uix.GetBallparkRecord(itemID) if slimItem: slimItems.append(slimItem) if not slimItem: invItem = self.TryGetInvItem(itemID) if invItem: invItems.append(invItem) goForSlim = 0 if not slimItems and not invItems and not fleetMember: self.itemIDs = [] self.lastActionSerial = None self.lastActionDist = None self.FlushContent() return if not self or self.destroyed: return text = '' blue.pyos.BeNice() updateActions = updateActions or 0 typeID = None fleetSlim = None if fleetMember: multi = 1 text = fleetMember.name typeID = fleetMember.typeID fleetSlim = self.GetSlimItemForCharID(fleetMember.id) blue.pyos.BeNice() elif invItems: text = uix.GetItemName(invItems[0]) typeID = invItems[0].typeID multi = len(invItems) blue.pyos.BeNice() elif slimItems: text = uix.GetSlimItemName(slimItems[0]) typeID = slimItems[0].typeID multi = len(slimItems) if multi == 1: slimItem = slimItems[0] itemID = slimItem.itemID ball = bp.GetBall(itemID) if not ball: self.itemIDs = [] self.sr.updateTimer = None self.FlushContent() return dist = ball.surfaceDist if dist is not None: md = None myball = bp.GetBall(eve.session.shipid) if myball: md = myball.mode text += '<br>' + localization.GetByLabel( 'UI/Inflight/ActiveItem/SelectedItemDistance', distToItem=util.FmtDist(dist, maxdemicals=1)) if not self.lastActionDist or md != self.lastActionDist[ 1] or self.CheckDistanceUpdate( self.lastActionDist[0], dist): self.lastActionDist = (dist, md) updateActions = 1 sec = slimItem.securityStatus if sec: text += '<br>' + localization.GetByLabel( 'UI/Inflight/ActiveItem/SelectedItemSecurity', secStatus=sec) blue.pyos.BeNice() corpID = None charID = None categoryID = None bountyItemID = None bountyTypeID = None bountySlim = None displayUtilMenu = False if multi > 1: text += '<br>' + localization.GetByLabel( 'UI/Inflight/ActiveItem/MultipleItems', itemCount=multi) blue.pyos.BeNice() elif multi == 1: if slimItems: slim = slimItems[0] if slim.categoryID == const.categoryShip: if util.IsCharacter(slim.charID): charID = slim.charID categoryID = slim.categoryID if slim.categoryID == const.categoryEntity: bountyTypeID = slim.typeID elif slim.charID: bountyItemID = slim.charID bountySlim = slim killRightID, price = self.bountySvc.GetBestKillRight( slim.charID) self.utilMenu.UpdateKillRightInfo(killRightID, price, slim.charID, slim.itemID) stateSvc = sm.GetService('state') if killRightID is not None and not ( stateSvc.CheckSuspect(slim) or stateSvc.CheckCriminal(slim)): displayUtilMenu = True blue.pyos.BeNice() self.sr.utilMenuArea.display = displayUtilMenu self.utilMenu.display = displayUtilMenu if self.lastIcon != (typeID, itemID, charID): uthread.pool('ActiveItem::GetIcon', self.GetIcon, typeID, itemID, charID, corpID, categoryID) self.lastIcon = (typeID, itemID, charID) else: self.sr.iconpar.state = uiconst.UI_PICKCHILDREN if categoryID == const.categoryShip and charID: self.sr.chariconpar.state = uiconst.UI_PICKCHILDREN bountyHint = None reducedBountyIndication = None if (bountyItemID, bountyTypeID) != self.lastBountyCheck: bounty, bountyHint, reducedBountyIndication = self.CheckBounty( bountyTypeID, bountySlim) blue.pyos.BeNice() if bounty: self.bounty = localization.GetByLabel('UI/Common/BountyAmount', bountyAmount=util.FmtISK( bounty, 0)) else: self.bounty = None self.lastBountyCheck = (bountyItemID, bountyTypeID) self.lastBountyInfo = (bountyHint, reducedBountyIndication) else: bountyHint, reducedBountyIndication = self.lastBountyInfo if self.bounty: text += '<br>' text += self.bounty if reducedBountyIndication: text += reducedBountyIndication if updateActions: self.ReloadActions(slimItems, invItems, fleetMember, fleetSlim) else: self.CheckActions(1) self.SetText(text, bountyHint) self.ShowNoSelectedHint() blue.pyos.BeNice() self.laseUpdateWidth = self.absoluteRight - self.absoluteLeft if not self.sr.updateTimer and not invItems: self.sr.updateTimer = base.AutoTimer(500, self.UpdateAll)
def UpdateInfo(self): if self.destroyed: return self.sr.hint = '' if uicore.uilib.mouseOver != self: self.sr.accuracyTimer = None return infoList = [localization.GetByLabel('UI/Common/TypeLabel', typeID=self.sr.typeID)] statusList = [] defEff = self.GetDefaultEffect() if defEff: if defEff.isActive: statusList.append(localization.GetByLabel('UI/Inflight/StatusActive')) else: statusList.append(localization.GetByLabel('UI/Inflight/StatusInactive')) if self.goingOnline: statusList.append(localization.GetByLabel('UI/Inflight/GoingOnline')) if self.waitingForActiveTarget: statusList.append(localization.GetByLabel('UI/Inflight/WaitingForActiveTarget')) if statusList: infoList.append(localization.GetByLabel('UI/Inflight/StatusLabel', statusList=localization.formatters.FormatGenericList(statusList))) if cfg.IsChargeCompatible(self.moduleinfo): if self.charge and self.charge.typeID: infoList.append(localization.GetByLabel('UI/Inflight/ChargeQuantity', quantity=self.quantity, typeID=self.charge.typeID)) else: infoList.append(localization.GetByLabel('UI/Inflight/ChargeNoCharge')) accuracy = self.GetAccuracy() acc = '' if accuracy is not None: infoList.append(localization.GetByLabel('UI/Inflight/AccuracyLabel', accuracy=accuracy[0])) if self.charge: godmaInfo = sm.GetService('godma').GetItem(self.charge.itemID) if godmaInfo and godmaInfo.crystalsGetDamaged: infoList.append(localization.GetByLabel('UI/Inflight/DamageLabel', damage=godmaInfo.damage)) t = self.sr.Get('targetID', None) if t: slimItem = sm.GetService('michelle').GetBallpark().GetInvItem(t) infoList.append(localization.GetByLabel('UI/Inflight/TargetLabel', itemName=uix.GetSlimItemName(slimItem))) pos = uicore.layer.shipui.GetPosFromFlag(self.moduleinfo.itemID) if pos: slotno = pos[1] + 1 cmd = uicore.cmd combo = cmd.GetShortcutByFuncName('CmdActivateHighPowerSlot%i' % slotno, True) if not combo: combo = localization.GetByLabel('UI/Common/None') infoList.append(localization.GetByLabel('UI/Inflight/ShortcutLabel', keyCombo=combo)) if self and getattr(self, 'sr', None): self.sr.hint = '<br>'.join(infoList)
def GetLabel(self): return uix.GetSlimItemName(self.slimItem)