示例#1
0
        public RoutineSettings()
        {
            base.LoadDefaults();

            Core.Routines.Changed += OnRoutineChanged;
            var current = Core.Routines.CurrentRoutine;

            UILoader.OnSettingsWindowOpened   += UILoaderOnOnSettingsWindowOpened;
            GameInfo.Instance.PropertyChanged += GameInfoChanged;

            foreach (var routine in Core.Routines.AllRoutines)
            {
                var routineViewModel = new RoutineViewModel(routine);
                AllRoutines.Add(routineViewModel);

                if (current == routine)
                {
                    CurrentRoutine  = routineViewModel;
                    SelectedRoutine = routineViewModel;
                }
            }

            UpdateRoutineLists();

            if (_routineMode == RoutineMode.None)
            {
                _routineMode = RoutineMode.Automatic;
            }
        }
示例#2
0
        private void UpdateRoutineLists()
        {
            var actorClass = GetCurrentClass();

            ClassRoutines          = AllRoutines.Where(r => r.Class == actorClass || r.Class == ActorClass.Invalid).ToList();
            ClassAvailableRoutines = ClassRoutines.Where(r => r != CurrentRoutine && r.RequiredBuild != null).ToList();
        }
        public void SelectRoutine()
        {
            if (Core.Settings.Routine == null)
            {
                return;
            }

            if (!TrinityPlugin.IsEnabled)
            {
                return;
            }

            // Ignore wizards going into archon mode.
            if (Core.Player.ActorClass == ActorClass.Wizard && Core.Hotbar.ActivePowers.Any(p
                                                                                            => GameData.ArchonSkillIds.Contains((int)p)))
            {
                return;
            }

            var genericRoutines     = new List <IRoutine>();
            var manualSelectionName = Core.Settings.Routine.SelectedRoutineClassName;

            if (Settings.RoutineMode == RoutineMode.Manual && !string.IsNullOrEmpty(manualSelectionName))
            {
                var routine = AllRoutines.FirstOrDefault(r => r.GetType().Name == manualSelectionName);
                if (routine != null)
                {
                    if (routine != CurrentRoutine)
                    {
                        Core.Logger.Log($"Loading Force-Selected Routine: {manualSelectionName}");
                        CurrentRoutine = routine;
                    }

                    return;
                }
            }

            if (!Core.Actors.Actors.Any())
            {
                Core.Actors.Update();
            }

            foreach (var routine in CurrentClassRoutines.OrderBy(r => r.BuildRequirements?.RequirementCount))
            {
                if (routine.BuildRequirements == null && routine.Class != ActorClass.Invalid)
                {
                    genericRoutines.Add(routine);
                    continue;
                }
                if (routine.BuildRequirements?.IsEquipped() ?? false)
                {
                    CurrentRoutine = routine;
                    return;
                }
            }

            CurrentRoutine = genericRoutines.FirstOrDefault();
        }
示例#4
0
        private void OnRoutineChanged(IRoutine newRoutine)
        {
            var routineViewModel = AllRoutines.FirstOrDefault(r => r.DisplayName == newRoutine.DisplayName);

            if (routineViewModel != null)
            {
                CurrentRoutine  = routineViewModel;
                SelectedRoutine = routineViewModel;
                UpdateRoutineLists();
            }
        }
        public void ManualSelectRoutine(string typeName)
        {
            var routine = AllRoutines.FirstOrDefault(r => r.GetType().Name == typeName);

            if (routine != null)
            {
                CurrentRoutine = routine;
                Settings.SelectedRoutineClassName = routine.GetType().Name;
                Settings.RoutineMode = RoutineMode.Manual;
                Core.Logger.Log($"Set Routine Selection: {Settings.SelectedRoutineClassName}");
            }
        }
示例#6
0
        public void SelectRoutine()
        {
            if (Core.Settings.Routine == null)
            {
                return;
            }

            if (!TrinityPlugin.IsEnabled)
            {
                return;
            }

            // Ignore wizards going into archon mode.
            if (Core.Player.ActorClass == ActorClass.Wizard && Core.Hotbar.ActivePowers.Any(p
                                                                                            => GameData.ArchonSkillIds.Contains((int)p)))
            {
                return;
            }

            var genericRoutines     = new List <IRoutine>();
            var manualSelectionName = Core.Settings.Routine.SelectedRoutineClassName;

            if (Settings.RoutineMode == RoutineMode.Manual && !string.IsNullOrEmpty(manualSelectionName))
            {
                var routine = AllRoutines.FirstOrDefault(r => r.GetType().Name == manualSelectionName);
                if (routine != null)
                {
                    if (routine != CurrentRoutine)
                    {
                        Core.Logger.Log($"Loading Force-Selected Routine:");
                        CurrentRoutine = routine;
                        Core.Logger.Warn($"Author: {CurrentRoutine.Author}");
                        Core.Logger.Warn($"Class: {CurrentRoutine.Class}");
                        Core.Logger.Warn($"DisplayName: {CurrentRoutine.DisplayName}");
                        //Range
                        Core.Logger.Warn($"ClusterRadius: {CurrentRoutine.ClusterRadius}");
                        Core.Logger.Warn($"ClusterSize: {CurrentRoutine.ClusterSize}");
                        Core.Logger.Warn($"EliteRange: {CurrentRoutine.EliteRange}");
                        Core.Logger.Warn($"TrashRange: {CurrentRoutine.TrashRange}");
                        Core.Logger.Warn($"ShrineRange: {CurrentRoutine.ShrineRange}");
                        //Health
                        Core.Logger.Warn($"PotionHealthPct: {CurrentRoutine.PotionHealthPct}");
                        Core.Logger.Warn($"EmergencyHealthPct: {CurrentRoutine.EmergencyHealthPct}");
                        Core.Logger.Warn($"HealthGlobeRange: {CurrentRoutine.HealthGlobeRange}");

                        Core.Logger.Warn($"PrimaryEnergyReserve: {CurrentRoutine.PrimaryEnergyReserve}");
                    }

                    return;
                }
            }

            if (!Core.Actors.Actors.Any())
            {
                Core.Actors.Update();
            }

            foreach (var routine in CurrentClassRoutines.OrderBy(r => r.BuildRequirements?.RequirementCount))
            {
                if (routine.BuildRequirements == null && routine.Class != ActorClass.Invalid)
                {
                    genericRoutines.Add(routine);
                    continue;
                }
                if (routine.BuildRequirements?.IsEquipped() ?? false)
                {
                    CurrentRoutine = routine;
                    return;
                }
            }

            CurrentRoutine = genericRoutines.FirstOrDefault();
        }