private static void EnableListOnly(UIMouseEvent evt, UIElement listeningElement) { UIModPackItem modListItem = (UIModPackItem)listeningElement.Parent; foreach (var item in UIModPacks.mods) { ModLoader.DisableMod(item); } foreach (string modname in modListItem.mods) { if (UIModPacks.mods.Contains(modname)) { ModLoader.EnableMod(modname); } } Main.menuMode = Interface.reloadModsID; // should reload, which should refresh enabled counts if (modListItem.numModsMissing > 0) { string missing = "The following mods were not found:\n"; for (int i = 0; i < modListItem.mods.Length; i++) { if (modListItem.modMissing[i]) { missing += modListItem.mods[i] + "\n"; } } Interface.infoMessage.SetMessage(missing); Interface.infoMessage.SetGotoMenu(Interface.reloadModsID); Main.menuMode = Interface.infoMessageID; } }
private static void EnableListOnly(UIMouseEvent evt, UIElement listeningElement) { UIModPackItem modListItem = (UIModPackItem)listeningElement.Parent; foreach (var item in UIModPacks.mods) { ModLoader.DisableMod(item); } foreach (string modname in modListItem.mods) { if (UIModPacks.mods.Contains(modname)) { ModLoader.EnableMod(modname); } } Main.menuMode = Interface.reloadModsID; // should reload, which should refresh enabled counts if (modListItem.numModsMissing > 0) { string missing = ""; for (int i = 0; i < modListItem.mods.Length; i++) { if (modListItem.modMissing[i]) { missing += modListItem.mods[i] + "\n"; } } Interface.infoMessage.Show(Language.GetTextValue("tModLoader.ModPackModsMissing", missing), Interface.reloadModsID); } }
private void ExitAndDisableAll(UIMouseEvent evt, UIElement listeningElement) { foreach (var mod in ModLoader.EnabledMods) { ModLoader.DisableMod(mod); } Environment.Exit(0); }
private void ExitAndDisableAll(UIMouseEvent evt, UIElement listeningElement) { var enabledMods = new HashSet <string>(ModLoader.EnabledMods); foreach (var mod in enabledMods) { ModLoader.DisableMod(mod); } Environment.Exit(0); }