cosmeticFittingErrorScreen.py (2171B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\fittingScreen\cosmetics\cosmeticFittingErrorScreen.py 2 from carbonui import Density, TextAlign, uiconst 3 from carbonui.primitives.containerAutoSize import ContainerAutoSize 4 from carbonui.uianimations import animations 5 from carbonui.primitives.container import Container 6 from carbonui.primitives.fill import Fill 7 from eve.client.script.ui import eveColor 8 from eve.client.script.ui.control.eveLabel import EveCaptionLarge, EveCaptionSmall 9 from carbonui.control.button import Button 10 from localization import GetByLabel 11 12 class CosmeticFittingErrorScreen(Container): 13 14 def ApplyAttributes(self, attributes): 15 super(CosmeticFittingErrorScreen, self).ApplyAttributes(attributes) 16 self._CreateLayout(attributes.centralContWidth) 17 18 def _CreateLayout(self, centralContWidth): 19 self.centralCont = ContainerAutoSize(name='centralCont', parent=self, align=uiconst.CENTER, width=centralContWidth) 20 self.errorMessage = EveCaptionLarge(name='errorMessage', parent=self.centralCont, align=uiconst.TOTOP, textAlign=TextAlign.CENTER) 21 self.errorSubtext = EveCaptionSmall(name='errorSubtext', parent=self.centralCont, align=uiconst.TOTOP, text=GetByLabel('UI/Fitting/FittingWindow/Cosmetic/ErrorSubtext'), textAlign=TextAlign.CENTER, padTop=5) 22 btnCont = Container(name='btnCont', parent=self.centralCont, align=uiconst.TOTOP, height=32, padTop=32) 23 self.actionBtn = Button(name='actionBtn', parent=btnCont, align=uiconst.CENTER, density=Density.EXPANDED) 24 Fill(name='blackFill', parent=self, color=eveColor.BLACK) 25 26 def ShowScreen(self, errorMsg, buttonText, buttonCallback): 27 animations.FadeTo(self, startVal=self.opacity, endVal=1.0, duration=0.25) 28 self.errorMessage.text = errorMsg 29 self.actionBtn.label = buttonText 30 self.actionBtn.OnClick = buttonCallback 31 self.Enable() 32 33 def CloseScreen(self, animate): 34 if animate: 35 animations.FadeTo(self, startVal=self.opacity, endVal=0.0, duration=0.25) 36 else: 37 self.opacity = 0.0 38 self.Disable()