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

scannerUtil.py (2589B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\inflight\scannerFiles\scannerUtil.py
      2 from carbon.common.script.util.format import IntToRoman
      3 from carbonui.control.editPlainText import EditPlainTextCore
      4 from carbonui.control.singlelineedits.baseSingleLineEdit import BaseSingleLineEdit
      5 from carbonui.uicore import uicore
      6 from eve.client.script.ui.shared.mapView.dockPanelUtil import GetPanelAlignMode
      7 import carbonui.const as uiconst
      8 from localization import GetByLabel
      9 COLOR_DSCAN = (0.225, 0.75, 0.5, 1.0)
     10 
     11 def IsProbeScanPanelEmbedded():
     12     return settings.char.ui.Get('mapProbePanelEmbedded', True)
     13 
     14 
     15 def IsProbeScanEmbeddedPanelOpen():
     16     return settings.char.ui.Get('probeScanPanelOpen', False)
     17 
     18 
     19 def SetProbeScanEmbeddedPanelOpen():
     20     settings.char.ui.Set('probeScanPanelOpen', True)
     21 
     22 
     23 def SetProbeScanEmbeddedPanelClosed():
     24     settings.char.ui.Set('probeScanPanelOpen', False)
     25 
     26 
     27 def SetProbeScanPanelEmbedded():
     28     settings.char.ui.Set('mapProbePanelEmbedded', True)
     29 
     30 
     31 def SetProbeScanPanelWindowed():
     32     settings.char.ui.Set('mapProbePanelEmbedded', False)
     33 
     34 
     35 def IsDirectionalScanPanelEmbedded():
     36     return settings.char.ui.Get('mapDirectionPanelEmbedded', True)
     37 
     38 
     39 def IsDirectionalScanEmbeddedPanelOpen():
     40     return settings.char.ui.Get('directionalScanPanelOpen', False)
     41 
     42 
     43 def SetDirectionalScanEmbeddedPanelOpen():
     44     settings.char.ui.Set('directionalScanPanelOpen', True)
     45 
     46 
     47 def SetDirectionalScanEmbeddedPanelClosed():
     48     settings.char.ui.Set('directionalScanPanelOpen', False)
     49 
     50 
     51 def SetDirectionalScanPanelEmbedded():
     52     settings.char.ui.Set('mapDirectionPanelEmbedded', True)
     53 
     54 
     55 def SetDirectionalScanPanelWindowed():
     56     settings.char.ui.Set('mapDirectionPanelEmbedded', False)
     57 
     58 
     59 def IsSolarSystemMapFullscreen():
     60     return GetPanelAlignMode('solar_system_map_panel') == uiconst.TOALL
     61 
     62 
     63 def GetScanDifficultyText(difficulty):
     64     if difficulty is None:
     65         return GetByLabel('UI/Inflight/Scanner/DifficultyUnknown')
     66     else:
     67         level = IntToRoman(difficulty)
     68         return GetByLabel('UI/Agents/AgentEntry/Level', level=level)
     69 
     70 
     71 def IsShortuctExecutionAllowed(panel):
     72     return not IsEditFieldInFocus() and not IsModifierKeyPressed()
     73 
     74 
     75 def IsEditFieldInFocus():
     76     focus = uicore.registry.GetFocus()
     77     editFieldHasFocus = focus and isinstance(focus, (EditPlainTextCore, BaseSingleLineEdit))
     78     return editFieldHasFocus
     79 
     80 
     81 def IsModifierKeyPressed():
     82     for key in (uiconst.VK_CONTROL, uiconst.VK_MENU, uiconst.VK_SHIFT):
     83         if uicore.uilib.Key(key):
     84             return True
     85 
     86     return False