currencySelectionPanel.py (1540B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\view\aurumstore\purchasepanels\currencySelectionPanel.py 2 from carbonui import uiconst 3 from eve.client.script.ui.shared.vgs.priceTag import PriceTagMedium 4 from eve.client.script.ui.view.aurumstore.purchasepanels.basePurchasePanel import BasePurchasePanel 5 from eve.client.script.ui.view.aurumstore.shared.paymentselector import PaymentSelector 6 7 class PurchaseCurrencySelectionPanel(BasePurchasePanel): 8 9 def ApplyAttributes(self, attributes): 10 super(PurchaseCurrencySelectionPanel, self).ApplyAttributes(attributes) 11 self.offer = attributes.offer 12 defaultValue = attributes.defaultValue 13 onSelect = attributes.onSelect 14 self.priceTags = {pricing.currency:PriceTagMedium(align=uiconst.CENTER, currency=pricing.currency, price=pricing.price, basePrice=pricing.basePrice, showBasePrice=False) for pricing in self.offer.offerPricings} 15 self.selector = PaymentSelector(parent=self, optionsDict=self.priceTags, align=uiconst.TOALL, state=uiconst.UI_PICKCHILDREN, defaultValue=defaultValue, onSelect=onSelect) 16 17 def GetSelectedCurrency(self): 18 return self.selector.GetSelectedValue() 19 20 def SetSelectedCurrency(self, currency): 21 self.selector.SelectValue(currency) 22 23 def SetQuantity(self, value): 24 for pricing in self.offer.offerPricings: 25 priceTag = self.priceTags[pricing.currency] 26 priceTag.UpdatePrice(value * pricing.price, value * pricing.basePrice)