NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

basePage.py (1401B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\cosmetics\structure\pages\basePage.py
      2 import eve.client.script.ui.cosmetics.structure.paintToolSelections as paintToolSelections
      3 from carbonui.primitives.container import Container
      4 from carbonui.uianimations import animations
      5 from carbonui import const as uiconst
      6 
      7 class BasePage(Container):
      8     default_opacity = 0.0
      9 
     10     def __init__(self, page_id, **kw):
     11         super(BasePage, self).__init__(**kw)
     12         self._page_id = page_id
     13         self._construct_layout()
     14         paintToolSelections.SELECTED_PAGE.on_change.connect(self._on_selected_page_changed)
     15         self._on_selected_page_changed(paintToolSelections.SELECTED_PAGE.get())
     16 
     17     def Close(self):
     18         super(BasePage, self).Close()
     19         paintToolSelections.SELECTED_PAGE.on_change.disconnect(self._on_selected_page_changed)
     20 
     21     def _construct_layout(self):
     22         raise NotImplementedError
     23 
     24     def _open_page(self):
     25         self.state = uiconst.UI_PICKCHILDREN
     26         animations.FadeTo(self, self.opacity, 1.0, 0.25)
     27 
     28     def _close_page(self):
     29         self.state = uiconst.UI_DISABLED
     30         animations.FadeTo(self, self.opacity, 0.0, 0.25)
     31 
     32     def _on_selected_page_changed(self, page_id):
     33         if self._page_id == page_id:
     34             self._open_page()
     35         if self._page_id != page_id:
     36             self._close_page()