activityInfoPanel.py (2416B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\activities\activityInfoPanel.py 2 import blue 3 from carbonui import uiconst 4 from carbonui.control.button import Button 5 from carbonui.primitives.container import Container 6 from carbonui.util.color import Color 7 from eve.client.script.ui.control.eveEdit import Edit 8 from eve.client.script.ui.shared.activities.activitiesUIConst import ACTIVITY_INFO_BUTTON_BACKGROUND, ACTIVITY_INFO_CLOSE_BUTTON_POS, ACTIVITY_INFO_FOOTER_HEIGHT, ACTIVITY_INFO_MAIN_CONTAINER_HEIGHT, ACTIVITY_INFO_OPEN_STORE_BUTTON_POS 9 from eve.common.lib import appConst 10 from localization import GetByLabel 11 12 class ActivityInfoPanel(Container): 13 14 def ApplyAttributes(self, attributes): 15 super(ActivityInfoPanel, self).ApplyAttributes(attributes) 16 self.service = sm.GetService('activities') 17 self.ConstructMain() 18 self.ConstructFooterParent() 19 self.ConstructFooter() 20 self.browser = Edit(parent=self.mainCont, padding=appConst.defaultPadding, readonly=1, opacity=1.0) 21 self.browser.AllowResizeUpdates(0) 22 self.browser.sr.window = self.mainCont 23 24 def UpdateHTML(self, info): 25 if self.state in (uiconst.UI_NORMAL, uiconst.UI_PICKCHILDREN): 26 blue.pyos.synchro.Yield() 27 self.browser.LoadHTML(info) 28 29 def ConstructMain(self): 30 self.mainCont = Container(parent=self, name='footerMain', align=uiconst.TOTOP, bgColor=Color.BLACK, height=ACTIVITY_INFO_MAIN_CONTAINER_HEIGHT, opacity=1.0) 31 32 def ConstructFooterParent(self): 33 self.footerParent = Container(parent=self, name='footer', align=uiconst.TOBOTTOM, bgColor=Color.BLACK, height=ACTIVITY_INFO_FOOTER_HEIGHT, opacity=1.0) 34 35 def ConstructFooter(self): 36 Button(name='returnButton', parent=self.footerParent, align=uiconst.CENTER, pos=ACTIVITY_INFO_CLOSE_BUTTON_POS, label=GetByLabel('UI/NewActivitiesWindow/Close'), func=self.OnCloseClicked, texturePath=ACTIVITY_INFO_BUTTON_BACKGROUND) 37 Button(name='openStoreButton', parent=self.footerParent, align=uiconst.CENTER, pos=ACTIVITY_INFO_OPEN_STORE_BUTTON_POS, func=self.OpenStore, label=GetByLabel('UI/NewActivitiesWindow/GoToBuy'), texturePath=ACTIVITY_INFO_BUTTON_BACKGROUND) 38 39 def OnCloseClicked(self, *args): 40 self.service.OnActivityInfoCloseClicked() 41 42 def OpenStore(self, *args): 43 self.service.StartAction()