idle.py (2300B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\dynamicresources\client\ess\bracket\main_bank\idle.py 2 import uthread2 3 from carbonui import uiconst 4 from carbonui.control.button import Button 5 from carbonui.primitives.containerAutoSize import ContainerAutoSize 6 from carbonui.uianimations import animations 7 from dynamicresources.client import text 8 from dynamicresources.client.ess.bracket.label import Header 9 from dynamicresources.client.ess.bracket.state_machine import State, Transition 10 from dynamicresources.client.service import get_dynamic_resource_service 11 from player_messaging.client.ui_message import prompt_player_fsd_dialog 12 13 class Idle(State): 14 15 def __init__(self, panel): 16 self._panel = panel 17 self._content = None 18 self._button = None 19 20 def enter(self): 21 self._content = ContainerAutoSize(parent=self._panel.content) 22 Header(parent=self._content, align=uiconst.TOPRIGHT, text=text.title_main_bank()) 23 self._button = Button(parent=self._content, align=uiconst.TOPRIGHT, top=30, label=text.action_hack_main_bank(), func=self._link, args=()) 24 animations.FadeTo(self._content, duration=0.3) 25 26 def exit(self): 27 self._button.Disable() 28 transition = Exit(self._content) 29 self._content = None 30 return transition 31 32 def close(self): 33 if self._content: 34 self._content.Close() 35 36 def _link(self): 37 self._button.Disable() 38 try: 39 service = get_dynamic_resource_service() 40 error = service.RequestESSMainBankLink() 41 if error is not None: 42 message = text.link_error_description(error) 43 if message is not None: 44 prompt_player_fsd_dialog('CustomNotify', {'notify': message}) 45 uthread2.sleep(1.0) 46 finally: 47 if not self._button.destroyed: 48 self._button.Enable() 49 50 51 class Exit(Transition): 52 53 def __init__(self, content): 54 super(Exit, self).__init__() 55 self._content = content 56 57 def animation(self): 58 animations.FadeOut(self._content, duration=0.2) 59 self.sleep(0.2) 60 61 def on_close(self): 62 self._content.Close() 63 64 65 from dynamicresources.client.ess.bracket.debug import __reload_update__