コード例 #1
0
        public static void LoadAll()
        {
            if (OnStartedLoadingMods != null)
            {
                OnStartedLoadingMods();
            }

            if (Directory.Exists(ModsDirectory))
            {
                foreach (var ModPath in Directory.GetDirectories(ModsDirectory))
                {
                    TitanfallMod newMod       = new TitanfallMod(ModPath);
                    string       modDirectory = System.IO.Path.GetFileName(newMod.Directory);
                    if (!modDirectory.StartsWith("."))
                    {
                        LoadedMods.Add(newMod);
                        if (OnModLoaded != null)
                        {
                            OnModLoaded(newMod);
                        }
                    }
                }
            }

            if (OnFinishedLoadingMods != null)
            {
                OnFinishedLoadingMods();
            }
        }
コード例 #2
0
        public static void LoadAll()
        {
            if (OnStartedLoadingMods != null)
            {
                OnStartedLoadingMods();
            }

            string modsFullDirectory = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ModsDirectory);

            if (Directory.Exists(modsFullDirectory))
            {
                foreach (var modPath in Directory.GetDirectories(modsFullDirectory))
                {
                    TitanfallMod newMod       = new TitanfallMod(modPath);
                    string       modDirectory = Path.GetFileName(newMod.Directory);
                    if (!modDirectory.StartsWith("."))
                    {
                        LoadedMods.Add(newMod);
                        if (OnModLoaded != null)
                        {
                            OnModLoaded(newMod);
                        }
                    }
                }
            }

            if (OnFinishedLoadingMods != null)
            {
                OnFinishedLoadingMods();
            }
        }