def ConstructLayout(self): corpName = cfg.eveowners.Get(self.corpid).name corpInfoCont = uiprimitives.Container(name='corpInfo', parent=self.sr.main, align=uiconst.TOTOP, height=68, padding=const.defaultPadding) corpLogoCont = uiprimitives.Container(name='corpLogo', parent=corpInfoCont, align=uiconst.TOLEFT, width=68) corpTextCont = uiprimitives.Container(name='corpName', parent=corpInfoCont, align=uiconst.TOALL) applicationCont = uiprimitives.Container(name='corpInfo', parent=self.sr.main, align=uiconst.TOALL, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) uiutil.GetOwnerLogo(corpLogoCont, self.corpid, size=64, noServerCall=True) corpText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/ApplyForMembership', corporation=corpName) corpNameLabel = uicontrols.EveLabelLarge(parent=corpTextCont, text=corpText, top=12, align=uiconst.TOPLEFT, width=270) editText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/CorporationApplicationText') editLabel = uicontrols.EveLabelSmall(parent=applicationCont, text=editText, align=uiconst.TOTOP) tax = self.corporation.taxRate * 100 taxText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/CurrentTaxRateForCorporation', corporation=corpName, taxRate=tax) taxLabel = uicontrols.EveLabelSmall(parent=applicationCont, text=taxText, align=uiconst.TOBOTTOM) corpService = sm.GetService('corp') aggressionSettings = corpService.GetAggressionSettings(self.corpid) statusText = corpService.GetCorpFriendlyFireStatus(aggressionSettings) ffText = localization.GetByLabel('UI/Corporations/FriendlyFire/FriendlyFireStatus', ffStatus=statusText) ffCont = uiprimitives.Container(parent=applicationCont, align=uiconst.TOBOTTOM, height=16) friendlyFireLabel = uicontrols.EveLabelSmall(parent=ffCont, text=ffText, align=uiconst.TOLEFT) helpIcon = MoreInfoIcon(parent=ffCont, align=uiconst.TORIGHT, hint=localization.GetByLabel('UI/Corporations/FriendlyFire/Description')) if self.corporation and not self.corporation.isRecruiting: notRecruitingText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/RecruitmentMayBeClosed') notRecruiting = uicontrols.EveLabelSmall(parent=applicationCont, text=notRecruitingText, align=uiconst.TOBOTTOM, idx=0) self.SetMinSize((self.default_width, self.default_height + notRecruiting.textheight), refresh=True) self.applicationText = uicls.EditPlainText(setvalue='', parent=applicationCont, align=uiconst.TOALL, maxLength=1000)
def Startup(self, *args): node = self.sr.node self.corpSvc = sm.GetService('corp') self.lscSvc = sm.GetService('LSC') self.viewButton = None self.removeButton = None self.rejectButton = None self.acceptButton = None self.ownerID = None if node.myView: self.ownerID = node.application.corporationID else: self.ownerID = node.application.characterID self.entryContainer = uiprimitives.Container(parent=self) self.headerContainer = uiprimitives.Container(parent=self.entryContainer, align=uiconst.TOTOP, name='applicationHeaderContainer', height=self.APPHEADERHEIGHT) self.expander = uiprimitives.Sprite(parent=self.headerContainer, state=uiconst.UI_DISABLED, name='expander', pos=(0, 0, 16, 16), texturePath='res:/UI/Texture/Shared/getMenuIcon.png', align=uiconst.CENTERLEFT) if node.isExpanded: self.expander.rotation = -pi * 0.5 logoParent = uiprimitives.Container(parent=self.headerContainer, align=uiconst.TOPLEFT, pos=(16, 2, 48, 48)) uiutil.GetOwnerLogo(logoParent, self.ownerID, size=48, noServerCall=True) logoParent.children[0].OnMouseEnter = self.OnMouseEnter logoParent.children[0].OnClick = self.ShowOwnerInfo self.nameLabel = self.CORPNAMECLASS(parent=self.headerContainer, name='nameLabel', state=uiconst.UI_DISABLED, align=uiconst.CENTERLEFT, padding=self.CORPNAMEPAD) self.expandedParent = uiprimitives.Container(parent=self.entryContainer, name='expandedParent', height=0) self.expandedLabel = self.EXTENDEDCLASS(parent=self.expandedParent, name='applicationText', text=node.application.applicationText, padding=self.EXTENDEDPAD, align=uiconst.TOALL) self.hilite = uiprimitives.Fill(bgParent=self.headerContainer, color=(1, 1, 1, 0)) uiprimitives.Fill(bgParent=self.expandedParent, color=(0, 0, 0, 0.2))
def ConstructLayout(self): charInfoCont = uicls.Container(name='charInfo', parent=self.sr.main, align=uiconst.TOTOP, height=68, padding=const.defaultPadding) charLogoCont = uicls.Container(name='charLogo', parent=charInfoCont, align=uiconst.TOLEFT, width=68) charTextCont = uicls.Container(name='charName', parent=charInfoCont, align=uiconst.TOALL) applicationCont = uicls.Container(name='charInfo', parent=self.sr.main, align=uiconst.TOALL, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) uiutil.GetOwnerLogo(charLogoCont, self.charID, size=64, noServerCall=True) charText = localization.GetByLabel( 'UI/Corporations/CorpApplications/ApplicationSubjectLine', player=self.charID) charNameLabel = uicls.EveLabelLarge(parent=charTextCont, text=charText, top=12, align=uiconst.TOPLEFT, width=270) editText = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/CorporationApplicationText') editLabel = uicls.EveLabelSmall(parent=applicationCont, text=editText, align=uiconst.TOTOP) self.rejectRb = uicls.Checkbox(text=localization.GetByLabel( 'UI/Corporations/CorpApplications/RejectApplication'), parent=applicationCont, configName='reject', retval=1, checked=False, groupname='state', align=uiconst.TOBOTTOM) self.acceptRb = uicls.Checkbox(text=localization.GetByLabel( 'UI/Corporations/CorpApplications/ApplicationInviteApplicant'), parent=applicationCont, configName='accept', retval=0, checked=True, groupname='state', align=uiconst.TOBOTTOM) if self.status not in (const.crpApplicationAppliedByCharacter, const.crpApplicationAcceptedByCorporation): self.rejectRb.state = uiconst.UI_HIDDEN self.acceptRb.state = uiconst.UI_HIDDEN self.applicationText = uicls.EditPlainText(setvalue=self.appText, parent=applicationCont, maxLength=1000, readonly=True)
def Play(self, data): if data is None: return self.PlayIntro(data.get('introVideoPath', None)) leftFrame = uicls.ScreenFrame1(parent=self, align=uiconst.TOPLEFT, pos=(60, 50, 400, 400)) uiutil.GetOwnerLogo(leftFrame.mainCont, data.oldOwnerID, size=400) blue.pyos.synchro.SleepWallclock(100) uicore.animations.FadeIn(leftFrame.mainCont, duration=0.1, loops=3) rightFrame = uicls.ScreenFrame1(parent=self, align=uiconst.TOPRIGHT, pos=(60, 50, 400, 400)) uiutil.GetOwnerLogo(rightFrame.mainCont, data.newOwnerID, size=400) uicore.animations.FadeIn(rightFrame.mainCont, duration=0.1, loops=3) text = '<center>' + localization.GetByLabel( 'UI/Station/Holoscreen/SOV/SovereigntyChange') + '<center>' headingLabel = uicls.Label(parent=self, text=text, align=uiconst.CENTER, bold=True, color=util.Color.WHITE, fontsize=40, pos=(0, -120, 300, 0)) uicore.animations.BlinkIn(headingLabel) text = '<center>' + data.middleText + '<center>' label = uicls.Label(parent=self, text=text, align=uiconst.CENTER, bold=True, fontsize=25, pos=(0, -20, 230, 0)) uicore.animations.BlinkIn(label) banner = uicls.TextBanner(parent=self, align=uiconst.TOBOTTOM, padTop=10, scrollText=False, text=data.bottomText, fontSize=30, leftContWidth=310) uicls.Sprite( parent=banner.leftCont, pos=(30, -20, 252, 114), texturePath='res:/UI/Texture/Classes/CQMainScreen/scopeNewsLogo.png' ) uicore.animations.BlinkIn(banner) blue.pyos.synchro.SleepWallclock(TEMPLATE_DURATION)
def ConstructLayout(self): corpName = cfg.eveowners.Get(self.corpid).name corpInfoCont = uicls.Container(name='corpInfo', parent=self.sr.main, align=uiconst.TOTOP, height=68, padding=const.defaultPadding) corpLogoCont = uicls.Container(name='corpLogo', parent=corpInfoCont, align=uiconst.TOLEFT, width=68) corpTextCont = uicls.Container(name='corpName', parent=corpInfoCont, align=uiconst.TOALL) applicationCont = uicls.Container(name='corpInfo', parent=self.sr.main, align=uiconst.TOALL, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) uiutil.GetOwnerLogo(corpLogoCont, self.corpid, size=64, noServerCall=True) corpText = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/ApplyForMembership', corporation=corpName) corpNameLabel = uicls.EveLabelLarge(parent=corpTextCont, text=corpText, top=12, align=uiconst.TOPLEFT, width=270) editText = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/CorporationApplicationText') editLabel = uicls.EveLabelSmall(parent=applicationCont, text=editText, align=uiconst.TOTOP) tax = self.corporation.taxRate * 100 taxText = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/CurrentTaxRateForCorporation', corporation=corpName, taxRate=tax) taxLabel = uicls.EveLabelSmall(parent=applicationCont, text=taxText, align=uiconst.TOBOTTOM) if self.corporation and not self.corporation.isRecruiting: notRecruitingText = localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/RecruitmentMayBeClosed') notRecruiting = uicls.EveLabelSmall(parent=applicationCont, text=notRecruitingText, align=uiconst.TOBOTTOM, idx=0) self.SetMinSize((self.default_width, self.default_height + notRecruiting.textheight), refresh=True) self.applicationText = uicls.EditPlainText(setvalue='', parent=applicationCont, align=uiconst.TOALL, maxLength=1000)
def LoadPortrait(self, orderIfMissing=True): self.sr.picture.Flush() if self.sr.node is None: return if uiutil.GetOwnerLogo(self.sr.picture, self.id, size=32, callback=True, orderIfMissing=orderIfMissing): self.picloaded = 1
def Play(self, data): if data is None: return self.PlayIntro(data.get('introVideoPath', None)) self.leftCont = uicls.Container(parent=self, align=uiconst.TOLEFT, width=640, padRight=10) self.rightCont = uicls.ScreenFrame5(parent=self, align=uiconst.TOALL) headingCont = uicls.Container(parent=self.leftCont, align=uiconst.TOTOP, height=100, bgColor=(0.35, 0.35, 0.35, 1.0)) uicls.Label(parent=headingCont, text=data.headingText, fontsize=80, align=uiconst.CENTER, color=util.Color.WHITE, uppercase=True, bold=True) blue.pyos.synchro.SleepWallclock(300) uicls.ScreenHeading2(parent=self.leftCont, appear=True, align=uiconst.TOTOP, text=data.subHeadingText) frame = uicls.ScreenFrame4(parent=self.leftCont, align=uiconst.TOALL, appear=True, padTop=10) frame.mainCont.padLeft = 30 frame.mainCont.padTop = 20 uicls.Label(name='charNameLabel', parent=frame.mainCont, text=cfg.eveowners.Get(data.charID).name, fontsize=35, left=290) pictureCont = uicls.Container(align=uiconst.TOPLEFT, parent=frame.mainCont, pos=(0, 8, 256, 256)) uicls.Frame(parent=pictureCont, color=util.Color.WHITE) uiutil.GetOwnerLogo(pictureCont, data.charID, size=256) uicls.EveLabelMedium(name='mainTextLabel', parent=frame.mainCont, pos=(290, 45, 300, 0), text=data.mainText) video = uicls.VideoSprite(parent=self.rightCont.mainCont, videoPath=data.careerVideoPath, align=uiconst.TOALL, repeat=True, positionComponent=getattr( self.uiDesktop, 'positionComponent', None)) while not video.isFinished: blue.synchro.Yield()
def ApplyAttributes(self, attributes): invCont._InvContBase.ApplyAttributes(self, attributes) ownerID = attributes.ownerID ownerName = cfg.eveowners.Get(ownerID).name self.topCont = uicls.Container(parent=self, align=uiconst.TOTOP, height=65, idx=0) myImgCont = uicls.Container(name='myImgCont', parent=self.topCont, align=uiconst.TOPLEFT, width=64, height=64, padLeft=2) uiutil.GetOwnerLogo(myImgCont, ownerID, size=64, noServerCall=True) uicls.EveLabelMedium(text=ownerName, parent=self.topCont, left=72, top=2, bold=True) self.acceptIcon = uicls.Icon(icon='ui_38_16_193', parent=self.topCont, left=67, top=14) uicls.InvContViewBtns(parent=self.topCont, align=uiconst.BOTTOMLEFT, left=72, controller=self) self.moneyLabel = uicls.EveLabelMedium(parent=self.topCont, left=6, top=-2, align=uiconst.BOTTOMRIGHT)
def ConstructLayout(self): allianceName = cfg.eveowners.Get(self.allianceID).name allianceInfoCont = uiprimitives.Container(name='allianceInfo', parent=self.sr.main, align=uiconst.TOTOP, height=68, padding=const.defaultPadding) allianceLogoCont = uiprimitives.Container(name='allianceLogo', parent=allianceInfoCont, align=uiconst.TOLEFT, width=68) allianceTextCont = uiprimitives.Container(name='allianceName', parent=allianceInfoCont, align=uiconst.TOALL) applicationCont = uiprimitives.Container(name='allianceInfo', parent=self.sr.main, align=uiconst.TOALL, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) uiutil.GetOwnerLogo(allianceLogoCont, self.allianceID, size=64, noServerCall=True) allianceText = localization.GetByLabel('UI/Corporations/CorpApplications/YourApplicationToJoin', corpName=allianceName) allianceNameLabel = uicontrols.EveLabelLarge(parent=allianceTextCont, text=allianceText, top=12, align=uiconst.TOPLEFT, width=270) editText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/CorporationApplicationText') editLabel = uicontrols.EveLabelSmall(parent=applicationCont, text=editText, height=16, align=uiconst.TOTOP) if self.application.applicationText is not None: appText = self.application.applicationText else: appText = '' self.applicationText = uicls.EditPlainText(setvalue=appText, parent=applicationCont, align=uiconst.TOTOP, maxLength=1000, height=100, readonly=True) status = uicontrols.EveLabelSmall(parent=applicationCont, text=localization.GetByLabel('UI/Corporations/CorporationWindow/Alliances/Applications/Status'), align=uiconst.TOTOP, top=6) statusLabel = uicontrols.EveLabelSmallBold(parent=applicationCont, text=_GetApplicationStatusStr(self.application.state), height=12, align=uiconst.TOTOP)
def ConstructLayout(self): allianceName = cfg.eveowners.Get(self.allianceID).name allianceInfoCont = uiprimitives.Container(name='allianceInfo', parent=self.sr.main, align=uiconst.TOTOP, height=68, padding=const.defaultPadding) allianceLogoCont = uiprimitives.Container(name='allianceLogo', parent=allianceInfoCont, align=uiconst.TOLEFT, width=68) allianceTextCont = uiprimitives.Container(name='allianceName', parent=allianceInfoCont, align=uiconst.TOALL) applicationCont = uiprimitives.Container(name='allianceInfo', parent=self.sr.main, align=uiconst.TOALL, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) uiutil.GetOwnerLogo(allianceLogoCont, self.allianceID, size=64, noServerCall=True) allianceText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/ApplyForMembership', corporation=allianceName) allianceNameLabel = uicontrols.EveLabelLarge(parent=allianceTextCont, text=allianceText, top=12, align=uiconst.TOPLEFT, width=270) alliance = sm.GetService('alliance').GetAlliance(self.allianceID) corp = sm.GetService('corp').GetCorporation(alliance.executorCorpID) myCorpName = cfg.eveowners.Get(session.corpid).ownerName stdText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/AskJoinAlliance', ceo='-----', ceoID=corp.ceoID, mycorp=myCorpName, alliancename=allianceName, sender=session.charid, mycorpname=myCorpName) editText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/CorporationApplicationText') editLabel = uicontrols.EveLabelSmall(parent=applicationCont, text=editText, height=16, align=uiconst.TOTOP) self.applicationText = uicls.EditPlainText(setvalue=stdText, parent=applicationCont, align=uiconst.TOTOP, maxLength=1000, height=100) appText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/ThisApplicationOverwritesOlderOnes') appLabel = uicontrols.EveLabelMedium(parent=applicationCont, text=appText, align=uiconst.TOTOP, top=8)
def ConstructLayout(self): self.acceptRb = None self.withdrawRb = None corpName = cfg.eveowners.Get(self.corpid).name corpInfoCont = uiprimitives.Container(name='corpInfo', parent=self.sr.main, align=uiconst.TOTOP, height=68, padding=const.defaultPadding) corpLogoCont = uiprimitives.Container(name='corpLogo', parent=corpInfoCont, align=uiconst.TOLEFT, width=68) corpTextCont = uiprimitives.Container(name='corpName', parent=corpInfoCont, align=uiconst.TOALL) controlCont = uiprimitives.Container(name='buttons', parent=self.sr.main, align=uiconst.TOBOTTOM, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) controlContHeight = 0 applicationCont = uiprimitives.Container(name='applicationCont', parent=self.sr.main, align=uiconst.TOALL, padding=(const.defaultPadding, 0, const.defaultPadding, const.defaultPadding)) uiutil.GetOwnerLogo(corpLogoCont, self.corpid, size=64, noServerCall=True) corpText = localization.GetByLabel('UI/Corporations/CorpApplications/YourApplicationToJoin', corpName=corpName) corpNameLabel = uicontrols.EveLabelLarge(parent=corpTextCont, text=corpText, top=12, align=uiconst.TOPLEFT, width=270) if self.status == const.crpApplicationAppliedByCharacter: statusText = localization.GetByLabel('UI/Corporations/CorpApplications/ApplicationNotProcessed') statusLabel = uicontrols.EveLabelSmall(parent=applicationCont, text=statusText, align=uiconst.TOTOP, padBottom=const.defaultPadding) else: statusText = statusLabel = '' editText = localization.GetByLabel('UI/Corporations/BaseCorporationUI/CorporationApplicationText') editLabel = uicontrols.EveLabelSmall(parent=applicationCont, text=editText, align=uiconst.TOTOP) if self.application.applicationText is not None: appText = self.application.applicationText else: appText = '' self.applicationText = uicls.EditPlainText(setvalue=appText, parent=applicationCont, maxLength=1000, readonly=True) if self.status in const.crpApplicationActiveStatuses: isWithdrawChecked = True if self.status in (const.crpApplicationAcceptedByCorporation, const.crpApplicationInvitedByCorporation): isWithdrawChecked = False self.acceptRb = uicontrols.Checkbox(text=localization.GetByLabel('UI/Corporations/CorpApplications/AcceptApplication'), parent=controlCont, configName='accept', retval=1, checked=True, groupname='stateGroup', align=uiconst.TOBOTTOM) controlContHeight += 40 self.withdrawRb = uicontrols.Checkbox(text=localization.GetByLabel('UI/Corporations/CorpApplications/WithdrawApplication'), parent=controlCont, configName='accept', retval=3, checked=isWithdrawChecked, groupname='stateGroup', align=uiconst.TOBOTTOM) controlContHeight += 20 controlCont.height = controlContHeight
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.application = attributes.application self.windowID = 'rejectCorpApplication' self.DefineButtons(uiconst.OKCANCEL, okFunc=self.Reject, cancelFunc=self.Cancel, okLabel=localization.GetByLabel('UI/Corporations/CorpApplications/RejectApplication')) wndCaption = localization.GetByLabel('UI/Corporations/Applications/ApplicationRejection') self.SetCaption(wndCaption) self.SetTopparentHeight(0) self.MakeUnResizeable() topCont = Container(parent=self.sr.main, align=uiconst.TOTOP, height=58) textCont = Container(parent=self.sr.main, align=uiconst.TOALL, padding=8) charName = cfg.eveowners.Get(self.application.characterID).name corpName = cfg.eveowners.Get(self.application.corporationID).name logoParent = uiprimitives.Container(parent=topCont, align=uiconst.TOPLEFT, pos=(8, 6, 48, 48)) uiutil.GetOwnerLogo(logoParent, self.application.characterID, size=48, noServerCall=True) characterLink = localization.GetByLabel('UI/Contracts/ContractsWindow/ShowInfoLink', showInfoName=charName, info=('showinfo', const.typeCharacterAmarr, self.application.characterID)) nameLabel = EveLabelMedium(parent=topCont, left=64, top=12, text=characterLink, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) applicationDate = localization.GetByLabel('UI/Corporations/Applications/ApplicationDate', applicationDateTime=self.application.applicationDateTime) dateLabel = EveLabelMedium(parent=topCont, left=64, top=2, text=applicationDate, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) messageLabel = EveLabelMedium(parent=textCont, align=uiconst.TOTOP, text=localization.GetByLabel('UI/Corporations/CorpApplications/ApplicationRejectionText', charName=charName, corpName=corpName)) regardsLabel = EveLabelMedium(parent=textCont, align=uiconst.TOBOTTOM, text=localization.GetByLabel('UI/Corporations/CorpApplications/ApplicationRejectionRegards', corpName=corpName), padTop=4) self.messageTextEdit = uicls.EditPlainText(parent=textCont, maxLength=4000, hintText=localization.GetByLabel('UI/Corporations/CorpApplications/CorpRejectionMessage'), top=4)
def ConstructLayout(self): topCont = uiprimitives.Container(name='topCont', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 76), padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) imgCont = uiprimitives.Container(name='imgCont', parent=topCont, align=uiconst.TOLEFT, pos=(0, 0, 64, 0), padding=(0, 0, const.defaultPadding, 0)) topRightCont = uiprimitives.Container(name='topRightCont', parent=topCont, align=uiconst.TOALL) nameCont = uiprimitives.Container(name='nameCont', parent=topRightCont, align=uiconst.TOTOP, pos=(0, 0, 0, 20), padding=(0, 0, 0, 0)) splitter = uiprimitives.Container(name='splitter', parent=topRightCont, align=uiconst.TOTOP, pos=(0, 0, 0, 1), padding=(0, 0, 0, 0)) uiprimitives.Line(parent=splitter, align=uiconst.TOBOTTOM) levelCont = uiprimitives.Container(name='levelCont', parent=topRightCont, align=uiconst.TOALL) textCont = uiprimitives.Container(name='textCont', parent=levelCont, align=uiconst.TOTOP, pos=(0, 0, 0, 18)) sliderCont = uiprimitives.Container(name='sliderCont', parent=levelCont, align=uiconst.TOTOP, pos=(0, 0, 0, 12)) levelsCont = uiprimitives.Container(name='levelsCont', parent=levelCont, align=uiconst.TOTOP, pos=(0, 0, 0, 40)) uiprimitives.Container(name='bottomCont', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) labels = sm.GetService('addressbook').GetContactLabels(self.contactType).values() if not self.isContact and len(labels): labelList = [] labelCont = uiprimitives.Container(name='labelCont', parent=self.sr.main, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 18), padding=(const.defaultPadding, 0, 0, const.defaultPadding)) for label in labels: labelList.append((label.name, label.labelID)) assignLabelText = localization.GetByLabel('UI/PeopleAndPlaces/AssignLabel') labelList.insert(0, (assignLabelText, None)) self.labelsCombo = uicontrols.Combo(label='', parent=labelCont, options=labelList, name='labelscombo', adjustWidth=True) self.minHeight += labelCont.height self.standingList = {const.contactHighStanding: localization.GetByLabel('UI/PeopleAndPlaces/ExcellentStanding'), const.contactGoodStanding: localization.GetByLabel('UI/PeopleAndPlaces/GoodStanding'), const.contactNeutralStanding: localization.GetByLabel('UI/PeopleAndPlaces/NeutralStanding'), const.contactBadStanding: localization.GetByLabel('UI/PeopleAndPlaces/BadStanding'), const.contactHorribleStanding: localization.GetByLabel('UI/PeopleAndPlaces/TerribleStanding')} levelList = self.standingList.keys() levelList.sort() levelText = '' self.levelText = uicontrols.EveLabelMedium(text=levelText, parent=textCont, left=0, align=uiconst.TOPLEFT, width=170, state=uiconst.UI_DISABLED, idx=0) startVal = 0.5 if self.isContact: startVal = self.level / 20.0 + 0.5 self.sr.slider = self.AddSlider(sliderCont, 'standing', -10.0, 10.0, '', startVal=startVal) self.sr.slider.SetValue(startVal) self.levelSelector = uicls.StandingLevelSelector(name='levelCont', parent=levelsCont, align=uiconst.TOTOP, height=55, level=self.level) self.levelSelector.OnStandingLevelSelected = self.OnStandingLevelSelected charName = cfg.eveowners.Get(self.entityID).name uiutil.GetOwnerLogo(imgCont, self.entityID, size=64, noServerCall=True) label = uicontrols.EveLabelLargeBold(text=charName, parent=nameCont, left=0, top=2, align=uiconst.TOPLEFT, width=170, state=uiconst.UI_DISABLED, idx=0) nameCont.state = uiconst.UI_DISABLED nameCont.height = label.height + 5 self.minHeight += nameCont.height topCont.height = max(topCont.height, nameCont.height + levelsCont.height + splitter.height + textCont.height) btnText = localization.GetByLabel('UI/PeopleAndPlaces/AddContact') if self.isContact: btnText = localization.GetByLabel('UI/PeopleAndPlaces/EditContact') self.btnGroup = uicontrols.ButtonGroup(btns=[[btnText, self.Confirm, (), 81, 1, 1, 0], [localization.GetByLabel('UI/Common/Buttons/Cancel'), self.Cancel, (), 81, 0, 0, 0]], parent=self.sr.main, idx=0) if self.level is None: self.levelText.text = localization.GetByLabel('UI/PeopleAndPlaces/SelectStanding') btn = self.btnGroup.GetBtnByLabel(btnText) uicore.registry.SetFocus(btn) uthread.new(self.SetWindowSize)
def ConstructLayout(self): topCont = uiprimitives.Container( name='topCont', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 70), padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) imgCont = uiprimitives.Container(name='imgCont', parent=topCont, align=uiconst.TOLEFT, pos=(0, 0, 64, 0), padding=(0, 0, const.defaultPadding, 0)) topRightCont = uiprimitives.Container(name='topRightCont', parent=topCont, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=(const.defaultPadding, 0, 0, 0)) nameCont = uiprimitives.Container(name='nameCont', parent=topRightCont, align=uiconst.TOTOP, pos=(0, 0, 0, 20)) uiprimitives.Line(parent=nameCont, align=uiconst.TOBOTTOM) levelCont = uiprimitives.Container(name='levelCont', parent=topRightCont, align=uiconst.TOTOP, height=42, padding=(0, const.defaultPadding, 0, 0)) self.standingList = { const.contactHighStanding: localization.GetByLabel('UI/PeopleAndPlaces/ExcellentStanding'), const.contactGoodStanding: localization.GetByLabel('UI/PeopleAndPlaces/GoodStanding'), const.contactNeutralStanding: localization.GetByLabel('UI/PeopleAndPlaces/NeutralStanding'), const.contactBadStanding: localization.GetByLabel('UI/PeopleAndPlaces/BadStanding'), const.contactHorribleStanding: localization.GetByLabel('UI/PeopleAndPlaces/TerribleStanding') } levelList = self.standingList.keys() levelList.sort() levelText = self.standingList.get(self.level) self.levelText = uicontrols.EveLabelMedium(text=levelText, parent=levelCont, height=14, align=uiconst.TOTOP, state=uiconst.UI_DISABLED, idx=0) self.levelSelector = uicls.StandingLevelSelector(name='levelCont', parent=levelCont, align=uiconst.TOTOP, height=55, padTop=4, level=self.level) self.levelSelector.OnStandingLevelSelected = self.OnStandingLevelSelected charName = cfg.eveowners.Get(self.entityID).name uiutil.GetOwnerLogo(imgCont, self.entityID, size=64, noServerCall=True) label = uicontrols.EveLabelLargeBold(text=charName, parent=nameCont, left=0, align=uiconst.TOPLEFT, width=170, state=uiconst.UI_DISABLED, idx=0) nameCont.state = uiconst.UI_DISABLED nameCont.height = label.height + 2 self.minHeight += nameCont.height topCont.height = max(topCont.height, nameCont.height + levelCont.height) labels = sm.GetService('addressbook').GetContactLabels( 'contact').values() if not self.isContact and len(labels): labelList = [] labelCont = uiprimitives.Container(name='topCont', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 18), padding=(const.defaultPadding, 0, 0, const.defaultPadding)) for label in labels: labelList.append( (label.name.lower(), (label.name, label.labelID))) labelList = uiutil.SortListOfTuples(labelList) assignLabelText = '-- %s --' % localization.GetByLabel( 'UI/Mail/AssignLabel') labelList.insert(0, (assignLabelText, None)) self.labelsCombo = uicontrols.Combo(label='', parent=labelCont, options=labelList, name='labelscombo', adjustWidth=True) self.minHeight += labelCont.height if self.labelID: self.labelsCombo.SetValue(self.labelID) if util.IsCharacter(self.entityID): splitter = uiprimitives.Container(name='splitter', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 1), padding=(0, 0, 0, 0)) uiprimitives.Line(parent=splitter, align=uiconst.TOBOTTOM) bottomCont = uiprimitives.Container(name='bottomCont', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=const.defaultPadding) cbCont = uiprimitives.Container(name='cbCont', parent=bottomCont, align=uiconst.TOTOP, pos=(0, 0, 0, 16), state=uiconst.UI_HIDDEN) notifyCont = uiprimitives.Container(name='notifyCont', parent=bottomCont, align=uiconst.TOTOP, pos=(0, 0, 0, 95)) cbCont.state = uiconst.UI_NORMAL self.inWatchlistCb = uicontrols.Checkbox( text=localization.GetByLabel( 'UI/PeopleAndPlaces/AddContactToWatchlist'), parent=cbCont, configName='inWatchlistCb', retval=0, checked=self.watchlist, align=uiconst.TOTOP) self.inWatchlistCb.hint = localization.GetByLabel( 'UI/PeopleAndPlaces/BuddyListHint') self.sendNotificationCb = uicontrols.Checkbox( text=localization.GetByLabel( 'UI/PeopleAndPlaces/SendNotificationTo', contactName=charName), parent=notifyCont, configName='sendNotificationCb', retval=0, checked=0, align=uiconst.TOTOP) self.message = uicls.EditPlainText(setvalue='', parent=notifyCont, align=uiconst.TOALL, maxLength=120, padBottom=const.defaultPadding) self.minHeight += 120 btnText = localization.GetByLabel('UI/PeopleAndPlaces/AddContact') if self.isContact: btnText = localization.GetByLabel('UI/PeopleAndPlaces/EditContact') self.btnGroup = uicontrols.ButtonGroup( btns=[[btnText, self.Confirm, (), 81, 1, 1, 0], [ localization.GetByLabel('UI/Common/Buttons/Cancel'), self.Cancel, (), 81, 0, 0, 0 ]], parent=self.sr.main, idx=0) if self.level is None: self.levelText.text = localization.GetByLabel( 'UI/PeopleAndPlaces/SelectStanding') btn = self.btnGroup.GetBtnByLabel(btnText) uicore.registry.SetFocus(btn) uthread.new(self.SetWindowSize)
def ConstructLayout(self): invitorCont = uiprimitives.Container(name='invitorCont', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 70), padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, 0), state=uiconst.UI_PICKCHILDREN) challangerImgCont = uiprimitives.Container( name='challangerImgCont', parent=invitorCont, align=uiconst.TOLEFT, pos=(0, 0, 64, 0), padding=(0, 0, const.defaultPadding, 0), state=uiconst.UI_PICKCHILDREN) challangerCont = uiprimitives.Container(name='challangerCont', parent=invitorCont, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=(const.defaultPadding, 0, 0, 0)) uiutil.GetOwnerLogo(challangerImgCont, self.charID, size=64, noServerCall=True) stateFlag = FlagIconWithState(parent=challangerImgCont, align=uiconst.BOTTOMRIGHT, left=4, top=10) labels = [ uicontrols.EveLabelMedium( name='charNameLabel', text=localization.GetByLabel('UI/Common/Name'), parent=challangerCont, left=0, top=0, align=uiconst.TOPLEFT, width=60, state=uiconst.UI_NORMAL, idx=0), uicontrols.EveLabelMedium( name='corpNameLabel', text=localization.GetByLabel('UI/Common/Corporation'), parent=challangerCont, left=0, top=21, align=uiconst.TOPLEFT, width=270, state=uiconst.UI_NORMAL, idx=0) ] if self.allianceID is not None: labels.append( uicontrols.EveLabelMedium( name='allianceNameLabel', text=localization.GetByLabel('UI/Common/Alliance'), parent=challangerCont, left=0, top=42, align=uiconst.TOPLEFT, width=270, state=uiconst.UI_NORMAL, idx=0)) labelLength = max( (l.textwidth for l in labels)) + 2 * const.defaultPadding uicontrols.EveLabelMedium(name='charName', text=util.FmtOwnerLink(self.charID), parent=challangerCont, left=labelLength, top=0, align=uiconst.TOPLEFT, width=270, state=uiconst.UI_NORMAL, idx=0) uicontrols.EveLabelMedium(name='corpName', text=util.FmtOwnerLink(self.corpID), parent=challangerCont, left=labelLength, top=21, align=uiconst.TOPLEFT, width=270, state=uiconst.UI_NORMAL, idx=0) if self.allianceID is not None: uicontrols.EveLabelMedium(name='allianceName', text=util.FmtOwnerLink(self.allianceID) if self.allianceID else '', parent=challangerCont, left=labelLength, top=42, align=uiconst.TOPLEFT, width=270, state=uiconst.UI_NORMAL, idx=0) uiprimitives.Sprite( name='logo', parent=invitorCont, texturePath= 'res:/UI/Texture/Crimewatch/Crimewatch_LimitedEngagement_64.png', width=64, height=64, align=uiconst.TOPRIGHT, padding=(0, 0, const.defaultPadding, 0)) bodyTextCont = uiprimitives.Container( name='bodyTextCont', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 30), padding=(const.defaultPadding, const.defaultPadding * 2, const.defaultPadding, 0), state=uiconst.UI_PICKCHILDREN) box = uiprimitives.Container( parent=bodyTextCont, name='frame', align=uiconst.TOLEFT, width=64, height=64, padding=(const.defaultPadding, const.defaultPadding * 3, const.defaultPadding, const.defaultPadding * 3)) self.time = uicontrols.Label(parent=box, name='counter', text='60', fontsize=32, bold=False, align=uiconst.CENTERRIGHT, color=Colors.Engagement.GetRGBA(), left=15) captionCont = uiprimitives.Container(name='captionCont', parent=bodyTextCont, align=uiconst.TOALL, pos=(0, 0, 0, 0)) l = uicontrols.EveLabelSmall( name='charName', text=localization.GetByLabel('UI/Crimewatch/Duel/DuelDecleration'), parent=captionCont, left=0, top=0, align=uiconst.TOALL, state=uiconst.UI_NORMAL) bodyTextCont.height = max(64, l.textheight) controlsCont = uiprimitives.Container( name='controlsCont', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 20 + const.defaultPadding), padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, 0)) self.blockOption = uicontrols.Checkbox(text=localization.GetByLabel( 'UI/Crimewatch/Duel/BlockCommunications'), parent=controlsCont, configName='block', retval=1, checked=0, groupname=None, pos=(const.defaultPadding, 0, 300, 0), align=uiconst.TOPLEFT) self.btnGroup = uicontrols.ButtonGroup( btns=[[ localization.GetByLabel('UI/Crimewatch/Duel/Accept'), self.Confirm, (), 81, 1, 0, 0 ], [ localization.GetByLabel('UI/Crimewatch/Duel/Decline'), self.Decline, (), 81, 1, 1, 0 ]], parent=self.sr.main, align=uiconst.TOTOP) self.SetHeight(sum((c.height for c in self.sr.main.children)) + 40) uicore.registry.SetFocus(self.btnGroup.children[0]) icon = challangerImgCont.children[0] icon.isDragObject = True icon.GetDragData = self.CharGetDragData icon.OnClick = self.CharOnClick slimItem = sm.GetService('crimewatchSvc').GetSlimItemDataForCharID( self.charID) if slimItem is not None: stateSvc = sm.GetService('state') flagCode = stateSvc.CheckFilteredFlagState(slimItem) flagInfo = stateSvc.GetStatePropsColorAndBlink(flagCode) stateFlag.ModifyIcon(flagInfo=flagInfo)
def LoadContactEntry(self, node): data = node.data uiutil.GetOwnerLogo(self.sr.picture, node.senderID, size=32, noServerCall=True)
def Play(self, data): if data is None: return self.PlayIntro(data.get('introVideoPath', None)) uicls.TextBanner(parent=self, align=uiconst.TOBOTTOM, height=100, text=data.bottomText) rightCont = uicls.ScreenFrame5(parent=self, align=uiconst.TORIGHT, width=700, padLeft=10, padBottom=10) blue.pyos.synchro.SleepWallclock(300) topLeftCont = uicls.ScreenFrame2(parent=self, align=uiconst.TOTOP, height=300) bottomLeftCont = uicls.ScreenHeading1(parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0), padTop=10, padBottom=10, leftContWidth=150, appear=False) blue.pyos.synchro.SleepWallclock(300) uicls.ScreenHeading2( parent=topLeftCont.mainCont, text=localization.GetByLabel( 'UI/Station/Holoscreen/RacialEpicArc/EpicArcAgent'), align=uiconst.TOBOTTOM, hasBargraph=False, padBottom=10, padRight=10) topLeftCont.mainCont.padLeft = 30 topLeftCont.mainCont.padTop = 15 pictureCont = uicls.Container(align=uiconst.TOPLEFT, parent=topLeftCont.mainCont, pos=(0, 20, 180, 180)) uicls.Frame(parent=pictureCont, color=util.Color.WHITE) uiutil.GetOwnerLogo(pictureCont, data.charID, size=256) logo = pictureCont.children[1] logo.align = uiconst.TOALL logo.width = logo.height = 0 uicls.Label(name='charNameLabel', parent=topLeftCont.mainCont, text=cfg.eveowners.Get(data.charID).name, fontsize=50, left=200, top=20, color=util.Color.WHITE) uicls.EveLabelMedium(name='charLocationLabel', parent=topLeftCont.mainCont, pos=(200, 75, 300, 0), text=data.mainText) uicore.animations.BlinkIn(topLeftCont.mainCont) uiutil.GetOwnerLogo(bottomLeftCont.leftCont, data.factionID, size=150) icon = bottomLeftCont.leftCont.children[0] icon.align = uiconst.CENTER uicls.Label(parent=bottomLeftCont.mainCont, text=data.factionNameText, fontsize=42, top=30, left=15) uicls.Label( parent=bottomLeftCont.mainCont, text=localization.GetByLabel('UI/Agents/MissionTypes/EpicArc'), fontsize=30, top=80, left=15) bottomLeftCont.AnimAppear() video = uicls.VideoSprite(parent=rightCont.mainCont, videoPath=data.videoPath, align=uiconst.TOALL, positionComponent=getattr( self.uiDesktop, 'positionComponent', None)) while not video.isFinished: blue.synchro.Yield()
def Play(self, data): if data is None: return self.PlayIntro(data.get('introVideoPath', None)) banner = uicls.TextBanner(parent=self, align=uiconst.TOBOTTOM, padTop=10, scrollText=False, text=data.bottomText, fontSize=35, leftContWidth=310) uicls.Sprite( parent=banner.leftCont, pos=(10, -20, 300, 100), texturePath='res:/UI/Texture/Classes/CQMainScreen/concordLogo.png') uicore.animations.BlinkIn(banner, sleep=True) iconFrame = uicls.ScreenFrame5(parent=self, align=uiconst.TOPLEFT, pos=(100, 10, 450, 450), appear=True) blue.pyos.synchro.SleepWallclock(300) uiutil.GetOwnerLogo(iconFrame.mainCont, data.charID, size=512) icon = iconFrame.mainCont.children[0] icon.width = icon.height = 0 icon.align = uiconst.TOALL if data.isWanted: wantedCont = uicls.Container(parent=iconFrame.mainCont, align=uiconst.BOTTOMLEFT, width=iconFrame.width, height=90, idx=0) fill = uicls.Fill(bgParent=wantedCont, color=(1.0, 0.0, 0.0, 0.5)) uicore.animations.FadeTo(fill, startVal=0.5, endVal=0.2, duration=1.0, loops=uiconst.ANIM_REPEAT) label = uicls.Label(parent=wantedCont, text=data.wantedHeading, fontsize=50, align=uiconst.CENTERTOP, color=util.Color.WHITE, bold=True) uicore.animations.SpGlowFadeOut(icon, duration=0.1, loops=3, sleep=True) frame = uicls.ScreenFrame4(parent=self, align=uiconst.TOPRIGHT, pos=(100, 50, 500, 400), appear=True) blue.pyos.synchro.SleepWallclock(300) uicls.Fill(bgParent=frame.mainCont, color=BG_GRAY) uicls.Label(name='heading', parent=frame.mainCont, text=data.heading, fontsize=40, left=20, top=20, uppercase=True, bold=True) uicls.EveLabelMedium(name='mainTextLabel', parent=frame.mainCont, pos=(20, 70, 480, 0), text=data.mainText) uicore.animations.BlinkIn(frame.mainCont) if data.isWanted: label = uicls.Label(parent=frame.mainCont, text=data.wantedText, fontsize=45, top=-50, color=(0.6, 0.0, 0.0, 1.0), bold=True) blue.pyos.synchro.SleepWallclock(TEMPLATE_DURATION)