Ejemplo n.º 1
0
        public override void Load()
        {
            base.Load();

            //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/Exo2.0-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));

            API = new APIAccess()
            {
                Username = Config.Get <string>(OsuConfig.Username),
                Password = Config.Get <string>(OsuConfig.Password),
                Token    = Config.Get <string>(OsuConfig.Token)
            };

            Add(new Drawable[]
            {
                ratioContainer = new RatioAdjust
                {
                    Children = new Drawable[]
                    {
                        Options = new Options(),
                        new OsuCursorContainer()
                    }
                }
            });
        }
Ejemplo n.º 2
0
        private void load(FrameworkConfigManager config)
        {
            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(@"osu.Framework.dll"), @"Resources"));

            Textures = new TextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
            dependencies.Cache(Textures);

            var tracks = new ResourceStore <byte[]>();

            tracks.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Tracks"));
            tracks.AddStore(new OnlineStore());

            var samples = new ResourceStore <byte[]>();

            samples.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Samples"));
            samples.AddStore(new OnlineStore());

            Audio = new AudioManager(Host.AudioThread, tracks, samples)
            {
                EventScheduler = Scheduler
            };
            dependencies.Cache(Audio);

            dependencies.CacheAs(Audio.Tracks);
            dependencies.CacheAs(Audio.Samples);

            // attach our bindables to the audio subsystem.
            config.BindWith(FrameworkSetting.AudioDevice, Audio.AudioDevice);
            config.BindWith(FrameworkSetting.VolumeUniversal, Audio.Volume);
            config.BindWith(FrameworkSetting.VolumeEffect, Audio.VolumeSample);
            config.BindWith(FrameworkSetting.VolumeMusic, Audio.VolumeTrack);

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));
            dependencies.Cache(Shaders);

            var cacheStorage = Host.Storage.GetStorageForDirectory(Path.Combine("cache", "fonts"));

            // base store is for user fonts
            Fonts = new FontStore(useAtlas: true, cacheStorage: cacheStorage);

            // nested store for framework provided fonts.
            // note that currently this means there could be two async font load operations.
            Fonts.AddStore(localFonts = new FontStore(useAtlas: false));

            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-Bold"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-Italic"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-BoldItalic"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Solid"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Brands"));

            dependencies.Cache(Fonts);

            Localisation = new LocalisationManager(config);
            dependencies.Cache(Localisation);
        }
Ejemplo n.º 3
0
        private void load(FrameworkConfigManager config)
        {
            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(@"osu.Framework.dll"), @"Resources"));
            Resources.AddStore(new DllResourceStore(MainResourceFile));

            Textures = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(new RawTextureLoaderStore(new OnlineStore()));
            Dependencies.Cache(Textures);

            Audio = Dependencies.Cache(new AudioManager(
                                           new NamespacedResourceStore <byte[]>(Resources, @"Tracks"),
                                           new NamespacedResourceStore <byte[]>(Resources, @"Samples"))
            {
                EventScheduler = Scheduler
            });

            Host.RegisterThread(Audio.Thread);

            //attach our bindables to the audio subsystem.
            config.BindWith(FrameworkSetting.AudioDevice, Audio.AudioDevice);
            config.BindWith(FrameworkSetting.VolumeUniversal, Audio.Volume);
            config.BindWith(FrameworkSetting.VolumeEffect, Audio.VolumeSample);
            config.BindWith(FrameworkSetting.VolumeMusic, Audio.VolumeTrack);

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));
            Dependencies.Cache(Shaders);

            Fonts = new FontStore(new GlyphStore(Resources, @"Fonts/OpenSans"))
            {
                ScaleAdjust = 100
            };
            Dependencies.Cache(Fonts);
        }
Ejemplo n.º 4
0
        protected override void Load(BaseGame game)
        {
            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(@"osu.Framework.dll"), @"Resources"));
            Resources.AddStore(new DllResourceStore(MainResourceFile));

            Textures = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(new RawTextureLoaderStore(new OnlineStore()));

            Audio = new AudioManager(new NamespacedResourceStore <byte[]>(Resources, @"Tracks"), new NamespacedResourceStore <byte[]>(Resources, @"Samples"));

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));

            Fonts = new TextureStore(new GlyphStore(Resources, @"Fonts/OpenSans"))
            {
                ScaleAdjust = 1 / 100f
            };

            (performanceContainer = new PerformanceOverlay
            {
                Position = new Vector2(5, 5),
                Direction = FlowDirection.VerticalOnly,
                AutoSizeAxes = Axes.Both,
                Alpha = 0,
                Spacing = new Vector2(10, 10),
                Anchor = Anchor.BottomRight,
                Origin = Anchor.BottomRight,
                Depth = float.MaxValue
            }).Preload(game, AddInternal);

            base.Load(game);

            addDebugTools();
        }
Ejemplo n.º 5
0
        private void load()
        {
            Dependencies.Cache(Config);

            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(@"osu.Framework.dll"), @"Resources"));
            Resources.AddStore(new DllResourceStore(MainResourceFile));

            Textures = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(new RawTextureLoaderStore(new OnlineStore()));
            Dependencies.Cache(Textures);

            Audio = Dependencies.Cache(new AudioManager(
                                           new NamespacedResourceStore <byte[]>(Resources, @"Tracks"),
                                           new NamespacedResourceStore <byte[]>(Resources, @"Samples"))
            {
                EventScheduler = Scheduler
            });

            //attach our bindables to the audio subsystem.
            Audio.AudioDevice.Weld(Config.GetBindable <string>(FrameworkConfig.AudioDevice));
            Audio.Volume.Weld(Config.GetBindable <double>(FrameworkConfig.VolumeUniversal));
            Audio.VolumeSample.Weld(Config.GetBindable <double>(FrameworkConfig.VolumeEffect));
            Audio.VolumeTrack.Weld(Config.GetBindable <double>(FrameworkConfig.VolumeMusic));

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));
            Dependencies.Cache(Shaders);

            Fonts = new FontStore(new GlyphStore(Resources, @"Fonts/OpenSans"))
            {
                ScaleAdjust = 100
            };
            Dependencies.Cache(Fonts);
        }
Ejemplo n.º 6
0
            private void load(TextureStore textures, GameHost host)
            {
                if (!textures.GetAvailableResources().Contains("Textures/SentakkiIcon.png"))
                {
                    textures.AddStore(host.CreateTextureLoaderStore(ruleset.CreateResourceStore()));
                }

                Texture = textures.Get("Textures/SentakkiIcon.png");
            }
Ejemplo n.º 7
0
        //public override int LegacyID => 0;

        public RpRuleset(RulesetInfo rulesetInfo)
            : base(rulesetInfo)
        {
            //TODO : use this or not
            VitaruResources = new ResourceStore <byte[]>();
            VitaruResources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore("osu.Game.Rulesets.RP.dll"), ("Assets")));
            VitaruResources.AddStore(new DllResourceStore("osu.Game.Rulesets.RP.dll"));
            VitaruTextures = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(VitaruResources, @"Textures")));
            VitaruTextures.AddStore(new RawTextureLoaderStore(new OnlineStore()));
        }
Ejemplo n.º 8
0
        public 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/Exo2.0-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));

            API = new APIAccess()
            {
                Username = Config.Get <string>(OsuConfig.Username),
                Password = Config.Get <string>(OsuConfig.Password),
                Token    = Config.Get <string>(OsuConfig.Token)
            };
        }
Ejemplo n.º 9
0
        private void load(FrameworkConfigManager config)
        {
            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(@"osu.Framework.dll"), @"Resources"));

            Textures = new TextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
            dependencies.Cache(Textures);

            var tracks = new ResourceStore <byte[]>(Resources);

            tracks.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Tracks"));
            tracks.AddStore(new OnlineStore());

            var samples = new ResourceStore <byte[]>(Resources);

            samples.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Samples"));
            samples.AddStore(new OnlineStore());

            Audio = new AudioManager(tracks, samples)
            {
                EventScheduler = Scheduler
            };
            dependencies.Cache(Audio);

            Host.RegisterThread(Audio.Thread);

            //attach our bindables to the audio subsystem.
            config.BindWith(FrameworkSetting.AudioDevice, Audio.AudioDevice);
            config.BindWith(FrameworkSetting.VolumeUniversal, Audio.Volume);
            config.BindWith(FrameworkSetting.VolumeEffect, Audio.VolumeSample);
            config.BindWith(FrameworkSetting.VolumeMusic, Audio.VolumeTrack);

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));
            dependencies.Cache(Shaders);

            Fonts = new FontStore(new GlyphStore(Resources, @"Fonts/OpenSans"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans-Bold"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans-Italic"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans-BoldItalic"));
            dependencies.Cache(Fonts);

            Localisation = new LocalisationManager(config);
            dependencies.Cache(Localisation);
        }
Ejemplo n.º 10
0
        private void load(FrameworkConfigManager config)
        {
            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(@"osu.Framework.dll"), @"Resources"));

            Textures = new TextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
            dependencies.Cache(Textures);

            var tracks = new ResourceStore <byte[]>();

            tracks.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Tracks"));
            tracks.AddStore(new OnlineStore());

            var samples = new ResourceStore <byte[]>();

            samples.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Samples"));
            samples.AddStore(new OnlineStore());

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));
            dependencies.Cache(Shaders);

            var cacheStorage = Host.Storage.GetStorageForDirectory(Path.Combine("cache", "fonts"));

            // base store is for user fonts
            Fonts = new FontStore(useAtlas: true, cacheStorage: cacheStorage);

            // nested store for framework provided fonts.
            // note that currently this means there could be two async font load operations.
            Fonts.AddStore(localFonts = new FontStore(useAtlas: false));

            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-Bold"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-Italic"));
            localFonts.AddStore(new GlyphStore(Resources, @"Fonts/OpenSans/OpenSans-BoldItalic"));

            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Solid"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Regular"));
            Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome5/FontAwesome-Brands"));

            dependencies.Cache(Fonts);

            Localisation = new LocalisationManager(config);
            dependencies.Cache(Localisation);
        }
        public DrawableRulesetDependencies(Ruleset ruleset, IReadOnlyDependencyContainer parent)
            : base(parent)
        {
            var resources = ruleset.CreateResourceStore();

            if (resources != null)
            {
                TextureStore = new TextureStore(new TextureLoaderStore(new NamespacedResourceStore <byte[]>(resources, @"Textures")));
                TextureStore.AddStore(parent.Get <TextureStore>());
                Cache(TextureStore);

                SampleStore = parent.Get <AudioManager>().GetSampleStore(new NamespacedResourceStore <byte[]>(resources, @"Samples"));
                SampleStore.PlaybackConcurrency = OsuGameBase.SAMPLE_CONCURRENCY;
                CacheAs <ISampleStore>(new FallbackSampleStore(SampleStore, parent.Get <ISampleStore>()));
            }

            RulesetConfigManager = parent.Get <RulesetConfigCache>().GetConfigFor(ruleset);
            if (RulesetConfigManager != null)
            {
                Cache(RulesetConfigManager);
            }
        }
Ejemplo n.º 12
0
        private void load()
        {
            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(@"osu.Framework.dll"), @"Resources"));
            Resources.AddStore(new DllResourceStore(MainResourceFile));

            Textures = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(new RawTextureLoaderStore(new OnlineStore()));
            Dependencies.Cache(Textures);

            Audio = Dependencies.Cache(new AudioManager(
                                           new NamespacedResourceStore <byte[]>(Resources, @"Tracks"),
                                           new NamespacedResourceStore <byte[]>(Resources, @"Samples")));

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));
            Dependencies.Cache(Shaders);

            Fonts = new FontStore(new GlyphStore(Resources, @"Fonts/OpenSans"))
            {
                ScaleAdjust = 1 / 100f
            };
            Dependencies.Cache(Fonts);
        }
Ejemplo n.º 13
0
        //TODO: Implement "GetSkinAudioElement" and "GetAudioElement"
        //private readonly AudioManager thSharpAudio;

        public THSharpSkinElement(Storage storage, THSharpConfigManager config)
        {
            this.storage = storage;
            this.config  = config;

            if (thSharpResources == null)
            {
                thSharpResources = new ResourceStore <byte[]>();
                thSharpResources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore("THSharp.Game.Resources.dll"), "Assets"));
                thSharpResources.AddStore(new DllResourceStore("THSharp.Game.Resources.dll"));
                thSharpTextures = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(thSharpResources, @"Textures")));
                thSharpTextures.AddStore(new RawTextureLoaderStore(new OnlineStore()));

                var tracks = new ResourceStore <byte[]>(thSharpResources);
                tracks.AddStore(new NamespacedResourceStore <byte[]>(thSharpResources, @"Tracks"));
                tracks.AddStore(new OnlineStore());

                var samples = new ResourceStore <byte[]>(thSharpResources);
                samples.AddStore(new NamespacedResourceStore <byte[]>(thSharpResources, @"Samples"));
                samples.AddStore(new OnlineStore());

                //thSharpAudio = new AudioManager(tracks, samples);
            }
        }
Ejemplo n.º 14
0
            private void load(TextureStore textures, FontStore store, GameHost host)
            {
                if (!textures.GetAvailableResources().Contains("Textures/tau.png"))
                {
                    textures.AddStore(host.CreateTextureLoaderStore(ruleset.CreateResourceStore()));
                }

                // Note to new ruleset creators:
                // This is definitely something you should try to avoid.
                // Typically resources would only be loaded inside of gameplay, NOT anywhere else.
                // Until the osu! team figures out a safe way for you to use resources out of the gameplay area (e.g mods icon),
                // Please try to avoid this at all costs.
                store.AddStore(new GlyphStore(
                                   new ResourceStore <byte[]>(ruleset.CreateResourceStore()),
                                   "Fonts/tauFont",
                                   host.CreateTextureLoaderStore(ruleset.CreateResourceStore())));

                AddRangeInternal(new Drawable[]
                {
                    new SpriteIcon
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        Icon   = FontAwesome.Regular.Circle,
                    },
                    new Sprite
                    {
                        RelativeSizeAxes = Axes.Both,
                        Size             = new Vector2(1),
                        Scale            = new Vector2(.625f),
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        Texture          = textures.Get("Textures/tau")
                    }
                });
            }
Ejemplo n.º 15
0
        private void load(TextureStore textures, Storage storage)
        {
            this.storage = storage;

            TextureStore flagStore = new TextureStore();

            // Local flag store
            flagStore.AddStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(new StorageBackedResourceStore(storage), "Drawings")));
            // Default texture store
            flagStore.AddStore(textures);

            dependencies.Cache(flagStore);

            if (TeamList == null)
            {
                TeamList = new StorageBackedTeamList(storage);
            }

            if (!TeamList.Teams.Any())
            {
                Exit();
                return;
            }

            drawingsConfig = new DrawingsConfigManager(storage);

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = new Color4(77, 77, 77, 255)
                },
                new Sprite
                {
                    RelativeSizeAxes = Axes.Both,
                    FillMode         = FillMode.Fill,
                    Texture          = textures.Get(@"Backgrounds/Drawings/background.png")
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Horizontal,

                    Children = new Drawable[]
                    {
                        // Main container
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Width            = 0.85f,

                            Children = new Drawable[]
                            {
                                // Visualiser
                                new VisualiserContainer
                                {
                                    Anchor = Anchor.Centre,
                                    Origin = Anchor.Centre,

                                    RelativeSizeAxes = Axes.X,
                                    Size             = new Vector2(1, 10),

                                    Colour = new Color4(255, 204, 34, 255),

                                    Lines = 6
                                },
                                // Groups
                                groupsContainer = new GroupContainer(drawingsConfig.Get <int>(DrawingsConfig.Groups), drawingsConfig.Get <int>(DrawingsConfig.TeamsPerGroup))
                                {
                                    Anchor = Anchor.TopCentre,
                                    Origin = Anchor.TopCentre,

                                    RelativeSizeAxes = Axes.Y,
                                    AutoSizeAxes     = Axes.X,

                                    Padding = new MarginPadding
                                    {
                                        Top    = 35f,
                                        Bottom = 35f
                                    }
                                },
                                // Scrolling teams
                                teamsContainer = new ScrollingTeamContainer
                                {
                                    Anchor = Anchor.Centre,
                                    Origin = Anchor.Centre,

                                    RelativeSizeAxes = Axes.X,
                                },
                                // Scrolling team name
                                fullTeamNameText = new OsuSpriteText
                                {
                                    Anchor = Anchor.Centre,
                                    Origin = Anchor.TopCentre,

                                    Position = new Vector2(0, 45f),

                                    Alpha = 0,

                                    Font     = "Exo2.0-Light",
                                    TextSize = 42f
                                }
                            }
                        },
                        // Control panel container
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Width            = 0.15f,

                            Children = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = new Color4(54, 54, 54, 255)
                                },
                                new OsuSpriteText
                                {
                                    Anchor = Anchor.TopCentre,
                                    Origin = Anchor.TopCentre,

                                    Text     = "Control Panel",
                                    TextSize = 22f,
                                    Font     = "Exo2.0-Bold"
                                },
                                new FillFlowContainer
                                {
                                    Anchor = Anchor.TopCentre,
                                    Origin = Anchor.TopCentre,

                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Width            = 0.75f,

                                    Position = new Vector2(0, 35f),

                                    Direction = FillDirection.Vertical,
                                    Spacing   = new Vector2(0, 5f),

                                    Children = new Drawable[]
                                    {
                                        new TriangleButton
                                        {
                                            RelativeSizeAxes = Axes.X,

                                            Text   = "Begin random",
                                            Action = teamsContainer.StartScrolling,
                                        },
                                        new TriangleButton
                                        {
                                            RelativeSizeAxes = Axes.X,

                                            Text   = "Stop random",
                                            Action = teamsContainer.StopScrolling,
                                        },
                                        new TriangleButton
                                        {
                                            RelativeSizeAxes = Axes.X,

                                            Text   = "Reload",
                                            Action = reloadTeams
                                        }
                                    }
                                },
                                new FillFlowContainer
                                {
                                    Anchor = Anchor.BottomCentre,
                                    Origin = Anchor.BottomCentre,

                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Width            = 0.75f,

                                    Position = new Vector2(0, -5f),

                                    Direction = FillDirection.Vertical,
                                    Spacing   = new Vector2(0, 5f),

                                    Children = new Drawable[]
                                    {
                                        new TriangleButton
                                        {
                                            RelativeSizeAxes = Axes.X,

                                            Text   = "Reset",
                                            Action = () => reset()
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };

            teamsContainer.OnSelected      += onTeamSelected;
            teamsContainer.OnScrollStarted += () => fullTeamNameText.FadeOut(200);

            reset(true);
        }
Ejemplo n.º 16
0
        private void load(FrameworkConfigManager config)
        {
            if (!AssetsLoaded)
            {
                AssetsLoaded    = true;
                VitaruResources = new ResourceStore <byte[]>();
                VitaruResources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore("osu.Game.Rulesets.Vitaru.dll"), ("Assets")));
                VitaruResources.AddStore(new DllResourceStore("osu.Game.Rulesets.Vitaru.dll"));

                VitaruTextures = new TextureStore(new RawTextureLoaderStore(new NamespacedResourceStore <byte[]>(VitaruResources, @"Textures")));
                VitaruTextures.AddStore(new RawTextureLoaderStore(new OnlineStore()));

                //This is wrong, but I am unsure how to add the audio files
                //Audio = Dependencies.Cache(new SampleManager(new NamespacedResourceStore<byte[]>(Resources, @"Audio/Samples")));
            }

            //Drawable stuff loading for each individual Character
            Anchor   = Anchor.TopLeft;
            Origin   = Anchor.Centre;
            Children = new Drawable[]
            {
                CharacterSprite = new Sprite()
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Alpha  = 1,
                },
                CharacterKiaiSprite = new Sprite()
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Alpha  = 0,
                },
                Hitbox = new Hitbox()
                {
                    Alpha       = 0,
                    HitboxWidth = HitboxWidth,
                    HitboxColor = HitboxColor,
                },
                CharacterSign = new Sprite()
                {
                    Alpha  = 0,
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                }
            };

            string characterType = "null";

            switch (CharacterType)
            {
            case HitObjectType.Player:
                characterType = "player";
                break;

            case HitObjectType.Enemy:
                characterType = "enemy";
                break;

            case HitObjectType.Boss:
                characterType = "boss";
                break;
            }

            //sampleDeath = audio.Sample.Get(@"deathSound");
            //sampleShoot = audio.Sample.Get(@"shootSound");
            CharacterSprite.Texture     = VitaruTextures.Get(characterType);
            CharacterKiaiSprite.Texture = VitaruTextures.Get(characterType + "Kiai");
            CharacterSign.Texture       = VitaruTextures.Get(characterType + "Sign");
        }
Ejemplo n.º 17
0
        private void load(FrameworkConfigManager config)
        {
            Resources = new ResourceStore <byte[]>();
            Resources.AddStore(new NamespacedResourceStore <byte[]>(new DllResourceStore(typeof(Game).Assembly), @"Resources"));

            Textures = new TextureStore(Host.CreateTextureLoaderStore(new NamespacedResourceStore <byte[]>(Resources, @"Textures")));
            Textures.AddStore(Host.CreateTextureLoaderStore(new OnlineStore()));
            dependencies.Cache(Textures);

            var tracks = new ResourceStore <byte[]>();

            tracks.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Tracks"));
            tracks.AddStore(new OnlineStore());

            var samples = new ResourceStore <byte[]>();

            samples.AddStore(new NamespacedResourceStore <byte[]>(Resources, @"Samples"));
            samples.AddStore(new OnlineStore());

            Audio = new AudioManager(Host.AudioThread, tracks, samples)
            {
                EventScheduler = Scheduler
            };
            dependencies.Cache(Audio);

            dependencies.CacheAs(Audio.Tracks);
            dependencies.CacheAs(Audio.Samples);

            // attach our bindables to the audio subsystem.
            config.BindWith(FrameworkSetting.AudioDevice, Audio.AudioDevice);
            config.BindWith(FrameworkSetting.VolumeUniversal, Audio.Volume);
            config.BindWith(FrameworkSetting.VolumeEffect, Audio.VolumeSample);
            config.BindWith(FrameworkSetting.VolumeMusic, Audio.VolumeTrack);

            Shaders = new ShaderManager(new NamespacedResourceStore <byte[]>(Resources, @"Shaders"));
            dependencies.Cache(Shaders);

            var cacheStorage = Host.Storage.GetStorageForDirectory(Path.Combine("cache", "fonts"));

            // base store is for user fonts
            Fonts = new FontStore(useAtlas: true, cacheStorage: cacheStorage);

            // nested store for framework provided fonts.
            // note that currently this means there could be two async font load operations.
            Fonts.AddStore(localFonts = new FontStore(useAtlas: false));

            addFont(localFonts, Resources, @"Fonts/OpenSans/OpenSans");
            addFont(localFonts, Resources, @"Fonts/OpenSans/OpenSans-Bold");
            addFont(localFonts, Resources, @"Fonts/OpenSans/OpenSans-Italic");
            addFont(localFonts, Resources, @"Fonts/OpenSans/OpenSans-BoldItalic");

            addFont(Fonts, Resources, @"Fonts/FontAwesome5/FontAwesome-Solid");
            addFont(Fonts, Resources, @"Fonts/FontAwesome5/FontAwesome-Regular");
            addFont(Fonts, Resources, @"Fonts/FontAwesome5/FontAwesome-Brands");

            dependencies.Cache(Fonts);

            Localisation = new LocalisationManager(config);
            dependencies.Cache(Localisation);

            logOverlayVisibility = config.GetBindable <bool>(FrameworkSetting.ShowLogOverlay);
            logOverlayVisibility.BindValueChanged(visibility =>
            {
                if (visibility.NewValue)
                {
                    if (logOverlay == null)
                    {
                        LoadComponentAsync(logOverlay = new LogOverlay
                        {
                            Depth = float.MinValue / 2,
                        }, AddInternal);
                    }

                    logOverlay.Show();
                }
                else
                {
                    logOverlay?.Hide();
                }
            }, true);
        }