Beispiel #1
0
        private void load(Storage baseStorage)
        {
            Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));

            dependencies.CacheAs <Storage>(storage = new TournamentStorage(baseStorage));
            dependencies.CacheAs(storage);

            dependencies.Cache(new TournamentVideoResourceStore(storage));

            Textures.AddStore(new TextureLoaderStore(new StorageBackedResourceStore(storage)));

            dependencies.CacheAs(new StableInfo(storage));

            Task.Run(readBracket);
        }
Beispiel #2
0
        private void load(Storage storage)
        {
            Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));

            dependencies.CacheAs(tournamentStorage = new TournamentStorage(storage));

            Textures.AddStore(new TextureLoaderStore(tournamentStorage));

            this.storage = storage;

            readBracket();

            ladder.CurrentMatch.Value = ladder.Matches.FirstOrDefault(p => p.Current.Value);

            dependencies.CacheAs <MatchIPCInfo>(ipc = new FileBasedIPC());
            Add(ipc);
        }
Beispiel #3
0
        private void load(Storage baseStorage)
        {
            AddInternal(initialisationText = new TournamentSpriteText
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Font   = OsuFont.Torus.With(size: 32),
            });

            Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));

            dependencies.CacheAs <Storage>(storage = new TournamentStorage(baseStorage));
            dependencies.CacheAs(storage);

            dependencies.Cache(new TournamentVideoResourceStore(storage));

            Textures.AddStore(new TextureLoaderStore(new StorageBackedResourceStore(storage)));

            dependencies.CacheAs(new StableInfo(storage));
        }
Beispiel #4
0
        private void load(Storage storage, FrameworkConfigManager frameworkConfig)
        {
            Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));

            dependencies.CacheAs(tournamentStorage = new TournamentStorage(storage));

            Textures.AddStore(new TextureLoaderStore(tournamentStorage));

            this.storage = storage;

            windowSize = frameworkConfig.GetBindable <Size>(FrameworkSetting.WindowedSize);
            windowSize.BindValueChanged(size => ScheduleAfterChildren(() =>
            {
                var minWidth = (int)(size.NewValue.Height / 768f * TournamentSceneManager.REQUIRED_WIDTH) - 1;

                heightWarning.Alpha = size.NewValue.Width < minWidth ? 1 : 0;
            }), true);

            readBracket();

            ladder.CurrentMatch.Value = ladder.Matches.FirstOrDefault(p => p.Current.Value);

            dependencies.CacheAs <MatchIPCInfo>(ipc = new FileBasedIPC());
            Add(ipc);

            AddRange(new[]
            {
                new Container
                {
                    CornerRadius = 10,
                    Depth        = float.MinValue,
                    Position     = new Vector2(5),
                    Masking      = true,
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.BottomRight,
                    Origin       = Anchor.BottomRight,
                    Children     = new Drawable[]
                    {
                        new Box
                        {
                            Colour           = OsuColour.Gray(0.2f),
                            RelativeSizeAxes = Axes.Both,
                        },
                        new TourneyButton
                        {
                            Text    = "Save Changes",
                            Width   = 140,
                            Height  = 50,
                            Padding = new MarginPadding
                            {
                                Top  = 10,
                                Left = 10,
                            },
                            Margin = new MarginPadding
                            {
                                Right  = 10,
                                Bottom = 10,
                            },
                            Action = SaveChanges,
                        },
                    }
                },
                heightWarning = new Container
                {
                    Masking      = true,
                    CornerRadius = 5,
                    Depth        = float.MinValue,
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    AutoSizeAxes = Axes.Both,
                    Children     = new Drawable[]
                    {
                        new Box
                        {
                            Colour           = Color4.Red,
                            RelativeSizeAxes = Axes.Both,
                        },
                        new TournamentSpriteText
                        {
                            Text    = "Please make the window wider",
                            Font    = OsuFont.Torus.With(weight: FontWeight.Bold),
                            Colour  = Color4.White,
                            Padding = new MarginPadding(20)
                        }
                    }
                },
            });
        }