Esempio n. 1
0
 private void load()
 {
     Children = new Drawable[]
     {
         new Container
         {
             RelativeSizeAxes = Axes.Y,
             Width            = rank_width,
             Children         = new[]
             {
                 new OsuSpriteText
                 {
                     Anchor   = Anchor.CentreLeft,
                     Origin   = Anchor.CentreLeft,
                     Font     = @"Exo2.0-MediumItalic",
                     TextSize = 22,
                     // ReSharper disable once ImpureMethodCallOnReadonlyValueField
                     Text = RankPosition.ToString(),
                 },
             },
         },
         content = new Container
         {
             RelativeSizeAxes = Axes.Both,
             Padding          = new MarginPadding {
                 Left = rank_width,
             },
             Children = new Drawable[]
             {
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     CornerRadius     = corner_radius,
                     Masking          = true,
                     Children         = new[]
                     {
                         background = new Box
                         {
                             RelativeSizeAxes = Axes.Both,
                             Colour           = Color4.Black,
                             Alpha            = background_alpha,
                         },
                     },
                 },
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Padding          = new MarginPadding(edge_margin),
                     Children         = new[]
                     {
                         avatar = new DelayedLoadWrapper(
                             new Avatar(Score.User)
                         {
                             RelativeSizeAxes = Axes.Both,
                             CornerRadius     = corner_radius,
                             Masking          = true,
                             OnLoadComplete   = d => d.FadeInFromZero(200),
                             EdgeEffect       = new EdgeEffectParameters
                             {
                                 Type   = EdgeEffectType.Shadow,
                                 Radius = 1,
                                 Colour = Color4.Black.Opacity(0.2f),
                             },
                         })
                         {
                             RelativeSizeAxes = Axes.None,
                             Size             = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2),
                         },
                         new Container
                         {
                             RelativeSizeAxes = Axes.Y,
                             AutoSizeAxes     = Axes.X,
                             Position         = new Vector2(HEIGHT - edge_margin, 0f),
                             Children         = new Drawable[]
                             {
                                 nameLabel = new OsuSpriteText
                                 {
                                     Text     = Score.User.Username,
                                     Font     = @"Exo2.0-BoldItalic",
                                     TextSize = 23,
                                 },
                                 new FillFlowContainer
                                 {
                                     Origin       = Anchor.BottomLeft,
                                     Anchor       = Anchor.BottomLeft,
                                     AutoSizeAxes = Axes.Both,
                                     Direction    = FillDirection.Horizontal,
                                     Spacing      = new Vector2(10f, 0f),
                                     Children     = new Drawable[]
                                     {
                                         flagBadgeContainer = new Container
                                         {
                                             Origin   = Anchor.BottomLeft,
                                             Anchor   = Anchor.BottomLeft,
                                             Size     = new Vector2(87f, 20f),
                                             Masking  = true,
                                             Children = new Drawable[]
                                             {
                                                 new DrawableFlag(Score.User?.Country)
                                                 {
                                                     Width            = 30,
                                                     RelativeSizeAxes = Axes.Y,
                                                 },
                                             },
                                         },
                                         new FillFlowContainer
                                         {
                                             Origin       = Anchor.BottomLeft,
                                             Anchor       = Anchor.BottomLeft,
                                             AutoSizeAxes = Axes.Both,
                                             Direction    = FillDirection.Horizontal,
                                             Spacing      = new Vector2(10f, 0f),
                                             Margin       = new MarginPadding {
                                                 Left = edge_margin
                                             },
                                             Children = new Drawable[]
                                             {
                                                 maxCombo = new ScoreComponentLabel(FontAwesome.fa_link, Score.MaxCombo.ToString(), "Max Combo"),
                                                 accuracy = new ScoreComponentLabel(FontAwesome.fa_crosshairs, string.Format(Score.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", Score.Accuracy), "Accuracy"),
                                             },
                                         },
                                     },
                                 },
                             },
                         },
                         new FillFlowContainer
                         {
                             AutoSizeAxes = Axes.Both,
                             Anchor       = Anchor.TopRight,
                             Origin       = Anchor.TopRight,
                             Direction    = FillDirection.Horizontal,
                             Spacing      = new Vector2(5f, 0f),
                             Children     = new Drawable[]
                             {
                                 scoreLabel = new GlowingSpriteText(Score.TotalScore.ToString(@"N0"), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa")),
                                 new Container
                                 {
                                     Size     = new Vector2(40f, 20f),
                                     Children = new[]
                                     {
                                         scoreRank = new DrawableRank(Score.Rank)
                                         {
                                             Anchor = Anchor.Centre,
                                             Origin = Anchor.Centre,
                                             Size   = new Vector2(40f),
                                         },
                                     },
                                 },
                             },
                         },
                         modsContainer = new FillFlowContainer <ModIcon>
                         {
                             Anchor             = Anchor.BottomRight,
                             Origin             = Anchor.BottomRight,
                             AutoSizeAxes       = Axes.Both,
                             Direction          = FillDirection.Horizontal,
                             ChildrenEnumerable = Score.Mods.Select(mod => new ModIcon(mod)
                             {
                                 Scale = new Vector2(0.375f)
                             })
                         },
                     },
                 },
             },
         },
     };
 }
Esempio n. 2
0
        private void loadUser()
        {
            coverContainer.Add(new AsyncLoadWrapper(new UserCoverBackground(user)
            {
                RelativeSizeAxes = Axes.Both,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                FillMode         = FillMode.Fill,
                OnLoadComplete   = d => d.FadeInFromZero(200)
            })
            {
                Masking          = true,
                RelativeSizeAxes = Axes.Both,
                Depth            = float.MaxValue
            });

            if (user.IsSupporter)
            {
                supporterTag.Show();
            }

            if (!string.IsNullOrEmpty(user.Colour))
            {
                colourBar.Colour = OsuColour.FromHex(user.Colour);
                colourBar.Show();
            }

            Action <SpriteText> boldItalic = t =>
            {
                t.Font  = @"Exo2.0-BoldItalic";
                t.Alpha = 1;
            };

            if (user.Age != null)
            {
                infoTextLeft.AddText($"{user.Age} years old ", boldItalic);
            }
            if (user.Country != null)
            {
                infoTextLeft.AddText("from ");
                infoTextLeft.AddText(user.Country.FullName, boldItalic);
                countryFlag.FlagName = user.Country.FlagName;
            }
            infoTextLeft.NewParagraph();

            if (user.JoinDate.ToUniversalTime().Year < 2008)
            {
                infoTextLeft.AddText("Here since the beginning", boldItalic);
            }
            else
            {
                infoTextLeft.AddText("Joined ");
                infoTextLeft.AddText(user.JoinDate.LocalDateTime.ToShortDateString(), boldItalic);
            }
            infoTextLeft.NewLine();
            infoTextLeft.AddText("Last seen ");
            infoTextLeft.AddText(user.LastVisit.LocalDateTime.ToShortDateString(), boldItalic);
            infoTextLeft.NewParagraph();

            if (user.PlayStyle?.Length > 0)
            {
                infoTextLeft.AddText("Plays with ");
                infoTextLeft.AddText(string.Join(", ", user.PlayStyle), boldItalic);
            }

            string websiteWithoutProtcol = user.Website;

            if (!string.IsNullOrEmpty(websiteWithoutProtcol))
            {
                int protocolIndex = websiteWithoutProtcol.IndexOf("//", StringComparison.Ordinal);
                if (protocolIndex >= 0)
                {
                    websiteWithoutProtcol = websiteWithoutProtcol.Substring(protocolIndex + 2);
                }
            }

            tryAddInfoRightLine(FontAwesome.fa_map_marker, user.Location);
            tryAddInfoRightLine(FontAwesome.fa_heart_o, user.Intrerests);
            tryAddInfoRightLine(FontAwesome.fa_suitcase, user.Occupation);
            infoTextRight.NewParagraph();
            if (!string.IsNullOrEmpty(user.Twitter))
            {
                tryAddInfoRightLine(FontAwesome.fa_twitter, "@" + user.Twitter, $@"https://twitter.com/{user.Twitter}");
            }
            tryAddInfoRightLine(FontAwesome.fa_globe, websiteWithoutProtcol, user.Website);
            tryAddInfoRightLine(FontAwesome.fa_skype, user.Skype, @"skype:" + user.Skype + @"?chat");

            if (user.Statistics != null)
            {
                levelBadge.Show();
                levelText.Text = user.Statistics.Level.Current.ToString();

                scoreText.Add(createScoreText("Ranked Score"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.RankedScore.ToString(@"#,0")));
                scoreText.Add(createScoreText("Accuracy"));
                scoreNumberText.Add(createScoreNumberText($"{user.Statistics.Accuracy.ToString("0.##", CultureInfo.CurrentCulture)}%"));
                scoreText.Add(createScoreText("Play Count"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.PlayCount.ToString(@"#,0")));
                scoreText.Add(createScoreText("Total Score"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.TotalScore.ToString(@"#,0")));
                scoreText.Add(createScoreText("Total Hits"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.TotalHits.ToString(@"#,0")));
                scoreText.Add(createScoreText("Max Combo"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.MaxCombo.ToString(@"#,0")));
                scoreText.Add(createScoreText("Replays Watched by Others"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.ReplaysWatched.ToString(@"#,0")));

                gradeSS.DisplayCount = user.Statistics.GradesCount.SS;
                gradeSS.Show();
                gradeS.DisplayCount = user.Statistics.GradesCount.S;
                gradeS.Show();
                gradeA.DisplayCount = user.Statistics.GradesCount.A;
                gradeA.Show();

                gradeSPlus.DisplayCount  = 0;
                gradeSSPlus.DisplayCount = 0;

                chartContainer.Add(new RankChart(user)
                {
                    RelativeSizeAxes = Axes.Both
                });
            }
        }
Esempio n. 3
0
        private void load(OsuColour colours)
        {
            this.colours = colours;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex(@"343138"),
                },
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    RowDimensions    = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.Distributed),
                    },
                    Content = new[]
                    {
                        new Drawable[]
                        {
                            new FillFlowContainer
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                                Direction        = FillDirection.Vertical,
                                Children         = new Drawable[]
                                {
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        Height           = 200,
                                        Masking          = true,
                                        Children         = new Drawable[]
                                        {
                                            background = new UpdateableBeatmapBackgroundSprite {
                                                RelativeSizeAxes = Axes.Both
                                            },
                                            new Box
                                            {
                                                RelativeSizeAxes = Axes.Both,
                                                Colour           = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0)),
                                            },
                                            new Container
                                            {
                                                RelativeSizeAxes = Axes.Both,
                                                Padding          = new MarginPadding(20),
                                                Children         = new Drawable[]
                                                {
                                                    participantCount = new ParticipantCountDisplay
                                                    {
                                                        Anchor = Anchor.TopRight,
                                                        Origin = Anchor.TopRight,
                                                    },
                                                    name = new OsuSpriteText
                                                    {
                                                        Anchor   = Anchor.BottomLeft,
                                                        Origin   = Anchor.BottomLeft,
                                                        TextSize = 30,
                                                    },
                                                },
                                            },
                                        },
                                    },
                                    statusStrip = new Box
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        Height           = 5,
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Children         = new Drawable[]
                                        {
                                            new Box
                                            {
                                                RelativeSizeAxes = Axes.Both,
                                                Colour           = OsuColour.FromHex(@"28242d"),
                                            },
                                            new FillFlowContainer
                                            {
                                                RelativeSizeAxes = Axes.X,
                                                AutoSizeAxes     = Axes.Y,
                                                Direction        = FillDirection.Vertical,
                                                LayoutDuration   = transition_duration,
                                                Padding          = contentPadding,
                                                Spacing          = new Vector2(0f, 5f),
                                                Children         = new Drawable[]
                                                {
                                                    status = new OsuSpriteText
                                                    {
                                                        TextSize = 14,
                                                        Font     = @"Exo2.0-Bold",
                                                    },
                                                    beatmapTypeInfo = new BeatmapTypeInfo(),
                                                },
                                            },
                                        },
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Padding          = contentPadding,
                                        Children         = new Drawable[]
                                        {
                                            participantInfo = new ParticipantInfo(),
                                        },
                                    },
                                },
                            },
                        },
                        new Drawable[]
                        {
                            participants = new MatchParticipants
                            {
                                RelativeSizeAxes = Axes.Both,
                            }
                        }
                    }
                }
            };

            participantInfo.Host.BindTo(bindings.Host);
            participantInfo.ParticipantCount.BindTo(bindings.ParticipantCount);
            participantInfo.Participants.BindTo(bindings.Participants);
            participantCount.Participants.BindTo(bindings.Participants);
            participantCount.ParticipantCount.BindTo(bindings.ParticipantCount);
            participantCount.MaxParticipants.BindTo(bindings.MaxParticipants);
            beatmapTypeInfo.Beatmap.BindTo(bindings.CurrentBeatmap);
            beatmapTypeInfo.Ruleset.BindTo(bindings.CurrentRuleset);
            beatmapTypeInfo.Type.BindTo(bindings.Type);
            background.Beatmap.BindTo(bindings.CurrentBeatmap);
            bindings.Status.BindValueChanged(displayStatus);
            bindings.Name.BindValueChanged(n => name.Text = n);
            Room.BindValueChanged(updateRoom, true);
        }
Esempio n. 4
0
 private void load()
 {
     BackgroundColour      = OsuColour.FromHex(@"593790");
     Triangles.ColourLight = OsuColour.FromHex(@"7247b6");
     Triangles.ColourDark  = OsuColour.FromHex(@"593790");
 }
Esempio n. 5
0
            private void load(OsuColour colours)
            {
                Container dimContent;

                InternalChildren = new Drawable[]
                {
                    dimContent = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Children         = new Drawable[]
                        {
                            new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                Colour           = OsuColour.FromHex(@"28242d"),
                            },
                            new GridContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                RowDimensions    = new[]
                                {
                                    new Dimension(GridSizeMode.Distributed),
                                    new Dimension(GridSizeMode.AutoSize),
                                },
                                Content = new[]
                                {
                                    new Drawable[]
                                    {
                                        new OsuScrollContainer
                                        {
                                            Padding = new MarginPadding
                                            {
                                                Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING,
                                                Vertical   = 10
                                            },
                                            RelativeSizeAxes = Axes.Both,
                                            Children         = new[]
                                            {
                                                new Container
                                                {
                                                    Padding = new MarginPadding {
                                                        Horizontal = SearchableListOverlay.WIDTH_PADDING
                                                    },
                                                    RelativeSizeAxes = Axes.X,
                                                    AutoSizeAxes     = Axes.Y,
                                                    Children         = new Drawable[]
                                                    {
                                                        new SectionContainer
                                                        {
                                                            Padding = new MarginPadding {
                                                                Right = field_padding / 2
                                                            },
                                                            Children = new[]
                                                            {
                                                                new Section("Room name")
                                                                {
                                                                    Child = NameField = new SettingsTextBox
                                                                    {
                                                                        RelativeSizeAxes         = Axes.X,
                                                                        TabbableContentContainer = this,
                                                                        OnCommit = (sender, text) => apply(),
                                                                    },
                                                                },
                                                                new Section("Duration")
                                                                {
                                                                    Child = DurationField = new DurationDropdown
                                                                    {
                                                                        RelativeSizeAxes = Axes.X,
                                                                        Items            = new[]
                                                                        {
                                                                            TimeSpan.FromMinutes(30),
                                                                            TimeSpan.FromHours(1),
                                                                            TimeSpan.FromHours(2),
                                                                            TimeSpan.FromHours(4),
                                                                            TimeSpan.FromHours(8),
                                                                            TimeSpan.FromHours(12),
                                                                            //TimeSpan.FromHours(16),
                                                                            TimeSpan.FromHours(24),
                                                                            TimeSpan.FromDays(3),
                                                                            TimeSpan.FromDays(7)
                                                                        }
                                                                    }
                                                                },
                                                                new Section("Room visibility")
                                                                {
                                                                    Alpha = disabled_alpha,
                                                                    Child = AvailabilityPicker = new RoomAvailabilityPicker
                                                                    {
                                                                        Enabled = { Value = false }
                                                                    },
                                                                },
                                                                new Section("Game type")
                                                                {
                                                                    Alpha = disabled_alpha,
                                                                    Child = new FillFlowContainer
                                                                    {
                                                                        AutoSizeAxes     = Axes.Y,
                                                                        RelativeSizeAxes = Axes.X,
                                                                        Direction        = FillDirection.Vertical,
                                                                        Spacing          = new Vector2(7),
                                                                        Children         = new Drawable[]
                                                                        {
                                                                            TypePicker = new GameTypePicker
                                                                            {
                                                                                RelativeSizeAxes = Axes.X,
                                                                                Enabled          = { Value = false }
                                                                            },
                                                                            typeLabel = new OsuSpriteText
                                                                            {
                                                                                Font   = OsuFont.GetFont(size: 14),
                                                                                Colour = colours.Yellow
                                                                            },
                                                                        },
                                                                    },
                                                                },
                                                                new Section("Max participants")
                                                                {
                                                                    Alpha = disabled_alpha,
                                                                    Child = MaxParticipantsField = new SettingsNumberTextBox
                                                                    {
                                                                        RelativeSizeAxes         = Axes.X,
                                                                        TabbableContentContainer = this,
                                                                        ReadOnly = true,
                                                                        OnCommit = (sender, text) => apply()
                                                                    },
                                                                },
                                                                new Section("Password (optional)")
                                                                {
                                                                    Alpha = disabled_alpha,
                                                                    Child = new SettingsPasswordTextBox
                                                                    {
                                                                        RelativeSizeAxes         = Axes.X,
                                                                        TabbableContentContainer = this,
                                                                        ReadOnly = true,
                                                                        OnCommit = (sender, text) => apply()
                                                                    },
                                                                },
                                                            },
                                                        },
                                                        new SectionContainer
                                                        {
                                                            Anchor  = Anchor.TopRight,
                                                            Origin  = Anchor.TopRight,
                                                            Padding = new MarginPadding {
                                                                Left = field_padding / 2
                                                            },
                                                            Children = new[]
                                                            {
                                                                new Section("Playlist")
                                                                {
                                                                    Child = new GridContainer
                                                                    {
                                                                        RelativeSizeAxes = Axes.X,
                                                                        Height           = 300,
                                                                        Content          = new[]
                                                                        {
                                                                            new Drawable[]
                                                                            {
                                                                                playlist = new DrawableRoomPlaylist(true, true)
                                                                                {
                                                                                    RelativeSizeAxes = Axes.Both
                                                                                }
                                                                            },
                                                                            new Drawable[]
                                                                            {
                                                                                new PurpleTriangleButton
                                                                                {
                                                                                    RelativeSizeAxes = Axes.X,
                                                                                    Height           = 40,
                                                                                    Text             = "Edit playlist",
                                                                                    Action           = () => EditPlaylist?.Invoke()
                                                                                }
                                                                            }
                                                                        },
                                                                        RowDimensions = new[]
                                                                        {
                                                                            new Dimension(),
                                                                            new Dimension(GridSizeMode.AutoSize),
                                                                        }
                                                                    }
                                                                },
                                                            },
                                                        },
                                                    },
                                                }
                                            },
                                        },
                                    },
                                    new Drawable[]
                                    {
                                        new Container
                                        {
                                            Anchor           = Anchor.BottomLeft,
                                            Origin           = Anchor.BottomLeft,
                                            Y                = 2,
                                            RelativeSizeAxes = Axes.X,
                                            AutoSizeAxes     = Axes.Y,
                                            Children         = new Drawable[]
                                            {
                                                new Box
                                                {
                                                    RelativeSizeAxes = Axes.Both,
                                                    Colour           = OsuColour.FromHex(@"28242d").Darken(0.5f).Opacity(1f),
                                                },
                                                new FillFlowContainer
                                                {
                                                    RelativeSizeAxes = Axes.X,
                                                    AutoSizeAxes     = Axes.Y,
                                                    Direction        = FillDirection.Vertical,
                                                    Spacing          = new Vector2(0, 20),
                                                    Margin           = new MarginPadding {
                                                        Vertical = 20
                                                    },
                                                    Padding = new MarginPadding {
                                                        Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                                                    },
                                                    Children = new Drawable[]
                                                    {
                                                        ApplyButton = new CreateRoomButton
                                                        {
                                                            Anchor  = Anchor.BottomCentre,
                                                            Origin  = Anchor.BottomCentre,
                                                            Size    = new Vector2(230, 55),
                                                            Enabled = { Value = false },
                                                            Action  = apply,
                                                        },
                                                        ErrorText = new OsuSpriteText
                                                        {
                                                            Anchor = Anchor.BottomCentre,
                                                            Origin = Anchor.BottomCentre,
                                                            Alpha  = 0,
                                                            Depth  = 1,
                                                            Colour = colours.RedDark
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                        }
                    },
                    loadingLayer = new LoadingLayer(dimContent)
                };

                TypePicker.Current.BindValueChanged(type => typeLabel.Text = type.NewValue?.Name ?? string.Empty, true);
                RoomName.BindValueChanged(name => NameField.Text           = name.NewValue, true);
                Availability.BindValueChanged(availability => AvailabilityPicker.Current.Value = availability.NewValue, true);
                Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true);
                MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
                Duration.BindValueChanged(duration => DurationField.Current.Value   = duration.NewValue, true);

                playlist.Items.BindTo(Playlist);
            }
Esempio n. 6
0
 private void load(OsuColour colours)
 {
     Children = new Drawable[]
     {
         new StatusColouredContainer(transition_duration)
         {
             RelativeSizeAxes = Axes.Both,
             Child            = selectionBox
         },
         new Container
         {
             RelativeSizeAxes = Axes.Both,
             Padding          = new MarginPadding(SELECTION_BORDER_WIDTH),
             Child            = new Container
             {
                 RelativeSizeAxes = Axes.Both,
                 Masking          = true,
                 CornerRadius     = corner_radius,
                 EdgeEffect       = new EdgeEffectParameters
                 {
                     Type   = EdgeEffectType.Shadow,
                     Colour = Color4.Black.Opacity(40),
                     Radius = 5,
                 },
                 Children = new Drawable[]
                 {
                     new Box
                     {
                         RelativeSizeAxes = Axes.Both,
                         Colour           = OsuColour.FromHex(@"212121"),
                     },
                     new StatusColouredContainer(transition_duration)
                     {
                         RelativeSizeAxes = Axes.Y,
                         Width            = side_strip_width,
                         Child            = new Box {
                             RelativeSizeAxes = Axes.Both
                         }
                     },
                     new Container
                     {
                         RelativeSizeAxes = Axes.Y,
                         Width            = cover_width,
                         Masking          = true,
                         Margin           = new MarginPadding {
                             Left = side_strip_width
                         },
                         Child = new MultiplayerBackgroundSprite {
                             RelativeSizeAxes = Axes.Both
                         }
                     },
                     new Container
                     {
                         RelativeSizeAxes = Axes.Both,
                         Padding          = new MarginPadding
                         {
                             Vertical = content_padding,
                             Left     = side_strip_width + cover_width + content_padding,
                             Right    = content_padding,
                         },
                         Children = new Drawable[]
                         {
                             new FillFlowContainer
                             {
                                 RelativeSizeAxes = Axes.X,
                                 AutoSizeAxes     = Axes.Y,
                                 Direction        = FillDirection.Vertical,
                                 Spacing          = new Vector2(5f),
                                 Children         = new Drawable[]
                                 {
                                     new RoomName {
                                         TextSize = 18
                                     },
                                     new ParticipantInfo(),
                                 },
                             },
                             new FillFlowContainer
                             {
                                 Anchor           = Anchor.BottomLeft,
                                 Origin           = Anchor.BottomLeft,
                                 RelativeSizeAxes = Axes.X,
                                 AutoSizeAxes     = Axes.Y,
                                 Direction        = FillDirection.Vertical,
                                 Spacing          = new Vector2(0, 5),
                                 Children         = new Drawable[]
                                 {
                                     new RoomStatusInfo(),
                                     new BeatmapTitle {
                                         TextSize = 14
                                     },
                                 },
                             },
                             new ModeTypeInfo
                             {
                                 Anchor = Anchor.BottomRight,
                                 Origin = Anchor.BottomRight,
                             },
                         },
                     },
                 },
             },
         },
     };
 }
Esempio n. 7
0
        private void loadUser()
        {
            LoadComponentAsync(new UserCoverBackground(user)
            {
                RelativeSizeAxes = Axes.Both,
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                FillMode         = FillMode.Fill,
                OnLoadComplete   = d => d.FadeInFromZero(200),
                Depth            = float.MaxValue,
            }, coverContainer.Add);

            if (user.IsSupporter)
            {
                SupporterTag.Show();
            }

            if (!string.IsNullOrEmpty(user.Colour))
            {
                colourBar.Colour = OsuColour.FromHex(user.Colour);
                colourBar.Show();
            }

            void boldItalic(SpriteText t) => t.Font = @"Exo2.0-BoldItalic";
            void lightText(SpriteText t) => t.Alpha = 0.8f;

            OsuSpriteText createScoreText(string text) => new OsuSpriteText
            {
                TextSize = 14,
                Text     = text
            };

            OsuSpriteText createScoreNumberText(string text) => new OsuSpriteText
            {
                TextSize = 14,
                Font     = @"Exo2.0-Bold",
                Anchor   = Anchor.TopRight,
                Origin   = Anchor.TopRight,
                Text     = text
            };

            if (user.Country != null)
            {
                infoTextLeft.AddText("From ", lightText);
                infoTextLeft.AddText(user.Country.FullName, boldItalic);
                countryFlag.Country = user.Country;
            }

            infoTextLeft.NewParagraph();

            if (user.JoinDate.ToUniversalTime().Year < 2008)
            {
                infoTextLeft.AddText(new DrawableJoinDate(user.JoinDate), lightText);
            }
            else
            {
                infoTextLeft.AddText("Joined ", lightText);
                infoTextLeft.AddText(new DrawableJoinDate(user.JoinDate), boldItalic);
            }

            if (user.LastVisit.HasValue)
            {
                infoTextLeft.NewLine();
                infoTextLeft.AddText("Last seen ", lightText);
                infoTextLeft.AddText(new DrawableDate(user.LastVisit.Value), boldItalic);
                infoTextLeft.NewParagraph();
            }

            if (user.PlayStyle?.Length > 0)
            {
                infoTextLeft.AddText("Plays with ", lightText);
                infoTextLeft.AddText(string.Join(", ", user.PlayStyle), boldItalic);
            }

            infoTextLeft.NewLine();
            infoTextLeft.AddText("Contributed ", lightText);
            infoTextLeft.AddLink($@"{user.PostCount} forum posts", url: $"https://osu.ppy.sh/users/{user.Id}/posts", creationParameters: boldItalic);

            string websiteWithoutProtcol = user.Website;

            if (!string.IsNullOrEmpty(websiteWithoutProtcol))
            {
                int protocolIndex = websiteWithoutProtcol.IndexOf("//", StringComparison.Ordinal);
                if (protocolIndex >= 0)
                {
                    websiteWithoutProtcol = websiteWithoutProtcol.Substring(protocolIndex + 2);
                }
            }

            tryAddInfoRightLine(FontAwesome.fa_map_marker, user.Location);
            tryAddInfoRightLine(FontAwesome.fa_heart_o, user.Interests);
            tryAddInfoRightLine(FontAwesome.fa_suitcase, user.Occupation);
            infoTextRight.NewParagraph();
            if (!string.IsNullOrEmpty(user.Twitter))
            {
                tryAddInfoRightLine(FontAwesome.fa_twitter, "@" + user.Twitter, $@"https://twitter.com/{user.Twitter}");
            }
            tryAddInfoRightLine(FontAwesome.fa_gamepad, user.Discord);
            tryAddInfoRightLine(FontAwesome.fa_skype, user.Skype, @"skype:" + user.Skype + @"?chat");
            tryAddInfoRightLine(FontAwesome.fa_lastfm, user.Lastfm, $@"https://last.fm/users/{user.Lastfm}");
            tryAddInfoRightLine(FontAwesome.fa_globe, websiteWithoutProtcol, user.Website);

            if (user.Statistics != null)
            {
                levelBadge.Show();
                levelText.Text = user.Statistics.Level.Current.ToString();

                scoreText.Add(createScoreText("Ranked Score"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.RankedScore.ToString(@"#,0")));
                scoreText.Add(createScoreText("Accuracy"));
                scoreNumberText.Add(createScoreNumberText($"{user.Statistics.Accuracy:0.##}%"));
                scoreText.Add(createScoreText("Play Count"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.PlayCount.ToString(@"#,0")));
                scoreText.Add(createScoreText("Total Score"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.TotalScore.ToString(@"#,0")));
                scoreText.Add(createScoreText("Total Hits"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.TotalHits.ToString(@"#,0")));
                scoreText.Add(createScoreText("Max Combo"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.MaxCombo.ToString(@"#,0")));
                scoreText.Add(createScoreText("Replays Watched by Others"));
                scoreNumberText.Add(createScoreNumberText(user.Statistics.ReplaysWatched.ToString(@"#,0")));

                gradeSSPlus.DisplayCount = user.Statistics.GradesCount.SSPlus;
                gradeSSPlus.Show();
                gradeSS.DisplayCount = user.Statistics.GradesCount.SS;
                gradeSS.Show();
                gradeSPlus.DisplayCount = user.Statistics.GradesCount.SPlus;
                gradeSPlus.Show();
                gradeS.DisplayCount = user.Statistics.GradesCount.S;
                gradeS.Show();
                gradeA.DisplayCount = user.Statistics.GradesCount.A;
                gradeA.Show();

                rankGraph.User.Value = user;
            }

            badgeContainer.ShowBadges(user.Badges);
        }
Esempio n. 8
0
        private void load(IAPIProvider api, OsuColour colour)
        {
            var user = score.User;

            statisticsLabels = GetStatistics(score).Select(s => new ScoreComponentLabel(s)).ToList();

            DrawableAvatar innerAvatar;

            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Y,
                    Width            = rank_width,
                    Children         = new[]
                    {
                        new OsuSpriteText
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,
                            Font   = OsuFont.GetFont(size: 20, italics: true),
                            Text   = rank == null ? "-" : rank.Value.ToMetric(decimals: rank < 100000 ? 1 : 0),
                        },
                    },
                },
                content = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Left = rank_width,
                    },
                    Children = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            CornerRadius     = corner_radius,
                            Masking          = true,
                            Children         = new[]
                            {
                                background = new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = user.Id == api.LocalUser.Value.Id && allowHighlight ? colour.Green : Color4.Black,
                                    Alpha            = background_alpha,
                                },
                            },
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Padding          = new MarginPadding(edge_margin),
                            Children         = new[]
                            {
                                avatar          = new DelayedLoadWrapper(
                                    innerAvatar = new DrawableAvatar(user)
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    CornerRadius     = corner_radius,
                                    Masking          = true,
                                    EdgeEffect       = new EdgeEffectParameters
                                    {
                                        Type   = EdgeEffectType.Shadow,
                                        Radius = 1,
                                        Colour = Color4.Black.Opacity(0.2f),
                                    },
                                })
                                {
                                    RelativeSizeAxes = Axes.None,
                                    Size             = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2),
                                },
                                new Container
                                {
                                    RelativeSizeAxes = Axes.Y,
                                    AutoSizeAxes     = Axes.X,
                                    Position         = new Vector2(HEIGHT - edge_margin, 0f),
                                    Children         = new Drawable[]
                                    {
                                        nameLabel = new OsuSpriteText
                                        {
                                            Text = user.Username,
                                            Font = OsuFont.GetFont(size: 23, weight: FontWeight.Bold, italics: true)
                                        },
                                        new FillFlowContainer
                                        {
                                            Origin       = Anchor.BottomLeft,
                                            Anchor       = Anchor.BottomLeft,
                                            AutoSizeAxes = Axes.Both,
                                            Direction    = FillDirection.Horizontal,
                                            Spacing      = new Vector2(10f, 0f),
                                            Children     = new Drawable[]
                                            {
                                                flagBadgeContainer = new Container
                                                {
                                                    Origin   = Anchor.BottomLeft,
                                                    Anchor   = Anchor.BottomLeft,
                                                    Size     = new Vector2(60f, 20f),
                                                    Masking  = true,
                                                    Children = new Drawable[]
                                                    {
                                                        new UpdateableFlag(user.Country)
                                                        {
                                                            Width            = 30,
                                                            RelativeSizeAxes = Axes.Y,
                                                        },
                                                    },
                                                },
                                                new FillFlowContainer
                                                {
                                                    Origin       = Anchor.BottomLeft,
                                                    Anchor       = Anchor.BottomLeft,
                                                    AutoSizeAxes = Axes.Both,
                                                    Direction    = FillDirection.Horizontal,
                                                    Spacing      = new Vector2(10f, 0f),
                                                    Margin       = new MarginPadding {
                                                        Left = edge_margin
                                                    },
                                                    Children = statisticsLabels
                                                },
                                            },
                                        },
                                    },
                                },
                                new FillFlowContainer
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Anchor       = Anchor.TopRight,
                                    Origin       = Anchor.TopRight,
                                    Direction    = FillDirection.Horizontal,
                                    Spacing      = new Vector2(5f, 0f),
                                    Children     = new Drawable[]
                                    {
                                        scoreLabel = new GlowingSpriteText
                                        {
                                            TextColour = Color4.White,
                                            GlowColour = OsuColour.FromHex(@"83ccfa"),
                                            Text       = score.TotalScore.ToString(@"N0"),
                                            Font       = OsuFont.Numeric.With(size: 23),
                                        },
                                        RankContainer = new Container
                                        {
                                            Size     = new Vector2(40f, 20f),
                                            Children = new[]
                                            {
                                                scoreRank = new UpdateableRank(score.Rank)
                                                {
                                                    Anchor = Anchor.Centre,
                                                    Origin = Anchor.Centre,
                                                    Size   = new Vector2(40f)
                                                },
                                            },
                                        },
                                    },
                                },
                                modsContainer = new FillFlowContainer <ModIcon>
                                {
                                    Anchor             = Anchor.BottomRight,
                                    Origin             = Anchor.BottomRight,
                                    AutoSizeAxes       = Axes.Both,
                                    Direction          = FillDirection.Horizontal,
                                    Spacing            = new Vector2(1),
                                    ChildrenEnumerable = score.Mods.Select(mod => new ModIcon(mod)
                                    {
                                        Scale = new Vector2(0.375f)
                                    })
                                },
                            },
                        },
                    },
                },
            };

            innerAvatar.OnLoadComplete += d => d.FadeInFromZero(200);
        }
Esempio n. 9
0
        public MedalOverlay(Medal medal)
        {
            this.medal       = medal;
            RelativeSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Black.Opacity(60),
                },
                outerSpin = new Sprite
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Size   = new Vector2(DISC_SIZE + 500),
                    Alpha  = 0f,
                },
                backgroundStrip = new Container
                {
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    RelativeSizeAxes = Axes.X,
                    Height           = border_width,
                    Alpha            = 0f,
                    Children         = new[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.CentreRight,
                            Width            = 0.5f,
                            Padding          = new MarginPadding {
                                Right = DISC_SIZE / 2
                            },
                            Children = new[]
                            {
                                leftStrip = new BackgroundStrip(0f, 1f)
                                {
                                    Anchor = Anchor.TopRight,
                                    Origin = Anchor.TopRight,
                                },
                            },
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.CentreLeft,
                            Width            = 0.5f,
                            Padding          = new MarginPadding {
                                Left = DISC_SIZE / 2
                            },
                            Children = new[]
                            {
                                rightStrip = new BackgroundStrip(1f, 0f),
                            },
                        },
                    },
                },
                particleContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Alpha            = 0f,
                },
                disc = new CircularContainer
                {
                    Anchor          = Anchor.Centre,
                    Origin          = Anchor.Centre,
                    Alpha           = 0f,
                    Masking         = true,
                    AlwaysPresent   = true,
                    BorderColour    = Color4.White,
                    BorderThickness = border_width,
                    Size            = new Vector2(DISC_SIZE),
                    Scale           = new Vector2(0.8f),
                    Children        = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = OsuColour.FromHex(@"05262f"),
                        },
                        new Triangles
                        {
                            RelativeSizeAxes = Axes.Both,
                            TriangleScale    = 2,
                            ColourDark       = OsuColour.FromHex(@"04222b"),
                            ColourLight      = OsuColour.FromHex(@"052933"),
                        },
                        innerSpin = new Sprite
                        {
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            RelativeSizeAxes = Axes.Both,
                            Size             = new Vector2(1.05f),
                            Alpha            = 0.25f,
                        },
                    },
                },
            };
        }
Esempio n. 10
0
        public PopupDialog()
        {
            RelativeSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                content = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.BottomCentre,
                    Origin           = Anchor.BottomCentre,
                    Width            = 0.4f,
                    Alpha            = 0f,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Masking          = true,
                            EdgeEffect       = new EdgeEffectParameters
                            {
                                Type   = EdgeEffectType.Shadow,
                                Colour = Color4.Black.Opacity(0.5f),
                                Radius = 8,
                            },
                            Children = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = OsuColour.FromHex(@"221a21"),
                                },
                                new Triangles
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    ColourLight      = OsuColour.FromHex(@"271e26"),
                                    ColourDark       = OsuColour.FromHex(@"1e171e"),
                                    TriangleScale    = 4,
                                },
                            },
                        },
                        new FillFlowContainer
                        {
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.BottomCentre,
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Position         = new Vector2(0f, -50f),
                            Direction        = FillDirection.Vertical,
                            Spacing          = new Vector2(0f, 10f),
                            Children         = new Drawable[]
                            {
                                new Container
                                {
                                    Origin = Anchor.TopCentre,
                                    Anchor = Anchor.TopCentre,
                                    Size   = ringSize,
                                    Margin = new MarginPadding
                                    {
                                        Bottom = 30,
                                    },
                                    Children = new Drawable[]
                                    {
                                        ring = new CircularContainer
                                        {
                                            Origin          = Anchor.Centre,
                                            Anchor          = Anchor.Centre,
                                            Masking         = true,
                                            BorderColour    = Color4.White,
                                            BorderThickness = 5f,
                                            Children        = new Drawable[]
                                            {
                                                new Box
                                                {
                                                    RelativeSizeAxes = Axes.Both,
                                                    Colour           = Color4.Black.Opacity(0),
                                                },
                                                iconText = new TextAwesome
                                                {
                                                    Origin   = Anchor.Centre,
                                                    Anchor   = Anchor.Centre,
                                                    Icon     = FontAwesome.fa_close,
                                                    TextSize = 50,
                                                },
                                            },
                                        },
                                    },
                                },
                                header = new OsuSpriteText
                                {
                                    Origin   = Anchor.TopCentre,
                                    Anchor   = Anchor.TopCentre,
                                    Text     = @"Header",
                                    TextSize = 25,
                                    Shadow   = true,
                                },
                                body = new OsuSpriteText
                                {
                                    Origin   = Anchor.TopCentre,
                                    Anchor   = Anchor.TopCentre,
                                    Text     = @"Body",
                                    TextSize = 18,
                                    Shadow   = true,
                                },
                            },
                        },
                        buttonsContainer = new FillFlowContainer <PopupDialogButton>
                        {
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.TopCentre,
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Direction        = FillDirection.Vertical,
                        },
                    },
                },
            };
        }
Esempio n. 11
0
        public ModSelectOverlay()
        {
            Waves.FirstWaveColour  = OsuColour.FromHex(@"19b0e2");
            Waves.SecondWaveColour = OsuColour.FromHex(@"2280a2");
            Waves.ThirdWaveColour  = OsuColour.FromHex(@"005774");
            Waves.FourthWaveColour = OsuColour.FromHex(@"003a4e");

            Height  = 510;
            Padding = new MarginPadding
            {
                Left  = -overflow_padding,
                Right = -overflow_padding
            };

            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = new Color4(36, 50, 68, 255)
                        },
                        new Triangles
                        {
                            TriangleScale    = 5,
                            RelativeSizeAxes = Axes.X,
                            Height           = Height, //set the height from the start to ensure correct triangle density.
                            ColourLight      = new Color4(53, 66, 82, 255),
                            ColourDark       = new Color4(41, 54, 70, 255),
                        },
                    },
                },
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.BottomCentre,
                    Origin           = Anchor.BottomCentre,
                    RowDimensions    = new[]
                    {
                        new Dimension(GridSizeMode.Absolute, 90),
                        new Dimension(GridSizeMode.Distributed),
                        new Dimension(GridSizeMode.Absolute, 70),
                    },
                    Content = new[]
                    {
                        new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Origin           = Anchor.TopCentre,
                                Anchor           = Anchor.TopCentre,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = OsuColour.Gray(10).Opacity(100),
                                    },
                                    new FillFlowContainer
                                    {
                                        Origin           = Anchor.Centre,
                                        Anchor           = Anchor.Centre,
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Direction        = FillDirection.Vertical,
                                        Width            = content_width,
                                        Padding          = new MarginPadding
                                        {
                                            Left  = overflow_padding,
                                            Right = overflow_padding
                                        },
                                        Children = new Drawable[]
                                        {
                                            new OsuSpriteText
                                            {
                                                Font     = @"Exo2.0-Bold",
                                                Text     = @"Gameplay Mods",
                                                TextSize = 22,
                                                Shadow   = true,
                                                Margin   = new MarginPadding
                                                {
                                                    Bottom = 4,
                                                },
                                            },
                                            new OsuTextFlowContainer(text =>
                                            {
                                                text.TextSize = 18;
                                                text.Shadow   = true;
                                            })
                                            {
                                                RelativeSizeAxes = Axes.X,
                                                AutoSizeAxes     = Axes.Y,
                                                Text             = "Mods provide different ways to enjoy gameplay. Some have an effect on the score you can achieve during ranked play.\nOthers are just for fun.",
                                            },
                                        },
                                    },
                                },
                            },
                        },
                        new Drawable[]
                        {
                            // Body
                            new OsuScrollContainer
                            {
                                ScrollbarVisible = false,
                                Origin           = Anchor.TopCentre,
                                Anchor           = Anchor.TopCentre,
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding
                                {
                                    Vertical = 10,
                                    Left     = overflow_padding,
                                    Right    = overflow_padding
                                },
                                Child = ModSectionsContainer = new FillFlowContainer <ModSection>
                                {
                                    Origin           = Anchor.TopCentre,
                                    Anchor           = Anchor.TopCentre,
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Spacing          = new Vector2(0f, 10f),
                                    Width            = content_width,
                                    Children         = new ModSection[]
                                    {
                                        new DifficultyReductionSection {
                                            Action = modButtonPressed
                                        },
                                        new DifficultyIncreaseSection {
                                            Action = modButtonPressed
                                        },
                                        new AutomationSection {
                                            Action = modButtonPressed
                                        },
                                        new ConversionSection {
                                            Action = modButtonPressed
                                        },
                                        new FunSection {
                                            Action = modButtonPressed
                                        },
                                    }
                                },
                            },
                        },
                        new Drawable[]
                        {
                            // Footer
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Origin           = Anchor.TopCentre,
                                Anchor           = Anchor.TopCentre,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = new Color4(172, 20, 116, 255),
                                        Alpha            = 0.5f,
                                    },
                                    footerContainer = new FillFlowContainer
                                    {
                                        Origin           = Anchor.BottomCentre,
                                        Anchor           = Anchor.BottomCentre,
                                        AutoSizeAxes     = Axes.Y,
                                        RelativeSizeAxes = Axes.X,
                                        Width            = content_width,
                                        Direction        = FillDirection.Horizontal,
                                        Padding          = new MarginPadding
                                        {
                                            Vertical = 15,
                                            Left     = overflow_padding,
                                            Right    = overflow_padding
                                        },
                                        Children = new Drawable[]
                                        {
                                            DeselectAllButton = new TriangleButton
                                            {
                                                Width  = 180,
                                                Text   = "Deselect All",
                                                Action = DeselectAll,
                                                Margin = new MarginPadding
                                                {
                                                    Right = 20
                                                }
                                            },
                                            new OsuSpriteText
                                            {
                                                Text     = @"Score Multiplier:",
                                                TextSize = 30,
                                                Margin   = new MarginPadding
                                                {
                                                    Top   = 5,
                                                    Right = 10
                                                }
                                            },
                                            MultiplierLabel = new OsuSpriteText
                                            {
                                                Font     = @"Exo2.0-Bold",
                                                TextSize = 30,
                                                Margin   = new MarginPadding
                                                {
                                                    Top = 5
                                                }
                                            },
                                            UnrankedLabel = new OsuSpriteText
                                            {
                                                Font     = @"Exo2.0-Bold",
                                                Text     = @"(Unranked)",
                                                TextSize = 30,
                                                Margin   = new MarginPadding
                                                {
                                                    Top  = 5,
                                                    Left = 10
                                                }
                                            }
                                        }
                                    }
                                },
                            }
                        },
                    },
                },
            };
        }
Esempio n. 12
0
 public Editor()
 {
     Add(new Container
     {
         RelativeSizeAxes = Axes.X,
         Height           = 40,
         Children         = new Drawable[]
         {
             new Box
             {
                 RelativeSizeAxes = Axes.Both,
                 Colour           = OsuColour.FromHex("111")
             },
             new EditorMenuBar
             {
                 Anchor = Anchor.CentreLeft,
                 Origin = Anchor.CentreLeft,
                 X      = 100,
                 Items  = new[]
                 {
                     new EditorMenuBarItem("File")
                     {
                         Items = new[]
                         {
                             new EditorMenuItem("Clear all notes"),
                             new EditorMenuItem("Open difficulty..."),
                             new EditorMenuItem("Save"),
                             new EditorMenuItem("Create new difficulty..."),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Revert to saved"),
                             new EditorMenuItem("Revert to saved (full"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Test beatmap"),
                             new EditorMenuItem("Open AiMod"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Upload Beatmap..."),
                             new EditorMenuItem("Export package"),
                             new EditorMenuItem("Export map package"),
                             new EditorMenuItem("Import from..."),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Open song folder"),
                             new EditorMenuItem("Open .osu in Notepad"),
                             new EditorMenuItem("Open .osb in Notepad"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Exit", MenuItemType.Standard, Exit)
                         }
                     },
                     new EditorMenuBarItem("Edit")
                     {
                         Items = new[]
                         {
                             new EditorMenuItem("Undo"),
                             new EditorMenuItem("Redo"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Cut"),
                             new EditorMenuItem("Copy"),
                             new EditorMenuItem("Paste"),
                             new EditorMenuItem("Delete"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Select all"),
                             new EditorMenuItem("Clone"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Reverse selection"),
                             new EditorMenuItem("Flip horizontally"),
                             new EditorMenuItem("Flip vertically"),
                             new EditorMenuItem("Rotate 90deg clockwise"),
                             new EditorMenuItem("Rotate 90deg anticlockwise"),
                             new EditorMenuItem("Rotate by..."),
                             new EditorMenuItem("Scale by..."),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Reset selected objects' samples"),
                             new EditorMenuItem("Reset all samples", MenuItemType.Destructive),
                             new EditorMenuItem("Reset combo colours", MenuItemType.Destructive),
                             new EditorMenuItem("Reset breaks", MenuItemType.Destructive),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Nudge backward"),
                             new EditorMenuItem("Nudge forward")
                         }
                     },
                     new EditorMenuBarItem("View")
                     {
                         Items = new[]
                         {
                             new EditorMenuItem("Compose"),
                             new EditorMenuItem("Design"),
                             new EditorMenuItem("Timing"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Song setup..."),
                             new EditorMenuItem("Timing setup..."),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Volume"),
                             new EditorMenuItem("Grid level"),
                             new EditorMenuItem("Show video"),
                             new EditorMenuItem("Show sample name"),
                             new EditorMenuItem("Snaking sliders"),
                             new EditorMenuItem("Hit animations"),
                             new EditorMenuItem("Follow points"),
                             new EditorMenuItem("Stacking")
                         }
                     },
                     new EditorMenuBarItem("Compose")
                     {
                         Items = new[]
                         {
                             new EditorMenuItem("Snap divisor"),
                             new EditorMenuItem("Audio rate"),
                             new EditorMenuItem("Grid snapping"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Create polygon cricles..."),
                             new EditorMenuItem("Convert slider to stream"),
                             new EditorMenuItem("Enable live mapping mode"),
                             new EditorMenuItem("Sample import")
                         }
                     },
                     new EditorMenuBarItem("Design")
                     {
                         Items = new[]
                         {
                             new EditorMenuItem("Move all elements in time...")
                         }
                     },
                     new EditorMenuBarItem("Timing")
                     {
                         Items = new[]
                         {
                             new EditorMenuItem("Time signature"),
                             new EditorMenuItem("Metronome clicks"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Add timing section"),
                             new EditorMenuItem("Add inheriting section"),
                             new EditorMenuItem("Reset current section"),
                             new EditorMenuItem("Delete timing section"),
                             new EditorMenuItem("Resnap current section"),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Timing setup..."),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Resnap all notes", MenuItemType.Destructive),
                             new EditorMenuItem("Move all notes in time...", MenuItemType.Destructive),
                             new EditorMenuItem("Recalculate slider lengths", MenuItemType.Destructive),
                             new EditorMenuItem("Delete all timing sections", MenuItemType.Destructive),
                             new EditorMenuItemSpacer(),
                             new EditorMenuItem("Set current position as preview point")
                         }
                     },
                     new EditorMenuBarItem("Web")
                     {
                         Items = new[]
                         {
                             new EditorMenuItem("This Beatmap's information page"),
                             new EditorMenuItem("This Beatmap's thread"),
                             new EditorMenuItem("Quick reply")
                         }
                     },
                     new EditorMenuBarItem("Help")
                     {
                         Items = new[]
                         {
                             new EditorMenuItem("Show in-game help"),
                             new EditorMenuItem("View FAQ")
                         }
                     }
                 }
             }
         }
     });
 }
Esempio n. 13
0
            public ScoreComponentLabel(LeaderboardScoreStatistic statistic)
            {
                name         = statistic.Name;
                AutoSizeAxes = Axes.Both;

                Child = content = new FillFlowContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Horizontal,
                    Children     = new Drawable[]
                    {
                        new Container
                        {
                            Anchor       = Anchor.CentreLeft,
                            Origin       = Anchor.CentreLeft,
                            AutoSizeAxes = Axes.Both,
                            Children     = new[]
                            {
                                new SpriteIcon
                                {
                                    Anchor   = Anchor.Centre,
                                    Origin   = Anchor.Centre,
                                    Size     = new Vector2(icon_size),
                                    Rotation = 45,
                                    Colour   = OsuColour.FromHex(@"3087ac"),
                                    Icon     = FontAwesome.fa_square,
                                    Shadow   = true,
                                },
                                new SpriteIcon
                                {
                                    Anchor = Anchor.Centre,
                                    Origin = Anchor.Centre,
                                    Size   = new Vector2(icon_size - 6),
                                    Colour = OsuColour.FromHex(@"a4edff"),
                                    Icon   = statistic.Icon,
                                },
                            },
                        },
                        new GlowingSpriteText(statistic.Value, OsuFont.GetFont(size: 17, weight: FontWeight.Bold), Color4.White, OsuColour.FromHex(@"83ccfa"))
                        {
                            Anchor = Anchor.CentreLeft,
                            Origin = Anchor.CentreLeft,
                        },
                    },
                };
            }
Esempio n. 14
0
        public RoomSettingsOverlay(Room room)
        {
            Masking = true;

            Child = content = new Container
            {
                RelativeSizeAxes     = Axes.Both,
                RelativePositionAxes = Axes.Y,
                Children             = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = OsuColour.FromHex(@"28242d"),
                    },
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Padding          = new MarginPadding {
                            Top = 35, Bottom = 75, Horizontal = SearchableListOverlay.WIDTH_PADDING
                        },
                        Children = new[]
                        {
                            new SectionContainer
                            {
                                Padding = new MarginPadding {
                                    Right = field_padding / 2
                                },
                                Children = new[]
                                {
                                    new Section("ROOM NAME")
                                    {
                                        Child = NameField = new SettingsTextBox
                                        {
                                            RelativeSizeAxes         = Axes.X,
                                            TabbableContentContainer = this,
                                            OnCommit = (sender, text) => apply(),
                                        },
                                    },
                                    new Section("ROOM VISIBILITY")
                                    {
                                        Child = AvailabilityPicker = new RoomAvailabilityPicker(),
                                    },
                                    new Section("GAME TYPE")
                                    {
                                        Child = new FillFlowContainer
                                        {
                                            AutoSizeAxes     = Axes.Y,
                                            RelativeSizeAxes = Axes.X,
                                            Direction        = FillDirection.Vertical,
                                            Spacing          = new Vector2(7),
                                            Children         = new Drawable[]
                                            {
                                                TypePicker = new GameTypePicker
                                                {
                                                    RelativeSizeAxes = Axes.X,
                                                },
                                                typeLabel = new OsuSpriteText
                                                {
                                                    TextSize = 14,
                                                },
                                            },
                                        },
                                    },
                                },
                            },
                            new SectionContainer
                            {
                                Anchor  = Anchor.TopRight,
                                Origin  = Anchor.TopRight,
                                Padding = new MarginPadding {
                                    Left = field_padding / 2
                                },
                                Children = new[]
                                {
                                    new Section("MAX PARTICIPANTS")
                                    {
                                        Child = MaxParticipantsField = new SettingsNumberTextBox
                                        {
                                            RelativeSizeAxes         = Axes.X,
                                            TabbableContentContainer = this,
                                            OnCommit = (sender, text) => apply(),
                                        },
                                    },
                                    new Section("PASSWORD (OPTIONAL)")
                                    {
                                        Child = new SettingsPasswordTextBox
                                        {
                                            RelativeSizeAxes         = Axes.X,
                                            TabbableContentContainer = this,
                                            OnCommit = (sender, text) => apply(),
                                        },
                                    },
                                },
                            },
                        },
                    },
                    ApplyButton = new ApplySettingsButton
                    {
                        Anchor = Anchor.BottomCentre,
                        Origin = Anchor.BottomCentre,
                        Size   = new Vector2(230, 35),
                        Margin = new MarginPadding {
                            Bottom = 20
                        },
                        Action = apply,
                    },
                },
            };

            TypePicker.Current.ValueChanged += t => typeLabel.Text = t.Name;

            nameBind.ValueChanged            += n => NameField.Text = n;
            availabilityBind.ValueChanged    += a => AvailabilityPicker.Current.Value = a;
            typeBind.ValueChanged            += t => TypePicker.Current.Value = t;
            maxParticipantsBind.ValueChanged += m => MaxParticipantsField.Text = m?.ToString();

            nameBind.BindTo(room.Name);
            availabilityBind.BindTo(room.Availability);
            typeBind.BindTo(room.Type);
            maxParticipantsBind.BindTo(room.MaxParticipants);
        }
Esempio n. 15
0
File: OsuLogo.cs Progetto: tgi74/osu
        public OsuLogo()
        {
            EarlyActivationMilliseconds = early_activation;

            Size = new Vector2(default_size);

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            AutoSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                logoHoverContainer = new Container
                {
                    AutoSizeAxes = Axes.Both,
                    Children     = new Drawable[]
                    {
                        logoBounceContainer = new Container
                        {
                            AutoSizeAxes = Axes.Both,
                            Children     = new Drawable[]
                            {
                                rippleContainer = new Container
                                {
                                    Anchor           = Anchor.Centre,
                                    Origin           = Anchor.Centre,
                                    RelativeSizeAxes = Axes.Both,
                                    Children         = new Drawable[]
                                    {
                                        ripple = new Sprite
                                        {
                                            Anchor       = Anchor.Centre,
                                            Origin       = Anchor.Centre,
                                            BlendingMode = BlendingMode.Additive,
                                            Alpha        = 0
                                        }
                                    }
                                },
                                logoAmplitudeContainer = new Container
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new Drawable[]
                                    {
                                        logoBeatContainer = new Container
                                        {
                                            AutoSizeAxes = Axes.Both,
                                            Children     = new Drawable[]
                                            {
                                                visualizer = new LogoVisualisation
                                                {
                                                    RelativeSizeAxes = Axes.Both,
                                                    Origin           = Anchor.Centre,
                                                    Anchor           = Anchor.Centre,
                                                    Alpha            = 0.5f,
                                                    Size             = new Vector2(0.96f)
                                                },
                                                new BufferedContainer
                                                {
                                                    AutoSizeAxes = Axes.Both,
                                                    Children     = new Drawable[]
                                                    {
                                                        logoContainer = new CircularContainer
                                                        {
                                                            Anchor           = Anchor.Centre,
                                                            Origin           = Anchor.Centre,
                                                            RelativeSizeAxes = Axes.Both,
                                                            Scale            = new Vector2(0.88f),
                                                            Masking          = true,
                                                            Children         = new Drawable[]
                                                            {
                                                                colourAndTriangles = new Container
                                                                {
                                                                    RelativeSizeAxes = Axes.Both,
                                                                    Anchor           = Anchor.Centre,
                                                                    Origin           = Anchor.Centre,
                                                                    Children         = new Drawable[]
                                                                    {
                                                                        new Box
                                                                        {
                                                                            RelativeSizeAxes = Axes.Both,
                                                                            Colour           = OsuPink,
                                                                        },
                                                                        triangles = new Triangles
                                                                        {
                                                                            TriangleScale    = 4,
                                                                            ColourLight      = OsuColour.FromHex(@"ff7db7"),
                                                                            ColourDark       = OsuColour.FromHex(@"de5b95"),
                                                                            RelativeSizeAxes = Axes.Both,
                                                                        },
                                                                    }
                                                                },
                                                                flashLayer = new Box
                                                                {
                                                                    RelativeSizeAxes = Axes.Both,
                                                                    BlendingMode     = BlendingMode.Additive,
                                                                    Colour           = Color4.White,
                                                                    Alpha            = 0,
                                                                },
                                                            },
                                                        },
                                                        logo = new Sprite
                                                        {
                                                            Anchor = Anchor.Centre,
                                                            Origin = Anchor.Centre,
                                                        },
                                                    }
                                                },
                                                impactContainer = new CircularContainer
                                                {
                                                    Anchor           = Anchor.Centre,
                                                    Origin           = Anchor.Centre,
                                                    Alpha            = 0,
                                                    BorderColour     = Color4.White,
                                                    RelativeSizeAxes = Axes.Both,
                                                    BorderThickness  = 10,
                                                    Masking          = true,
                                                    Children         = new Drawable[]
                                                    {
                                                        new Box
                                                        {
                                                            RelativeSizeAxes = Axes.Both,
                                                            AlwaysPresent    = true,
                                                            Alpha            = 0,
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };
        }
Esempio n. 16
0
        public ChannelSelectionOverlay()
        {
            RelativeSizeAxes = Axes.X;

            Waves.FirstWaveColour  = OsuColour.FromHex("353535");
            Waves.SecondWaveColour = OsuColour.FromHex("434343");
            Waves.ThirdWaveColour  = OsuColour.FromHex("515151");
            Waves.FourthWaveColour = OsuColour.FromHex("595959");

            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        bg = new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                        },
                        triangles = new Triangles
                        {
                            RelativeSizeAxes = Axes.Both,
                            TriangleScale    = 5,
                        },
                    },
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Top = 85, Right = WIDTH_PADDING
                    },
                    Children = new[]
                    {
                        new OsuScrollContainer
                        {
                            RelativeSizeAxes = Axes.Both,
                            Children         = new[]
                            {
                                sectionsFlow = new SearchContainer <ChannelSection>
                                {
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Direction        = FillDirection.Vertical,
                                    LayoutDuration   = 200,
                                    LayoutEasing     = Easing.OutQuint,
                                    Spacing          = new Vector2(0f, 20f),
                                    Padding          = new MarginPadding {
                                        Vertical = 20, Left = WIDTH_PADDING
                                    },
                                },
                            },
                        },
                    },
                },
                new Container
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Children         = new Drawable[]
                    {
                        headerBg = new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                        },
                        new FillFlowContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Direction        = FillDirection.Vertical,
                            Spacing          = new Vector2(0f, 10f),
                            Padding          = new MarginPadding {
                                Top = 10f, Bottom = 10f, Left = WIDTH_PADDING, Right = WIDTH_PADDING
                            },
                            Children = new Drawable[]
                            {
                                new OsuSpriteText
                                {
                                    Text   = @"Chat Channels",
                                    Font   = OsuFont.GetFont(size: 20),
                                    Shadow = false,
                                },
                                search = new HeaderSearchTextBox {
                                    RelativeSizeAxes = Axes.X
                                },
                            },
                        },
                    },
                },
            };

            search.Current.ValueChanged += term => sectionsFlow.SearchTerm = term.NewValue;
        }
Esempio n. 17
0
        public ParticipantInfo(string rankPrefix = null)
        {
            RelativeSizeAxes = Axes.X;
            Height           = 15f;

            Children = new Drawable[]
            {
                new FillFlowContainer
                {
                    AutoSizeAxes     = Axes.X,
                    RelativeSizeAxes = Axes.Y,
                    Direction        = FillDirection.Horizontal,
                    Spacing          = new Vector2(5f, 0f),
                    Children         = new Drawable[]
                    {
                        flagContainer = new Container
                        {
                            Width            = 22f,
                            RelativeSizeAxes = Axes.Y,
                        },
                        new Container //todo: team banners
                        {
                            Width            = 38f,
                            RelativeSizeAxes = Axes.Y,
                            CornerRadius     = 2f,
                            Masking          = true,
                            Children         = new[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = OsuColour.FromHex(@"ad387e"),
                                },
                            },
                        },
                        new OsuSpriteText
                        {
                            Text     = "hosted by",
                            Anchor   = Anchor.CentreLeft,
                            Origin   = Anchor.CentreLeft,
                            TextSize = 14,
                        },
                        host = new OsuSpriteText
                        {
                            Anchor   = Anchor.CentreLeft,
                            Origin   = Anchor.CentreLeft,
                            TextSize = 14,
                            Font     = @"Exo2.0-BoldItalic",
                        },
                    },
                },
                levelRangeContainer = new FillFlowContainer
                {
                    Anchor       = Anchor.CentreRight,
                    Origin       = Anchor.CentreRight,
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Horizontal,
                    Children     = new[]
                    {
                        new OsuSpriteText
                        {
                            Text     = rankPrefix,
                            TextSize = 14,
                        },
                        new OsuSpriteText
                        {
                            Text     = "#",
                            TextSize = 14,
                        },
                        levelRangeLower = new OsuSpriteText
                        {
                            TextSize = 14,
                            Font     = @"Exo2.0-Bold",
                        },
                        new OsuSpriteText
                        {
                            Text     = " - ",
                            TextSize = 14,
                        },
                        new OsuSpriteText
                        {
                            Text     = "#",
                            TextSize = 14,
                        },
                        levelRangeHigher = new OsuSpriteText
                        {
                            TextSize = 14,
                            Font     = @"Exo2.0-Bold",
                        },
                    },
                },
            };
        }
Esempio n. 18
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            bool     hasBackground = !string.IsNullOrEmpty(Message.Sender.Colour);
            Drawable username      = new OsuSpriteText
            {
                Font     = @"Exo2.0-BoldItalic",
                Text     = $@"{Message.Sender.Username}" + (hasBackground ? "" : ":"),
                Colour   = hasBackground ? customUsernameColour : username_colours[Message.UserId % username_colours.Length],
                TextSize = text_size,
            };

            if (hasBackground)
            {
                // Background effect
                username = username.WithEffect(new EdgeEffect
                {
                    CornerRadius = 4,
                    Parameters   = new EdgeEffectParameters
                    {
                        Radius = 1,
                        Colour = OsuColour.FromHex(Message.Sender.Colour),
                        Type   = EdgeEffectType.Shadow,
                    }
                }, d =>
                {
                    d.Padding = new MarginPadding {
                        Left = 3, Right = 3, Bottom = 1, Top = -3
                    };
                    d.Y = 3;
                })
                           // Drop shadow effect
                           .WithEffect(new EdgeEffect
                {
                    CornerRadius = 4,
                    Parameters   = new EdgeEffectParameters
                    {
                        Roundness = 1,
                        Offset    = new Vector2(0, 3),
                        Radius    = 3,
                        Colour    = Color4.Black.Opacity(0.3f),
                        Type      = EdgeEffectType.Shadow,
                    }
                });
            }

            Children = new Drawable[]
            {
                new Container
                {
                    Size     = new Vector2(message_padding, text_size),
                    Children = new Drawable[]
                    {
                        new OsuSpriteText
                        {
                            Anchor     = Anchor.CentreLeft,
                            Origin     = Anchor.CentreLeft,
                            Font       = @"Exo2.0-SemiBold",
                            Text       = $@"{Message.Timestamp.LocalDateTime:HH:mm:ss}",
                            FixedWidth = true,
                            TextSize   = text_size * 0.75f,
                            Alpha      = 0.4f,
                        },
Esempio n. 19
0
        public BeatmapPanel(BeatmapInfo beatmap)
        {
            Beatmap = beatmap;
            Height *= 0.60f;

            Children = new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                },
                triangles = new Triangles
                {
                    TriangleScale    = 2,
                    RelativeSizeAxes = Axes.Both,
                    ColourLight      = OsuColour.FromHex(@"3a7285"),
                    ColourDark       = OsuColour.FromHex(@"123744")
                },
                new FillFlowContainer
                {
                    Padding      = new MarginPadding(5),
                    Direction    = FillDirection.Horizontal,
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.CentreLeft,
                    Origin       = Anchor.CentreLeft,
                    Children     = new Drawable[]
                    {
                        new DifficultyIcon(beatmap)
                        {
                            Scale = new Vector2(1.8f),
                        },
                        new FillFlowContainer
                        {
                            Padding = new MarginPadding {
                                Left = 5
                            },
                            Direction    = FillDirection.Vertical,
                            AutoSizeAxes = Axes.Both,
                            Children     = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    Direction    = FillDirection.Horizontal,
                                    Spacing      = new Vector2(4, 0),
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-Medium",
                                            Text     = beatmap.Version,
                                            TextSize = 20,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-Medium",
                                            Text     = "mapped by",
                                            TextSize = 16,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-MediumItalic",
                                            Text     = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}",
                                            TextSize = 16,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                    }
                                },
                                starCounter = new StarCounter
                                {
                                    Count = (float)beatmap.StarDifficulty,
                                    Scale = new Vector2(0.8f),
                                }
                            }
                        }
                    }
                }
            };
        }
Esempio n. 20
0
        private void load()
        {
            const int line_offset   = 80;
            const int circle_offset = 250;

            Children = new Drawable[]
            {
                lines = new Container <Box>
                {
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    AutoSizeAxes = Axes.Both,
                    Children     = new []
                    {
                        lineTopLeft = new Box
                        {
                            Origin   = Anchor.CentreLeft,
                            Anchor   = Anchor.Centre,
                            Position = new Vector2(-line_offset, -line_offset),
                            Rotation = 45,
                            Colour   = Color4.White.Opacity(180),
                        },
                        lineTopRight = new Box
                        {
                            Origin   = Anchor.CentreRight,
                            Anchor   = Anchor.Centre,
                            Position = new Vector2(line_offset, -line_offset),
                            Rotation = -45,
                            Colour   = Color4.White.Opacity(80),
                        },
                        lineBottomLeft = new Box
                        {
                            Origin   = Anchor.CentreLeft,
                            Anchor   = Anchor.Centre,
                            Position = new Vector2(-line_offset, line_offset),
                            Rotation = -45,
                            Colour   = Color4.White.Opacity(230),
                        },
                        lineBottomRight = new Box
                        {
                            Origin   = Anchor.CentreRight,
                            Anchor   = Anchor.Centre,
                            Position = new Vector2(line_offset, line_offset),
                            Rotation = 45,
                            Colour   = Color4.White.Opacity(130),
                        },
                    }
                },
                bigRing     = new Ring(OsuColour.FromHex(@"B6C5E9"), 0.85f),
                mediumRing  = new Ring(Color4.White.Opacity(130), 0.7f),
                smallRing   = new Ring(Color4.White, 0.6f),
                welcomeText = new OsuSpriteText
                {
                    Anchor  = Anchor.Centre,
                    Origin  = Anchor.Centre,
                    Text    = "welcome",
                    Padding = new MarginPadding {
                        Bottom = 10
                    },
                    Font     = @"Exo2.0-Light",
                    Alpha    = 0,
                    TextSize = 42,
                    Spacing  = new Vector2(5),
                },
                new CircularContainer
                {
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.Centre,
                    Size     = new Vector2(logo_size),
                    Masking  = true,
                    Children = new Drawable[]
                    {
                        backgroundFill = new Box
                        {
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            RelativeSizeAxes = Axes.Both,
                            Height           = 0,
                            Colour           = OsuColour.FromHex(@"C6D8FF").Opacity(160),
                        },
                        foregroundFill = new Box
                        {
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            Size             = Vector2.Zero,
                            RelativeSizeAxes = Axes.Both,
                            Width            = 0,
                            Colour           = Color4.White,
                        },
                    }
                },
                purpleCircle = new Circle
                {
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.TopCentre,
                    Position = new Vector2(0, circle_offset),
                    Colour   = OsuColour.FromHex(@"AA92FF"),
                },
                blueCircle = new Circle
                {
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.CentreRight,
                    Position = new Vector2(-circle_offset, 0),
                    Colour   = OsuColour.FromHex(@"8FE5FE"),
                },
                yellowCircle = new Circle
                {
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.BottomCentre,
                    Position = new Vector2(0, -circle_offset),
                    Colour   = OsuColour.FromHex(@"FFD64C"),
                },
                pinkCircle = new Circle
                {
                    Anchor   = Anchor.Centre,
                    Origin   = Anchor.CentreLeft,
                    Position = new Vector2(circle_offset, 0),
                    Colour   = OsuColour.FromHex(@"e967a1"),
                },
            };

            foreach (var line in lines)
            {
                line.Size  = new Vector2(105, 1.5f);
                line.Alpha = 0;
            }

            Scale = new Vector2(0.5f);
        }
Esempio n. 21
0
        public Header(ScreenStack stack)
        {
            RelativeSizeAxes = Axes.X;
            Height           = HEIGHT;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex(@"2f2043"),
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Horizontal = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                    },
                    Children = new Drawable[]
                    {
                        new FillFlowContainer
                        {
                            Anchor       = Anchor.CentreLeft,
                            Origin       = Anchor.BottomLeft,
                            Position     = new Vector2(-35f, 5f),
                            AutoSizeAxes = Axes.Both,
                            Direction    = FillDirection.Horizontal,
                            Spacing      = new Vector2(10f, 0f),
                            Children     = new Drawable[]
                            {
                                new SpriteIcon
                                {
                                    Size = new Vector2(25),
                                    Icon = FontAwesome.fa_osu_multi,
                                },
                                new FillFlowContainer
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Horizontal,
                                    Children     = new[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Text     = "multiplayer ",
                                            TextSize = 25,
                                        },
                                        screenType = new OsuSpriteText
                                        {
                                            TextSize = 25,
                                            Font     = @"Exo2.0-Light",
                                        },
                                    },
                                },
                            },
                        },
                        breadcrumbs = new HeaderBreadcrumbControl(stack)
                        {
                            Anchor           = Anchor.BottomLeft,
                            Origin           = Anchor.BottomLeft,
                            RelativeSizeAxes = Axes.X,
                        },
                    },
                },
            };

            breadcrumbs.Current.ValueChanged += s =>
            {
                if (s is IMultiplayerSubScreen mpScreen)
                {
                    screenType.Text = mpScreen.ShortTitle.ToLowerInvariant();
                }
            };

            breadcrumbs.Current.TriggerChange();
        }
Esempio n. 22
0
        public OsuLogo()
        {
            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            AutoSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                logoBounceContainer = new Container
                {
                    AutoSizeAxes = Axes.Both,
                    Children     = new Drawable[]
                    {
                        logoHoverContainer = new Container
                        {
                            AutoSizeAxes = Axes.Both,
                            Children     = new Drawable[]
                            {
                                new BufferedContainer
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new Drawable[]
                                    {
                                        logoContainer = new CircularContainer
                                        {
                                            Anchor           = Anchor.Centre,
                                            RelativeSizeAxes = Axes.Both,
                                            Scale            = new Vector2(0.8f),
                                            Children         = new Drawable[]
                                            {
                                                colourAndTriangles = new Container
                                                {
                                                    RelativeSizeAxes = Axes.Both,
                                                    Anchor           = Anchor.Centre,
                                                    Origin           = Anchor.Centre,
                                                    Children         = new Drawable[]
                                                    {
                                                        new Box
                                                        {
                                                            RelativeSizeAxes = Axes.Both,
                                                            Colour           = OsuPink,
                                                        },
                                                        new Triangles
                                                        {
                                                            TriangleScale    = 4,
                                                            ColourLight      = OsuColour.FromHex(@"ff7db7"),
                                                            ColourDark       = OsuColour.FromHex(@"de5b95"),
                                                            RelativeSizeAxes = Axes.Both,
                                                        },
                                                    }
                                                },
                                                flashLayer = new Box
                                                {
                                                    RelativeSizeAxes = Axes.Both,
                                                    BlendingMode     = BlendingMode.Additive,
                                                    Colour           = Color4.White,
                                                    Alpha            = 0,
                                                },
                                            },
                                        },
                                        logo = new Sprite
                                        {
                                            Anchor = Anchor.Centre,
                                            Origin = Anchor.Centre,
                                        },
                                    }
                                },
                                rippleContainer = new Container
                                {
                                    Anchor   = Anchor.Centre,
                                    Origin   = Anchor.Centre,
                                    Children = new Drawable[]
                                    {
                                        ripple = new Sprite
                                        {
                                            Anchor       = Anchor.Centre,
                                            Origin       = Anchor.Centre,
                                            BlendingMode = BlendingMode.Additive,
                                            Alpha        = 0.15f
                                        }
                                    }
                                },
                                new MenuVisualisation
                                {
                                    Anchor       = Anchor.Centre,
                                    Origin       = Anchor.Centre,
                                    Size         = logo.Size,
                                    BlendingMode = BlendingMode.Additive,
                                    Alpha        = 0.2f,
                                }
                            }
                        }
                    }
                }
            };
        }
Esempio n. 23
0
 protected override Drawable CreateBackground() =>
 new Container
 {
     RelativeSizeAxes = Axes.Both,
     Children         = new Drawable[]
     {
         coverContainer = new UserCoverBackground
         {
             RelativeSizeAxes = Axes.Both,
         },
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = ColourInfo.GradientVertical(OsuColour.FromHex("222").Opacity(0.8f), OsuColour.FromHex("222").Opacity(0.2f))
         },
     }
 };
Esempio n. 24
0
        public Multiplayer()
        {
            Anchor           = Anchor.Centre;
            Origin           = Anchor.Centre;
            RelativeSizeAxes = Axes.Both;
            Padding          = new MarginPadding {
                Horizontal = -HORIZONTAL_OVERFLOW_PADDING
            };

            InternalChild = waves = new MultiplayerWaveContainer
            {
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Masking          = true,
                        Children         = new Drawable[]
                        {
                            new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                Colour           = OsuColour.FromHex(@"3e3a44"),
                            },
                            new Triangles
                            {
                                RelativeSizeAxes = Axes.Both,
                                ColourLight      = OsuColour.FromHex(@"3c3842"),
                                ColourDark       = OsuColour.FromHex(@"393540"),
                                TriangleScale    = 5,
                            },
                        },
                    },
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Padding          = new MarginPadding {
                            Top = Header.HEIGHT
                        },
                        Child = screenStack = new ScreenStack(loungeSubScreen = new LoungeSubScreen())
                        {
                            RelativeSizeAxes = Axes.Both
                        }
                    },
                    new Header(screenStack),
                    createButton = new HeaderButton
                    {
                        Anchor           = Anchor.TopRight,
                        Origin           = Anchor.TopRight,
                        RelativeSizeAxes = Axes.None,
                        Size             = new Vector2(150, Header.HEIGHT - 20),
                        Margin           = new MarginPadding
                        {
                            Top   = 10,
                            Right = 10 + HORIZONTAL_OVERFLOW_PADDING,
                        },
                        Text   = "Create room",
                        Action = () => loungeSubScreen.Open(new Room
                        {
                            Name = { Value = $"{api.LocalUser}'s awesome room" }
                        }),
                    },
                    roomManager = new RoomManager()
                }
            };

            screenStack.ScreenPushed += screenPushed;
            screenStack.ScreenExited += screenExited;
        }
Esempio n. 25
0
        private void load()
        {
            ReadyButton       readyButton;
            ViewBeatmapButton viewBeatmapButton;
            HostInfo          hostInfo;
            RoomStatusInfo    statusInfo;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex(@"28242d"),
                },
                new Container
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Padding          = new MarginPadding {
                        Horizontal = SearchableListOverlay.WIDTH_PADDING + OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                    },
                    Children = new Drawable[]
                    {
                        new FillFlowContainer
                        {
                            AutoSizeAxes = Axes.Both,
                            Direction    = FillDirection.Vertical,
                            Spacing      = new Vector2(0, 10),
                            Padding      = new MarginPadding {
                                Vertical = 20
                            },
                            Children = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Vertical,
                                    Children     = new Drawable[]
                                    {
                                        new OsuSpriteText
                                        {
                                            TextSize = 30,
                                            Current  = Name
                                        },
                                        new RoomStatusInfo(),
                                    }
                                },
                                hostInfo = new HostInfo(),
                            },
                        },
                        new FillFlowContainer
                        {
                            Anchor       = Anchor.CentreRight,
                            Origin       = Anchor.CentreRight,
                            AutoSizeAxes = Axes.X,
                            Height       = 70,
                            Spacing      = new Vector2(10, 0),
                            Direction    = FillDirection.Horizontal,
                            Children     = new Drawable[]
                            {
                                viewBeatmapButton = new ViewBeatmapButton(),
                                readyButton       = new ReadyButton
                                {
                                    Action = () => OnStart?.Invoke()
                                }
                            }
                        }
                    },
                },
            };

            viewBeatmapButton.Beatmap.BindTo(CurrentBeatmap);
            readyButton.Beatmap.BindTo(CurrentBeatmap);
            hostInfo.Host.BindTo(Host);
        }
Esempio n. 26
0
        public ModSelectOverlay()
        {
            Waves.FirstWaveColour  = OsuColour.FromHex(@"19b0e2");
            Waves.SecondWaveColour = OsuColour.FromHex(@"2280a2");
            Waves.ThirdWaveColour  = OsuColour.FromHex(@"005774");
            Waves.FourthWaveColour = OsuColour.FromHex(@"003a4e");

            RelativeSizeAxes = Axes.Both;

            Padding = new MarginPadding {
                Horizontal = -OsuScreen.HORIZONTAL_OVERFLOW_PADDING
            };

            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = new Color4(36, 50, 68, 255)
                        },
                        new Triangles
                        {
                            TriangleScale    = 5,
                            RelativeSizeAxes = Axes.Both,
                            ColourLight      = new Color4(53, 66, 82, 255),
                            ColourDark       = new Color4(41, 54, 70, 255),
                        },
                    },
                },
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.BottomCentre,
                    Origin           = Anchor.BottomCentre,
                    RowDimensions    = new[]
                    {
                        new Dimension(GridSizeMode.Absolute, 90),
                        new Dimension(GridSizeMode.Distributed),
                        new Dimension(GridSizeMode.Absolute, 70),
                    },
                    Content = new[]
                    {
                        new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Origin           = Anchor.TopCentre,
                                Anchor           = Anchor.TopCentre,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = OsuColour.Gray(10).Opacity(100),
                                    },
                                    new FillFlowContainer
                                    {
                                        Origin           = Anchor.Centre,
                                        Anchor           = Anchor.Centre,
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Direction        = FillDirection.Vertical,
                                        Width            = content_width,
                                        Padding          = new MarginPadding {
                                            Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                                        },
                                        Children = new Drawable[]
                                        {
                                            new OsuSpriteText
                                            {
                                                Text   = @"Gameplay Mods",
                                                Font   = OsuFont.GetFont(size: 22, weight: FontWeight.Bold),
                                                Shadow = true,
                                                Margin = new MarginPadding
                                                {
                                                    Bottom = 4,
                                                },
                                            },
                                            new OsuTextFlowContainer(text =>
                                            {
                                                text.Font   = text.Font.With(size: 18);
                                                text.Shadow = true;
                                            })
                                            {
                                                RelativeSizeAxes = Axes.X,
                                                AutoSizeAxes     = Axes.Y,
                                                Text             = "Mods provide different ways to enjoy gameplay. Some have an effect on the score you can achieve during ranked play.\nOthers are just for fun.",
                                            },
                                        },
                                    },
                                },
                            },
                        },
                        new Drawable[]
                        {
                            // Body
                            new OsuScrollContainer
                            {
                                ScrollbarVisible = false,
                                Origin           = Anchor.TopCentre,
                                Anchor           = Anchor.TopCentre,
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding
                                {
                                    Vertical   = 10,
                                    Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                                },
                                Child = ModSectionsContainer = new FillFlowContainer <ModSection>
                                {
                                    Origin           = Anchor.TopCentre,
                                    Anchor           = Anchor.TopCentre,
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Spacing          = new Vector2(0f, 10f),
                                    Width            = content_width,
                                    LayoutDuration   = 200,
                                    LayoutEasing     = Easing.OutQuint,
                                    Children         = new ModSection[]
                                    {
                                        new DifficultyReductionSection {
                                            Action = modButtonPressed
                                        },
                                        new DifficultyIncreaseSection {
                                            Action = modButtonPressed
                                        },
                                        new AutomationSection {
                                            Action = modButtonPressed
                                        },
                                        new ConversionSection {
                                            Action = modButtonPressed
                                        },
                                        new FunSection {
                                            Action = modButtonPressed
                                        },
                                    }
                                },
                            },
                        },
                        new Drawable[]
                        {
                            // Footer
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Origin           = Anchor.TopCentre,
                                Anchor           = Anchor.TopCentre,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = new Color4(172, 20, 116, 255),
                                        Alpha            = 0.5f,
                                    },
                                    footerContainer = new FillFlowContainer
                                    {
                                        Origin           = Anchor.BottomCentre,
                                        Anchor           = Anchor.BottomCentre,
                                        AutoSizeAxes     = Axes.Y,
                                        RelativeSizeAxes = Axes.X,
                                        Width            = content_width,
                                        Direction        = FillDirection.Horizontal,
                                        Padding          = new MarginPadding
                                        {
                                            Vertical   = 15,
                                            Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                                        },
                                        Children = new Drawable[]
                                        {
                                            DeselectAllButton = new TriangleButton
                                            {
                                                Width  = 180,
                                                Text   = "Deselect All",
                                                Action = DeselectAll,
                                                Margin = new MarginPadding
                                                {
                                                    Right = 20
                                                }
                                            },
                                            CustomiseButton = new TriangleButton
                                            {
                                                Width   = 180,
                                                Text    = "Customisation",
                                                Action  = () => ModSettingsContainer.Alpha = ModSettingsContainer.Alpha == 1 ? 0 : 1,
                                                Enabled = { Value = false },
                                                Margin  = new MarginPadding
                                                {
                                                    Right = 20
                                                }
                                            },
                                            CloseButton = new TriangleButton
                                            {
                                                Width  = 180,
                                                Text   = "Close",
                                                Action = Hide,
                                                Margin = new MarginPadding
                                                {
                                                    Right = 20
                                                }
                                            },
                                            new OsuSpriteText
                                            {
                                                Text   = @"Score Multiplier:",
                                                Font   = OsuFont.GetFont(size: 30),
                                                Margin = new MarginPadding
                                                {
                                                    Top   = 5,
                                                    Right = 10
                                                }
                                            },
                                            MultiplierLabel = new OsuSpriteText
                                            {
                                                Font   = OsuFont.GetFont(size: 30, weight: FontWeight.Bold),
                                                Margin = new MarginPadding
                                                {
                                                    Top = 5
                                                }
                                            },
                                            UnrankedLabel = new OsuSpriteText
                                            {
                                                Text   = @"(Unranked)",
                                                Font   = OsuFont.GetFont(size: 30, weight: FontWeight.Bold),
                                                Margin = new MarginPadding
                                                {
                                                    Top  = 5,
                                                    Left = 10
                                                }
                                            }
                                        }
                                    }
                                },
                            }
                        },
                    },
                },
                ModSettingsContainer = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.BottomRight,
                    Origin           = Anchor.BottomRight,
                    Width            = 0.25f,
                    Alpha            = 0,
                    X        = -100,
                    Children = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = new Color4(0, 0, 0, 192)
                        },
                        new OsuScrollContainer
                        {
                            RelativeSizeAxes = Axes.Both,
                            Child            = ModSettingsContent = new FillFlowContainer <ModControlSection>
                            {
                                Anchor           = Anchor.TopCentre,
                                Origin           = Anchor.TopCentre,
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                                Spacing          = new Vector2(0f, 10f),
                                Padding          = new MarginPadding(20),
                            }
                        }
                    }
                }
            };
        }
Esempio n. 27
0
        public ModSelectOverlay()
        {
            Waves.FirstWaveColour = OsuColour.FromHex(@"19b0e2");
            Waves.SecondWaveColour = OsuColour.FromHex(@"2280a2");
            Waves.ThirdWaveColour = OsuColour.FromHex(@"005774");
            Waves.FourthWaveColour = OsuColour.FromHex(@"003a4e");

            Height = 510;
            Children = new Drawable[]
            {
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking = true,
                    Children = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour = new Color4(36, 50, 68, 255)
                        },
                        new Triangles
                        {
                            TriangleScale = 5,
                            RelativeSizeAxes = Axes.X,
                            Height = Height, //set the height from the start to ensure correct triangle density.
                            ColourLight = new Color4(53, 66, 82, 255),
                            ColourDark = new Color4(41, 54, 70, 255),
                        },
                    },
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes = Axes.Y,
                    Anchor = Anchor.BottomCentre,
                    Origin = Anchor.BottomCentre,
                    Direction = FillDirection.Vertical,
                    Spacing = new Vector2(0f, 10f),
                    Children = new Drawable[]
                    {
                        // Header
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height = 82,
                            Origin = Anchor.TopCentre,
                            Anchor = Anchor.TopCentre,
                            Children = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour = OsuColour.Gray(10).Opacity(100),
                                },
                                new FillFlowContainer
                                {
                                    Origin = Anchor.TopCentre,
                                    Anchor = Anchor.TopCentre,
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes = Axes.Y,
                                    Direction = FillDirection.Vertical,
                                    Width = content_width,
                                    Padding = new MarginPadding
                                    {
                                        Top = 10,
                                        Bottom = 10,
                                    },
                                    Children = new Drawable[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Font = @"Exo2.0-Bold",
                                            Text = @"Gameplay Mods",
                                            TextSize = 22,
                                            Shadow = true,
                                            Margin = new MarginPadding
                                            {
                                                Bottom = 4,
                                            },
                                        },
                                        new OsuSpriteText
                                        {
                                            Text = @"Mods provide different ways to enjoy gameplay. Some have an effect on the score you can achieve during ranked play.",
                                            TextSize = 18,
                                            Shadow = true,
                                        },
                                        new OsuSpriteText
                                        {
                                            Text = @"Others are just for fun.",
                                            TextSize = 18,
                                            Shadow = true,
                                        },
                                    },
                                },
                            },
                        },
                        // Body
                        ModSectionsContainer = new FillFlowContainer<ModSection>
                        {
                            Origin = Anchor.TopCentre,
                            Anchor = Anchor.TopCentre,
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes = Axes.Y,
                            Spacing = new Vector2(0f, 10f),
                            Width = content_width,
                            Children = new ModSection[]
                            {
                                new DifficultyReductionSection
                                {
                                    RelativeSizeAxes = Axes.X,
                                    Origin = Anchor.TopCentre,
                                    Anchor = Anchor.TopCentre,
                                    Action = modButtonPressed,
                                },
                                new DifficultyIncreaseSection
                                {
                                    RelativeSizeAxes = Axes.X,
                                    Origin = Anchor.TopCentre,
                                    Anchor = Anchor.TopCentre,
                                    Action = modButtonPressed,
                                },
                                new SpecialSection
                                {
                                    RelativeSizeAxes = Axes.X,
                                    Origin = Anchor.TopCentre,
                                    Anchor = Anchor.TopCentre,
                                    Action = modButtonPressed,
                                },
                            }
                        },
                        // Footer
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height = 70,
                            Origin = Anchor.TopCentre,
                            Anchor = Anchor.TopCentre,
                            Children = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour = new Color4(172, 20, 116, 255),
                                    Alpha = 0.5f,
                                },
                                footerContainer = new FillFlowContainer
                                {
                                    Origin = Anchor.BottomCentre,
                                    Anchor = Anchor.BottomCentre,
                                    AutoSizeAxes = Axes.Y,
                                    RelativeSizeAxes = Axes.X,
                                    Width = content_width,
                                    Direction = FillDirection.Horizontal,
                                    Padding = new MarginPadding
                                    {
                                        Vertical = 15
                                    },
                                    Children = new Drawable[]
                                    {
                                        DeselectAllButton = new TriangleButton
                                        {
                                            Width = 180,
                                            Text = "Deselect All",
                                            Action = DeselectAll,
                                            Margin = new MarginPadding
                                            {
                                                Right = 20
                                            }
                                        },
                                        new OsuSpriteText
                                        {
                                            Text = @"Score Multiplier: ",
                                            TextSize = 30,
                                            Shadow = true,
                                            Margin = new MarginPadding
                                            {
                                                Top = 5
                                            }
                                        },
                                        MultiplierLabel = new OsuSpriteText
                                        {
                                            Font = @"Exo2.0-Bold",
                                            TextSize = 30,
                                            Shadow = true,
                                            Margin = new MarginPadding
                                            {
                                                Top = 5
                                            }
                                        }
                                    }
                                }
                            },
                        },
                    },
                },
            };
        }
Esempio n. 28
0
        public ScrollableTimeline()
        {
            Masking      = true;
            CornerRadius = 5;

            OsuCheckbox hitObjectsCheckbox;
            OsuCheckbox hitSoundsCheckbox;
            OsuCheckbox waveformCheckbox;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex("111")
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Horizontal,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            AutoSizeAxes     = Axes.X,
                            RelativeSizeAxes = Axes.Y,
                            Children         = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = OsuColour.FromHex("222")
                                },
                                new FillFlowContainer
                                {
                                    Anchor       = Anchor.CentreLeft,
                                    Origin       = Anchor.CentreLeft,
                                    AutoSizeAxes = Axes.Y,
                                    Width        = 160,
                                    Padding      = new MarginPadding {
                                        Horizontal = 15
                                    },
                                    Direction = FillDirection.Vertical,
                                    Spacing   = new Vector2(0, 4),
                                    Children  = new[]
                                    {
                                        hitObjectsCheckbox = new OsuCheckbox {
                                            LabelText = "Hitobjects"
                                        },
                                        hitSoundsCheckbox = new OsuCheckbox {
                                            LabelText = "Hitsounds"
                                        },
                                        waveformCheckbox = new OsuCheckbox {
                                            LabelText = "Waveform"
                                        }
                                    }
                                }
                            }
                        },
                        new Container
                        {
                            AutoSizeAxes     = Axes.X,
                            RelativeSizeAxes = Axes.Y,
                            Children         = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = OsuColour.FromHex("333")
                                },
                                new Container <TimelineButton>
                                {
                                    Anchor           = Anchor.CentreLeft,
                                    Origin           = Anchor.CentreLeft,
                                    RelativeSizeAxes = Axes.Y,
                                    AutoSizeAxes     = Axes.X,
                                    Masking          = true,
                                    Children         = new[]
                                    {
                                        new TimelineButton
                                        {
                                            RelativeSizeAxes = Axes.Y,
                                            Height           = 0.5f,
                                            Icon             = FontAwesome.fa_search_plus,
                                            Action           = () => timelineContainer.Zoom++
                                        },
                                        new TimelineButton
                                        {
                                            Anchor           = Anchor.BottomLeft,
                                            Origin           = Anchor.BottomLeft,
                                            RelativeSizeAxes = Axes.Y,
                                            Height           = 0.5f,
                                            Icon             = FontAwesome.fa_search_minus,
                                            Action           = () => timelineContainer.Zoom--
                                        },
                                    }
                                }
                            }
                        },
                        timelineContainer = new ScrollingTimelineContainer {
                            RelativeSizeAxes = Axes.Y
                        }
                    }
                }
            };

            hitObjectsCheckbox.Current.Value = true;
            hitSoundsCheckbox.Current.Value  = true;
            waveformCheckbox.Current.Value   = true;

            timelineContainer.WaveformVisible.BindTo(waveformCheckbox.Current);
        }
Esempio n. 29
0
        private void load(SongSelect songSelect, BeatmapManager manager)
        {
            if (songSelect != null)
            {
                startRequested = songSelect.FinaliseSelection;
                editRequested  = songSelect.Edit;
            }

            if (manager != null)
            {
                hideRequested = manager.Hide;
            }

            Children = new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                },
                triangles = new Triangles
                {
                    TriangleScale    = 2,
                    RelativeSizeAxes = Axes.Both,
                    ColourLight      = OsuColour.FromHex(@"3a7285"),
                    ColourDark       = OsuColour.FromHex(@"123744")
                },
                new FillFlowContainer
                {
                    Padding      = new MarginPadding(5),
                    Direction    = FillDirection.Horizontal,
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.CentreLeft,
                    Origin       = Anchor.CentreLeft,
                    Children     = new Drawable[]
                    {
                        new DifficultyIcon(beatmap)
                        {
                            Scale = new Vector2(1.8f),
                        },
                        new FillFlowContainer
                        {
                            Padding = new MarginPadding {
                                Left = 5
                            },
                            Direction    = FillDirection.Vertical,
                            AutoSizeAxes = Axes.Both,
                            Children     = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    Direction    = FillDirection.Horizontal,
                                    Spacing      = new Vector2(4, 0),
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-Medium",
                                            Text     = beatmap.Version,
                                            TextSize = 20,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-Medium",
                                            Text     = "mapped by",
                                            TextSize = 16,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Font     = @"Exo2.0-MediumItalic",
                                            Text     = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author.Username}",
                                            TextSize = 16,
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft
                                        },
                                    }
                                },
                                starCounter = new StarCounter
                                {
                                    CountStars = (float)beatmap.StarDifficulty,
                                    Scale      = new Vector2(0.8f),
                                }
                            }
                        }
                    }
                }
            };
        }
Esempio n. 30
0
            public ScoreComponentLabel(FontAwesome icon, string value, string name)
            {
                this.name    = name;
                AutoSizeAxes = Axes.Y;
                Width        = 60;

                Child = content = new FillFlowContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Horizontal,
                    Children     = new Drawable[]
                    {
                        new Container
                        {
                            Anchor       = Anchor.CentreLeft,
                            Origin       = Anchor.CentreLeft,
                            AutoSizeAxes = Axes.Both,
                            Children     = new[]
                            {
                                new SpriteIcon
                                {
                                    Anchor   = Anchor.Centre,
                                    Origin   = Anchor.Centre,
                                    Size     = new Vector2(icon_size),
                                    Rotation = 45,
                                    Colour   = OsuColour.FromHex(@"3087ac"),
                                    Icon     = FontAwesome.fa_square,
                                    Shadow   = true,
                                },
                                new SpriteIcon
                                {
                                    Anchor = Anchor.Centre,
                                    Origin = Anchor.Centre,
                                    Size   = new Vector2(icon_size - 6),
                                    Colour = OsuColour.FromHex(@"a4edff"),
                                    Icon   = icon,
                                },
                            },
                        },
                        new GlowingSpriteText(value, @"Exo2.0-Bold", 17, Color4.White, OsuColour.FromHex(@"83ccfa"))
                        {
                            Anchor = Anchor.CentreLeft,
                            Origin = Anchor.CentreLeft,
                        },
                    },
                };
            }