Ejemplo n.º 1
0
        protected override void Load(BaseGame game)
        {
            base.Load(game);

            OszArchiveReader.Register();
            Beatmaps = new BeatmapDatabase(Host.Storage, Host);

            //this completely overrides the framework default. will need to change once we make a proper FontStore.
            Fonts = new TextureStore()
            {
                ScaleAdjust = 0.01f
            };

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-RegularItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBoldItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Bold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BoldItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Light"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-LightItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));

            API = new APIAccess()
            {
                Username = Config.Get <string>(OsuConfig.Username),
                Password = Config.Get <string>(OsuConfig.Password),
                Token    = Config.Get <string>(OsuConfig.Token)
            };
        }
Ejemplo n.º 2
0
        private void load()
        {
            Dependencies.Cache(this);
            Dependencies.Cache(LocalConfig);

            SQLiteConnection connection = Host.Storage.GetDatabase(@"client");

            Dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection));
            Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host));
            Dependencies.Cache(ScoreDatabase   = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase));
            Dependencies.Cache(new OsuColour());

            //this completely overrides the framework default. will need to change once we make a proper FontStore.
            Dependencies.Cache(Fonts = new FontStore {
                ScaleAdjust = 100
            }, true);

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-Basic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-Hangul"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-CJK-Basic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-CJK-Compatibility"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-RegularItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBoldItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Bold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BoldItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Light"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-LightItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));

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

            var defaultBeatmap = new DummyWorkingBeatmap(this);

            Beatmap = new NonNullableBindable <WorkingBeatmap>(defaultBeatmap);
            BeatmapDatabase.DefaultBeatmap = defaultBeatmap;

            OszArchiveReader.Register();

            Dependencies.Cache(API = new APIAccess
            {
                Username = LocalConfig.Get <string>(OsuSetting.Username),
                Token    = LocalConfig.Get <string>(OsuSetting.Token)
            });

            API.Register(this);
        }
Ejemplo n.º 3
0
        private void load()
        {
            Dependencies.Cache(this);
            Dependencies.Cache(LocalConfig);
            Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, Host));
            Dependencies.Cache(ScoreDatabase   = new ScoreDatabase(Host.Storage, Host, BeatmapDatabase));
            Dependencies.Cache(new OsuColour());

            //this completely overrides the framework default. will need to change once we make a proper FontStore.
            Dependencies.Cache(Fonts = new FontStore {
                ScaleAdjust = 100
            }, true);

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-RegularItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBoldItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Bold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BoldItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Light"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-LightItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Venera"));

            OszArchiveReader.Register();

            Dependencies.Cache(API = new APIAccess
            {
                Username = LocalConfig.Get <string>(OsuConfig.Username),
                Token    = LocalConfig.Get <string>(OsuConfig.Token)
            });

            API.Register(this);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            LegacyFilesystemReader.Register();
            OszArchiveReader.Register();

            using (var host = Host.GetSuitableHost(@"osu", true))
            {
                if (!host.IsPrimaryInstance)
                {
                    Console.WriteLine("Not launching, there is already an instance of the osu host running");
                    return;
                }

                using (var appController = new AppController(args, host))
                {
                    var Application = SelectApplication(args);

                    Application(args, host, appController.Dependencies);
                }
            }
        }
Ejemplo n.º 5
0
 public void SetUp()
 {
     OszArchiveReader.Register();
     Ruleset.Register(new OsuRuleset());
 }
Ejemplo n.º 6
0
 public void SetUp()
 {
     OszArchiveReader.Register();
 }
Ejemplo n.º 7
0
        private void load()
        {
            dependencies.Cache(this);
            dependencies.Cache(LocalConfig);

            SQLiteConnection connection = Host.Storage.GetDatabase(@"client");

            dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection));
            dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host));
            dependencies.Cache(ScoreDatabase   = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase));
            dependencies.Cache(new OsuColour());

            //this completely overrides the framework default. will need to change once we make a proper FontStore.
            dependencies.Cache(Fonts = new FontStore {
                ScaleAdjust = 100
            }, true);

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Medium"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-MediumItalic"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-Basic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-Hangul"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-CJK-Basic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Noto-CJK-Compatibility"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-RegularItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-SemiBoldItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Bold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BoldItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Light"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-LightItalic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-Black"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic"));

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

            var defaultBeatmap = new DummyWorkingBeatmap(this);

            Beatmap = new NonNullableBindable <WorkingBeatmap>(defaultBeatmap);
            BeatmapDatabase.DefaultBeatmap = defaultBeatmap;

            OszArchiveReader.Register();

            dependencies.Cache(API = new APIAccess
            {
                Username = LocalConfig.Get <string>(OsuSetting.Username),
                Token    = LocalConfig.Get <string>(OsuSetting.Token)
            });

            Beatmap.ValueChanged += b =>
            {
                // compare to last baetmap as sometimes the two may share a track representation (optimisation, see WorkingBeatmap.TransferTo)
                if (lastBeatmap?.Track != b.Track)
                {
                    // this disposal is done to stop the audio track.
                    // it may not be exactly what we want for cases beatmaps are reused, as it will
                    // trigger a fresh load of contained resources.
                    lastBeatmap?.Dispose();

                    Audio.Track.AddItem(b.Track);
                }

                lastBeatmap = b;
            };

            API.Register(this);
        }