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

hostileBaiterController.py (1815B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\spacecomponents\hostileBaiterController.py
      2 from eve.client.script.spacecomponents.countercontroller import BaseCounterController
      3 from spacecomponents.client.messages import MSG_ON_HOSTILE_BAITER_TIMER_UPDATED
      4 from spacecomponents.common.componentConst import HOSTILE_BAITER
      5 import blue
      6 import logging
      7 logger = logging.getLogger(__name__)
      8 ACTIVE_TIMER_COLOR = (1.0, 0.27, 0.29, 1.0)
      9 PAUSED_TIMER_COLOR = (1.0, 1.0, 0.27, 1.0)
     10 LABEL_UNLOCKING = 'UI/Inflight/SpaceComponents/ProximityLock/Unlocking'
     11 LABEL_CONTESTED = 'UI/Inflight/SpaceComponents/ProximityLock/Contested'
     12 
     13 class HostileBaiterCounterController(BaseCounterController):
     14     __componentClass__ = HOSTILE_BAITER
     15     __counterColor__ = ACTIVE_TIMER_COLOR
     16     __pausedColor__ = PAUSED_TIMER_COLOR
     17     __counterLabel__ = 'UI/Inflight/SpaceComponents/HostileBaiter/TimerLabel'
     18     __counterLabelPaused__ = 'UI/Inflight/SpaceComponents/HostileBaiter/TimerLabelBlocked'
     19     __timerFunc__ = blue.os.GetSimTime
     20     __countsDown__ = False
     21 
     22     def __init__(self, *args):
     23         BaseCounterController.__init__(self, *args)
     24         self.componentRegistry.SubscribeToItemMessage(self.itemID, MSG_ON_HOSTILE_BAITER_TIMER_UPDATED, self.UpdateTimerState)
     25 
     26     def UpdateTimerState(self, instance, slimItem):
     27         if slimItem.component_hostileBaiter is None:
     28             return
     29         if instance.completeAtTime is None:
     30             if self.timer is not None:
     31                 self.RemoveTimer()
     32         elif self.timer is None:
     33             self.AddTimer(instance.completeAtTime, instance.attributes.rewardWaitDuration, instance.pausedAtTime)
     34         else:
     35             self.ChangeTimer(instance.completeAtTime, instance.attributes.rewardWaitDuration, instance.pausedAtTime)