Exemplo n.º 1
0
        public void OnShow()
        {
            var mapId  = WorldFrame.Instance.MapManager.MapId;
            var mapRow = Storage.DbcStorage.Map.GetRowById(mapId);

            if (mapRow == null)
            {
                WorldFrame.Instance.State = AppState.MapSelect;
                return;
            }

            var loadScreenPath = "Interface\\Glues\\loading.blp";
            var loadEntry      = mapRow.GetInt32(Storage.MapFormatGuess.FieldMapLoadingScreen);

            if (loadEntry != 0)
            {
                var loadRow = Storage.DbcStorage.LoadingScreen.GetRowById(loadEntry);
                if (loadRow != null)
                {
                    var path = loadRow.GetString(Storage.MapFormatGuess.FieldLoadingScreenPath);
                    mWidescreen = false;

                    if (string.IsNullOrEmpty(path) == false)
                    {
                        if (Storage.MapFormatGuess.FieldLoadingScreenHasWidescreen >= 0 && loadRow.GetInt32(Storage.MapFormatGuess.FieldLoadingScreenHasWidescreen) == 1)
                        {
                            var widePath = path.ToUpperInvariant().Replace(".BLP", "WIDE.BLP");
                            if (IO.FileManager.Instance.Provider.Exists(widePath))
                            {
                                path        = widePath;
                                mWidescreen = true;
                            }
                        }

                        loadScreenPath = path;
                    }
                }
            }

            if (mLoadingImage != null)
            {
                mLoadingImage.Dispose();
            }
            mLoadingImage = new TextureBitmap();
            mLoadingImage.LoadComplete += ImageLoaded;
            mLoadingImage.LoadFromFile(loadScreenPath);

            if (mLoadingBarBackground == null)
            {
                mLoadingBarBackground = new TextureBitmap();
                mLoadingBarBackground.LoadFromFile(@"Interface\Glues\LoadingBar\Loading-BarBorder.blp");
                mLoadingBarFill = new TextureBitmap();
                mLoadingBarFill.LoadFromFile(@"Interface\Glues\LoadingBar\Loading-BarFill.blp");
            }
        }
Exemplo n.º 2
0
        public void OnShow()
        {
            var mapId = WorldFrame.Instance.MapManager.MapId;
            var mapRow = Storage.DbcStorage.Map.GetRowById(mapId);
            if(mapRow == null)
            {
                WorldFrame.Instance.State = AppState.MapSelect;
                return;
            }

            var loadScreenPath = "Interface\\Glues\\loading.blp";
            var loadEntry = mapRow.GetInt32(Storage.MapFormatGuess.FieldMapLoadingScreen);
            if(loadEntry != 0)
            {
                var loadRow = Storage.DbcStorage.LoadingScreen.GetRowById(loadEntry);
                if(loadRow != null)
                {
                    var path = loadRow.GetString(Storage.MapFormatGuess.FieldLoadingScreenPath);
                    mWidescreen = false;

                    if (string.IsNullOrEmpty(path) == false)
                    {
                        if (Storage.MapFormatGuess.FieldLoadingScreenHasWidescreen >= 0 && loadRow.GetInt32(Storage.MapFormatGuess.FieldLoadingScreenHasWidescreen) == 1)
                        {
                            var widePath = path.ToUpperInvariant().Replace(".BLP", "WIDE.BLP");
                            if (IO.FileManager.Instance.Provider.Exists(widePath))
                            {
                                path = widePath;
                                mWidescreen = true;
                            }
                        }

                        loadScreenPath = path;
                    }
                }
            }

            if (mLoadingImage != null)
                mLoadingImage.Dispose();
            mLoadingImage = new TextureBitmap();
            mLoadingImage.LoadComplete += ImageLoaded;
            mLoadingImage.LoadFromFile(loadScreenPath);

            if(mLoadingBarBackground == null)
            {
                mLoadingBarBackground = new TextureBitmap();
                mLoadingBarBackground.LoadFromFile(@"Interface\Glues\LoadingBar\Loading-BarBorder.blp");
                mLoadingBarFill = new TextureBitmap();
                mLoadingBarFill.LoadFromFile(@"Interface\Glues\LoadingBar\Loading-BarFill.blp");
            }
        }