def ShowOnMap(self, itemID, *args): if itemID >= const.mapWormholeRegionMin and itemID <= const.mapWormholeRegionMax or itemID >= const.mapWormholeConstellationMin and itemID <= const.mapWormholeConstellationMax or itemID >= const.mapWormholeSystemMin and itemID <= const.mapWormholeSystemMax: raise UserError('MapShowWormholeSpaceInfo', {'char': eve.session.charid}) if eve.session.stationid: sm.GetService('station').CleanUp() OpenMap(interestID=itemID)
def ShowInMap(self, args): try: solarsystemIDs = [ int(ssID) for ssID in args.split('//') ] except: log.LogError('failed to convert string to ids in Browser:ShowInMap. Args:', args) return from eve.client.script.ui.shared.mapView.mapViewUtil import OpenMap OpenMap(interestID=solarsystemIDs[0])
def ShowRouteTo(self, args): fromto = args.split('::') if len(fromto) not in (1, 2): log.LogError('failed to convert string to id in Browser:ShowRouteTo. Args:', args) return for i in fromto: try: id = int(i) except: log.LogError('failed to convert string to id in Browser:ShowRouteTo. Args:', args) return if eve.session.stationid: sm.GetService('station').CleanUp() destinationID = int(fromto[0]) sourceID = None if len(fromto) == 2: sourceID = int(fromto[1]) from eve.client.script.ui.shared.mapView.mapViewUtil import OpenMap OpenMap(interestID=destinationID, drawRoute=(sourceID, destinationID), zoomToItem=False)
def ShowMap(self, *args): submit_metric('igb_show_map') if not self._IsBrowserWindowActive(): return interestID = None for arg in args: solarsystemIDs = [ssID for ssID in arg.split('//')] for ssID in solarsystemIDs: interestID = browserutil.SanitizedSolarsystemID(ssID) if interestID is not None: break if interestID is not None: break if interestID is None: interestID = session.solarsystemid2 from eve.client.script.ui.shared.mapView.mapViewUtil import OpenMap OpenMap(interestID=interestID) if self.browserEventHandler and hasattr(self.browserEventHandler, 'Minimize'): self.browserEventHandler.Minimize()
def ShowRouteTo(self, *args): submit_metric('igb_show_route_to') if not self._IsBrowserWindowActive(): return destinationID = None sourceID = None if len(args) < 1: log.LogError( 'Insufficient arguments for CCPEVE.ShowRouteTo. You must pass in at least one argument.' ) return if len(args) == 1: fromto = args[0].split('::') if len(fromto) == 2: destinationID = fromto[0] sourceID = fromto[1] else: destinationID = args[0] else: destinationID = args[0] sourceID = args[1] if eve.session.stationid: sm.GetService('station').CleanUp() destinationID = browserutil.SanitizedSolarsystemID(destinationID) if sourceID is not None: sourceID = browserutil.SanitizedSolarsystemID(sourceID) if destinationID is None: log.LogError( 'Error when converting destinationID in CCPEVE.ShowRouteTo. First argument must be an integer.' ) return interestID = sourceID if sourceID is not None else eve.session.regionid from eve.client.script.ui.shared.mapView.mapViewUtil import OpenMap OpenMap(interestID=interestID, drawRoute=(sourceID, destinationID)) if self.browserEventHandler and hasattr(self.browserEventHandler, 'Minimize'): self.browserEventHandler.Minimize()
def ShowRoute(self, node=None, *args): data = node.contract if node != None else self.sr.node.contract OpenMap(interestID=data.startRegionID, drawRoute=(session.solarsystemid2, data.startSolarSystemID))
def OnClick(self, *args): OpenMap(interestID=self.itemID)
def Load(self, data): iconsize = 48 self.factionParent.Flush() if hasattr(data, 'aggressorFactionID') and data.aggressorFactionID: factionID = data.aggressorFactionID owner = cfg.eveowners.Get(factionID) uiutil.GetLogoIcon(parent=self.factionParent, align=uiconst.RELATIVE, size=64, itemID=factionID, ignoreSize=True, hint=localization.GetByLabel( 'UI/Incursion/Journal/FactionStagingRuler', faction=owner.ownerName)) rowHeader = localization.GetByLabel( 'UI/Incursion/Journal/ReportRowHeader', constellation=data.constellationID, constellationInfo=('showinfo', const.typeConstellation, data.constellationID)) self.constellationLabel.SetText(rowHeader) incursionStateMessages = [ localization.GetByLabel('UI/Incursion/Journal/Withdrawing'), localization.GetByLabel('UI/Incursion/Journal/Mobilizing'), localization.GetByLabel('UI/Incursion/Journal/Established') ] self.statusText.SetText(incursionStateMessages[data.state]) if data.jumps is not None: distanceAwayText = localization.GetByLabel( 'UI/Incursion/Journal/ReportRowNumJumps', jumps=data.jumps) else: distanceAwayText = localization.GetByLabel( 'UI/Incursion/Journal/ReportRowSystemUnreachable') bodyText = localization.GetByLabel( 'UI/Incursion/Journal/ReportRowBody', color='<color=' + sm.GetService('map').GetSystemColorString( data.stagingSolarSystemID) + '>', security=data.security, securityColor=sm.GetService('map').GetSystemColorString( data.stagingSolarSystemID), system=data.stagingSolarSystemID, systemInfo=('showinfo', const.typeSolarSystem, data.stagingSolarSystemID), distanceAway=distanceAwayText) self.stagingText.SetText(bodyText) self.statusBar.SetInfluence(taleCommon.CalculateDecayedInfluence( data.influenceData), None, animate=False) self.finalEncounterIcon.SetFinalEncounterSpawned( data.hasFinalEncounter) self.corpMapButton.OnClick = lambda: OpenMap( interestID=data.constellationID, starColorMode=STARMODE_FRIENDS_CORP) self.mapButton.OnClick = lambda: OpenMap( interestID=data.constellationID, starColorMode=STARMODE_INCURSION) self.autopilotButton.OnClick = lambda: sm.GetService( 'starmap').SetWaypoint(data.stagingSolarSystemID, clearOtherWaypoints=True) self.lpButton.OnClick = lambda: sm.GetService( 'journal').ShowIncursionTab(flag=IncursionTab.LPLog, taleID=data.taleID, constellationID=data.constellationID) self.loyaltyPoints.number.SetText( localization.GetByLabel( 'UI/Incursion/Journal/NumberLoyaltyPointsAcronym', points=util.FmtAmt(data.loyaltyPoints)))