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

missionDetailsWindow.py (2443B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\station\agents\missionDetailsWindow.py
      2 import uthread
      3 from carbonui import const as uiconst
      4 from eve.client.script.ui.control.eveEdit import Edit
      5 from carbonui.control.window import Window
      6 from eve.client.script.ui.station.agents import agentDialogueUtil
      7 from eve.common.lib import appConst
      8 import blue
      9 CLOSE_ACTIONIDS = (appConst.agentMissionReset,
     10  appConst.agentMissionDeclined,
     11  appConst.agentMissionCompleted,
     12  appConst.agentMissionQuit,
     13  appConst.agentMissionFailed,
     14  appConst.agentMissionOffered,
     15  appConst.agentMissionOfferRemoved)
     16 
     17 class MissionDetailsWindow(Window):
     18     __notifyevents__ = ['OnSessionChanged', 'OnAgentMissionChange']
     19     default_windowID = 'MissionDetails'
     20     default_minSize = (420, 400)
     21     default_caption = ''
     22     default_width = 600
     23     default_height = 800
     24 
     25     def ApplyAttributes(self, attributes):
     26         Window.ApplyAttributes(self, attributes)
     27         self.agentID = None
     28         self.sr.browser = Edit(parent=self.sr.main, padding=appConst.defaultPadding, readonly=1)
     29         self.sr.browser.AllowResizeUpdates(0)
     30         self.sr.browser.sr.window = self
     31 
     32     def ReconstructLayout(self, agentID, charID = None, contentID = None, maximize = True):
     33         self.agentID = agentID
     34         missionInfo = sm.GetService('agents').GetMissionInfo(agentID, charID, contentID)
     35         if not missionInfo:
     36             return self.Close()
     37         if self.state != uiconst.UI_NORMAL and maximize:
     38             self.Maximize()
     39         if self.state in (uiconst.UI_NORMAL, uiconst.UI_PICKCHILDREN):
     40             html = agentDialogueUtil.GetMissionDetailsWindowHTML(missionInfo, agentID)
     41             blue.pyos.synchro.Yield()
     42             self.sr.browser.LoadHTML(html)
     43 
     44     def OnEndScale_(self, *args):
     45         uthread.new(self.Reload)
     46 
     47     def Reload(self, *args):
     48         if self.destroyed:
     49             return
     50         uthread.new(self.sr.browser.LoadHTML, None, scrollTo=self.sr.browser.GetScrollProportion())
     51 
     52     def OnSessionChanged(self, isRemote, sess, change):
     53         if 'stationid' in change:
     54             self.ReconstructLayout(self.agentID, maximize=False)
     55 
     56     def OnAgentMissionChange(self, actionID, agentID):
     57         if agentID != self.agentID or self.destroyed:
     58             return
     59         if actionID in CLOSE_ACTIONIDS:
     60             self.Close()
     61         else:
     62             self.ReconstructLayout(agentID)