public void Init()
        {
            RegistryKey key      = Registry.LocalMachine;
            RegistryKey keySteam = key.OpenSubKey("software\\wow6432Node\\Valve\\Steam", true);

            if (keySteam != null)
            {
                string steamPath      = keySteam.GetValue("InstallPath").ToString();
                string bannerlordPath = Path.Combine(steamPath, "steamapps\\common\\Mount & Blade II Bannerlord\\bin\\Win64_Shipping_Client\\TaleWorlds.MountAndBlade.Launcher.exe");
                if (File.Exists(bannerlordPath))
                {
                    bannerlordExePath = bannerlordPath;

                    string        bannerlordModulePath = Path.Combine(steamPath, "steamapps\\common\\Mount & Blade II Bannerlord\\Modules");
                    DirectoryInfo di = new DirectoryInfo(bannerlordModulePath);
                    foreach (var dii in di.EnumerateDirectories())
                    {
                        if (dii.EnumerateFiles().Where(o => o.Name == "SubModule.xml").Count() == 1)
                        {
                            MBModule        module;
                            var             moduleFile      = dii.EnumerateFiles().Where(o => o.Name == "SubModule.xml").FirstOrDefault();
                            XmlObjectLoader xmlObjectLoader = new XmlObjectLoader(moduleFile.FullName);
                            xmlObjectLoader.Load(out module);
                            if (module.Official != null && module.Official.value == "true")
                            {
                                MBBannerlordModule officalModule = new MBBannerlordModule(dii.FullName);
                                OfficialMods.Add(officalModule);
                            }
                        }
                    }
                }
            }
        }
示例#2
0
        public AMProject(string path)
        {
            this.path = path;
            DirectoryInfo di = new DirectoryInfo(path);

            Name             = di.Name;
            bannerlordModule = new MBBannerlordModule(path);
            ModuleName       = bannerlordModule.ModuleInfo.Name.value;
            Location         = path;
        }
示例#3
0
 public AMProject()
 {
     bannerlordModule = new MBBannerlordModule();
 }