コード例 #1
0
def GetOreAvgBonusAsLabel(avgBonus):
    """
        Takes in float: avgBonus and returns labels: oreAvgBonusLabel, oreAvgTextLabel.
    """
    oreAvgBonusLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/YieldFormatting', bonusYield=1.0 + avgBonus / 100), colSpan=1, align=uiconst.TORIGHT, padRight=3, color=COL_GREEN, bold=True)
    oreAvgTextLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/OreProcessingHint'), colSpan=1, padLeft=3)
    return (oreAvgBonusLabel, oreAvgTextLabel)
コード例 #2
0
 def AddColumnName(self):
     col = self.AddColumnContainer(width=NAME_COL_WIDTH)
     col.state = uiconst.UI_NORMAL
     col.hint = self.charLabel
     nameText = GetByLabel('UI/Contracts/ContractsWindow/ShowInfoLink', showInfoName=self.charLabel, info=('showinfo', const.typeCharacterAmarr, self.charID))
     nameLabel = EveLabelMedium(parent=col, text=nameText, align=uiconst.CENTERLEFT, left=6, autoFadeSides=35)
     nameLabel.state = uiconst.UI_NORMAL
コード例 #3
0
def GetStationEfficiencyAsLabel(stationEfficiency):
    """
        Takes in float: stationEfficiency and returns labels: stationBonusLabel, stationTextLabel.
    """
    stationBonusLabel = EveLabelMedium(text=GetByLabel('UI/Common/Formatting/Percentage', percentage=stationEfficiency * 100), colSpan=1, align=uiconst.TORIGHT, padRight=2, color=COL_LIGHTBLUE, bold=True)
    stationTextLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/BaseYield'), colSpan=1, padLeft=2)
    return (stationBonusLabel, stationTextLabel)
コード例 #4
0
ファイル: reprocessingWnd.py プロジェクト: connoryang/1v1dec
def GetSkillBonusesAsLabels(typeID,
                            getTypeAttribute,
                            getSkillLevel,
                            category=False):
    skillLabels = []
    if not category:
        skillBonuses = GetSkillFromTypeID(typeID, getTypeAttribute,
                                          getSkillLevel)
    else:
        skillBonuses = GetSkillFromCategoryID(typeID, getTypeAttribute,
                                              getSkillLevel)
    for skillType, bonus in skillBonuses:
        skillName = evetypes.GetName(skillType)
        labelOpacity = 0.35
        if bonus > 0:
            labelOpacity = 0.75
        skillLabels.append(
            EveLabelMedium(text=GetByLabel(
                'UI/Reprocessing/ReprocessingWindow/YieldFormatting',
                bonusYield=1.0 + bonus / 100),
                           colSpan=1,
                           align=uiconst.TORIGHT,
                           padRight=3,
                           color=COL_GREEN,
                           bold=True,
                           opacity=labelOpacity))
        skillLabels.append(
            EveLabelMedium(text=GetByLabel(
                'UI/Reprocessing/ReprocessingWindow/BonusFromSkill',
                skillName=skillName),
                           colSpan=1,
                           padLeft=3,
                           opacity=labelOpacity))

    return skillLabels
コード例 #5
0
ファイル: reprocessingWnd.py プロジェクト: connoryang/1v1dec
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     nameCont = Container(name='nameCont',
                          parent=self,
                          align=uiconst.TOTOP,
                          height=18)
     infoCont = Container(name='infoCont',
                          parent=self,
                          align=uiconst.TOBOTTOM,
                          height=54,
                          clipChildren=True)
     self.groupContainers = {}
     self.overlayCont = Container(name='overlayCont',
                                  parent=self,
                                  align=uiconst.TOALL)
     self.CreateScrollContainer()
     self.captionLabel = EveLabelMediumBold(parent=nameCont, left=6)
     self.volumeLabel = EveLabelMedium(name='volumeLabel',
                                       parent=infoCont,
                                       align=uiconst.BOTTOMRIGHT,
                                       left=5,
                                       top=4)
     self.totalPriceLabel = EveLabelMedium(name='totalPriceLabel',
                                           parent=infoCont,
                                           align=uiconst.BOTTOMRIGHT,
                                           left=5,
                                           top=20)
     self.numItemsLabel = EveLabelMedium(name='numItemsLabel',
                                         parent=infoCont,
                                         align=uiconst.BOTTOMRIGHT,
                                         left=5,
                                         top=36)
コード例 #6
0
 def Layout(self):
     self.HideHeader()
     self.MakeUnResizeable()
     self.SetWndIcon(self.iconNum, mainTop=2, mainLeft=6)
     self.SetTopparentHeight(self.TOP_PARENT_HEIGHT)
     station = cfg.stations.Get(session.stationid2)
     WndCaptionLabel(parent=self.sr.topParent,
                     align=uiconst.RELATIVE,
                     text=localization.GetByLabel('UI/Medical/Medical'),
                     subcaption=station.stationName)
     self.container = ContainerAutoSize(parent=self.GetMainArea(),
                                        align=uiconst.TOTOP,
                                        alignMode=uiconst.TOTOP,
                                        state=uiconst.UI_PICKCHILDREN,
                                        padding=(self.PADDING, self.PADDING,
                                                 self.PADDING,
                                                 self.PADDING),
                                        callback=self.OnContainerResized,
                                        opacity=0.0)
     EveLabelLargeBold(
         parent=self.container,
         align=uiconst.TOTOP,
         text=localization.GetByLabel('UI/Medical/MedicalClone'))
     EveLabelMedium(
         parent=self.container,
         align=uiconst.TOTOP,
         text=localization.GetByLabel('UI/Medical/MedicalCloneDescription'),
         color=GRAY_COLOR,
         padding=(0, 0, 0, self.HALF_PADDING))
     self.homeStation = CreateSectionContainer(self.container)
     EveLabelLargeBold(
         parent=self.container,
         align=uiconst.TOTOP,
         text=localization.GetByLabel('UI/Medical/ActiveClone'),
         padding=(0, self.PADDING, 0, 0))
     EveLabelMedium(parent=self.container,
                    align=uiconst.TOTOP,
                    text=localization.GetByLabel(
                        'UI/Medical/DestroyActiveCloneDescription'),
                    color=GRAY_COLOR,
                    padding=(0, 0, 0, self.HALF_PADDING))
     EveLabelMediumBold(parent=self.container,
                        align=uiconst.TOTOP,
                        text=localization.GetByLabel(
                            'UI/Medical/DestroyActiveCloneWarning'),
                        color=RED_COLOR,
                        padding=(0, 0, 0, self.HALF_PADDING))
     self.activeClone = CreateSectionContainer(self.container)
     EveLabelLargeBold(parent=self.container,
                       align=uiconst.TOTOP,
                       text=localization.GetByLabel('UI/Medical/JumpClone'),
                       padding=(0, self.PADDING, 0, 0))
     EveLabelMedium(
         parent=self.container,
         align=uiconst.TOTOP,
         text=localization.GetByLabel('UI/Medical/JumpCloneDescription'),
         color=GRAY_COLOR,
         padding=(0, 0, 0, self.HALF_PADDING))
     self.jumpClone = CreateSectionContainer(self.container)
     animations.FadeIn(self.container, duration=0.5)
コード例 #7
0
    def LoadTooltipPanel(self, tooltipPanel, *args):
        tooltipPanel.columns = 5
        tooltipPanel.margin = 6
        tooltipPanel.cellPadding = 3
        tooltipPanel.cellSpacing = 0
        text = GetByLabel('UI/Sovereignty/ActivityDefenseMultiplier')
        label = EveLabelMedium(text=text, align=uiconst.TOTOP, padTop=1, bold=True)
        tooltipPanel.AddCell(cellObject=label, colSpan=4)
        text = GetByLabel('UI/Sovereignty/DefenseMultiplierDisplayNumber', bonusMultiplier=self.currentMultiplier)
        label = EveLabelLarge(text=text, align=uiconst.TOPRIGHT, bold=True)
        tooltipPanel.AddCell(cellObject=label)
        valueAndTextures = [(self.devIndexes[2], 'res:/UI/Texture/classes/Sov/strategicIndex.png', 'UI/Sovereignty/StrategicIndex'), (self.devIndexes[0], 'res:/UI/Texture/classes/Sov/militaryIndex.png', 'UI/Sovereignty/MilitaryIndex'), (self.devIndexes[1], 'res:/UI/Texture/classes/Sov/industryIndex.png', 'UI/Sovereignty/IndustryIndex')]
        for indexValue, texturePath, labelPath in valueAndTextures:
            indexSprite = Sprite(name='indexSprite', parent=tooltipPanel, pos=(0, 0, 16, 16), align=uiconst.CENTERLEFT, texturePath=texturePath)
            label = EveLabelMedium(text=GetByLabel(labelPath))
            tooltipPanel.AddCell(cellObject=label)
            indexBars = IndexBars(currentIndex=indexValue, align=uiconst.CENTERRIGHT)
            tooltipPanel.AddCell(cellObject=indexBars, cellPadding=(16, 0, 3, 0), colSpan=3)

        if self.isCapital:
            tooltipPanel.state = uiconst.UI_NORMAL
            l = LineThemeColored(height=1, align=uiconst.TOTOP, opacity=0.3)
            tooltipPanel.AddCell(l, colSpan=5, cellPadding=(1, 1, 1, 3))
            capitalSprite = Sprite(name='capitalSprite', parent=tooltipPanel, pos=(0, 0, 16, 16), align=uiconst.CENTERLEFT, texturePath='res:/UI/Texture/classes/Sov/bonusShieldCapital16.png')
            capitalLabel = EveLabelMedium(text=GetByLabel('UI/Sovereignty/Capital'), align=uiconst.CENTERLEFT)
            tooltipPanel.AddCell(cellObject=capitalLabel)
            infoLabel = GetByLabel('UI/Contracts/ContractsWindow/ShowInfoLink', showInfoName=cfg.eveowners.Get(self.capitalOwnerID).name, info=('showinfo', const.typeAlliance, self.capitalOwnerID))
            tooltipPanel.AddLabelMedium(text=infoLabel, colSpan=3, wrapWidth=160, align=uiconst.CENTERRIGHT, state=uiconst.UI_NORMAL)
コード例 #8
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.achievement = attributes.Get('achievement', None)
     if self.achievement.isEnabled:
         alpha = 0.75
     else:
         alpha = 0.25
     if self.achievement.completed:
         textColor = (0.0, 1.0, 0.0, 1.0)
     else:
         textColor = (1.0, 1.0, 1.0, alpha)
     if self.achievement.isClientAchievement:
         clientText = ' (client)'
     else:
         clientText = ''
     self.label = EveLabelMedium(name='myLabel',
                                 parent=self,
                                 align=uiconst.CENTERLEFT,
                                 text='%s - %s%s' %
                                 (self.achievement.achievementID,
                                  self.achievement.name, clientText),
                                 left=4,
                                 color=textColor)
     self.hint = self.achievement.description
     self.UpdateState()
コード例 #9
0
 def ApplyAttributes(self, attributes):
     LayoutGrid.ApplyAttributes(self, attributes)
     self.nameLabel = EveLabelLarge(bold=True)
     self.AddCell(cellObject=self.nameLabel, colSpan=self.columns)
     EveLabelMedium(parent=self,
                    text=GetByLabel('UI/Map/StarMap/SecurityStatus'))
     self.securityValue = EveLabelMedium(parent=self,
                                         bold=True,
                                         color=(1, 0, 0, 1))
コード例 #10
0
    def _ShowDetails(self):
        if not self.autoShowDetails:
            return
        self.detailsParent = ContainerAutoSize(align=uiconst.TOTOP,
                                               parent=self,
                                               clipChildren=True,
                                               sate=uiconst.UI_NORMAL)
        if self.callbackTaskExpanded:
            self.callbackTaskExpanded(self)
        self.detailsParent.DisableAutoSize()
        label = EveLabelMedium(parent=self.detailsParent,
                               text=self.achievementTask.description,
                               align=uiconst.TOTOP,
                               padding=(6, 3, 6, 2),
                               state=uiconst.UI_NORMAL)
        extraInfo = ACHIEVEMENT_TASK_EXTRAINFO.get(
            self.achievementTask.achievementID, None)
        if extraInfo:
            grid = LayoutGrid(parent=self.detailsParent,
                              align=uiconst.TOTOP,
                              cellPadding=2,
                              columns=2,
                              padding=4)
            for taskInfoEntry in extraInfo:
                if isinstance(taskInfoEntry, TaskInfoEntry_Text):
                    label = EveLabelMedium(text=taskInfoEntry.text,
                                           color=taskInfoEntry.textColor,
                                           width=240)
                    grid.AddCell(label, colSpan=2)
                elif isinstance(taskInfoEntry, TaskInfoEntry_ImageText):
                    texturePath = taskInfoEntry.GetTexturePath()
                    icon = Sprite(name='icon',
                                  parent=grid,
                                  pos=(0, 0, taskInfoEntry.imageSize,
                                       taskInfoEntry.imageSize),
                                  texturePath=texturePath,
                                  state=uiconst.UI_DISABLED,
                                  align=uiconst.CENTER,
                                  color=taskInfoEntry.imageColor)
                    text = GetByLabel(taskInfoEntry.textPath)
                    label = EveLabelMedium(text=text,
                                           color=taskInfoEntry.textColor,
                                           width=220,
                                           align=uiconst.CENTERLEFT)
                    grid.AddCell(label)

        blue.synchro.Yield()
        height = self.detailsParent.GetAutoSize()[1]
        uicore.animations.FadeIn(self.detailsParent, duration=0.3)
        uicore.animations.MorphScalar(self.detailsParent,
                                      'height',
                                      self.detailsParent.height,
                                      height,
                                      duration=0.25,
                                      sleep=True)
        if self.detailsParent and not self.detailsParent.destroyed:
            self.detailsParent.EnableAutoSize()
コード例 #11
0
def AddPriceRow(panel, price):
    if not price:
        iskPrice = localization.GetByLabel('UI/Inventory/PriceUnavailable')
    else:
        iskPrice = FmtISK(price)
    label = EveLabelMedium(text=localization.GetByLabel('UI/Industry/TotalEstimatedPrice'), color=Color.GRAY)
    panel.AddCell(label)
    label = EveLabelMedium(align=uiconst.TOPRIGHT, text=iskPrice)
    panel.AddCell(label, cellPadding=(8, 0, 0, 0))
    panel.AddCell(cellPadding=PADBOTTOM, colSpan=2)
コード例 #12
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.achievement = attributes.Get('achievement', None)
     textColor = (1.0, 0.5, 0.5)
     if self.achievement.completed:
         textColor = (0.0, 0.7, 0.0)
     self.label = EveLabelMedium(name='myLabel', parent=self, align=uiconst.CENTERLEFT, text='%s - %s' % (self.achievement.id, self.achievement.name), left=4, hint='bleggibleg', textColor=textColor)
     self.label.SetTextColor(textColor)
     self.hint = self.achievement.description
     Line(parent=self, align=uiconst.TOBOTTOM, opacity=0.1)
コード例 #13
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.title = attributes.title
     self.channelID = attributes.channelID
     self.channelName = attributes.channelName
     self.displayName = attributes.displayName
     self.SetMinSize([250, 250])
     self.SetCaption(localization.GetByLabel('UI/Menusvc/PasswordRequired'))
     self.SetTopparentHeight(0)
     self.tries = 0
     settings.user.ui.Set('%sPassword' % self.channelName, '')
     parentGrid = LayoutGrid(parent=self.sr.main,
                             columns=1,
                             state=uiconst.UI_PICKCHILDREN,
                             align=uiconst.TOPLEFT,
                             left=10,
                             top=4)
     topLabel = EveLabelMedium(text=attributes.title,
                               state=uiconst.UI_DISABLED,
                               align=uiconst.TOPLEFT,
                               width=300)
     parentGrid.AddCell(cellObject=topLabel)
     passwordLabel = localization.GetByLabel(
         'UI/Menusvc/PleaseEnterPassword')
     self.passwordLabel = EveLabelMedium(text=passwordLabel,
                                         state=uiconst.UI_DISABLED,
                                         align=uiconst.TOPLEFT,
                                         padTop=10)
     parentGrid.AddCell(cellObject=self.passwordLabel)
     self.passwordEdit = SinglelineEdit(name='passwordEdit',
                                        align=uiconst.TOTOP,
                                        passwordCharacter=u'\u2022',
                                        top=4)
     parentGrid.AddCell(cellObject=self.passwordEdit)
     savePasswordLabel = localization.GetByLabel('UI/Chat/SavePassword')
     self.rememberPwdCb = Checkbox(text=savePasswordLabel,
                                   configName='rememberPwdCb',
                                   retval=1,
                                   checked=0,
                                   groupname=None,
                                   align=uiconst.TOTOP)
     parentGrid.AddCell(cellObject=self.rememberPwdCb)
     parentGrid.RefreshGridLayout()
     self.btnGroup = ButtonGroup(parent=self.sr.main, idx=0)
     self.btnGroup.AddButton(
         localization.GetByLabel('UI/Chat/ChannelWindow/JoinChannel'),
         self.TryPassword, ())
     self.btnGroup.AddButton(localization.GetByLabel('UI/Common/Cancel'),
                             self.Close, ())
     self.height = self.btnGroup.height + parentGrid.height + self.sr.headerParent.height + parentGrid.top + 10
     self.width = parentGrid.width + 2 * parentGrid.left
     self.MakeUnResizeable()
     self.MakeUnMinimizable()
     self.MakeUncollapseable()
コード例 #14
0
def AddTypeBonusRow(panel, text, bonusME = None, bonusTE = None):
    label = EveLabelMedium(text=text, color=Color.GRAY)
    panel.AddCell(label)
    if bonusME:
        label = EveLabelMedium(align=uiconst.TOPRIGHT, text=bonusME)
        panel.AddCell(label, cellPadding=(8, 0, 0, 0))
    if bonusTE:
        label = EveLabelMedium(align=uiconst.TOPRIGHT, text=bonusTE)
        panel.AddCell(label, cellPadding=(8, 0, 0, 0))
    panel.FillRow()
    panel.AddCell(cellPadding=PADBOTTOM, colSpan=2)
コード例 #15
0
 def BuildUI(self):
     inv = sm.GetService('invCache').GetInventoryFromId(self.structureID)
     item = inv.GetItem()
     stationName = cfg.evelocations.Get(self.structureID).name or evetypes.GetName(item.typeID)
     stationText = GetShowInfoLink(item.typeID, stationName, itemID=self.structureID)
     self.nameLabel = EveLabelMedium(name='nameLabel', parent=self.sr.main, text=stationText, padLeft=10, align=uiconst.TOTOP, state=uiconst.UI_NORMAL)
     ownerText = GetShowInfoLink(const.typeCorporation, cfg.eveowners.Get(item.ownerID).name, itemID=item.ownerID)
     self.ownerLabel = EveLabelMedium(name='ownerLabel', parent=self.sr.main, text=ownerText, padLeft=10, align=uiconst.TOTOP, state=uiconst.UI_NORMAL)
     Button(parent=self.sr.main, align=uiconst.TOTOP, label='_Take control', func=self.TakeControl, padding=(10, 2, 10, 2))
     self.AddCurrentShip()
     Button(parent=self.sr.main, align=uiconst.TOTOP, label='_Undock', func=self.Undock, padding=(10, 2, 10, 2))
コード例 #16
0
 def PrepareCompleteMessage(self):
     self.messagePanel.Flush()
     text = localization.GetByLabel(
         'UI/SkillTrading/CompleteMessageCaption')
     EveCaptionMedium(parent=self.messagePanel,
                      align=uiconst.TOTOP,
                      text='<center>%s</center>' % text)
     text = localization.GetByLabel('UI/SkillTrading/CompleteMessageMain',
                                    amount=self.controller.SKILL_POINT_GOAL,
                                    injector=invconst.typeSkillInjector)
     EveLabelMedium(parent=self.messagePanel,
                    align=uiconst.TOTOP,
                    top=4,
                    text='<center>%s</center>' % text)
     iconCont = Container(parent=self.messagePanel,
                          align=uiconst.TOTOP,
                          top=8,
                          height=64)
     Icon(parent=iconCont,
          align=uiconst.CENTER,
          left=-40,
          typeID=invconst.typeSkillInjector,
          size=64,
          state=uiconst.UI_DISABLED)
     Sprite(
         parent=iconCont,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/skilltrading/arrow_right.png',
         width=32,
         height=32,
         opacity=0.6)
     Sprite(parent=iconCont,
            align=uiconst.CENTER,
            state=uiconst.UI_DISABLED,
            left=40,
            texturePath='res:/UI/Texture/WindowIcons/itemHangar.png',
            width=64,
            height=64)
     text = localization.GetByLabel('UI/SkillTrading/CompleteMessageTail',
                                    injector=invconst.typeSkillInjector)
     EveLabelMedium(parent=self.messagePanel,
                    align=uiconst.TOTOP,
                    top=8,
                    text='<center>%s</center>' % text)
     buttonCont = Container(parent=self.messagePanel,
                            align=uiconst.TOTOP,
                            top=16,
                            height=40)
     Button(parent=buttonCont,
            align=uiconst.CENTER,
            label=localization.GetByLabel('UI/Common/Done'),
            func=self.Close)
コード例 #17
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes=attributes)
     self.badgeLabel = EveLabelMedium(name='myLabel',
                                      parent=self,
                                      align=uiconst.CENTER,
                                      bold=True,
                                      text='1')
     self.width = self.badgeLabel.width + 10
     self.left = -self.badgeLabel.width - 20
     self.top = self.parent.height / 2 - self.parent.height / 2
     self.pointFromLeft = attributes.Get('pointfromleft', True)
     self.pointerframe = FrameWithPointer(
         bgParent=self, skinName=FRAME_WITH_POINTER_SKIN_BADGE)
コード例 #18
0
 def _CreateNotificationText(self):
     self.titleLabel = EveLabelMedium(name='notificationSubjectLabel',
                                      parent=self.rightContainer,
                                      align=uiconst.TOTOP,
                                      text=self.title,
                                      padding=TITLE_PADDING,
                                      bold=True)
     if self.subtext:
         self.subtextLabel = EveLabelMedium(name='notificationSubtextLabel',
                                            parent=self.rightContainer,
                                            align=uiconst.TOTOP,
                                            text=self.subtext,
                                            padding=SUBTEXT_PADDING)
コード例 #19
0
def GetImplantModifiersAsLabels():
    """
        Generates and returns a list of labels based on implants that affect reprocessing.
    """
    implantLabels = []
    implants = sm.GetService('godma').GetItem(session.charid).implants
    for implant in implants:
        implantBonus = getattr(implant, 'refiningYieldMutator')
        if implantBonus > 0.0:
            implantLabels.append(EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/YieldFormatting', bonusYield=1.0 + implantBonus / 100), colSpan=1, align=uiconst.TORIGHT, padRight=3, color=COL_GREEN, bold=True))
            implantLabels.append(EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/BonusFromSkill', skillName=implant.name), colSpan=1, padLeft=3))

    return implantLabels
コード例 #20
0
    def SearchTree(self):
        self.searchThread = None
        self.filterString = self.searchInput.GetValue()
        if not self.filterString:
            self.searchResultParent.Hide()
            self.searchResultParent.Flush()
            return
        self.searchResultParent.Flush()
        res = []
        searchFor = self.filterString.lower()

        def Crawl(obj, path):
            if obj is self:
                return
            if searchFor in obj.name.lower():
                if path:
                    res.append((obj, path + '/ <b>' + obj.name + '</b>'))
                else:
                    res.append((obj, '<b>' + obj.name + '</b>'))
            if hasattr(obj, 'children'):
                for each in obj.children:
                    if path:
                        Crawl(each, path + '/' + obj.name)
                    else:
                        Crawl(each, obj.name)

        for root in uicore.uilib.rootObjects:
            Crawl(root, '')

        if res:
            for obj, path in res[:20]:
                label = Label(parent=self.searchResultParent,
                              align=uiconst.TOTOP,
                              text=path,
                              state=uiconst.UI_NORMAL,
                              padding=(10, 2, 10, 2))
                label._searchObj = obj
                label.hint = path
                label.OnClick = (self.OnSearchResultClick, obj)

            if len(res) > 20:
                Label(parent=self.searchResultParent,
                      align=uiconst.TOTOP,
                      text='and even more... (%s found)' % len(res),
                      padding=(10, 2, 10, 2))
        else:
            Label(parent=self.searchResultParent,
                  align=uiconst.TOTOP,
                  text='No Match!',
                  padding=(10, 3, 10, 3))
        self.searchResultParent.Show()
コード例 #21
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.SetTopparentHeight(0)
     self.topHint = EveLabelMedium(text='',
                                   parent=self.sr.main,
                                   top=4,
                                   state=uiconst.UI_DISABLED,
                                   align=uiconst.TOTOP,
                                   padding=4)
     self.scroll = Scroll(
         parent=self.sr.main,
         padding=(const.defaultPadding, const.defaultPadding,
                  const.defaultPadding, const.defaultPadding),
         id='containerContentWindow')
コード例 #22
0
ファイル: reprocessingWnd.py プロジェクト: connoryang/1v1dec
def GetStationTaxAsLabel(stationTax):
    taxBonusLabel = EveLabelMedium(text=GetByLabel(
        'UI/Reprocessing/ReprocessingWindow/YieldFormatting',
        bonusYield=1.0 - stationTax),
                                   colSpan=1,
                                   align=uiconst.TORIGHT,
                                   padRight=3,
                                   color=COL_RED,
                                   bold=True)
    taxTextLabel = EveLabelMedium(
        text=GetByLabel('UI/Reprocessing/ReprocessingWindow/StationTaxHint'),
        colSpan=1,
        padLeft=3)
    return (taxBonusLabel, taxTextLabel)
コード例 #23
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     charID = attributes.charID
     parentLayoutGrid = LayoutGrid(parent=self,
                                   columns=2,
                                   align=uiconst.TOPLEFT,
                                   padding=6,
                                   cellSpacing=(10, 10))
     addHeader = attributes.get('addHeader', True)
     if addHeader:
         self.AddHeader(parentLayoutGrid)
     sprite = Sprite(parent=parentLayoutGrid,
                     align=uiconst.TOPLEFT,
                     state=uiconst.UI_DISABLED,
                     pos=(0, 0, 128, 128))
     sm.GetService('photo').GetPortrait(charID,
                                        128,
                                        sprite,
                                        allowServerTrip=True)
     subLayoutGrid = LayoutGrid(parent=parentLayoutGrid,
                                columns=2,
                                align=uiconst.TOPLEFT)
     spacer = Fill(align=uiconst.TOPLEFT,
                   state=uiconst.UI_DISABLED,
                   width=128,
                   height=1,
                   color=(0, 0, 0, 0))
     subLayoutGrid.AddCell(cellObject=spacer, colSpan=2)
     parallelCalls = []
     parallelCalls.append(
         (sm.RemoteSvc('charMgr').GetPublicInfo3, (charID, )))
     parallelCalls.append(
         (sm.GetService('corp').GetInfoWindowDataForChar, (charID, 1)))
     charinfo, corpCharInfo = uthread.parallel(parallelCalls)
     charName = cfg.eveowners.Get(charID).name
     nameLabel = EveLabelMedium(text=charName, autoFitToText=True)
     subLayoutGrid.AddCell(cellObject=nameLabel, colSpan=2)
     titleText = self.GetTitleText(corpCharInfo)
     titleLabel = EveLabelMedium(text=titleText, autoFitToText=True)
     if titleLabel.textwidth > self.maxTextWidth:
         titleLabel.width = self.maxTextWidth
     subLayoutGrid.AddCell(cellObject=titleLabel, colSpan=2)
     if corpCharInfo:
         corpID = corpCharInfo.corpID
         allianceID = corpCharInfo.allianceID
         for eachID in (corpID, allianceID):
             if eachID:
                 logo = self.GetLogo(eachID)
                 logo.hint = cfg.eveowners.Get(eachID).name
                 subLayoutGrid.AddCell(cellObject=logo)
コード例 #24
0
 def DrawNumbers(self):
     self.numbersGrid = LayoutGrid(parent=self.bottomRight, columns=2, align=uiconst.TORIGHT, top=6)
     self.brokersFee = EveLabelMedium(text='', padRight=4)
     self.numbersGrid.AddCell(self.brokersFee)
     self.brokersFeeAmt = EveLabelMediumBold(text='', align=uiconst.CENTERRIGHT, padLeft=4)
     self.numbersGrid.AddCell(self.brokersFeeAmt)
     self.salesTax = EveLabelMedium(text='', padRight=4)
     self.numbersGrid.AddCell(self.salesTax)
     self.salesTaxAmt = EveLabelMediumBold(text='', align=uiconst.CENTERRIGHT, padLeft=4)
     self.numbersGrid.AddCell(self.salesTaxAmt)
     spacer = Container(align=uiconst.TOTOP, height=12)
     self.numbersGrid.AddCell(spacer, colSpan=2)
     self.totalAmt = EveLabelLargeBold(text='', align=uiconst.CENTERRIGHT, padLeft=4, color=COL_GREEN)
     self.numbersGrid.AddCell(self.totalAmt, colSpan=2)
コード例 #25
0
ファイル: fittingWnd.py プロジェクト: connoryang/1v1dec
 def ConstructPowerAndCpuLabels(self):
     powerGridAndCpuCont = LayoutGrid(parent=self.overlayCont,
                                      columns=1,
                                      state=uiconst.UI_PICKCHILDREN,
                                      align=uiconst.BOTTOMRIGHT,
                                      top=10,
                                      left=10)
     cpu_statustextHeader = EveLabelMediumBold(
         text=GetByLabel('UI/Fitting/FittingWindow/CPUStatusHeader'),
         name='cpu_statustextHeader',
         state=uiconst.UI_NORMAL,
         align=uiconst.TOPRIGHT)
     SetFittingTooltipInfo(targetObject=cpu_statustextHeader,
                           tooltipName='CPU')
     powerGridAndCpuCont.AddCell(cpu_statustextHeader)
     self.cpu_statustext = EveLabelMedium(text='',
                                          name='cpu_statustext',
                                          state=uiconst.UI_NORMAL,
                                          align=uiconst.TOPRIGHT)
     SetFittingTooltipInfo(targetObject=self.cpu_statustext,
                           tooltipName='CPU')
     powerGridAndCpuCont.AddCell(self.cpu_statustext)
     powerGridAndCpuCont.AddCell(cellObject=Container(
         name='spacer', align=uiconst.TOTOP, height=10))
     power_statustextHeader = EveLabelMediumBold(
         text=GetByLabel('UI/Fitting/FittingWindow/PowergridHeader'),
         name='power_statustextHeader',
         state=uiconst.UI_NORMAL,
         align=uiconst.TOPRIGHT)
     SetFittingTooltipInfo(targetObject=power_statustextHeader,
                           tooltipName='PowerGrid')
     powerGridAndCpuCont.AddCell(power_statustextHeader)
     self.power_statustext = EveLabelMedium(text='',
                                            name='power_statustext',
                                            state=uiconst.UI_NORMAL,
                                            align=uiconst.TOPRIGHT)
     powerGridAndCpuCont.AddCell(self.power_statustext)
     SetFittingTooltipInfo(targetObject=self.power_statustext,
                           tooltipName='PowerGrid')
     self.calibration_statustext = EveLabelMedium(
         text='',
         parent=self.overlayCont,
         name='calibrationstatustext',
         pos=(8, 50, 0, 0),
         idx=0,
         state=uiconst.UI_NORMAL)
     SetFittingTooltipInfo(targetObject=self.calibration_statustext,
                           tooltipName='Calibration')
コード例 #26
0
 def GetDynamicHeight(node, width):
     return max(
         32,
         EveLabelMedium.MeasureTextSize(node.description,
                                        width=width - 60)[1] +
         EveLabelMediumBold.MeasureTextSize(node.title,
                                            width=width - 60)[1] + 8)
コード例 #27
0
 def BuildTopParentUI(self):
     self.sr.topParent.padding = (2 * const.defaultPadding, 0,
                                  2 * const.defaultPadding, 0)
     self.shipIcon = Icon(name='shipIcon',
                          parent=self.sr.topParent,
                          state=uiconst.UI_NORMAL,
                          size=64,
                          ignoreSize=True)
     self.shipIcon.GetDragData = self.GetFittingDragData
     self.shipIcon.OnClick = self.OpenFitting
     self.shipIcon.hint = GetByLabel('UI/Fitting/ShowFitting')
     self.techSprite = Sprite(name='techIcon',
                              parent=self.sr.topParent,
                              align=uiconst.RELATIVE,
                              width=16,
                              height=16,
                              idx=0)
     self.fitNameEdit = SinglelineEdit(
         name='fitNameEdit',
         parent=self.sr.topParent,
         left=72,
         width=150,
         maxLength=20,
         hint=GetByLabel('UI/Common/ShipName'))
     top = self.fitNameEdit.top + self.fitNameEdit.height + 5
     self.shipNameLabel = EveLabelMedium(name='shipNameLabel',
                                         parent=self.sr.topParent,
                                         left=77,
                                         top=top,
                                         state=uiconst.UI_NORMAL)
コード例 #28
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     typeID = attributes.typeID
     qty = attributes.qty
     iconPadding = 1 * const.defaultPadding
     typeIcon = Icon(name='typeIcon',
                     parent=self,
                     state=uiconst.UI_NORMAL,
                     size=32,
                     left=iconPadding,
                     ignoreSize=True,
                     typeID=typeID)
     techIcon = uix.GetTechLevelIcon(typeID=typeID)
     if techIcon:
         techIcon.left = iconPadding
         techIcon.SetParent(self, idx=0)
     typeName = evetypes.GetName(typeID)
     link = '<url="showinfo:%s">%s</url>' % (typeID, typeName)
     text = '%sx %s' % (qty, link)
     left = iconPadding * 2 + typeIcon.width + 10
     label = EveLabelMedium(parent=self,
                            left=left,
                            text=text,
                            state=uiconst.UI_NORMAL,
                            align=uiconst.CENTERLEFT)
     self.width = label.left + label.textwidth + 10
コード例 #29
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.headerLabel = EveLabelLarge(parent=self,
                                      align=uiconst.TOTOP,
                                      bold=True)
     self.resultLabel = EveLabelMedium(parent=self, align=uiconst.TOTOP)
     self.mapView = weakref.ref(attributes.mapView)
コード例 #30
0
 def Startup(self, *args):
     self.Flush()
     self.mainCont = Container(parent=self, align=uiconst.TOTOP, height=30)
     leftCont = Container(parent=self.mainCont,
                          align=uiconst.TOLEFT,
                          width=50)
     self.icon = Container(parent=leftCont,
                           align=uiconst.TOPLEFT,
                           pos=(3, 3, 32, 32))
     self.corpNameCont = Container(parent=self.mainCont,
                                   align=uiconst.TOTOP,
                                   height=17)
     label = GetByLabel('UI/Station/Lobby/CorpName')
     self.corpNameLabel = EveLabelSmall(text=label,
                                        parent=self.corpNameCont,
                                        left=5,
                                        top=2,
                                        state=uiconst.UI_DISABLED)
     self.corpNameText = EveLabelMedium(text='',
                                        parent=self.corpNameCont,
                                        left=5,
                                        state=uiconst.UI_NORMAL)
     LineThemeColored(parent=self, align=uiconst.TOBOTTOM)
     self.buttonCnt = Container(parent=self,
                                align=uiconst.TOTOP,
                                height=25,
                                state=uiconst.UI_PICKCHILDREN)
     self.buttonCnt.display = False
     self.infoicon = InfoIcon(left=32, top=3, parent=leftCont, idx=0)
コード例 #31
0
 def ConstructLayout(self):
     if not self.jobData:
         return
     if self.jobData.status == industry.STATUS_READY:
         self.deliverBtn = Button(
             name='deliverBtn',
             parent=self,
             align=uiconst.TOALL,
             label='<b>' + localization.GetByLabel('UI/Industry/Deliver'),
             func=self.OnDeliverBtn,
             padding=2)
         self.deliverBtn.width = self.deliverBtn.height = 0
         self.deliverBtn.Blink(time=3000)
         self.Enable()
     else:
         self.Disable()
         gaugeCont = ContainerAutoSize(name='gaugeCont',
                                       parent=self,
                                       align=uiconst.TOBOTTOM)
         mainCont = Container(name='mainCont', parent=self)
         self.deliverBtn = None
         self.valueLabel = EveLabelMedium(parent=mainCont,
                                          align=uiconst.CENTERLEFT,
                                          left=4)
     if self.jobData.status == industry.STATUS_INSTALLED:
         color = industryUIConst.COLOR_MANUFACTURING if self.jobData.activityID == industry.MANUFACTURING else industryUIConst.COLOR_SCIENCE
         self.gauge = Gauge(parent=gaugeCont,
                            align=uiconst.TOTOP,
                            state=uiconst.UI_DISABLED,
                            color=color,
                            height=6,
                            gaugeHeight=6,
                            padTop=1,
                            backgroundColor=(1.0, 1.0, 1.0, 0.05))
コード例 #32
0
ファイル: main.py プロジェクト: connoryang/dec-eve-serenity
    def SearchTree(self):
        self.searchThread = None
        self.filterString = self.searchInput.GetValue()
        if not self.filterString:
            self.searchResultParent.Hide()
            self.searchResultParent.Flush()
            return
        self.searchResultParent.Flush()
        res = []
        searchFor = self.filterString.lower()

        def Crawl(obj, path):
            if obj is self:
                return
            if searchFor in obj.name.lower():
                if path:
                    res.append((obj, path + '/ <b>' + obj.name + '</b>'))
                else:
                    res.append((obj, '<b>' + obj.name + '</b>'))
            if hasattr(obj, 'children'):
                for each in obj.children:
                    if path:
                        Crawl(each, path + '/' + obj.name)
                    else:
                        Crawl(each, obj.name)

        for root in uicore.uilib.rootObjects:
            Crawl(root, '')

        if res:
            for obj, path in res[:20]:
                label = Label(parent=self.searchResultParent, align=uiconst.TOTOP, text=path, state=uiconst.UI_NORMAL, padding=(10, 2, 10, 2))
                label._searchObj = obj
                label.hint = path
                label.OnClick = (self.OnSearchResultClick, obj)

            if len(res) > 20:
                Label(parent=self.searchResultParent, align=uiconst.TOTOP, text='and even more... (%s found)' % len(res), padding=(10, 2, 10, 2))
        else:
            Label(parent=self.searchResultParent, align=uiconst.TOTOP, text='No Match!', padding=(10, 3, 10, 3))
        self.searchResultParent.Show()
コード例 #33
0
 def OnTextSizeChange(self, newWidth, newHeight):
     EveLabelMedium._OnSizeChange_NoBlock(self.text, newWidth, newHeight)
     self.height = self.text.textheight + 12