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

hudButtonsCont.py (3636B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\inflight\shipHud\hudButtonsCont.py
      2 from carbon.client.script.environment.AudioUtil import PlaySound
      3 from carbonui.primitives.containerAutoSize import ContainerAutoSize
      4 from carbonui.uianimations import animations
      5 from clientsettings.setting import UserSettingBool
      6 from eve.client.script.ui.inflight.shipHud.leftSideButton import LeftSideButtonScanner, LeftSideButtonTactical, LeftSideButtonAutopilot, LeftSideButtonZoomIn, LeftSideButtonZoomOut, LeftSideButtonCameraOrbit, LeftSideButtonCameraTactical, LeftSideButtonCameraPOV, LeftSideButtonStructureAmmoHold
      7 from eve.client.script.ui.inflight.shipHud.leftSideButtons.leftSideButtonCargo import LeftSideButtonCargo
      8 import telemetry
      9 from eve.common.script.sys.eveCfg import IsControllingStructure
     10 import eve.client.script.ui.shared.pointerTool.pointerToolConst as pConst
     11 from eveuniverse.solar_systems import is_scanning_suppressed, is_directional_scanner_suppressed, is_solarsystem_map_suppressed
     12 from uihider import UiHiderMixin
     13 COL1 = 0
     14 COL2 = 28
     15 COL3 = 56
     16 HEIGHT = 16
     17 show_zoom_buttons_setting = UserSettingBool('showZoomBtns', False)
     18 
     19 def is_scanner_button_disabled():
     20     solar_system_id = session.solarsystemid2
     21     return is_scanning_suppressed(solar_system_id) and is_directional_scanner_suppressed(solar_system_id) and is_solarsystem_map_suppressed(solar_system_id)
     22 
     23 
     24 class HudButtonsCont(UiHiderMixin, ContainerAutoSize):
     25     uniqueUiName = pConst.UNIQUE_NAME_HUD_BUTTONS
     26     default_name = 'HudButtonsCont'
     27     isAutoSizeEnabled = False
     28 
     29     def ApplyAttributes(self, attributes):
     30         super(HudButtonsCont, self).ApplyAttributes(attributes)
     31         self.cameraTactical = None
     32         self.cameraOrbit = None
     33         self.cameraPov = None
     34         self.tacticalOverlay = None
     35         self.autopilotBtn = None
     36 
     37     def AnimateReveal(self):
     38         PlaySound('onboarding_ui_sfx_play')
     39         self.opacity = 0
     40         self.Show()
     41         animations.BlinkIn(self, startVal=0.2, endVal=1.0, loops=3)
     42 
     43     def Hide(self, *args):
     44         super(HudButtonsCont, self).Hide(*args)
     45         self.opacity = 0
     46 
     47     def Show(self, *args, **kwargs):
     48         super(HudButtonsCont, self).Show(*args, **kwargs)
     49         self.opacity = 1.0
     50 
     51     @telemetry.ZONE_METHOD
     52     def construct_buttons(self):
     53         self.Flush()
     54         self.cameraTactical = LeftSideButtonCameraTactical(parent=self, left=COL1, top=HEIGHT)
     55         self.cameraOrbit = LeftSideButtonCameraOrbit(parent=self, left=COL1, top=3 * HEIGHT)
     56         self.cameraPov = LeftSideButtonCameraPOV(parent=self, left=COL1, top=5 * HEIGHT)
     57         self.AddCargoBtn(COL2)
     58         self.tacticalOverlay = LeftSideButtonTactical(parent=self, left=COL2, top=2 * HEIGHT)
     59         scannerBtn = LeftSideButtonScanner(parent=self, left=COL2, top=4 * HEIGHT)
     60         if is_scanner_button_disabled():
     61             scannerBtn.Disable()
     62         self.autopilotBtn = LeftSideButtonAutopilot(parent=self, left=COL2, top=6 * HEIGHT)
     63         if IsControllingStructure():
     64             self.autopilotBtn.Disable()
     65         else:
     66             self.autopilotBtn.Enable()
     67         if show_zoom_buttons_setting.is_enabled():
     68             LeftSideButtonZoomIn(parent=self, left=COL3, top=HEIGHT)
     69             LeftSideButtonZoomOut(parent=self, left=COL3, top=3 * HEIGHT)
     70         self.EnableAutoSize()
     71         self.DisableAutoSize()
     72 
     73     def AddCargoBtn(self, left):
     74         if IsControllingStructure():
     75             cargoClass = LeftSideButtonStructureAmmoHold
     76         else:
     77             cargoClass = LeftSideButtonCargo
     78         cargoClass(parent=self, left=left, top=0)