def _GetTabs(self): tabs = [] tabs.append( self._BuildTabParams( 'UI/Corporations/CorporationWindow/Alliances/Home', self.sr.wndViewParent, 'alliances_home')) if session.allianceid is not None: tabs.extend([ self._BuildTabParams( 'UI/Corporations/CorporationWindow/Alliances/Bulletins', self.sr.wndViewParent, 'alliances_bulletins'), self._BuildTabParams( 'UI/Corporations/CorporationWindow/Alliances/Members', self.sr.wndViewParent, 'alliances_members'), self._BuildTabParams( 'UI/Corporations/CorporationWindow/Alliances/AllianceContacts', self.sr.contacts, 'alliancecontact') ]) if not IsNPC(session.corpid): tabs.append( self._BuildTabParams( 'UI/Corporations/CorporationWindow/Alliances/Applications', self.sr.wndViewParent, 'alliances_applications')) tabs.append( self._BuildTabParams( 'UI/Corporations/CorporationWindow/Alliances/Rankings', self.sr.wndViewParent, 'alliances_rankings')) return tabs
def _IsDirectorInExecCorp(self, executorCorpID): if session.allianceid is None: return False if IsNPC(session.corpid): return False if session.corpid != executorCorpID: return False if corpRoleDirector & session.corprole != corpRoleDirector: return False return True
def GetHeight(self, *args): node, width = args height = 2 lw, lh = EveLabelSmall.MeasureTextSize(text=localization.GetByLabel('UI/Station/Lobby/CorpName')) tw, th = EveLabelMedium.MeasureTextSize(text=node.corpName) multiplier = 1 height += (lh + th + 15) * multiplier height += 5 if not IsNPC(node.corpID) and eve.session.corpid != node.corpID: height += 30 node.height = height return node.height
def Register(self, *args): if IsNPC(session.corpid) and sm.GetService( 'facwar').GetCorporationWarFactionID(session.corpid) is None: raise UserError('CantUseFleetfinder') if session.fleetid is None: return if sm.GetService('fleet').IsBoss(): if sm.GetService('fleet').options.isRegistered: self.EditDetail() else: from eve.client.script.ui.shared.fleet.fleetregister import RegisterFleetWindow RegisterFleetWindow.CloseIfOpen() RegisterFleetWindow.Open()
def _IsFilteredByOwner(self, structureController): ownerValue = self.controller.GetStructureOwnerValue() if ownerValue == browserUIConst.OWNER_ANY: return False ownerID = structureController.GetOwnerID() if ownerValue == browserUIConst.OWNER_CORP: if ownerID == session.corpid: return False else: return True if ownerValue == browserUIConst.OWNER_NPC: if IsNPC(ownerID): return False else: return True return False
def Load(self, node): self.sr.node = node data = node self.infoicon.UpdateInfoLink(const.typeCorporation, data.corpID) mainHeight = 0 corpName = data.Get('corpName', '') self.corpNameText.text = corpName self.corpNameText.top = self.corpNameLabel.textheight self.corpNameCont.height = self.corpNameText.top + self.corpNameText.textheight + 2 if self.corpNameCont.display: mainHeight += self.corpNameCont.height self.mainCont.height = mainHeight + 10 self.icon.Flush() def LogoThread(): if not self.destroyed: GetLogoIcon(itemID=data.corpID, parent=self.icon, acceptNone=False, align=uiconst.TOALL) uthread.new(LogoThread) self.buttonCnt.Flush() if not IsNPC(node.corpID): buttonEntries = [] if session.corpid != node.corpID: if sm.GetService('corp').GetActiveApplication( node.corpID) is not None: applyLabel = GetByLabel( 'UI/Corporations/CorpApplications/ViewApplication') else: applyLabel = GetByLabel( 'UI/Corporations/CorporationWindow/Alliances/Rankings/ApplyToJoin' ) buttonEntries.append( (applyLabel, sm.GetService('corp').ApplyForMembership, (node.corpID, ), 80)) self.buttonCnt.display = True if len(buttonEntries) > 0: self.buttonsGroup = ButtonGroup(btns=buttonEntries, parent=self.buttonCnt, unisize=0, line=0) self.buttonsGroup.top -= 1 else: self.buttonCnt.display = False
def CheckCanRepackage(item, dogma=None): if not item.singleton: raise UserError('RepackageItemNotSingleton') if IsNPC(item.ownerID): raise UserError('NotAvailableForNpcCorp') if not CanRepackageType(item.typeID): raise UserError('CanNotUnassembleInThisItemLoc') if not CanRepackageLocation(item.locationID, item.flagID): raise UserError('CanNotUnassembleInThisItemLoc') if dogma and dogma.TypeHasAttribute(item.typeID, dogmaconst.attributeArmorHP): if dogma.GetAttributeValue(item.itemID, dogmaconst.attributeArmorDamage): raise UserError('CantRepackageDamagedItem') if dogma and dogma.TypeHasAttribute(item.typeID, dogmaconst.attributeHp): if dogma.GetAttributeValue(item.itemID, dogmaconst.attributeDamage): raise UserError('CantRepackageDamagedItem')
def Load(self, node): self.sr.node = node data = node self.sr.infoicon.UpdateInfoLink(const.typeCorporation, data.corpID) mainHeight = 0 fieldName = 'corpName' infofield = self.sr.Get(fieldName, None) fieldText = self.sr.Get(fieldName + '_Text', None) fieldLabel = self.sr.Get(fieldName + '_Label', None) fieldText.text = data.Get(fieldName, '') fieldText.top = fieldLabel.textheight infofield.height = fieldText.top + fieldText.textheight + 2 if infofield.state != uiconst.UI_HIDDEN: mainHeight += infofield.height self.sr.main.height = mainHeight + 10 self.sr.icon.Flush() def LogoThread(): if not self.destroyed: GetLogoIcon(itemID=data.corpID, parent=self.sr.icon, acceptNone=False, align=uiconst.TOALL) uthread.new(LogoThread) self.sr.buttonCnt.Flush() if not IsNPC(node.corpID): buttonEntries = [] if eve.session.corpid != node.corpID: if sm.GetService('corp').GetActiveApplication(node.corpID) is not None: applyLabel = localization.GetByLabel('UI/Corporations/CorpApplications/ViewApplication') else: applyLabel = localization.GetByLabel('UI/Corporations/CorporationWindow/Alliances/Rankings/ApplyToJoin') buttonEntries.append((applyLabel, sm.GetService('corp').ApplyForMembership, (node.corpID,), 80)) if len(buttonEntries) > 0: self.sr.buttonCnt.state = uiconst.UI_PICKCHILDREN self.sr.buttons = ButtonGroup(btns=buttonEntries, parent=self.sr.buttonCnt, unisize=0, line=0) self.sr.buttons.top -= 1 else: self.sr.buttonCnt.state = uiconst.UI_PICKCHILDREN else: self.sr.buttonCnt.state = uiconst.UI_HIDDEN
def IsPlayerCharacter(self, charID): return IsCharacter(charID) and not IsNPC(charID)