예제 #1
0
        public void Initialize()
        {
            Logger.WriteInfo("Initializing ...");
            ViewModels.BaseSettings.Instance.RoutineSelectedInUi = RotationManager.CurrentRotation.ToString();
            DispelManager.Reset();
            InterruptsAndStunsManager.Reset();
            //TankBusterManager.ResetHealers();
            //TankBusterManager.ResetTanks();
            TreeRoot.OnStart += OnStart;
            TreeRoot.OnStop  += OnStop;
            CurrentZone       = WorldManager.ZoneId;
            CurrentJob        = Core.Me.CurrentJob;

            HookBehaviors();

            Application.Current.Dispatcher.Invoke(delegate
            {
                _form         = new SettingsWindow();
                _form.Closed += (sender, args) =>
                {
                    _form = null;
                };
            });

            TogglesManager.LoadTogglesForCurrentJob();
            CombatMessageManager.RegisterMessageStrategiesForClass(Core.Me.CurrentJob);
            Logger.WriteInfo("Initialized");
        }
예제 #2
0
        public void OnStart(BotBase bot)
        {
            // Reset Zoom Limit based on ZoomHack Setting
            ZoomHack.Toggle();

            Logic.OpenerLogic.InOpener = false;
            Logic.OpenerLogic.OpenerQueue.Clear();
            Logic.SpellQueueLogic.SpellQueue.Clear();

            // Apply the gambits we have
            GambitsViewModel.Instance.ApplyGambits();
            OpenersViewModel.Instance.ApplyOpeners();
            OverlayManager.StartMainOverlay();
            OverlayManager.StartCombatMessageOverlay();
            CombatMessageManager.RegisterMessageStrategiesForClass(Core.Me.CurrentJob);
            HookBehaviors();
        }
예제 #3
0
        public void Pulse()
        {
            #region Job switching because events aren't reliable apparently
            if (CurrentJob != Core.Me.CurrentJob)
            {
                // Set our current job
                CurrentJob = Core.Me.CurrentJob;
                Logger.WriteInfo("Job Changed");

                // Run the shit we need to
                Application.Current.Dispatcher.Invoke(delegate
                {
                    GambitsViewModel.Instance.ApplyGambits();
                    OpenersViewModel.Instance.ApplyOpeners();
                    TogglesManager.LoadTogglesForCurrentJob();
                });

                HookBehaviors();
                DispelManager.Reset();
                InterruptsAndStunsManager.Reset();
                CombatMessageManager.RegisterMessageStrategiesForClass(Core.Me.CurrentJob);
                //TankBusterManager.ResetHealers();
                //TankBusterManager.ResetTanks();
            }
            #endregion

            #region Zone switching because events aren't reliable apparently

            if (WorldManager.ZoneId != CurrentZone)
            {
                // Set the current zone
                CurrentZone = WorldManager.ZoneId;

                // Run the shit we need to
                GambitsViewModel.Instance.ApplyGambits();
                OpenersViewModel.Instance.ApplyOpeners();
            }

            #endregion

            Tracking.Update();
            Combat.AdjustCombatTime();
            Combat.AdjustDutyTime();

            Debug.Instance.InCombatTime          = (long)Combat.CombatTime.Elapsed.TotalSeconds;
            Debug.Instance.OutOfCombatTime       = (int)Combat.OutOfCombatTime.Elapsed.TotalSeconds;
            Debug.Instance.InCombatMovingTime    = (int)Combat.MovingInCombatTime.Elapsed.TotalSeconds;
            Debug.Instance.NotMovingInCombatTime = (int)Combat.NotMovingInCombatTime.Elapsed.TotalSeconds;
            Debug.Instance.DutyTime      = (long)Combat.DutyTime.Elapsed.TotalSeconds;
            Debug.Instance.DutyState     = Duty.State();
            Debug.Instance.CastingGambit = Casting.CastingGambit;

            if (BaseSettings.Instance.DebugHealingLists)
            {
                Debug.Instance.CastableWithin10 = new ObservableCollection <GameObject>(Group.CastableAlliesWithin10);
                Debug.Instance.CastableWithin15 = new ObservableCollection <GameObject>(Group.CastableAlliesWithin15);
                Debug.Instance.CastableWithin30 = new ObservableCollection <GameObject>(Group.CastableAlliesWithin30);
            }

            if (Core.Me.InCombat)
            {
                Debug.Instance.InCombatTimeLeft = Combat.CombatTotalTimeLeft;
                //Debug.Instance.Enmity = new AsyncObservableCollection<Enmity>(EnmityManager.EnmityList);
            }

            if (Core.Me.HasTarget)
            {
                if (BaseSettings.Instance.DebugEnemyInfo)
                {
                    Debug.Instance.IsBoss = XivDataHelper.BossDictionary.ContainsKey(Core.Me.CurrentTarget.NpcId) ? "True" : "False";
                    Debug.Instance.TargetCombatTimeLeft = Core.Me.CurrentTarget.CombatTimeLeft();
                }
            }

            if (DateTime.Now < _pulseLimiter)
            {
                return;
            }
            _pulseLimiter = DateTime.Now.AddSeconds(1);

            if (DateTime.Now > _saveFormTime)
            {
                Dispelling.Instance.Save();
                InterruptsAndStuns.Instance.Save();
                BaseSettings.Instance.Save();
                //TankBusters.Instance.Save();
                TogglesViewModel.Instance.SaveToggles();

                #region Save Settings For All Routines

                Task.Run(SaveJobSettings);

                #endregion

                _saveFormTime = DateTime.Now.AddSeconds(60);
            }

            CombatMessageManager.UpdateDisplayedMessage();
        }