Esempio n. 1
0
        private void OnInitTimer(object sender, ElapsedEventArgs e)
        {
            ActionManager.Start();
            KeyUtils.Start();
            Inventory.Clear();
            MouseOperations.Start();
            _initTimer.Stop();
            _updateTimer.Elapsed -= OnUpdate;
            _updateTimer.Stop();
            ActionManager.SendAction(() =>
            {
                WinUtils.ActivateWindow(Constants.KO_WINDOW);
            }, 0.3f, () =>
            {
                int attempts = 0;
                SkillBar.Reset();
                while (!SkillBar.IsInitialized && attempts++ < MAX_ATTEMPT_INITIALIZE_SKILLBAR)
                {
                    SkillBar.InitSkillsInfo();
                }

                if (SkillBar.IsInitialized)
                {
                    _gos.ForEach(g => { g.Active = true; });

                    Started?.Invoke();
                    _sendStart = false;
                    _updateTimer.Restart();
                    _updateTimer.Elapsed += OnUpdate;
                }
                else
                {
                    Stop();
                    throw new Exception("Failed to initialize SkillBarManager, aborting.");
                }
            });
        }