Esempio n. 1
0
        private void LoadModList()
        {
            ModList.Clear();

            foreach (var mod in LoadService.GetListOfMods())
            {
                ModList.Add(mod);
            }

            UpdateListBox();
        }
        public void LoadModList()
        {
            ModList.Clear();

            foreach (var mod in LoadService.GetListOfMods())
            {
                ModList.Add(mod);
            }

            UpdateListView();
        }
Esempio n. 3
0
        public void LoadModList()
        {
            ModList.Clear();

            foreach (var mod in LoadService.GetListOfMods())
            {
                ModList.Add(new ModFolder(mod));
            }

            UpdateListBox();
        }
Esempio n. 4
0
        private static void Main(string[] args)
        {
            ///Booting Mods.
            ///
            LoadService.Setup();
            var mods = LoadService.GetListOfMods();

            var rules = RuleService.GetRules();

            File.WriteAllText("rules.json", JsonConvert.SerializeObject(rules));
            var orderedList = RuleService.OrderMods(mods);
        }
Esempio n. 5
0
 public IActionResult Get() => Ok(LoadService.GetListOfMods());
Esempio n. 6
0
        public static void conflict()
        {
            var stopwatch = Stopwatch.StartNew();

            var filename        = "changes.json";
            var detailsFilename = "detail.json";

            //if (args.Length > 0)
            //{
            //    filename = args[0];
            //    if (args.Length > 1)
            //        detailsFilename = args[1];

            //}
            ///Booting Mods.
            ///
            LoadService.Setup();

            var mods = LoadService.GetListOfMods();

            var orderedList = RuleService.OrderMods(mods);

            var changes = new Dictionary <string, List <Dictionary <string, string> > >();
            var cm      = new ConflictManager();

            var ordered      = mods.OrderBy(c => c.Order).ToList();
            var baseGameData = new GameData();

            foreach (var item in new string[6] {
                "gamedata.base",
                "Newwworld.mod",
                "Dialogue.mod",
                "Vitali.mod",
                "Nizu.mod",
                "rebirth.mod"
            })
            {
                cm.LoadMods(Path.Combine(LoadService.config.GamePath, "data", item), ModMode.BASE, baseGameData);
            }

            foreach (var mod in ordered)
            {
                cm.LoadMods(mod.FilePath, ModMode.ACTIVE, baseGameData);
            }

            baseGameData.resolveAllReferences();

            cm.LoadBaseChanges(baseGameData);

            baseGameData = null;

            foreach (var mod in ordered)
            {
                Console.WriteLine($"{mod.DisplayName} Loading...");
                var gd = new GameData();

                cm.LoadMods(mod.FilePath, ModMode.ACTIVE, gd);

                cm.ListOfGameData.Add(gd);
            }

            cm.LoadChanges();

            stopwatch.Stop();
            Console.WriteLine(stopwatch.ElapsedMilliseconds / 1000 + " Seconds Elapsed");

            if (!Directory.Exists("reports"))
            {
                Directory.CreateDirectory("reports");
            }

            Console.WriteLine("writing reports");
            var list = new Task[] {
                Task.Run(() => { File.WriteAllText(filename, JsonConvert.SerializeObject(cm.conflictIndex)); }),
                Task.Run(() => { File.WriteAllText(detailsFilename, JsonConvert.SerializeObject(cm.DetailIndex)); }),
                Task.Run(() => {
                    foreach (var item in cm.listOfTags)
                    {
                        File.WriteAllText($"reports/{item.Key}", JsonConvert.SerializeObject(item.Value.Select(c => c.ToString())));
                    }
                })
            };

            Task.WaitAll(list);
        }