purchaseResultPanel.py (2499B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\view\aurumstore\purchasepanels\purchaseResultPanel.py 2 from carbonui import const as uiconst 3 from carbonui.primitives.container import Container 4 from carbonui.primitives.sprite import Sprite 5 from carbonui.primitives.transform import Transform 6 from carbonui.uicore import uicore 7 from eve.client.script.ui.view.aurumstore.purchasepanels.basePurchasePanel import BasePurchasePanel 8 from eve.client.script.ui.view.aurumstore.shared.const import TEXT_PADDING, PROGRESS_TRANSITION_TIME 9 from eve.client.script.ui.view.aurumstore.vgsUiPrimitives import VgsLabelLarge 10 11 class PurchaseResultPanel(BasePurchasePanel): 12 default_name = 'purchaseResultPanel' 13 14 def ApplyAttributes(self, attributes): 15 super(PurchaseResultPanel, self).ApplyAttributes(attributes) 16 self.audioEventName = attributes.audioEventName 17 cont = Container(parent=self, align=uiconst.TOPLEFT, height=72, padTop=4) 18 self.iconForegroundTransform = Transform(parent=cont, align=uiconst.CENTERTOP, width=72, height=78, scalingCenter=(0.5, 0.5)) 19 self.iconForeground = Sprite(parent=self.iconForegroundTransform, align=uiconst.CENTER, texturePath=attributes.iconForegroundTexturePath, width=72, height=64, opacity=0) 20 self.iconBackgroundTransform = Transform(parent=cont, align=uiconst.CENTERTOP, width=72, height=78, scalingCenter=(0.5, 0.5)) 21 self.iconBackground = Sprite(parent=self.iconBackgroundTransform, align=uiconst.CENTER, texturePath=attributes.iconBackgroundTexturePath, width=72, height=64, opacity=0) 22 captionCont = Container(parent=self, align=uiconst.TOTOP, height=40, padding=(TEXT_PADDING, 23 4, 24 TEXT_PADDING, 25 0)) 26 VgsLabelLarge(parent=captionCont, align=uiconst.CENTER, text=attributes.textTitle) 27 28 def OnPanelActivated(self): 29 if self.audioEventName: 30 sm.GetService('audio').SendUIEvent(self.audioEventName) 31 uicore.animations.FadeIn(self.iconBackground, duration=0.5, timeOffset=PROGRESS_TRANSITION_TIME) 32 uicore.animations.FadeIn(self.iconForeground, duration=0.5, timeOffset=PROGRESS_TRANSITION_TIME + 0.5) 33 uicore.animations.Tr2DScaleTo(self.iconBackgroundTransform, (2.0, 2.0), (1.0, 1.0), duration=0.25, timeOffset=PROGRESS_TRANSITION_TIME) 34 uicore.animations.Tr2DScaleTo(self.iconForegroundTransform, (2.0, 2.0), (1.0, 1.0), duration=0.25, timeOffset=PROGRESS_TRANSITION_TIME + 0.5)