outcome_panel.py (2868B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\theatersOfWar\campaigns\panels\outcome_panel.py 2 from carbonui import Align, TextAlign, TextColor, PickState 3 from carbonui.control.scrollContainer import ScrollContainer 4 from carbonui.primitives.container import Container 5 from carbonui.primitives.containerAutoSize import ContainerAutoSize 6 from carbonui.primitives.stretchspritehorizontal import StretchSpriteHorizontal 7 from carbonui.text.custom import TextCustom 8 from carbonui.text.styles import TextDetail, TextBody 9 10 class OutcomePanel(Container): 11 12 def ApplyAttributes(self, attributes): 13 super(OutcomePanel, self).ApplyAttributes(attributes) 14 self._construct_ui() 15 16 def _construct_ui(self): 17 left_cont = Container(parent=self, align=Align.TOLEFT, left=64, width=456) 18 scroll_cont = ScrollContainer(name='scroll_cont', parent=left_cont) 19 text_cont = ContainerAutoSize(parent=scroll_cont, align=Align.TOTOP, top=136) 20 self.campaign_ended_label = TextDetail(name='campaign_ended', parent=text_cont, text='', align=Align.TOTOP, textAlign=TextAlign.CENTER) 21 self.campaign_name_label = TextCustom(name='campaign_name_label', parent=text_cont, text='', fontsize=16, align=Align.TOTOP, textAlign=TextAlign.CENTER, upperCase=True, color=TextColor.SECONDARY) 22 self._construct_decoration(text_cont) 23 self.resolution_header = TextCustom(name='outcome_state_label', parent=text_cont, text='', fontsize=60, align=Align.TOTOP, textAlign=TextAlign.CENTER) 24 desc_cont = ContainerAutoSize(parent=scroll_cont, align=Align.TOTOP, padding=(48, 0, 48, 0)) 25 self.desc_label = TextBody(name='desc_label', parent=desc_cont, text='', align=Align.TOTOP, pickState=PickState.ON) 26 27 def _construct_decoration(self, parent): 28 deco_cont = Container(name='deco_cont', parent=parent, align=Align.TOTOP, height=24) 29 StretchSpriteHorizontal(parent=deco_cont, texturePath='res:/UI/Texture/classes/Campaigns/horizontal_decorator.png', leftEdgeSize=27, pos=(0, 0, 457, 24), align=Align.CENTER) 30 self.accent_deco = StretchSpriteHorizontal(parent=deco_cont, texturePath='res:/UI/Texture/classes/Campaigns/accents_decorator.png', leftEdgeSize=27, pos=(0, 0, 457, 24), align=Align.CENTER) 31 32 def load_ui(self, campaign_ended_text, campaign_title, resolution_header, resolution_desc, theme_pack): 33 font_family = theme_pack.font_family 34 self.campaign_ended_label.SetText(campaign_ended_text) 35 self.campaign_ended_label.SetRGBA(*theme_pack.main_color) 36 self.campaign_name_label.SetText(campaign_title) 37 self.campaign_name_label.fontFamily = font_family 38 self.resolution_header.SetText(resolution_header) 39 self.desc_label.SetText(resolution_desc) 40 self.accent_deco.SetRGBA(*theme_pack.accent)