Beispiel #1
0
        public void InitFromPath()
        {
            if (string.IsNullOrEmpty(DataPath))
            {
                throw new InvalidOperationException("Cannot initialize file system without a path");
            }

            if (File.Exists(Path.Combine(DataPath, ".build.info")))
            {
                Files.Terrain.AdtFactory.Instance.Version  = FileDataVersion.Warlords;
                Files.Models.ModelFactory.Instance.Version = FileDataVersion.Warlords;
                Files.Sky.SkyManager.InitVersion(FileDataVersion.Warlords);
                Version = FileDataVersion.Warlords;

                var mgr = new CASC.FileManager();
                mgr.LoadComplete += () =>
                {
                    Storage.DbcStorage.Initialize();
                    Storage.DbcStorage.BuildCache();
                    if (LoadComplete != null)
                    {
                        LoadComplete();
                    }
                };

                Provider = mgr;
                mgr.Initialize(DataPath);
            }
            else
            {
                InitMpq();
            }

            UI.ThumbnailCache.Reload(); //Load thumbnails of models
        }
Beispiel #2
0
        public void InitFromPath()
        {
            if(string.IsNullOrEmpty(DataPath))
                throw new InvalidOperationException("Cannot initialize file system without a path");

            if (File.Exists(Path.Combine(DataPath, ".build.info")))
            {
                Files.Terrain.AdtFactory.Instance.Version = FileDataVersion.Warlords;
                Files.Models.ModelFactory.Instance.Version = FileDataVersion.Warlords;
                Files.Sky.SkyManager.InitVersion(FileDataVersion.Warlords);
                Version = FileDataVersion.Warlords;

                var mgr = new CASC.FileManager();
                mgr.LoadComplete += () =>
                {
                    Initialized = true;
                    if (LoadComplete != null)
                        LoadComplete();
                };

                Provider = mgr;
                mgr.Initialize(DataPath);
            }
            else
                InitMpq();
        }