Beispiel #1
0
 internal static void UpdateForm(SavedSettings newSettings)
 {
     settingsForm.UpdateFromSettings(newSettings);
 }
Beispiel #2
0
        public void Start()
        {
            _dir = Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%/Desktop"), "NGUInjector");
            if (!Directory.Exists(_dir))
            {
                Directory.CreateDirectory(_dir);
            }

            var logDir = Path.Combine(_dir, "logs");

            if (!Directory.Exists(logDir))
            {
                Directory.CreateDirectory(logDir);
            }
            OutputWriter = new StreamWriter(Path.Combine(logDir, "inject.log"))
            {
                AutoFlush = true
            };
            LootWriter = new StreamWriter(Path.Combine(logDir, "loot.log"))
            {
                AutoFlush = true
            };
            CombatWriter = new StreamWriter(Path.Combine(logDir, "combat.log"))
            {
                AutoFlush = true
            };
            AllocationWriter = new StreamWriter(Path.Combine(logDir, "allocation.log"))
            {
                AutoFlush = true
            };

            try
            {
                Character = FindObjectOfType <Character>();

                Log("Injected");
                LogLoot("Starting Loot Writer");
                LogCombat("Starting Combat Writer");
                LogAllocation("Started Allocation Writer");
                Controller       = Character.inventoryController;
                PlayerController = FindObjectOfType <PlayerController>();
                _invManager      = new InventoryManager();
                _yggManager      = new YggdrasilManager();
                _questManager    = new QuestManager();
                _combManager     = new CombatManager();
                LoadoutManager.ReleaseLock();
                DiggerManager.ReleaseLock();

                Settings = new SavedSettings(_dir);

                if (!Settings.LoadSettings())
                {
                    var temp = new SavedSettings(null)
                    {
                        PriorityBoosts        = new int[] { },
                        YggdrasilLoadout      = new int[] { },
                        SwapYggdrasilLoadouts = true,
                        HighestAKZone         = 0,
                        SwapTitanLoadouts     = true,
                        TitanLoadout          = new int[] { },
                        ManageDiggers         = true,
                        ManageYggdrasil       = true,
                        ManageEnergy          = true,
                        ManageMagic           = true,
                        ManageInventory       = true,
                        ManageGear            = true,
                        AutoConvertBoosts     = true,
                        SnipeZone             = 0,
                        FastCombat            = false,
                        PrecastBuffs          = true,
                        AutoFight             = false,
                        AutoQuest             = true,
                        AutoQuestITOPOD       = false,
                        AllowMajorQuests      = false,
                        GoldDropLoadout       = new int[] {},
                        AutoMoneyPit          = false,
                        AutoSpin              = false,
                        MoneyPitLoadout       = new int[] {},
                        AutoRebirth           = false,
                        ManageWandoos         = false,
                        InitialGoldZone       = -1,
                        MoneyPitThreshold     = 1e5,
                        NextGoldSwap          = false,
                        BoostBlacklist        = new int[] {},
                        GoldZone              = 0,
                        CombatMode            = 0,
                        RecoverHealth         = false,
                        SnipeBossOnly         = true,
                        AllowZoneFallback     = false,
                        QuestFastCombat       = true,
                        AbandonMinors         = false,
                        MinorAbandonThreshold = 30,
                        QuestCombatMode       = 0,
                        AutoBuyEM             = false,
                        AutoSpellSwap         = false,
                        CounterfeitThreshold  = 400,
                        SpaghettiThreshold    = 30,
                        BloodNumberThreshold  = 1e10,
                        BalanceCube           = true,
                        CombatEnabled         = false,
                        GlobalEnabled         = true,
                        QuickDiggers          = new int[] {},
                        QuickLoadout          = new int[] {},
                        UseButterMajor        = false,
                        ManualMinors          = false,
                        UseButterMinor        = false,
                        ActivateFruits        = true
                    };

                    Settings.MassUpdate(temp);

                    Log($"Created default settings");
                }
                settingsForm = new SettingsForm();

                _profile = new CustomAllocation(_dir);
                _profile.ReloadAllocation();

                ConfigWatcher = new FileSystemWatcher
                {
                    Path                = _dir,
                    Filter              = "settings.json",
                    NotifyFilter        = NotifyFilters.LastWrite,
                    EnableRaisingEvents = true
                };

                ConfigWatcher.Changed += (sender, args) =>
                {
                    if (IgnoreNextChange)
                    {
                        IgnoreNextChange = false;
                        return;
                    }
                    Settings.LoadSettings();
                    settingsForm.UpdateFromSettings(Settings);
                };

                AllocationWatcher = new FileSystemWatcher
                {
                    Path                = _dir,
                    Filter              = "allocation.json",
                    NotifyFilter        = NotifyFilters.LastWrite,
                    EnableRaisingEvents = true
                };

                AllocationWatcher.Changed += (sender, args) => { LoadAllocation(); };

                Settings.SaveSettings();
                Settings.LoadSettings();

                settingsForm.UpdateFromSettings(Settings);
                settingsForm.Show();

                InvokeRepeating("AutomationRoutine", 0.0f, 10.0f);
                InvokeRepeating("SnipeZone", 0.0f, .1f);
                InvokeRepeating("MonitorLog", 0.0f, 1f);
                InvokeRepeating("QuickStuff", 0.0f, .5f);
            }
            catch (Exception e)
            {
                Log(e.Message);
                Log(e.StackTrace);
            }
        }
Beispiel #3
0
        public void Start()
        {
            try
            {
                _dir = Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%/Desktop"), "NGUInjector");
                if (!Directory.Exists(_dir))
                {
                    Directory.CreateDirectory(_dir);
                }

                var logDir = Path.Combine(_dir, "logs");
                if (!Directory.Exists(logDir))
                {
                    Directory.CreateDirectory(logDir);
                }

                OutputWriter = new StreamWriter(Path.Combine(logDir, "inject.log"))
                {
                    AutoFlush = true
                };
                LootWriter = new StreamWriter(Path.Combine(logDir, "loot.log"))
                {
                    AutoFlush = true
                };
                CombatWriter = new StreamWriter(Path.Combine(logDir, "combat.log"))
                {
                    AutoFlush = true
                };
                AllocationWriter = new StreamWriter(Path.Combine(logDir, "allocation.log"))
                {
                    AutoFlush = true
                };
                PitSpinWriter = new StreamWriter(Path.Combine(logDir, "pitspin.log"), true)
                {
                    AutoFlush = true
                };
                CardsWriter = new StreamWriter(Path.Combine(logDir, "cards.log"))
                {
                    AutoFlush = true
                };

                _profilesDir = Path.Combine(_dir, "profiles");
                if (!Directory.Exists(_profilesDir))
                {
                    Directory.CreateDirectory(_profilesDir);
                }


                var oldPath = Path.Combine(_dir, "allocation.json");
                var newPath = Path.Combine(_profilesDir, "default.json");

                if (File.Exists(oldPath) && !File.Exists(newPath))
                {
                    File.Move(oldPath, newPath);
                }
            }
            catch (Exception e)
            {
                Log(e.Message);
                Log(e.StackTrace);
                Loader.Unload();
                return;
            }

            try
            {
                Character = FindObjectOfType <Character>();

                Log("Injected");
                LogLoot("Starting Loot Writer");
                LogCombat("Starting Combat Writer");
                LogCard("Starting Card Writer");
                Controller          = Character.inventoryController;
                PlayerController    = FindObjectOfType <PlayerController>();
                ArbitraryController = FindObjectOfType <ArbitraryController>();
                _invManager         = new InventoryManager();
                _yggManager         = new YggdrasilManager();
                _questManager       = new QuestManager();
                _combManager        = new CombatManager();
                _cardManager        = new CardManager();
                _cookingManager     = new CookingManager();
                _consumablesManager = new ConsumablesManager();
                LoadoutManager.ReleaseLock();
                DiggerManager.ReleaseLock();

                Settings = new SavedSettings(_dir);

                if (!Settings.LoadSettings())
                {
                    var temp = new SavedSettings(null)
                    {
                        PriorityBoosts        = new int[] { },
                        YggdrasilLoadout      = new int[] { },
                        SwapYggdrasilLoadouts = false,
                        SwapTitanLoadouts     = false,
                        TitanLoadout          = new int[] { },
                        ManageDiggers         = true,
                        ManageYggdrasil       = false,
                        ManageEnergy          = true,
                        ManageMagic           = true,
                        ManageInventory       = true,
                        ManageGear            = true,
                        AutoConvertBoosts     = true,
                        SnipeZone             = 0,
                        FastCombat            = false,
                        PrecastBuffs          = true,
                        AutoFight             = false,
                        AutoQuest             = false,
                        AutoQuestITOPOD       = false,
                        AllowMajorQuests      = false,
                        GoldDropLoadout       = new int[] { },
                        AutoMoneyPit          = false,
                        AutoSpin                 = false,
                        MoneyPitLoadout          = new int[] { },
                        AutoRebirth              = false,
                        ManageWandoos            = false,
                        MoneyPitThreshold        = 1e5,
                        DoGoldSwap               = false,
                        BoostBlacklist           = new int[] { },
                        CombatMode               = 0,
                        RecoverHealth            = false,
                        SnipeBossOnly            = true,
                        AllowZoneFallback        = false,
                        QuestFastCombat          = true,
                        AbandonMinors            = false,
                        MinorAbandonThreshold    = 30,
                        QuestCombatMode          = 0,
                        AutoBuyEM                = false,
                        AutoSpellSwap            = false,
                        CounterfeitThreshold     = 400,
                        SpaghettiThreshold       = 30,
                        BloodNumberThreshold     = 1e10,
                        CastBloodSpells          = false,
                        IronPillThreshold        = 10000,
                        BloodMacGuffinAThreshold = 6,
                        BloodMacGuffinBThreshold = 6,
                        CubePriority             = 0,
                        CombatEnabled            = false,
                        GlobalEnabled            = false,
                        QuickDiggers             = new int[] { },
                        QuickLoadout             = new int[] { },
                        UseButterMajor           = false,
                        ManualMinors             = false,
                        UseButterMinor           = false,
                        ActivateFruits           = false,
                        ManageR3                 = true,
                        WishPriorities           = new int[] { },
                        BeastMode                = true,
                        ManageNGUDiff            = true,
                        AllocationFile           = "default",
                        TitanGoldTargets         = new bool[ZoneHelpers.TitanZones.Length],
                        ManageGoldLoadouts       = false,
                        ResnipeTime              = 3600,
                        TitanMoneyDone           = new bool[ZoneHelpers.TitanZones.Length],
                        TitanSwapTargets         = new bool[ZoneHelpers.TitanZones.Length],
                        GoldCBlockMode           = false,
                        DebugAllocation          = false,
                        AdventureTargetITOPOD    = false,
                        ITOPODRecoverHP          = false,
                        ITOPODCombatMode         = 0,
                        ITOPODBeastMode          = true,
                        ITOPODFastCombat         = true,
                        ITOPODPrecastBuffs       = false,
                        DisableOverlay           = false,
                        OptimizeITOPODFloor      = false,
                        YggSwapThreshold         = 1,
                        UpgradeDiggers           = true,
                        BlacklistedBosses        = new int[0],
                        SpecialBoostBlacklist    = new int[0],
                        MoreBlockParry           = false,
                        WishSortOrder            = false,
                        WishSortPriorities       = false,
                        ManageMayo               = false,
                        TrashCards               = false,
                        TrashAdventureCards      = false,
                        AutoCastCards            = false,
                        CardsTrashQuality        = 0,
                        TrashCardCost            = 0,
                        DontCastCardType         = new string[0],
                        TrashChunkers            = false,
                        HackAdvance              = false
                    };

                    Settings.MassUpdate(temp);

                    Log($"Created default settings");
                }

                settingsForm = new SettingsForm();

                if (string.IsNullOrEmpty(Settings.AllocationFile))
                {
                    Settings.SetSaveDisabled(true);
                    Settings.AllocationFile = "default";
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.TitanGoldTargets == null || Settings.TitanGoldTargets.Length == 0)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.TitanGoldTargets = new bool[ZoneHelpers.TitanZones.Length];
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.TitanMoneyDone == null || Settings.TitanMoneyDone.Length == 0)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.TitanMoneyDone = new bool[ZoneHelpers.TitanZones.Length];
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.TitanSwapTargets == null || Settings.TitanSwapTargets.Length == 0)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.TitanSwapTargets = new bool[ZoneHelpers.TitanZones.Length];
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.SpecialBoostBlacklist == null)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.SpecialBoostBlacklist = new int[0];
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.BlacklistedBosses == null)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.BlacklistedBosses = new int[0];
                    Settings.SetSaveDisabled(false);
                }

                WishManager = new WishManager();

                LoadAllocation();
                LoadAllocationProfiles();

                ZoneWatcher = new FileSystemWatcher
                {
                    Path                = _dir,
                    Filter              = "zoneOverride.json",
                    NotifyFilter        = NotifyFilters.LastWrite,
                    EnableRaisingEvents = true
                };

                ZoneWatcher.Changed += (sender, args) =>
                {
                    Log(_dir);
                    ZoneStatHelper.CreateOverrides(_dir);
                };

                ConfigWatcher = new FileSystemWatcher
                {
                    Path                = _dir,
                    Filter              = "settings.json",
                    NotifyFilter        = NotifyFilters.LastWrite,
                    EnableRaisingEvents = true
                };

                ConfigWatcher.Changed += (sender, args) =>
                {
                    if (IgnoreNextChange)
                    {
                        IgnoreNextChange = false;
                        return;
                    }
                    Settings.LoadSettings();
                    settingsForm.UpdateFromSettings(Settings);
                    LoadAllocation();
                };

                AllocationWatcher = new FileSystemWatcher
                {
                    Path                = _profilesDir,
                    Filter              = "*.json",
                    NotifyFilter        = NotifyFilters.LastWrite | NotifyFilters.FileName,
                    EnableRaisingEvents = true
                };

                AllocationWatcher.Changed += (sender, args) => { LoadAllocation(); };
                AllocationWatcher.Created += (sender, args) => { LoadAllocationProfiles(); };
                AllocationWatcher.Deleted += (sender, args) => { LoadAllocationProfiles(); };
                AllocationWatcher.Renamed += (sender, args) => { LoadAllocationProfiles(); };

                Settings.SaveSettings();
                Settings.LoadSettings();

                LogAllocation("Started Allocation Writer");

                ZoneStatHelper.CreateOverrides(_dir);

                settingsForm.UpdateFromSettings(Settings);
                settingsForm.Show();

                InvokeRepeating("AutomationRoutine", 0.0f, 10.0f);
                InvokeRepeating("SnipeZone", 0.0f, .1f);
                InvokeRepeating("MonitorLog", 0.0f, 1f);
                InvokeRepeating("QuickStuff", 0.0f, .5f);
                InvokeRepeating("ShowBoostProgress", 0.0f, 60.0f);
                InvokeRepeating("SetResnipe", 0f, 1f);


                reference = this;
            }
            catch (Exception e)
            {
                Log(e.ToString());
                Log(e.StackTrace);
                Log(e.InnerException.ToString());
            }
        }
Beispiel #4
0
        internal void MassUpdate(SavedSettings other)
        {
            _priorityBoosts = other.PriorityBoosts;
            _boostBlacklist = other.BoostBlacklist;

            _yggdrasilLoadout      = other.YggdrasilLoadout;
            _swapYggdrasilLoadouts = other.SwapYggdrasilLoadouts;

            _swapTitanLoadouts = other.SwapTitanLoadouts;
            _titanLoadout      = other.TitanLoadout;

            _manageDiggers     = other.ManageDiggers;
            _manageYggdrasil   = other.ManageYggdrasil;
            _manageEnergy      = other.ManageEnergy;
            _manageMagic       = other.ManageMagic;
            _manageInventory   = other.ManageInventory;
            _manageGear        = other.ManageGear;
            _manageWandoos     = other.ManageWandoos;
            _autoConvertBoosts = other.AutoConvertBoosts;

            _snipeZone    = other.SnipeZone;
            _fastCombat   = other.FastCombat;
            _precastBuffs = other.PrecastBuffs;

            _autoFight = other.AutoFight;

            _autoQuest        = other.AutoQuest;
            _autoQuestItopod  = other.AutoQuestITOPOD;
            _allowMajorQuests = other.AllowMajorQuests;

            _goldDropLoadout = other.GoldDropLoadout;

            _autoMoneyPit      = other.AutoMoneyPit;
            _autoSpin          = other.AutoSpin;
            _moneyPitLoadout   = other.MoneyPitLoadout;
            _moneyPitThreshold = other.MoneyPitThreshold;

            _autoRebirth   = other.AutoRebirth;
            _manageWandoos = other.ManageWandoos;
            _doGoldSwap    = other.DoGoldSwap;

            _combatMode               = other.CombatMode;
            _recoverHealth            = other.RecoverHealth;
            _snipeBossOnly            = other.SnipeBossOnly;
            _allowZoneFallback        = other.AllowZoneFallback;
            _abandonMinors            = other.AbandonMinors;
            _minorAbandonThreshold    = other.MinorAbandonThreshold;
            _questCombatMode          = other.QuestCombatMode;
            _questFastCombat          = other.QuestFastCombat;
            _autoSpellSwap            = other.AutoSpellSwap;
            _counterfeitThreshold     = other.CounterfeitThreshold;
            _spaghettiThreshold       = other.SpaghettiThreshold;
            _castBloodSpells          = other.CastBloodSpells;
            _ironPillThreshold        = other.IronPillThreshold;
            _bloodMacGuffinAThreshold = other.BloodMacGuffinAThreshold;
            _bloodMacGuffinBThreshold = other.BloodMacGuffinBThreshold;
            _autoBuyEm             = other.AutoBuyEM;
            _bloodNumberThreshold  = other.BloodNumberThreshold;
            _quickDiggers          = other.QuickDiggers;
            _quickLoadout          = other.QuickLoadout;
            _combatEnabled         = other.CombatEnabled;
            _globalEnabled         = other.GlobalEnabled;
            _useButterMajor        = other.UseButterMajor;
            _useButterMinor        = other.UseButterMinor;
            _manualMinors          = other.ManualMinors;
            _manageR3              = other.ManageR3;
            _activateFruits        = other.ActivateFruits;
            _wishPriorities        = other.WishPriorities;
            _wishExclusions        = other.WishExclusions;
            _wishSortPriorities    = other.WishSortPriorities;
            _wishSortOrder         = other.WishSortOrder;
            _beastMode             = other.BeastMode;
            _cubePriority          = other.CubePriority;
            _manageNguDiff         = other.ManageNGUDiff;
            _allocationFile        = other.AllocationFile;
            _manageGoldLoadouts    = other.ManageGoldLoadouts;
            _titanGoldTargets      = other.TitanGoldTargets;
            _titanSwapTargets      = other.TitanSwapTargets;
            _titanMoneyDone        = other.TitanMoneyDone;
            _resnipeTime           = other.ResnipeTime;
            _goldCBlockMode        = other.GoldCBlockMode;
            _debugAllocation       = other.DebugAllocation;
            _optimizeItopodFloor   = other.OptimizeITOPODFloor;
            _adventureTargetItopod = other.AdventureTargetITOPOD;
            _itopodBeastMode       = other.ITOPODBeastMode;
            _itopodCombatMode      = other.ITOPODCombatMode;
            _itopodFastCombat      = other.ITOPODFastCombat;
            _itopodPrecastBuffs    = other.ITOPODPrecastBuffs;
            _itopodRecoverHp       = other.ITOPODRecoverHP;
            _disableOverlay        = other.DisableOverlay;
            _upgradeDiggers        = other._upgradeDiggers;
            _yggSwapThreshold      = other.YggSwapThreshold;
            _moreBlockParry        = other.MoreBlockParry;
            _specialBoostBlacklist = other.SpecialBoostBlacklist;
            _blacklistedBosses     = other.BlacklistedBosses;
            _hackAdvance           = other.HackAdvance;
        }
Beispiel #5
0
        internal void UpdateFromSettings(SavedSettings newSettings)
        {
            _initializing                      = true;
            AutoDailySpin.Checked              = newSettings.AutoSpin;
            AutoFightBosses.Checked            = newSettings.AutoFight;
            AutoITOPOD.Checked                 = newSettings.AutoQuestITOPOD;
            AutoMoneyPit.Checked               = newSettings.AutoMoneyPit;
            MoneyPitThreshold.Text             = newSettings.MoneyPitThreshold.ToString(CultureInfo.InvariantCulture);
            ManageEnergy.Checked               = newSettings.ManageEnergy;
            ManageMagic.Checked                = newSettings.ManageMagic;
            ManageGear.Checked                 = newSettings.ManageGear;
            ManageDiggers.Checked              = newSettings.ManageDiggers;
            ManageWandoos.Checked              = newSettings.ManageWandoos;
            AutoRebirth.Checked                = newSettings.AutoRebirth;
            ManageYggdrasil.Checked            = newSettings.ManageYggdrasil;
            YggdrasilSwap.Checked              = newSettings.SwapYggdrasilLoadouts;
            ManageInventory.Checked            = newSettings.ManageInventory;
            ManageBoostConvert.Checked         = newSettings.AutoConvertBoosts;
            SwapTitanLoadout.Checked           = newSettings.SwapTitanLoadouts;
            HighestTitanDropdown.SelectedIndex = newSettings.HighestAKZone;
            BossesOnly.Checked                 = newSettings.SnipeBossOnly;
            PrecastBuffs.Checked               = newSettings.PrecastBuffs;
            RecoverHealth.Checked              = newSettings.RecoverHealth;
            FastCombat.Checked                 = newSettings.FastCombat;
            CombatMode.SelectedIndex           = newSettings.CombatMode;
            SetSnipeZone(CombatTargetZone, newSettings.SnipeZone);
            AllowFallthrough.Checked = newSettings.AllowZoneFallback;
            SetOtherZone(GoldLoadoutZone, newSettings.GoldZone);
            SetOtherZone(InitialGoldTarget, newSettings.InitialGoldZone);
            QuestCombatMode.SelectedIndex = newSettings.QuestCombatMode;
            ManageQuests.Checked          = newSettings.AutoQuest;
            AllowMajor.Checked            = newSettings.AllowMajorQuests;
            AbandonMinors.Checked         = newSettings.AbandonMinors;
            AbandonMinorThreshold.Value   = newSettings.MinorAbandonThreshold;
            QuestFastCombat.Checked       = newSettings.QuestFastCombat;
            UseGoldLoadout.Checked        = newSettings.NextGoldSwap;
            AutoSpellSwap.Checked         = newSettings.AutoSpellSwap;
            SpaghettiCap.Value            = newSettings.SpaghettiThreshold;
            CounterfeitCap.Value          = newSettings.CounterfeitThreshold;
            AutoBuyEM.Checked             = newSettings.AutoBuyEM;
            BalanceCube.Checked           = newSettings.BalanceCube;
            MasterEnable.Checked          = newSettings.GlobalEnabled;
            CombatActive.Checked          = newSettings.CombatEnabled;
            ManualMinor.Checked           = newSettings.ManualMinors;
            ButterMajors.Checked          = newSettings.UseButterMajor;
            ManageR3.Checked          = newSettings.ManageR3;
            ButterMinors.Checked      = newSettings.UseButterMinor;
            ActivateFruits.Checked    = newSettings.ActivateFruits;
            BloodNumberThreshold.Text = newSettings.BloodNumberThreshold.ToString(CultureInfo.InvariantCulture);

            yggdrasilLoadoutBox.DataSource = null;
            yggdrasilLoadoutBox.DataSource = new BindingSource(Main.Settings.YggdrasilLoadout, null);

            priorityBoostBox.DataSource = null;
            priorityBoostBox.DataSource = new BindingSource(Main.Settings.PriorityBoosts, null);

            blacklistBox.DataSource = null;
            blacklistBox.DataSource = new BindingSource(Main.Settings.BoostBlacklist, null);

            titanLoadout.DataSource = null;
            titanLoadout.DataSource = new BindingSource(Main.Settings.TitanLoadout, null);

            GoldLoadout.DataSource = null;
            GoldLoadout.DataSource = new BindingSource(Main.Settings.GoldDropLoadout, null);
            Refresh();
            _initializing = false;
        }
Beispiel #6
0
        internal void UpdateFromSettings(SavedSettings newSettings)
        {
            _initializing                      = true;
            AutoDailySpin.Checked              = newSettings.AutoSpin;
            AutoFightBosses.Checked            = newSettings.AutoFight;
            AutoITOPOD.Checked                 = newSettings.AutoQuestITOPOD;
            AutoMoneyPit.Checked               = newSettings.AutoMoneyPit;
            MoneyPitThreshold.Text             = $"{newSettings.MoneyPitThreshold:#.##E+00}";
            ManageEnergy.Checked               = newSettings.ManageEnergy;
            ManageMagic.Checked                = newSettings.ManageMagic;
            ManageGear.Checked                 = newSettings.ManageGear;
            ManageDiggers.Checked              = newSettings.ManageDiggers;
            ManageWandoos.Checked              = newSettings.ManageWandoos;
            AutoRebirth.Checked                = newSettings.AutoRebirth;
            ManageYggdrasil.Checked            = newSettings.ManageYggdrasil;
            YggdrasilSwap.Checked              = newSettings.SwapYggdrasilLoadouts;
            ManageInventory.Checked            = newSettings.ManageInventory;
            ManageBoostConvert.Checked         = newSettings.AutoConvertBoosts;
            SwapTitanLoadout.Checked           = newSettings.SwapTitanLoadouts;
            HighestTitanDropdown.SelectedIndex = newSettings.HighestAKZone;
            BossesOnly.Checked                 = newSettings.SnipeBossOnly;
            PrecastBuffs.Checked               = newSettings.PrecastBuffs;
            RecoverHealth.Checked              = newSettings.RecoverHealth;
            FastCombat.Checked                 = newSettings.FastCombat;
            CombatMode.SelectedIndex           = newSettings.CombatMode;
            SetSnipeZone(CombatTargetZone, newSettings.SnipeZone);
            AllowFallthrough.Checked = newSettings.AllowZoneFallback;
            SetOtherZone(GoldLoadoutZone, newSettings.GoldZone);
            SetOtherZone(InitialGoldTarget, newSettings.InitialGoldZone);
            QuestCombatMode.SelectedIndex = newSettings.QuestCombatMode;
            ManageQuests.Checked          = newSettings.AutoQuest;
            AllowMajor.Checked            = newSettings.AllowMajorQuests;
            AbandonMinors.Checked         = newSettings.AbandonMinors;
            AbandonMinorThreshold.Value   = newSettings.MinorAbandonThreshold;
            QuestFastCombat.Checked       = newSettings.QuestFastCombat;
            UseGoldLoadout.Checked        = newSettings.NextGoldSwap;
            AutoSpellSwap.Checked         = newSettings.AutoSpellSwap;
            SpaghettiCap.Value            = newSettings.SpaghettiThreshold;
            CounterfeitCap.Value          = newSettings.CounterfeitThreshold;
            AutoBuyEM.Checked             = newSettings.AutoBuyEM;
            MasterEnable.Checked          = newSettings.GlobalEnabled;
            CombatActive.Checked          = newSettings.CombatEnabled;
            ManualMinor.Checked           = newSettings.ManualMinors;
            ButterMajors.Checked          = newSettings.UseButterMajor;
            ManageR3.Checked           = newSettings.ManageR3;
            ButterMinors.Checked       = newSettings.UseButterMinor;
            ActivateFruits.Checked     = newSettings.ActivateFruits;
            BeastMode.Checked          = newSettings.BeastMode;
            CubePriority.SelectedIndex = newSettings.CubePriority;
            BloodNumberThreshold.Text  = $"{newSettings.BloodNumberThreshold:#.##E+00}";


            var temp = newSettings.YggdrasilLoadout.ToDictionary(x => x, x => Main.Character.itemInfo.itemName[x]);

            if (temp.Count > 0)
            {
                yggdrasilLoadoutBox.DataSource    = null;
                yggdrasilLoadoutBox.DataSource    = new BindingSource(temp, null);
                yggdrasilLoadoutBox.ValueMember   = "Key";
                yggdrasilLoadoutBox.DisplayMember = "Value";
            }
            else
            {
                yggdrasilLoadoutBox.Items.Clear();
            }


            temp = newSettings.PriorityBoosts.ToDictionary(x => x, x => Main.Character.itemInfo.itemName[x]);
            if (temp.Count > 0)
            {
                priorityBoostBox.DataSource    = null;
                priorityBoostBox.DataSource    = new BindingSource(temp, null);
                priorityBoostBox.ValueMember   = "Key";
                priorityBoostBox.DisplayMember = "Value";
            }
            else
            {
                priorityBoostBox.Items.Clear();
            }

            temp = newSettings.BoostBlacklist.ToDictionary(x => x, x => Main.Character.itemInfo.itemName[x]);
            if (temp.Count > 0)
            {
                blacklistBox.DataSource    = null;
                blacklistBox.DataSource    = new BindingSource(temp, null);
                blacklistBox.ValueMember   = "Key";
                blacklistBox.DisplayMember = "Value";
            }
            else
            {
                blacklistBox.Items.Clear();
            }



            temp = newSettings.TitanLoadout.ToDictionary(x => x, x => Main.Character.itemInfo.itemName[x]);
            if (temp.Count > 0)
            {
                titanLoadout.DataSource    = null;
                titanLoadout.DataSource    = new BindingSource(temp, null);
                titanLoadout.ValueMember   = "Key";
                titanLoadout.DisplayMember = "Value";
            }
            else
            {
                titanLoadout.Items.Clear();
            }



            temp = newSettings.GoldDropLoadout.ToDictionary(x => x, x => Main.Character.itemInfo.itemName[x]);
            if (temp.Count > 0)
            {
                GoldLoadout.DataSource    = null;
                GoldLoadout.DataSource    = new BindingSource(temp, null);
                GoldLoadout.ValueMember   = "Key";
                GoldLoadout.DisplayMember = "Value";
            }
            else
            {
                GoldLoadout.Items.Clear();
            }


            temp = newSettings.WishPriorities.ToDictionary(x => x, x => Main.Character.wishesController.properties[x].wishName);
            if (temp.Count > 0)
            {
                WishPriority.DataSource    = null;
                WishPriority.DataSource    = new BindingSource(temp, null);
                WishPriority.ValueMember   = "Key";
                WishPriority.DisplayMember = "Value";
            }
            else
            {
                WishPriority.Items.Clear();
            }

            Refresh();
            _initializing = false;
        }
Beispiel #7
0
        internal void MassUpdate(SavedSettings other)
        {
            _priorityBoosts = other.PriorityBoosts;
            _boostBlacklist = other.BoostBlacklist;

            _yggdrasilLoadout      = other.YggdrasilLoadout;
            _swapYggdrasilLoadouts = other.SwapYggdrasilLoadouts;

            _highestAkZone     = other.HighestAKZone;
            _swapTitanLoadouts = other.SwapTitanLoadouts;
            _titanLoadout      = other.TitanLoadout;

            _manageDiggers     = other.ManageDiggers;
            _manageYggdrasil   = other.ManageYggdrasil;
            _manageEnergy      = other.ManageEnergy;
            _manageMagic       = other.ManageMagic;
            _manageInventory   = other.ManageInventory;
            _manageGear        = other.ManageGear;
            _manageWandoos     = other.ManageWandoos;
            _autoConvertBoosts = other.AutoConvertBoosts;

            _snipeZone    = other.SnipeZone;
            _fastCombat   = other.FastCombat;
            _precastBuffs = other.PrecastBuffs;

            _autoFight = other.AutoFight;

            _autoQuest        = other.AutoQuest;
            _autoQuestItopod  = other.AutoQuestITOPOD;
            _allowMajorQuests = other.AllowMajorQuests;

            _goldDropLoadout = other.GoldDropLoadout;

            _autoMoneyPit      = other.AutoMoneyPit;
            _autoSpin          = other.AutoSpin;
            _moneyPitLoadout   = other.MoneyPitLoadout;
            _moneyPitThreshold = other.MoneyPitThreshold;

            _autoRebirth     = other.AutoRebirth;
            _manageWandoos   = other.ManageWandoos;
            _initialGoldZone = other.InitialGoldZone;
            _nextGoldSwap    = other.NextGoldSwap;
            _goldZone        = other.GoldZone;

            _combatMode            = other.CombatMode;
            _recoverHealth         = other.RecoverHealth;
            _snipeBossOnly         = other.SnipeBossOnly;
            _allowZoneFallback     = other.AllowZoneFallback;
            _abandonMinors         = other.AbandonMinors;
            _minorAbandonThreshold = other.MinorAbandonThreshold;
            _questCombatMode       = other.QuestCombatMode;
            _questFastCombat       = other.QuestFastCombat;
            _autoSpellSwap         = other.AutoSpellSwap;
            _counterfeitThreshold  = other.CounterfeitThreshold;
            _spaghettiThreshold    = other.SpaghettiThreshold;
            _autoBuyEm             = other.AutoBuyEM;
            _bloodNumberThreshold  = other.BloodNumberThreshold;
            _quickDiggers          = other.QuickDiggers;
            _quickLoadout          = other.QuickLoadout;
            _combatEnabled         = other.CombatEnabled;
            _globalEnabled         = other.GlobalEnabled;
            _useButterMajor        = other.UseButterMajor;
            _useButterMinor        = other.UseButterMinor;
            _manualMinors          = other.ManualMinors;
            _manageR3       = other.ManageR3;
            _activateFruits = other.ActivateFruits;
            _wishPriorities = other.WishPriorities;
            _beastMode      = other.BeastMode;
            _cubePriority   = other.CubePriority;
        }