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

◆ CommandLineModPackOverride()

static void Terraria.ModLoader.Core.ModOrganizer.CommandLineModPackOverride ( IEnumerable< LocalMod > mods)
inlinestaticprivate

Definition at line 405 of file ModOrganizer.cs.

406 {
408 {
409 return;
410 }
411 if (!commandLineModPack.EndsWith(".json"))
412 {
413 commandLineModPack += ".json";
414 }
416 try
417 {
418 Directory.CreateDirectory(UIModPacks.ModPacksDirectory);
419 Logging.ServerConsoleLine(Language.GetTextValue("tModLoader.LoadingSpecifiedModPack", commandLineModPack));
420 HashSet<string> modSet = JsonConvert.DeserializeObject<HashSet<string>>(File.ReadAllText(filePath));
421 foreach (LocalMod mod in mods)
422 {
423 mod.Enabled = modSet.Contains(mod.Name);
424 }
425 }
426 catch (Exception e)
427 {
428 throw new Exception((e is FileNotFoundException) ? Language.GetTextValue("tModLoader.ModPackDoesNotExist", filePath) : Language.GetTextValue("tModLoader.ModPackMalformed", commandLineModPack), e);
429 }
430 finally
431 {
432 commandLineModPack = null;
433 }
434 }
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12

References Terraria.ModLoader.Core.ModOrganizer.commandLineModPack, Terraria.Localization.Language.GetTextValue(), Terraria.ModLoader.UI.UIModPacks.ModPacksDirectory, Terraria.ModLoader.Core.LocalMod.Name, and Terraria.ModLoader.Logging.ServerConsoleLine().

Referenced by Terraria.ModLoader.Core.ModOrganizer.SelectAndSortMods().

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