Exemplo n.º 1
0
        private void load(Storage storage, FrameworkConfigManager frameworkConfig)
        {
            Resources.AddStore(new DllResourceStore(@"osu.Game.Tournament.dll"));

            Fonts.AddStore(new GlyphStore(Resources, @"Resources/Fonts/Aquatico-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Resources/Fonts/Aquatico-Light"));

            Textures.AddStore(new TextureLoaderStore(new ResourceStore <byte[]>(new StorageBackedResourceStore(storage))));

            this.storage = storage;

            windowSize = frameworkConfig.GetBindable <Size>(FrameworkSetting.WindowedSize);

            readBracket();

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

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

            Add(new OsuButton
            {
                Text    = "Save Changes",
                Width   = 140,
                Height  = 50,
                Depth   = float.MinValue,
                Anchor  = Anchor.BottomRight,
                Origin  = Anchor.BottomRight,
                Padding = new MarginPadding(10),
                Action  = SaveChanges,
            });
        }
Exemplo n.º 2
0
 private void load(Storage store)
 {
     Resources.AddStore(new DllResourceStore(@"GamesToGo.Game.dll"));
     Resources.AddStore(new DllResourceStore(@"GamesToGo.Editor.dll"));
     Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
     Textures.AddStore(Host.CreateTextureLoaderStore(new StorageBackedResourceStore(store)));
     Textures.AddExtension("");
 }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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));
        }
Exemplo n.º 6
0
        private void load()
        {
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(CubismResources.ResourceAssembly), @"Resources"));
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(typeof(VignetteGame).Assembly), @"Resources"));

            dependencies.Cache(LocalConfig);
            dependencies.Cache(Files);

            var cubismAssets = new CubismAssetStore(new NamespacedResourceStore <byte[]>(Resources, @"Live2D"));

            dependencies.Cache(cubismAssets);

            var userCubismAssets = new UserCubismAssetStore(Files);

            dependencies.Cache(userCubismAssets);

            Textures.AddStore(new TextureLoaderStore(Files.Store));

            var cameraManager = new CameraManager(Host.UpdateThread)
            {
                EventScheduler = Scheduler
            };

            dependencies.Cache(cameraManager);

            dependencies.CacheAs <IReadOnlyList <Importer> >(importers);

            // Temporarily read the models in the output directory. We'll have a better support for embedded resources at a later date.
            dependencies.Cache(FaceRecognition.Create($"{RuntimeInfo.StartupDirectory}/models"));

            AddFont(Resources, @"Fonts/NotoExtraCond");
            AddFont(Resources, @"Fonts/NotoExtraCond-Italic");
            AddFont(Resources, @"Fonts/NotoExtraCond-Light");
            AddFont(Resources, @"Fonts/NotoExtraCond-LightItalic");
            AddFont(Resources, @"Fonts/NotoExtraCond-Bold");
            AddFont(Resources, @"Fonts/NotoExtraCond-BoldItalic");
            AddFont(Resources, @"Fonts/NotoExtraCond-Medium");
            AddFont(Resources, @"Fonts/NotoExtraCond-MediumItalic");
            AddFont(Resources, @"Fonts/NotoExtraCond-Black");
            AddFont(Resources, @"Fonts/NotoExtraCond-BlackItalic");
        }
Exemplo n.º 7
0
        private void load()
        {
            Resources.AddStore(new DllResourceStore(@"GamesToGo.Game.dll"));
            Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
            Textures.AddStore(Host.CreateTextureLoaderStore(new StorageBackedResourceStore(store)));
            dependencies.CacheAs(this);
            base.Content.Add(content = new DrawSizePreservingFillContainer
            {
                TargetDrawSize = new Vector2(1080, 1920),
                Strategy       = DrawSizePreservationStrategy.Minimum,
            });
            content.Add(stack = new ScreenStack
            {
                RelativeSizeAxes = Axes.Both,
                Depth            = 0,
            });
            content.Add(api = new APIController());
            dependencies.Cache(api);
            dependencies.Cache(stack);
            content.Add(infoOverlay = new SplashInfoOverlay(SplashPosition.Top, 150, 60)
            {
                Depth = -1
            });
            dependencies.Cache(infoOverlay);

            Invitations.BindCollectionChanged((_, e) =>
            {
                switch (e.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    infoOverlay.Show(@$ "{e.NewItems.Cast<Invitation>().Last().Sender.Username} te ha invitado a jugar", Colour4.LightBlue);

                    break;

                case NotifyCollectionChangedAction.Remove:
                    break;
                }
            });
        }
Exemplo n.º 8
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)
                        }
                    }
                },
            });
        }
Exemplo n.º 9
0
        private void load(FrameworkConfigManager config, Storage store) //Esta es la manera en la que se acceden a elementos de las dependencias, su tipo y un nombre local.
        {
            Host.Window.Title = Name;
            Resources.AddStore(new DllResourceStore(@"GamesToGo.Editor.dll"));
            Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
            Textures.AddStore(Host.CreateTextureLoaderStore(new StorageBackedResourceStore(store)));
            Textures.AddExtension("");
            dependencies.CacheAs(dbContext = new Context(Host.Storage.GetDatabaseConnectionString(Name)));

            previewEvents();
            previewActions();
            previewArguments();

            try
            {
                dbContext.Database.Migrate();
            }
            catch
            {
                Host.Storage.DeleteDatabase(Name);

                try
                {
                    dbContext.Database.Migrate();
                }
                catch
                {
                    //Can't get a database going, bail!
                    Exit();
                }

                store.DeleteDirectory("files");
            }
            finally
            {
                foreach (var _ in dbContext.Projects)
                {
                }
                foreach (var _ in dbContext.Files)
                {
                }
                foreach (var _ in dbContext.Relations)
                {
                }
            }

            //Ventana sin bordes, sin requerir modo exclusivo.
            config.GetBindable <WindowMode>(FrameworkSetting.WindowMode).Value             = WindowMode.Borderless;
            config.GetBindable <FrameSync>(FrameworkSetting.FrameSync).Value               = FrameSync.VSync;
            config.GetBindable <ConfineMouseMode>(FrameworkSetting.ConfineMouseMode).Value = ConfineMouseMode.Never;

            //Para agregar un elemento a las dependencias se agrega a su caché. En este caso se agrega el "juego" como un GamesToGoEditor
            dependencies.CacheAs(this);

            base.Content.Add(content = new DrawSizePreservingFillContainer {
                TargetDrawSize = new Vector2(1920, 1080)
            });

            //Cargamos y agregamos nuestra pila de pantallas a la ventana.
            content.Add(stack = new ScreenStack {
                RelativeSizeAxes = Axes.Both, Depth = 0
            });

            content.Add(api = new APIController());

            dependencies.Cache(api);

            content.Add(splashOverlay = new SplashInfoOverlay(SplashPosition.Bottom, 80, 30)
            {
                Depth = -2
            });

            dependencies.Cache(splashOverlay);

            content.Add(imageFinder = new ImageFinderOverlay {
                Depth = -1
            });

            dependencies.Cache(imageFinder);

            content.Add(optionsOverlay = new MultipleOptionOverlay {
                Depth = -3
            });

            dependencies.Cache(optionsOverlay);
        }
Exemplo n.º 10
0
        private void load(Storage storage, FrameworkConfigManager frameworkConfig)
        {
            Resources.AddStore(new DllResourceStore(@"osu.Game.Tournament.dll"));

            AddFont(Resources, @"Resources/Fonts/Aquatico-Regular");
            AddFont(Resources, @"Resources/Fonts/Aquatico-Light");

            Textures.AddStore(new TextureLoaderStore(new ResourceStore <byte[]>(new StorageBackedResourceStore(storage))));

            this.storage = storage;

            windowSize = frameworkConfig.GetBindable <Size>(FrameworkSetting.WindowedSize);
            windowSize.BindValueChanged(size => ScheduleAfterChildren(() =>
            {
                var minWidth = (int)(size.NewValue.Height / 9f * 16 + 400);

                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 TourneyButton
                {
                    Text    = "Save Changes",
                    Width   = 140,
                    Height  = 50,
                    Depth   = float.MinValue,
                    Anchor  = Anchor.BottomRight,
                    Origin  = Anchor.BottomRight,
                    Padding = new MarginPadding(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 OsuSpriteText
                        {
                            Text    = "Please make the window wider",
                            Font    = OsuFont.Default.With(weight: "bold"),
                            Colour  = Color4.White,
                            Padding = new MarginPadding(20)
                        }
                    }
                },
            });
        }