예제 #1
0
    def LoadAuctionHintPanel(self, tooltipPanel, *args):
        tooltipPanel.LoadGeneric3ColumnTemplate()
        tooltipPanel.AddLabelLarge(text=GetByLabel('UI/Industry/SystemBidList'), colSpan=tooltipPanel.columns, align=uiconst.CENTER)
        tooltipPanel.AddSpacer(colSpan=tooltipPanel.columns, width=0, height=2)
        topSystems = self.GetTopSystems()
        if topSystems:
            for i, (amount, solarSystemID) in enumerate(topSystems):
                if i > 2:
                    break
                systemName = self.FormatSystemName(solarSystemID)
                systemLabel = '%i %s' % (i + 1, systemName)
                tooltipPanel.AddLabelSmall(text=systemLabel, colSpan=1)
                tooltipPanel.AddSpacer(width=10, height=0)
                tooltipPanel.AddLabelSmall(text=FmtISK(amount, 0), colSpan=1, align=uiconst.TORIGHT)

        myBids = self.GetMyBids()
        if myBids:
            tooltipPanel.AddSpacer(colSpan=tooltipPanel.columns, width=0, height=6)
            tooltipPanel.AddLabelLarge(text=GetByLabel('UI/Industry/MyBidList'), colSpan=tooltipPanel.columns, align=uiconst.CENTER)
            tooltipPanel.AddSpacer(colSpan=tooltipPanel.columns, width=0, height=2)
            for solarSystemID, amount in myBids:
                systemName = self.FormatSystemName(solarSystemID)
                tooltipPanel.AddLabelSmall(text=systemName, colSpan=1)
                tooltipPanel.AddSpacer(width=10, height=0)
                tooltipPanel.AddLabelSmall(text=FmtISK(amount, 0), colSpan=1, align=uiconst.TORIGHT)
예제 #2
0
 def UpdateNumbers(self):
     totalShown = self.GetSum()
     if totalShown >= MILLION:
         totalAmtText = '%s (%s)' % (FmtISK(totalShown),
                                     FmtISKWithDescription(totalShown,
                                                           justDesc=True))
     else:
         totalAmtText = FmtISK(totalShown)
     self.totalAmt.text = totalAmtText
     self.totalAmt.SetRGB(*COL_RED)
     self.ShowOrHideStationWarning()
예제 #3
0
    def __init__(self, jobData, tooltipPanel):
        tooltipPanel.state = uiconst.UI_NORMAL
        tooltipPanel.margin = MARGIN
        tooltipPanel.columns = 2
        AddModifierRow(
            '<color=gray>%s</color>' %
            localization.GetByLabel('UI/Industry/BaseItemCost'),
            FmtISK(jobData.base_cost, 0), tooltipPanel)
        AddSystemCostIndexRow(jobData.activityID,
                              jobData.facility,
                              tooltipPanel,
                              cellPadding=(0, 0, 0, 4))
        tooltipPanel.AddSpacer(colSpan=2, width=0, height=6)
        modifiers = jobData.GetModifiers(industry.CostModifier)
        if modifiers or jobData.facility.tax:
            caption = jobData.GetModifierCaption(industry.CostModifier)
            label = IndustryCaptionLabel(text=caption, width=220)
            tooltipPanel.AddCell(label, colSpan=2, cellPadding=(0, 0, 0, 2))
            if modifiers:
                for modifier in modifiers:
                    AddModifierRow(modifier.GetName(),
                                   modifier.GetPercentageLabel(), tooltipPanel)

            if jobData.facility.tax is not None:
                taxLabel = '<color=red>+%s%%</color>' % FormatNumeric(
                    jobData.facility.tax * 100,
                    useGrouping=True,
                    decimalPlaces=1)
                AddModifierRow(
                    localization.GetByLabel('UI/Industry/FacilityTax'),
                    taxLabel, tooltipPanel)
        tooltipPanel.AddSpacer(width=0, height=6)
예제 #4
0
 def UpdateTotalSumLabel(self, totalSum, sumToDisplay):
     self.totalLabel.text = FmtISK(sumToDisplay)
     if sumToDisplay != totalSum:
         self.ConstructTotalStrikethroughLine()
         self.totalStrikethroughLine.width = self.totalLabel.textwidth
     else:
         self.ChangeTotalStrikethroughDisplay(display=False)
예제 #5
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     typeID = attributes.Get('typeID', None)
     iskAmount = attributes.Get('iskAmount', 0)
     amount = attributes.Get('amount', 0)
     typeName = evetypes.GetName(typeID)
     mainCont = Container(name='mainCont', parent=self)
     iconCont = Container(name='iconCont',
                          parent=mainCont,
                          align=uiconst.TOLEFT,
                          width=18)
     textCont = Container(name='textCont',
                          parent=mainCont,
                          align=uiconst.TOALL,
                          padding=const.defaultPadding)
     icon = Icon(parent=iconCont,
                 align=uiconst.TOALL,
                 size=18,
                 typeID=typeID,
                 ignoreSize=True)
     icon.OnClick = (self.ShowInfo, None, typeID)
     icon.hint = typeName
     iskLabel = EveLabelSmall(text=FmtISK(iskAmount, 0),
                              parent=textCont,
                              align=uiconst.TORIGHT,
                              maxLines=1)
     amountLabel = EveLabelSmall(text='%ix' % amount,
                                 parent=textCont,
                                 align=uiconst.TOLEFT,
                                 maxLines=1)
     if amount == 0:
         mainCont.opacity = 0.5
예제 #6
0
 def LoadTotalTooltip(self, tooltipPanel, *args):
     totalShown = self.GetSum()
     if not totalShown or not self.orderMultiplier:
         return
     numTypes, numAvailableTypes = self.GetNumTypesAndNumAvailableTypes()
     pricePerOrder = totalShown / float(self.orderMultiplier)
     tooltipPanel.LoadGeneric2ColumnTemplate()
     tooltipPanel.cellPadding = (4, 1, 4, 1)
     tooltipPanel.AddLabelMedium(
         text=GetByLabel('UI/Market/MarketQuote/NumOrders'))
     tooltipPanel.AddLabelMedium(text=FmtAmt(self.orderMultiplier),
                                 align=uiconst.CENTERRIGHT)
     tooltipPanel.AddLabelMedium(
         text=GetByLabel('UI/Market/MarketQuote/PricePerOrder'))
     tooltipPanel.AddLabelMedium(text=FmtISK(pricePerOrder),
                                 align=uiconst.CENTERRIGHT)
     if pricePerOrder >= MILLION:
         tooltipPanel.AddCell()
         tooltipPanel.AddLabelMedium(
             text='=%s' %
             FmtISKWithDescription(pricePerOrder, justDesc=True),
             align=uiconst.CENTERRIGHT)
     buyingText = GetByLabel(
         'UI/Market/MarketQuote/TypesAvailableAndTotalInOrder',
         numAvailable=numAvailableTypes,
         numTypes=numTypes)
     buyingLabel = tooltipPanel.AddLabelSmall(text=buyingText,
                                              align=uiconst.CENTERRIGHT,
                                              colSpan=tooltipPanel.columns)
     buyingLabel.SetAlpha(0.6)
     tooltipPanel.AddSpacer(1, 8, colSpan=tooltipPanel.columns)
     deltaText = self.GetOrderDeltaText()
     tooltipPanel.AddLabelMedium(text=deltaText,
                                 colSpan=tooltipPanel.columns)
예제 #7
0
 def UpdateNumbers(self):
     brokersFee, salesTax, totalSum = self.GetSums()
     totalShown = totalSum - salesTax - brokersFee
     if totalSum > 0:
         brokersPerc = round(brokersFee / totalSum * 100, 2)
         salesPerc = round(salesTax / totalSum * 100, 2)
     else:
         brokersPerc = 0.0
         salesPerc = 0.0
     self.brokersFeeAmt.text = FmtISK(brokersFee)
     self.brokersFee.text = GetByLabel('UI/Market/MarketQuote/BrokersFeePerc', percentage=brokersPerc)
     self.salesTaxAmt.text = FmtISK(salesTax)
     self.salesTax.text = GetByLabel('UI/Market/MarketQuote/SalesTaxPerc', percentage=salesPerc)
     self.totalAmt.text = FmtISK(totalShown)
     if totalShown < 0:
         self.totalAmt.SetRGB(*COL_RED)
     else:
         self.totalAmt.SetRGB(*COL_GREEN)
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)
예제 #9
0
 def UpdateState(self):
     if not self.jobData:
         self.costLabel.text = ''
         self.walletCombo.Hide()
         return
     if self.jobData.facility and self.jobData.activityID in self.jobData.facility.activities:
         manufacturingCost = self.jobData.total_cost
         self.costLabel.text = FmtISK(manufacturingCost, showFractionsAlways=False)
     else:
         self.costLabel.text = '-'
     self.UpdateWalletCombo()
예제 #10
0
 def LoadDeltaTooltip(self, tooltipPanel, *args):
     tooltipPanel.LoadGeneric2ColumnTemplate()
     tooltipPanel.cellPadding = (4, 1, 4, 1)
     tooltipPanel.AddLabelLarge(
         text=GetByLabel('UI/Market/MarketQuote/AskPrice'))
     tooltipPanel.AddLabelLarge(text=FmtISK(self.priceEdit.GetValue()),
                                align=uiconst.CENTERRIGHT)
     tooltipPanel.AddSpacer(1, 8, colSpan=tooltipPanel.columns)
     tooltipPanel.AddLabelMedium(
         text='%s %s' %
         (GetByLabel('UI/Market/MarketQuote/RegionalAdverage'),
          self.GetDeltaText()))
     tooltipPanel.AddLabelMedium(text=FmtISK(self.averagePrice),
                                 align=uiconst.CENTERRIGHT)
     tooltipPanel.AddLabelMedium(
         text=GetByLabel('UI/Market/MarketQuote/BestRegional'))
     bestMatch = tooltipPanel.AddLabelMedium(text='',
                                             align=uiconst.CENTERRIGHT)
     bestMatchDetails = tooltipPanel.AddLabelSmall(
         text='', align=uiconst.CENTERRIGHT, colSpan=tooltipPanel.columns)
     if not self.bestBid:
         bestMatch.text = GetByLabel('UI/Contracts/ContractEntry/NoBids')
         bestMatchDetails.text = GetByLabel(
             'UI/Market/MarketQuote/ImmediateWillFail')
         bestMatch.color = (1.0, 0.275, 0.0, 1.0)
         bestMatchDetails.color = (1.0, 0.275, 0.0, 1.0)
     else:
         bestMatch.text = FmtISK(self.bestBid.price)
         bestMatchText, volRemaining = self.GetBestMatchText()
         bestMatchDetails.text = bestMatchText
         bestMatchDetails.SetAlpha(0.6)
         if volRemaining:
             vol = tooltipPanel.AddLabelSmall(text=volRemaining,
                                              align=uiconst.CENTERRIGHT,
                                              colSpan=tooltipPanel.columns)
             vol.SetAlpha(0.6)
예제 #11
0
 def AddColumnAuction(self):
     col = self.AddColumnContainer()
     col.OnMouseEnter = self.OnMouseEnter
     col.OnMouseExit = self.OnMouseExit
     col.OnClick = self.OnClick
     col.state = uiconst.UI_NORMAL
     col.GetMenu = self.GetMenu
     col.LoadTooltipPanel = self.LoadAuctionHintPanel
     bidCont = Container(parent=col, align=uiconst.TORIGHT, width=50)
     costCont = Container(parent=col, align=uiconst.TOALL, clipChildren=True)
     costText = FmtISK(self.auctionCost, 0)
     self.costLabel = EveLabelMedium(text=costText, parent=costCont, align=uiconst.CENTERLEFT, left=6)
     self.bidUtilMenu = UtilMenu(menuAlign=uiconst.TOPRIGHT, align=uiconst.CENTERLEFT, parent=bidCont, GetUtilMenu=self.BidOnTeamMenu, texturePath='res:/UI/Texture/Icons/73_16_50.png', left=2, label=GetByLabel('UI/Industry/Bid'))
     bidCont.width = self.bidUtilMenu.width + 10
     self.bidUtilMenu.hint = GetByLabel('UI/Industry/BidBtnHint')
예제 #12
0
 def LoadDeltaTooltip(self, tooltipPanel, *args):
     tooltipPanel.LoadGeneric2ColumnTemplate()
     tooltipPanel.cellPadding = (4, 1, 4, 1)
     tooltipPanel.AddLabelLarge(
         text=GetByLabel('UI/Market/Marketbase/PricePerUnit'))
     tooltipPanel.AddLabelLarge(text=self.GetPriceText(),
                                align=uiconst.CENTERRIGHT)
     bestMatchDetails = tooltipPanel.AddLabelSmall(
         text='', align=uiconst.CENTERRIGHT, colSpan=tooltipPanel.columns)
     tooltipPanel.AddSpacer(1, 8, colSpan=tooltipPanel.columns)
     tooltipPanel.AddLabelMedium(text=self.GetDiffFromAvgText(),
                                 align=uiconst.CENTERRIGHT)
     tooltipPanel.AddLabelMedium(text=FmtISK(self.averagePrice),
                                 align=uiconst.CENTERRIGHT)
     tooltipPanel.AddSpacer(1, 8, colSpan=tooltipPanel.columns)
     tooltipPanel.AddLabelMedium(
         text=GetByLabel('UI/Market/MarketQuote/BestInStation'))
     stationBestPrice = self.GetBestMatchText(rangeStation)
     tooltipPanel.AddLabelMedium(text=stationBestPrice,
                                 align=uiconst.CENTERRIGHT)
     tooltipPanel.AddLabelMedium(
         text=GetByLabel('UI/Market/MarketQuote/BestInSystem'))
     stationBestPrice = self.GetBestMatchText(rangeSolarSystem)
     tooltipPanel.AddLabelMedium(text=stationBestPrice,
                                 align=uiconst.CENTERRIGHT)
     tooltipPanel.AddLabelMedium(
         text=GetByLabel('UI/Market/MarketQuote/BestRegional'))
     regBestPrice = self.GetBestMatchText(rangeRegion)
     tooltipPanel.AddLabelMedium(text=regBestPrice,
                                 align=uiconst.CENTERRIGHT)
     if not self.newBestPrice:
         bestMatchDetails.text = GetByLabel(
             'UI/Market/MarketQuote/NoMatchForOrder')
         bestMatchDetails.color = (1.0, 0.275, 0.0, 1.0)
     else:
         bestMatchDetails.text = GetByLabel(
             'UI/Market/MarketQuote/FromNumberOfOrders',
             numOrders=self.numOrders)
         bestMatchDetails.SetAlpha(0.6)
예제 #13
0
 def ApplyAttributes(self, attributes):
     self.amountLabel = None
     Container.ApplyAttributes(self, attributes)
     charID = attributes.Get('charID', None)
     amount = attributes.Get('amount', 0)
     contribName = cfg.eveowners.Get(charID).name
     contribType = cfg.eveowners.Get(charID).typeID
     contributerName = GetByLabel(
         'UI/Contracts/ContractsWindow/ShowInfoLink',
         showInfoName=contribName,
         info=('showinfo', contribType, charID))
     mainCont = Container(name='mainCont',
                          parent=self,
                          padding=const.defaultPadding)
     self.nameLabel = EveLabelSmall(text=contributerName,
                                    parent=mainCont,
                                    maxLines=1,
                                    state=uiconst.UI_NORMAL)
     self.amountLabel = EveLabelSmall(text=FmtISK(amount, 0),
                                      parent=mainCont,
                                      align=uiconst.TORIGHT,
                                      maxLines=1)
     width, height = self.GetAbsoluteSize()
     self._OnSizeChange_NoBlock(width, height)
예제 #14
0
 def GetTotalSum(self):
     price = self.GetPrice()
     qty = self.GetQty()
     self.totalSum = price * qty
     self.totalLabel.text = FmtISK(self.totalSum)
     return self.totalSum
예제 #15
0
 def GetBestMatchText(self, orderRange):
     bestOrder = self.quoteSvc.GetBestAskInRange(self.typeID,
                                                 self.stationID, orderRange)
     if bestOrder:
         return FmtISK(bestOrder.price)
     return NA_CHAR
예제 #16
0
 def GetForcedAuctionCost(self):
     return FmtISK(GetHighestBid(self.GetBids()), 0)
예제 #17
0
 def UpdateTotalIskCost(self, iskCost):
     self.totalIskCostLabel.SetText(FmtISK(-iskCost))
예제 #18
0
    def ShowBids(self):
        lines = []
        for solarSystemID, systemBids in self.GetBids().iteritems():
            lines.append('%s (%s), TOTAL: %s: ' % (cfg.evelocations.Get(solarSystemID).name, solarSystemID, sum((bid for bid in systemBids.itervalues()))))
            for characterID, bid in sorted(systemBids.iteritems(), itemgetter(1)):
                lines.append('-- %s (%s): %s' % (cfg.eveowners.Get(characterID).name, characterID, FmtISK(bid)))

        eve.Message('CustomInfo', {'info': '<br/>'.join(lines)})
예제 #19
0
 def SetTotalText(self, totalSum):
     if totalSum:
         self.totalLabel.text = FmtISK(totalSum)
     else:
         self.totalLabel.text = NA_CHAR
예제 #20
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.SetTopparentHeight(0)
     self.bountyEscrow = attributes.bountyEscrow
     self.bountyAmount = attributes.bountyAmount
     self.component = attributes.component
     factionResPath = FACTIONPATHBYESSTYPEID[attributes.ESSTypeID]
     navyID = CORPIDBYFACTIONID[attributes.ESSTypeID]
     self.SetCaption(GetByLabel(CAPTIONBYESSTYPEID[attributes.ESSTypeID]))
     self.myContribution = 0
     self.amountInTags = 0
     mainCont = Container(name='mainCont',
                          parent=self.sr.main,
                          padding=const.defaultPadding)
     iconCont = Container(name='iconCont',
                          parent=mainCont,
                          align=uiconst.TOTOP,
                          height=64)
     headerCont = Container(name='headerCont',
                            parent=mainCont,
                            align=uiconst.TOTOP,
                            height=54,
                            padBottom=6)
     buttonsCont = Container(name='buttonsCont',
                             parent=mainCont,
                             align=uiconst.TOBOTTOM,
                             height=80,
                             padTop=4,
                             padBottom=4)
     listCont = Container(name='listCont',
                          parent=mainCont,
                          align=uiconst.TOALL,
                          padBottom=14)
     factionLogo = Sprite(parent=iconCont,
                          align=uiconst.CENTERTOP,
                          width=64,
                          height=64,
                          texturePath=factionResPath)
     factionLogo.hint = cfg.eveowners.Get(navyID).name
     factionLogo.OnClick = (self.OpenNavyInfo, navyID)
     EveLabelLarge(text=GetByLabel('UI/Inflight/Brackets/TotalBounty'),
                   parent=headerCont,
                   maxLines=1,
                   align=uiconst.CENTERTOP)
     EveCaptionMedium(text=FmtISK(self.bountyAmount, 0),
                      parent=headerCont,
                      maxLines=1,
                      align=uiconst.CENTERTOP,
                      state=uiconst.UI_NORMAL,
                      top=16)
     contributorsCont = Container(name='contributorsCont',
                                  parent=listCont,
                                  align=uiconst.TOLEFT_PROP,
                                  width=0.45)
     self.tagsCont = Container(name='tagsCont',
                               parent=listCont,
                               align=uiconst.TORIGHT_PROP,
                               width=0.45)
     topSpaceCont = Container(name='topSpaceCont',
                              parent=listCont,
                              align=uiconst.TOALL)
     self.contributersList = ScrollContainer(name='contributersList',
                                             parent=contributorsCont,
                                             align=uiconst.TOALL)
     shareCont = Container(name='shareCont',
                           parent=buttonsCont,
                           align=uiconst.TOLEFT_PROP,
                           width=0.45)
     takeCont = Container(name='takeCont',
                          parent=buttonsCont,
                          align=uiconst.TORIGHT_PROP,
                          width=0.45)
     spaceCont = Container(name='spaceCont',
                           parent=buttonsCont,
                           align=uiconst.TOALL)
     youGetLabel = EveLabelMedium(
         text=GetByLabel('UI/Inflight/Brackets/YouGet'),
         parent=shareCont,
         align=uiconst.CENTERTOP,
         top=1)
     myContribLabel = EveLabelLargeBold(text='',
                                        parent=shareCont,
                                        align=uiconst.CENTERTOP,
                                        top=16)
     shareLabel = EveLabelSmall(
         text=GetByLabel('UI/Inflight/Brackets/EveryoneGetsTheirShare'),
         parent=shareCont,
         align=uiconst.CENTERBOTTOM)
     shareBtn = Button(parent=shareCont,
                       label=GetByLabel('UI/Inflight/Brackets/Share'),
                       align=uiconst.TOBOTTOM,
                       top=20,
                       func=self.ShareContribution)
     orLabel = EveLabelLargeBold(text=GetByLabel('UI/Inflight/Brackets/Or'),
                                 parent=spaceCont,
                                 align=uiconst.CENTER,
                                 top=10)
     amountInTagsLabel = EveLabelLarge(text=GetByLabel(
         'UI/Inflight/Brackets/AmountInTags', amount=FmtISK(0, 0)),
                                       parent=takeCont,
                                       align=uiconst.CENTERTOP,
                                       top=16)
     takeLabel = EveLabelSmall(
         text=GetByLabel('UI/Inflight/Brackets/OthersGetNothing'),
         parent=takeCont,
         align=uiconst.CENTERBOTTOM)
     takeAllBtn = Button(parent=takeCont,
                         label=GetByLabel('UI/Inflight/Brackets/TakeAll'),
                         align=uiconst.TOBOTTOM,
                         top=20,
                         func=self.TakeAll)
     self.LoadContributions(attributes.contributions)
     myContribLabel.SetText(FmtISK(self.myContribution, 0))
     self.LoadTags()
     amountInTagsLabel.SetText(
         GetByLabel('UI/Inflight/Brackets/AmountInTags',
                    amount=FmtISK(self.amountInTags, 0)))
예제 #21
0
 def GetWalletComboHint(self):
     ownerID, divisionID = self.jobData.account
     iskAmount = self.jobData.accounts[ownerID, divisionID]
     iskAmount = FmtISK(iskAmount)
     walletName = self.GetWalletName(ownerID, divisionID)
     return GetByLabel('UI/Industry/WalletSelectionHint', walletName=walletName, iskAmount=iskAmount)
예제 #22
0
 def GetPriceText(self):
     if self.newBestPrice:
         return FmtISK(self.newBestPrice)
     else:
         return NA_CHAR