Пример #1
0
        public virtual void Initialize(PlayerTimersGroup parentGroup, string player, TimerDefinition definition)
        {
            //derived must call this base before their own inits!
            TimerDefinition   = definition;
            Name              = definition.ToString();
            ShortName         = definition.ToString();
            playerTimersGroup = parentGroup;
            Player            = player;

            View = new TimerDisplayView(this);

            CDNotify = new CooldownHandler(Logger, SoundManager, TrayPopups)
            {
                DurationMillis  = PopupDurationMillis,
                Title           = Player,
                Message         = Name + " cooldown finished",
                SoundEnabled    = SoundNotify,
                PopupEnabled    = PopupNotify,
                PersistentPopup = PersistentPopup,
                SoundId         = SoundId
            };
            if (PopupOnWaLaunch)
            {
                CDNotify.ResetShownAndPlayed();
            }

            WurmCharacter = WurmApi.Characters.Get(new CharacterName(player));
            WurmCharacter.LogInOrCurrentServerPotentiallyChanged += _handleServerChange;

            telemetry.TrackEvent($"Timers: initialized timer {Name}");
        }
Пример #2
0
 internal void RegisterNewTimerDisplay(TimerDisplayView ControlTimer)
 {
     ControlTimer.WidgetManager = WidgetManager;
     this.flowLayoutPanel1.Controls.Add(ControlTimer);
     if (WidgetManager != null)
     {
         WidgetManager.ResetMouseEvents();
     }
 }
Пример #3
0
 internal void UnregisterTimerDisplay(TimerDisplayView ControlTimer)
 {
     this.flowLayoutPanel1.Controls.Remove(ControlTimer);
 }