Ejemplo n.º 1
0
        private async Task load(TextureStore textures)
        {
            if (textures == null)
            {
                throw new ArgumentNullException(nameof(textures));
            }

            Texture texture = null;

            if (user != null && user.Id > 1)
            {
                texture = await textures.GetAsync($@"https://a.ppy.sh/{user.Id}");
            }
            if (texture == null)
            {
                texture = await textures.GetAsync(@"Online/avatar-guest");
            }

            Add(new Sprite
            {
                RelativeSizeAxes = Axes.Both,
                Texture          = texture,
                FillMode         = FillMode.Fit,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre
            });
        }
Ejemplo n.º 2
0
            private async Task load(OsuConfigManager config, TextureStore textures, OsuColour colour)
            {
                Children = new Drawable[]
                {
                    cursorContainer = new Container
                    {
                        AutoSizeAxes = Axes.Both,
                        Children     = new Drawable[]
                        {
                            new Sprite
                            {
                                Texture = await textures.GetAsync(@"Cursor/menu-cursor"),
                            },
                            AdditiveLayer = new Sprite
                            {
                                Blending = BlendingMode.Additive,
                                Colour   = colour.Pink,
                                Alpha    = 0,
                                Texture  = await textures.GetAsync(@"Cursor/menu-cursor-additive"),
                            },
                        }
                    }
                };

                cursorScale = config.GetBindable <double>(OsuSetting.MenuCursorSize);
                cursorScale.ValueChanged += newScale => cursorContainer.Scale = new Vector2((float)newScale * base_scale);
                cursorScale.TriggerChange();
            }
Ejemplo n.º 3
0
        private async Task load(OsuColour colours, TextureStore textures)
        {
            medalSprite.Texture = await textures.GetAsync(medal.ImageUrl);

            medalGlow.Texture = await textures.GetAsync(@"MedalSplash/medal-glow");

            description.Colour = colours.BlueLight;
        }
Ejemplo n.º 4
0
        private async Task load(TextureStore textures, AudioManager audio)
        {
            sampleClick = await audio.Sample.GetAsync(@"Menu/osu-logo-select");

            sampleBeat = await audio.Sample.GetAsync(@"Menu/osu-logo-heartbeat");

            logo.Texture = await textures.GetAsync(@"Menu/logo");

            ripple.Texture = await textures.GetAsync(@"Menu/logo");
        }
Ejemplo n.º 5
0
 private async Task load(TextureStore textures)
 {
     Children = new Drawable[]
     {
         buttonSprite = new Sprite
         {
             Texture = await textures.GetAsync(@"KeyCounter/key-up"),
             Anchor  = Anchor.Centre,
             Origin  = Anchor.Centre,
         },
         glowSprite = new Sprite
         {
             Texture = await textures.GetAsync(@"KeyCounter/key-glow"),
             Anchor  = Anchor.Centre,
             Origin  = Anchor.Centre,
             Alpha   = 0
         },
         textLayer = new Container
         {
             Anchor           = Anchor.Centre,
             Origin           = Anchor.Centre,
             RelativeSizeAxes = Axes.Both,
             Children         = new Drawable[]
             {
                 new OsuSpriteText
                 {
                     Text                 = Name,
                     Font                 = @"Venera",
                     TextSize             = 12,
                     Anchor               = Anchor.Centre,
                     Origin               = Anchor.Centre,
                     RelativePositionAxes = Axes.Both,
                     Position             = new Vector2(0, -0.25f),
                     Colour               = KeyUpTextColor
                 },
                 countSpriteText = new OsuSpriteText
                 {
                     Text   = CountPresses.ToString(@"#,0"),
                     Anchor = Anchor.Centre,
                     Origin = Anchor.Centre,
                     RelativePositionAxes = Axes.Both,
                     Position             = new Vector2(0, 0.25f),
                     Colour = KeyUpTextColor
                 }
             }
         }
     };
     //Set this manually because an element with Alpha=0 won't take it size to AutoSizeContainer,
     //so the size can be changing between buttonSprite and glowSprite.
     Height = buttonSprite.DrawHeight;
     Width  = buttonSprite.DrawWidth;
 }
Ejemplo n.º 6
0
            private async Task load(TextureStore textures, OsuColour colours)
            {
                rim.Texture = await textures.GetAsync(@"Play/Taiko/taiko-drum-outer");

                rimHit.Texture = await textures.GetAsync(@"Play/Taiko/taiko-drum-outer-hit");

                centre.Texture = await textures.GetAsync(@"Play/Taiko/taiko-drum-inner");

                centreHit.Texture = await textures.GetAsync(@"Play/Taiko/taiko-drum-inner-hit");

                rimHit.Colour    = colours.Blue;
                centreHit.Colour = colours.Pink;
            }
Ejemplo n.º 7
0
 private async Task load(TextureStore textures)
 {
     if (!string.IsNullOrEmpty(user.CoverUrl))
     {
         cover.Texture = await textures.GetAsync(user.CoverUrl);
     }
 }
Ejemplo n.º 8
0
        private async Task load(ShaderManager shaders, TextureStore textures)
        {
            shader  = shaders?.Load(@"CursorTrail", FragmentShaderDescriptor.TEXTURE);
            texture = await textures.GetAsync(@"Cursor/cursortrail");

            Scale = new Vector2(1 / texture.ScaleAdjust);
        }
        private void load(TextureStore textures, APIController api, Storage store)
        {
            ProjectName.Text               = onlineProject.Name;
            ProjectDescription.Text        = onlineProject.Description;
            ImageContainer.Add(loadingIcon = new SpriteIcon
            {
                Size             = new Vector2(.7f),
                RelativeSizeAxes = Axes.Both,
                FillMode         = FillMode.Fit,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Icon             = FontAwesome.Solid.Spinner,
            });
            Schedule(async() =>  //ToDo: ????
            {
                var texture = await textures.GetAsync(@$ "https://gamestogo.company/api/Games/DownloadFile/{onlineProject.Image}");

                Schedule(() =>
                {
                    ProjectImage.Texture = texture;
                    loadingIcon.FadeOut();
                });
            });

            BottomContainer.Add(new SpriteText
            {
                Font = new FontUsage(size: SMALL_TEXT_SIZE),
                Text = @"Este juego ya fue publicado!",
            });

            var userRequest = new GetUserRequest(onlineProject.Creator.ID);

            userRequest.Success += user => UsernameBox.Text = @$ "De {user.Username} (Ultima vez editado {onlineProject.DateTimeLastEdited:dd/MM/yyyy HH:mm})";
            api.Queue(userRequest);
        }
Ejemplo n.º 10
0
 private async Task load(TextureStore textures)
 {
     Child = new Sprite
     {
         FillMode         = FillMode.Fit,
         RelativeSizeAxes = Axes.Both,
         Texture          = await textures.GetAsync(badge.ImageUrl),
     };
 }
Ejemplo n.º 11
0
        private async Task load(TextureStore textures)
        {
            if (textures == null)
            {
                throw new ArgumentNullException(nameof(textures));
            }

            if (!string.IsNullOrEmpty(user.CoverUrl))
            {
                Texture = await textures.GetAsync(user.CoverUrl);
            }
        }
Ejemplo n.º 12
0
        private void load(TextureStore textures)
        {
            ButtonFlowContainer.Add(editButton = new IconButton(FontAwesome.Solid.Download, Colour4.SkyBlue, true, Colour4.PowderBlue));

            BottomContainer.Add(new SpriteText
            {
                Font = new FontUsage(size: SMALL_TEXT_SIZE),
                Text = @"Este proyecto está en el servidor, descargalo para editarlo!",
            });

            ImageContainer.Add(loadingIcon = new SpriteIcon
            {
                Size             = new Vector2(.7f),
                RelativeSizeAxes = Axes.Both,
                FillMode         = FillMode.Fit,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Icon             = FontAwesome.Solid.Spinner,
            });

            editButton.Enabled.Value = false;
            loadingIcon.RotateTo(0).Then().RotateTo(360, 1500).Loop();

            ProjectName.Text         = onlineProject.Name;
            ProjectDescription.Text  = onlineProject.Description;
            editButton.Enabled.Value = true;
            Schedule(async() =>
            {
                var texture = await textures.GetAsync(@$ "https://gamestogo.company/api/Games/DownloadFile/{onlineProject.Image}");

                Schedule(() =>
                {
                    ProjectImage.Texture = texture;
                    loadingIcon.FadeOut();
                });
            });

            editButton.Action += downloadProject;

            var userRequest = new GetUserRequest(onlineProject.Creator.ID);

            userRequest.Success += user => UsernameBox.Text = @$ "De {user.Username} (Ultima vez editado {onlineProject.DateTimeLastEdited:dd/MM/yyyy HH:mm}) Estado: {onlineProject.Status.GetDescription()}";
            api.Queue(userRequest);
        }
Ejemplo n.º 13
0
 private async Task load(TextureStore textures)
 {
     RelativeSizeAxes = Axes.Both;
     Children         = new Drawable[]
     {
         new Sprite
         {
             Anchor  = Anchor.Centre,
             Origin  = Anchor.Centre,
             Texture = await textures.GetAsync(@"Play/osu/disc"),
         },
         new TrianglesPiece
         {
             RelativeSizeAxes = Axes.Both,
             Blending         = BlendingMode.Additive,
             Alpha            = 0.5f,
         }
     };
 }
Ejemplo n.º 14
0
        private async Task load(OsuColour colours, TextureStore textures, AudioManager audio)
        {
            getSample = await audio.Sample.GetAsync(@"MedalSplash/medal-get");

            innerSpin.Texture = outerSpin.Texture = await textures.GetAsync(@"MedalSplash/disc-spin");

            disc.EdgeEffect = leftStrip.EdgeEffect = rightStrip.EdgeEffect = new EdgeEffectParameters
            {
                Type   = EdgeEffectType.Glow,
                Colour = colours.Blue.Opacity(0.5f),
                Radius = 50,
            };

            disc.Add(drawableMedal = new DrawableMedal(medal)
            {
                Anchor           = Anchor.TopCentre,
                Origin           = Anchor.TopCentre,
                RelativeSizeAxes = Axes.Both,
            });
        }
Ejemplo n.º 15
0
        private async Task load(TextureStore textures)
        {
            string resource = null;

            switch (type)
            {
            case BeatmapSetCoverType.Cover:
                resource = set.OnlineInfo.Covers.Cover;
                break;

            case BeatmapSetCoverType.Card:
                resource = set.OnlineInfo.Covers.Card;
                break;

            case BeatmapSetCoverType.List:
                resource = set.OnlineInfo.Covers.List;
                break;
            }

            if (resource != null)
            {
                Texture = await textures.GetAsync(resource);
            }
        }
Ejemplo n.º 16
0
 private async Task load(TextureStore textures)
 {
     flagSprite.Texture = await textures.GetAsync($@"Flags/{Team.FlagName}");
 }
Ejemplo n.º 17
0
 private async Task <Texture> getFlagTexture() => await textures.GetAsync($@"Flags/{country?.FlagName ?? @"__"}");
Ejemplo n.º 18
0
 private async Task load(TextureStore textures)
 {
     texture = await textures.GetAsync("Drawings/visualiser-line");
 }
Ejemplo n.º 19
0
 private async Task load(TextureStore textures)
 {
     levelBadge.Texture = await textures.GetAsync(@"Profile/levelbadge");
 }
Ejemplo n.º 20
0
        private async Task load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config, GameHost host)
        {
            notificationOverlay = notification;
            this.config         = config;
            this.game           = game;
            this.host           = host;

            AutoSizeAxes = Axes.Both;
            Anchor       = Anchor.BottomCentre;
            Origin       = Anchor.BottomCentre;

            Alpha = 0;

            Children = new Drawable[]
            {
                new FillFlowContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Vertical,
                    Children     = new Drawable[]
                    {
                        new FillFlowContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Direction    = FillDirection.Horizontal,
                            Spacing      = new Vector2(5),
                            Anchor       = Anchor.TopCentre,
                            Origin       = Anchor.TopCentre,
                            Children     = new Drawable[]
                            {
                                new OsuSpriteText
                                {
                                    Font = @"Exo2.0-Bold",
                                    Text = game.Name
                                },
                                new OsuSpriteText
                                {
                                    Colour = DebugUtils.IsDebug ? colours.Red : Color4.White,
                                    Text   = game.Version
                                },
                            }
                        },
                        new OsuSpriteText
                        {
                            Anchor   = Anchor.TopCentre,
                            Origin   = Anchor.TopCentre,
                            TextSize = 12,
                            Colour   = colours.Yellow,
                            Font     = @"Venera",
                            Text     = @"Development Build"
                        },
                        new Sprite
                        {
                            Anchor  = Anchor.TopCentre,
                            Origin  = Anchor.TopCentre,
                            Texture = await textures.GetAsync(@"Menu/dev-build-footer"),
                        },
                    }
                }
            };
        }
Ejemplo n.º 21
0
 private void load(TextureStore textures)
 {
     RelativeSizeAxes = Axes.Both;
     Masking          = true;
     BorderColour     = Colour4.Black;
     BorderThickness  = 3.5f;
     InternalChildren = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = Colour4.LightGray,
         },
         new FillFlowContainer
         {
             RelativeSizeAxes = Axes.Both,
             Direction        = FillDirection.Horizontal,
             Padding          = new MarginPadding(20),
             Spacing          = new Vector2(20),
             Children         = new Drawable[]
             {
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .2f,
                     Child            = gameImage = new Sprite
                     {
                         RelativeSizeAxes = Axes.Both,
                         Texture          = textures.Get("Images/gtg"),
                     },
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .5f,
                     Child            = new FillFlowContainer
                     {
                         RelativeSizeAxes = Axes.Both,
                         Direction        = FillDirection.Vertical,
                         Children         = new Drawable[]
                         {
                             new Container
                             {
                                 RelativeSizeAxes = Axes.Both,
                                 Height           = .5f,
                                 Child            = new TextFlowContainer((w) => w.Font = new FontUsage(size: 60))
                                 {
                                     RelativeSizeAxes = Axes.Both,
                                     Text             = @"Sala de " + room.Owner.Username,
                                 },
                             },
                             new Container
                             {
                                 RelativeSizeAxes = Axes.Both,
                                 Height           = .5f,
                                 Child            = new SpriteText
                                 {
                                     Text = "Id: " + room.Id,
                                     Font = new FontUsage(size: 50),
                                 },
                             },
                         },
                     },
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .3f,
                     Padding          = new MarginPadding()
                     {
                         Right = 50
                     },
                     Child = new FillFlowContainer
                     {
                         RelativeSizeAxes = Axes.Both,
                         Direction        = FillDirection.Horizontal,
                         Children         = new Drawable[]
                         {
                             new Container
                             {
                                 Anchor           = Anchor.Centre,
                                 Origin           = Anchor.Centre,
                                 RelativeSizeAxes = Axes.Both,
                                 Width            = .4f,
                                 Child            = new SpriteText
                                 {
                                     Anchor = Anchor.Centre,
                                     Origin = Anchor.Centre,
                                     Text   = room.CurrentPlayers + "/" + room.Game.Maxplayers,
                                     Font   = new FontUsage(size: 60)
                                 }
                             },
                             new Container
                             {
                                 Anchor           = Anchor.Centre,
                                 Origin           = Anchor.Centre,
                                 RelativeSizeAxes = Axes.Both,
                                 Width            = .6f,
                                 Padding          = new MarginPadding(10),
                                 Child            = new SpriteIcon
                                 {
                                     RelativeSizeAxes = Axes.Both,
                                     Icon             = FontAwesome.Solid.Users
                                 },
                             },
                         },
                     },
                 },
             },
         },
     };
     Schedule(async() =>
     {
         gameImage.Texture = await textures.GetAsync($"https://gamestogo.company/api/Users/DownloadImage/{room.Owner.ID}");
     });
 }
Ejemplo n.º 22
0
 private async Task updateTexture() => rankSprite.Texture = await textures.GetAsync($@"Grades/{Rank.GetDescription()}");
Ejemplo n.º 23
0
 private async Task load(TextureStore textures)
 {
     sprite.Texture = await textures.GetAsync(url);
 }
Ejemplo n.º 24
0
 private void load(TextureStore textures)
 {
     RelativeSizeAxes = Axes.Both;
     Masking          = true;
     BorderColour     = Colour4.Black;
     BorderThickness  = 3.5f;
     InternalChildren = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = Colour4.LightGray,
         },
         new FillFlowContainer
         {
             RelativeSizeAxes = Axes.Both,
             Direction        = FillDirection.Horizontal,
             Padding          = new MarginPadding(20),
             Spacing          = new Vector2(10),
             Children         = new Drawable[]
             {
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .2f,
                     Child            = userImage = new Sprite
                     {
                         RelativeSizeAxes = Axes.Both,
                         Texture          = textures.Get("Images/gtg"),
                     },
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .6f,
                     Child            = new Container
                     {
                         RelativeSizeAxes = Axes.Both,
                         Height           = .5f,
                         Child            = new TextFlowContainer((w) => w.Font = new FontUsage(size: 100))
                         {
                             RelativeSizeAxes = Axes.Both,
                             Text             = user.Username
                         },
                     },
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .2f,
                     Padding          = new MarginPadding {
                         Right = 50
                     },
                     Child = inviteButton = new SurfaceButton
                     {
                         Action           = () => inviteUser(),
                         BackgroundColour = new Colour4(106, 100, 104, 255),
                         Children         = new Drawable[]
                         {
                             new SpriteIcon
                             {
                                 Anchor           = Anchor.Centre,
                                 Origin           = Anchor.Centre,
                                 RelativeSizeAxes = Axes.Both,
                                 Width            = .9f,
                                 Icon             = FontAwesome.Solid.Envelope,
                             },
                         },
                     },
                 },
             },
         },
     };
     Schedule(async() =>
     {
         userImage.Texture = await textures.GetAsync($"https://gamestogo.company/api/Users/DownloadImage/{user.ID}");
     });
 }
Ejemplo n.º 25
0
 private void load(TextureStore textures)
 {
     RelativeSizeAxes = Axes.Both;
     Masking          = true;
     BorderColour     = Colour4.Black;
     BorderThickness  = 3.5f;
     InternalChildren = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = new Colour4(106, 100, 104, 255)
         },
         new FillFlowContainer
         {
             RelativeSizeAxes = Axes.Both,
             Direction        = FillDirection.Horizontal,
             Padding          = new MarginPadding(40),
             Spacing          = new Vector2(20),
             Children         = new Drawable[]
             {
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .3f,
                     Child            = gameImage = new Sprite
                     {
                         RelativeSizeAxes = Axes.Both,
                         Texture          = textures.Get("Images/gtg")
                     }
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .5f,
                     Children         = new Drawable[]
                     {
                         new FillFlowContainer
                         {
                             RelativeSizeAxes = Axes.Both,
                             Direction        = FillDirection.Vertical,
                             Children         = new Drawable[]
                             {
                                 new Container
                                 {
                                     RelativeSizeAxes = Axes.Both,
                                     Child            = text = new TextFlowContainer
                                     {
                                         RelativeSizeAxes = Axes.Both
                                     }
                                 },
                             },
                         },
                     },
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .2f,
                     Padding          = new MarginPadding {
                         Right = 80
                     },
                     Child = new FillFlowContainer
                     {
                         RelativeSizeAxes = Axes.Both,
                         Direction        = FillDirection.Horizontal,
                         Spacing          = new Vector2(30),
                         Children         = new Drawable[]
                         {
                             new SpriteIcon
                             {
                                 Anchor           = Anchor.Centre,
                                 Origin           = Anchor.Centre,
                                 RelativeSizeAxes = Axes.Both,
                                 Width            = .5f,
                                 Icon             = FontAwesome.Solid.Users,
                             },
                             new SpriteText
                             {
                                 Anchor = Anchor.Centre,
                                 Origin = Anchor.Centre,
                                 Text   = game.Minplayers + "-" + game.Maxplayers,
                                 Font   = new FontUsage(size: GameNameSize),
                             },
                         },
                     },
                 },
             },
         },
     };
     Schedule(async() =>
     {
         gameImage.Texture = await textures.GetAsync(@$ "https://gamestogo.company/api/Games/DownloadFile/{game.Image}");
     });
     text.AddText(game.Name, f => f.Font = new FontUsage(size: GameNameSize));
     text.AddParagraph(@$ "Hecho por: {game.Creator.Username}", t => t.Font = new FontUsage(size: MadeBySize));
 }
Ejemplo n.º 26
0
 private void load(TextureStore textures)
 {
     RelativeSizeAxes = Axes.X;
     Height           = 150;
     Children         = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = Colour4.AliceBlue,
         },
         new FillFlowContainer
         {
             RelativeSizeAxes = Axes.Both,
             Direction        = FillDirection.Horizontal,
             Padding          = new MarginPadding(20),
             Spacing          = new Vector2(10),
             Children         = new Drawable[]
             {
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .15f,
                     Child            = userImage = new Sprite
                     {
                         RelativeSizeAxes = Axes.Both,
                         Texture          = textures.Get("Images/gtg"),
                     },
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .45f,
                     Child            = new TextFlowContainer((w) => w.Font = new FontUsage(size: 40))
                     {
                         RelativeSizeAxes = Axes.X,
                         Height           = 150,
                         Text             = Invitation.Sender.Username + " te ha invitado a jugar " + Invitation.Room.Game.Name,
                         Colour           = Colour4.Black,
                     }
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .17f,
                     Child            = new SurfaceButton
                     {
                         Action           = () => NextScreen(),
                         BackgroundColour = new Colour4(106, 100, 104, 255),
                         Children         = new Drawable[]
                         {
                             new SpriteIcon
                             {
                                 Anchor           = Anchor.Centre,
                                 Origin           = Anchor.Centre,
                                 RelativeSizeAxes = Axes.Both,
                                 Icon             = FontAwesome.Solid.Check
                             },
                         },
                     },
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Width            = .2f,
                     Padding          = new MarginPadding()
                     {
                         Right = 30
                     },
                     Child = new SurfaceButton
                     {
                         Action           = () => DeleteInvitation(),
                         BackgroundColour = new Colour4(106, 100, 104, 255),
                         Children         = new Drawable[]
                         {
                             new SpriteIcon
                             {
                                 Anchor           = Anchor.Centre,
                                 Origin           = Anchor.Centre,
                                 RelativeSizeAxes = Axes.Both,
                                 Icon             = FontAwesome.Solid.Times
                             }
                         }
                     }
                 }
             }
         }
     };
     Schedule(async() =>
     {
         userImage.Texture = await textures.GetAsync($"https://gamestogo.company/api/Users/DownloadImage/{Invitation.Sender.ID}");
         if (userImage.Texture == null)
         {
             userImage.Texture = await textures.GetAsync("Images/gtg");
         }
     });
 }
Ejemplo n.º 27
0
 private async Task load(TextureStore textures)
 {
     Texture = await textures.GetAsync(@"Play/Catch/fruit-catcher-idle");
 }
Ejemplo n.º 28
0
 private async Task load(TextureStore textures)
 {
     Sprite.Texture = beatmap?.Background ?? await textures.GetAsync(@"Backgrounds/bg1");
 }
Ejemplo n.º 29
0
        private async Task 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          = await textures.GetAsync(@"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);
        }