escalationContentPiece.py (2485B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\agencyNew\contentPieces\escalationContentPiece.py 2 import gametime 3 from eve.client.script.ui.shared.agencyNew import agencyConst 4 from eve.client.script.ui.shared.agencyNew.agencyUtil import GetTimeRemainingText 5 from eve.client.script.ui.shared.agencyNew.contentPieces.baseContentPiece import BaseContentPiece 6 from localization import GetByLabel, GetByMessageID 7 from localization.formatters import FormatTimeIntervalShortWritten 8 9 class EscalationContentPiece(BaseContentPiece): 10 contentType = agencyConst.CONTENTTYPE_ESCALATION 11 12 def __init__(self, escalationSite = None, **kwargs): 13 BaseContentPiece.__init__(self, **kwargs) 14 self.escalationSite = escalationSite 15 16 def GetBracketIconTexturePath(self): 17 return 'res:/UI/Texture/Shared/Brackets/beacon.png' 18 19 def GetName(self): 20 dungeon = self.GetDungeon() 21 if dungeon: 22 return GetByMessageID(getattr(dungeon, 'dungeonNameID', None)) 23 24 def GetSiteLevel(self): 25 dungeon = self.GetDungeon() 26 if dungeon: 27 return getattr(dungeon, 'difficulty', None) 28 29 def GetSiteLevelText(self): 30 return GetByLabel('UI/Agency/LevelX', level=self.GetSiteLevel()) 31 32 def GetEnemyOwnerID(self): 33 dungeon = self.GetDungeon() 34 if dungeon: 35 return getattr(dungeon, 'factionID', None) 36 37 def GetDungeon(self): 38 destDungeon = self.escalationSite.destDungeon 39 return destDungeon 40 41 def GetSubSolarSystemPosition(self): 42 return (0, 0, 0) 43 44 def GetMenu(self): 45 return sm.GetService('menu').CelestialMenu(self.solarSystemID) 46 47 def GetBlurbText(self): 48 return GetByLabel('UI/Agency/Blurbs/Escalation') 49 50 def GetRewardTypes(self): 51 return (agencyConst.REWARDTYPE_ISK3, agencyConst.REWARDTYPE_LOOT) 52 53 def GetExpiryTimeShort(self): 54 return FormatTimeIntervalShortWritten(self.GetTimeRemaining()) 55 56 def GetTimeRemaining(self): 57 return self.escalationSite.expiryTime - gametime.GetWallclockTime() 58 59 def IsExpired(self): 60 return self.GetTimeRemaining() < 0 61 62 def _ExecuteWarpTo(self): 63 sm.GetService('michelle').CmdWarpToStuff('epinstance', self.itemID) 64 65 def GetCardSortValue(self): 66 return (0, self.GetJumpsToSelfFromCurrentLocation()) 67 68 def GetPrimaryActionDisabledHint(self): 69 return GetTimeRemainingText(self.GetTimeRemaining())