Esempio n. 1
0
        public void Initialize()
        {
            Logger.WriteInfo("Initializing ...");
            RotationManager.Reset();
            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;

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

            TogglesManager.LoadTogglesForCurrentJob();
            Logger.WriteInfo("Initialized");
        }
Esempio n. 2
0
        public void RegisterToggles()
        {
            SaveToggles();

            // We save here because LoadToggles reads from the json file
            TogglesManager.LoadTogglesForCurrentJob();
        }
Esempio n. 3
0
        public void Initialize()
        {
            Logger.WriteInfo("Initializing ...");

            var patternFinder = new GreyMagic.PatternFinder(Core.Memory);
            var intPtr        = patternFinder.Find("Search 48 8D 0D ? ? ? ? E8 ? ? ? ? 48 8D 0D ? ? ? ? E8 ? ? ? ? EB AB Add 3 TraceRelative");
            var languageByte  = Core.Memory.Read <byte>(intPtr);

            switch (languageByte)
            {
            case 1:
                Globals.Language = GameVersion.English;
                break;

            case 2:
                Globals.Language = GameVersion.English;
                break;

            case 3:
                Globals.Language = GameVersion.English;
                break;

            case 4:
                Globals.Language = GameVersion.Chinese;
                break;

            default:
                Globals.Language = GameVersion.English;
                break;
            }

            Logger.WriteInfo($"Current Language: {Globals.Language}");
            RotationManager.Reset();
            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;

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

            TogglesManager.LoadTogglesForCurrentJob();
            Logger.WriteInfo("Initialized");
        }
Esempio n. 4
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();
                });

                RotationManager.Reset();
                DispelManager.Reset();
                InterruptsAndStunsManager.Reset();
                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);
            }

            // Reset Zoom Limit based on ZoomHack Setting
            ZoomHack.Toggle();

            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();
                }
            }
        }
Esempio n. 5
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();
        }