TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ UpdateModPack()

static void Terraria.ModLoader.UI.UIModPackItem.UpdateModPack ( UIMouseEvent evt,
UIElement listeningElement )
inlinestaticprivate

Definition at line 681 of file UIModPackItem.cs.

682 {
684 UIModPacks.SaveModPack(modpack._filename);
685 if (modpack._filepath == ModOrganizer.ModPackActive)
686 {
687 ModLoader.DisableAllMods();
688 Logging.tML.Info((object)("Cleaning up removed tmods " + modpack._filename));
689 ModLoader.OnSuccessfulLoad = (Action)Delegate.Combine(ModLoader.OnSuccessfulLoad, (Action)delegate
690 {
691 foreach (string current in Directory.EnumerateFiles(UIModPacks.ModPackModsPath(modpack._filename), "*.tmod"))
692 {
693 if (!modpack._mods.Contains<string>(Path.GetFileNameWithoutExtension(current)))
694 {
695 File.Delete(current);
696 }
697 }
699 });
700 ModLoader.Reload();
701 }
702 else
703 {
704 foreach (string file in Directory.EnumerateFiles(UIModPacks.ModPackModsPath(modpack._filename), "*.tmod"))
705 {
706 if (!modpack._mods.Contains<string>(Path.GetFileNameWithoutExtension(file)))
707 {
708 File.Delete(file);
709 }
710 }
711 }
712 Interface.modPacksMenu.OnDeactivate();
713 Interface.modPacksMenu.OnActivate();
714 }
Responsible for sorting, dependency verification and organizing which mods to load.
static void EnableList(UIMouseEvent evt, UIElement listeningElement)
UIModPackItem(string name, string[] mods, bool legacy, IEnumerable< LocalMod > localMods)

References Terraria.ModLoader.UI.UIModPackItem.UIModPackItem(), Terraria.ModLoader.ModLoader.DisableAllMods(), Terraria.ModLoader.UI.UIModPackItem.EnableList(), Terraria.ModLoader.Core.ModOrganizer.ModPackActive, Terraria.ModLoader.UI.UIModPacks.ModPackModsPath(), Terraria.ModLoader.UI.Interface.modPacksMenu, Terraria.ModLoader.ModLoader.OnSuccessfulLoad, Terraria.ModLoader.ModLoader.Reload(), Terraria.ModLoader.UI.UIModPacks.SaveModPack(), and Terraria.ModLoader.Logging.tML.

Referenced by Terraria.ModLoader.UI.UIModPackItem.UIModPackItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: