internal void UnregisterControlTimer(UControlTimerDisplay ControlTimer)
 {
     LayoutControl.UnregisterTimerDisplay(ControlTimer);
 }
 internal void RegisterNewControlTimer(UControlTimerDisplay ControlTimer)
 {
     LayoutControl.RegisterNewTimerDisplay(ControlTimer);
 }
 internal void RegisterNewTimerDisplay(UControlTimerDisplay ControlTimer)
 {
     ControlTimer.WidgetManager = WidgetManager;
     this.flowLayoutPanel1.Controls.Add(ControlTimer);
     if (WidgetManager != null) WidgetManager.ResetMouseEvents();
 }
 internal void UnregisterTimerDisplay(UControlTimerDisplay ControlTimer)
 {
     this.flowLayoutPanel1.Controls.Remove(ControlTimer);
 }
Beispiel #5
0
        public virtual void Initialize(PlayerTimersGroup parentGroup, string player, string timerId, ServerInfo.ServerGroup serverGroup, string compactId)
        {
            //derived must call this base before their own inits!
            this.TimerID = timerId;
            this.TimerShortID = compactId;
            this.ParentGroup = parentGroup;
            this.Player = player;
            this.TargetServerGroup = serverGroup;

            SettingsSavePath = Path.Combine(
                ParentGroup.ThisGroupDir,
                TimerID.Replace(" ", "").Replace("(", "_").Replace(")", "") + ".xml");
            DefaultSettings = new PersistentObject<TimerDefaultSettings>(new TimerDefaultSettings());
            DefaultSettings.FilePath = SettingsSavePath.Replace(".xml", "_default.xml");
            if (!DefaultSettings.Load()) DefaultSettings.Save();

            TimerDisplay = new UControlTimerDisplay(this);
            ParentGroup.RegisterNewControlTimer(TimerDisplay);

            CDNotify = new CooldownHandler();
            CDNotify.Duration = DefaultSettings.Value.PopupDuration;
            CDNotify.Title = Player;
            CDNotify.Message = timerId + " cooldown finished";
            CDNotify.SoundEnabled = DefaultSettings.Value.SoundNotify;
            CDNotify.PopupEnabled = DefaultSettings.Value.PopupNotify;
            CDNotify.PersistPopup = DefaultSettings.Value.PersistentPopup;
            CDNotify.SoundName = DefaultSettings.Value.SoundName;
            if (PopupOnWALaunch) CDNotify.ResetShownAndPlayed();

            Aldurcraft.WurmOnline.WurmState.WurmServer.OnPotentialWurmDateAndUptimeChange += _handleServerChange;
        }