Ejemplo n.º 1
0
 private void load(OsuColour colours)
 {
     background.Colour = Color4Extensions.FromHex(@"28242d");
 }
Ejemplo n.º 2
0
        private void load()
        {
            FillFlowContainer buttons;

            InternalChild = new GridContainer
            {
                RelativeSizeAxes = Axes.Both,
                Content          = new[]
                {
                    new Drawable[]
                    {
                        VerticalScrollContent = new VerticalScrollContainer
                        {
                            RelativeSizeAxes = Axes.Both,
                            ScrollbarVisible = false,
                            Child            = new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    statisticsPanel = new StatisticsPanel
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Score            = { BindTarget = SelectedScore }
                                    },
                                    ScorePanelList = new ScorePanelList
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        SelectedScore    = { BindTarget = SelectedScore },
                                        PostExpandAction = () => statisticsPanel.ToggleVisibility()
                                    },
                                    detachedPanelContainer = new Container <ScorePanel>
                                    {
                                        RelativeSizeAxes = Axes.Both
                                    },
                                }
                            }
                        },
                    },
                    new[]
                    {
                        bottomPanel = new Container
                        {
                            Anchor           = Anchor.BottomLeft,
                            Origin           = Anchor.BottomLeft,
                            RelativeSizeAxes = Axes.X,
                            Height           = TwoLayerButton.SIZE_EXTENDED.Y,
                            Alpha            = 0,
                            Children         = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = Color4Extensions.FromHex("#333")
                                },
                                buttons = new FillFlowContainer
                                {
                                    Anchor       = Anchor.Centre,
                                    Origin       = Anchor.Centre,
                                    AutoSizeAxes = Axes.Both,
                                    Spacing      = new Vector2(5),
                                    Direction    = FillDirection.Horizontal
                                }
                            }
                        }
                    }
                },
                RowDimensions = new[]
                {
                    new Dimension(),
                    new Dimension(GridSizeMode.AutoSize)
                }
            };

            if (Score != null)
            {
                // only show flair / animation when arriving after watching a play that isn't autoplay.
                bool shouldFlair = player != null && Score.Mods.All(m => m.UserPlayable);

                ScorePanelList.AddScore(Score, shouldFlair);
            }

            if (allowWatchingReplay)
            {
                buttons.Add(new ReplayDownloadButton(null)
                {
                    Score = { BindTarget = SelectedScore },
                    Width = 300
                });
            }

            if (player != null && allowRetry)
            {
                buttons.Add(new RetryButton {
                    Width = 300
                });

                AddInternal(new HotkeyRetryOverlay
                {
                    Action = () =>
                    {
                        if (!this.IsCurrentScreen())
                        {
                            return;
                        }

                        player?.Restart();
                    },
                });
            }
        }
Ejemplo n.º 3
0
 private void load()
 {
     InternalChild = content = new Container
     {
         Anchor   = Anchor.Centre,
         Origin   = Anchor.Centre,
         Size     = new Vector2(40),
         Children = new Drawable[]
         {
             topLayerContainer = new Container
             {
                 Name             = "Top layer",
                 RelativeSizeAxes = Axes.X,
                 Alpha            = 0,
                 Height           = 120,
                 Children         = new Drawable[]
                 {
                     new Container
                     {
                         RelativeSizeAxes = Axes.Both,
                         CornerRadius     = 20,
                         CornerExponent   = 2.5f,
                         Masking          = true,
                         Child            = topLayerBackground = new Box {
                             RelativeSizeAxes = Axes.Both
                         }
                     },
                     topLayerContentContainer = new Container {
                         RelativeSizeAxes = Axes.Both
                     }
                 }
             },
             middleLayerContainer = new Container
             {
                 Name             = "Middle layer",
                 RelativeSizeAxes = Axes.Both,
                 Children         = new Drawable[]
                 {
                     new Container
                     {
                         RelativeSizeAxes = Axes.Both,
                         CornerRadius     = 20,
                         CornerExponent   = 2.5f,
                         Masking          = true,
                         Children         = new[]
                         {
                             middleLayerBackground = new Box {
                                 RelativeSizeAxes = Axes.Both
                             },
                             new UserCoverBackground
                             {
                                 RelativeSizeAxes = Axes.Both,
                                 User             = Score.User,
                                 Colour           = ColourInfo.GradientVertical(Color4.White.Opacity(0.5f), Color4Extensions.FromHex("#444").Opacity(0))
                             }
                         }
                     },
                     middleLayerContentContainer = new Container {
                         RelativeSizeAxes = Axes.Both
                     }
                 }
             }
         }
     };
 }
Ejemplo n.º 4
0
 protected override Drawable CreateBackground() =>
 new Container
 {
     RelativeSizeAxes = Axes.X,
     Height           = 150,
     Masking          = true,
     Children         = new Drawable[]
     {
         coverContainer = new ProfileCoverBackground
         {
             RelativeSizeAxes = Axes.Both,
         },
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = ColourInfo.GradientVertical(Color4Extensions.FromHex("222").Opacity(0.8f), Color4Extensions.FromHex("222").Opacity(0.2f))
         },
     }
 };
Ejemplo n.º 5
0
 public void TestShader()
 {
     AddStep("Set colour", () => video.Colour = Color4Extensions.FromHex("#ea7948").Opacity(0.75f));
     AddStep("Use normal shader", () => video.UseRoundedShader  = false);
     AddStep("Use rounded shader", () => video.UseRoundedShader = true);
 }
Ejemplo n.º 6
0
        private void load()
        {
            InternalChild = new Container
            {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                RelativeSizeAxes = Axes.Both,
                FillMode         = FillMode.Fit,
                Children         = new Drawable[]
                {
                    new CircularContainer
                    {
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.Both,
                        Size             = new Vector2(inner_portion),
                        Masking          = true,
                        BorderThickness  = line_thickness,
                        BorderColour     = Color4.White,
                        Child            = new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = Color4Extensions.FromHex("#202624")
                        }
                    },
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Children         = new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding(1),
                                Child            = new Container
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Masking          = true,
                                    Children         = new Drawable[]
                                    {
                                        new Box
                                        {
                                            Anchor           = Anchor.Centre,
                                            Origin           = Anchor.Centre,
                                            EdgeSmoothness   = new Vector2(1),
                                            RelativeSizeAxes = Axes.Y,
                                            Height           = 2, // We're rotating along a diagonal - we don't really care how big this is.
                                            Width            = line_thickness / 2,
                                            Rotation         = -rotation,
                                            Alpha            = 0.3f,
                                        },
                                        new Box
                                        {
                                            Anchor           = Anchor.Centre,
                                            Origin           = Anchor.Centre,
                                            EdgeSmoothness   = new Vector2(1),
                                            RelativeSizeAxes = Axes.Y,
                                            Height           = 2,                  // We're rotating along a diagonal - we don't really care how big this is.
                                            Width            = line_thickness / 2, // adjust for edgesmoothness
                                            Rotation         = rotation
                                        },
                                    }
                                },
                            },
                            new Box
                            {
                                Anchor         = Anchor.TopRight,
                                Origin         = Anchor.TopRight,
                                Width          = 10,
                                EdgeSmoothness = new Vector2(1),
                                Height         = line_thickness / 2, // adjust for edgesmoothness
                            },
                            new Box
                            {
                                Anchor         = Anchor.TopRight,
                                Origin         = Anchor.TopRight,
                                EdgeSmoothness = new Vector2(1),
                                Width          = line_thickness / 2, // adjust for edgesmoothness
                                Height         = 10,
                            }
                        }
                    },
                    bufferedGrid = new BufferedContainer(cachedFrameBuffer: true)
                    {
                        RelativeSizeAxes = Axes.Both,
                        BackgroundColour = Color4Extensions.FromHex("#202624").Opacity(0),
                        Child            = pointGrid = new GridContainer
                        {
                            RelativeSizeAxes = Axes.Both
                        }
                    },
                }
            };

            Vector2 centre      = new Vector2(points_per_dimension) / 2;
            float   innerRadius = centre.X * inner_portion;

            Drawable[][] points = new Drawable[points_per_dimension][];

            for (int r = 0; r < points_per_dimension; r++)
            {
                points[r] = new Drawable[points_per_dimension];

                for (int c = 0; c < points_per_dimension; c++)
                {
                    HitPointType pointType = Vector2.Distance(new Vector2(c, r), centre) <= innerRadius
                        ? HitPointType.Hit
                        : HitPointType.Miss;

                    var point = new HitPoint(pointType, this)
                    {
                        BaseColour = pointType == HitPointType.Hit ? new Color4(102, 255, 204, 255) : new Color4(255, 102, 102, 255)
                    };

                    points[r][c] = point;
                }
            }

            pointGrid.Content = points;

            if (score.HitEvents.Count == 0)
            {
                return;
            }

            // Todo: This should probably not be done like this.
            float radius = OsuHitObject.OBJECT_RADIUS * (1.0f - 0.7f * (playableBeatmap.Difficulty.CircleSize - 5) / 5) / 2;

            foreach (var e in score.HitEvents.Where(e => e.HitObject is HitCircle && !(e.HitObject is SliderTailCircle)))
            {
                if (e.LastHitObject == null || e.Position == null)
                {
                    continue;
                }

                AddPoint(((OsuHitObject)e.LastHitObject).StackedEndPosition, ((OsuHitObject)e.HitObject).StackedEndPosition, e.Position.Value, radius);
            }
        }
Ejemplo n.º 7
0
 protected override void LoadComplete()
 {
     base.LoadComplete();
     AccentColour = Color4Extensions.FromHex("#e35c99");
 }
Ejemplo n.º 8
0
        private void load()
        {
            Masking      = true;
            CornerRadius = 5;

            OsuCheckbox waveformCheckbox;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4Extensions.FromHex("111")
                },
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Content          = new[]
                    {
                        new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Y,
                                AutoSizeAxes     = Axes.X,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = Color4Extensions.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[]
                                        {
                                            waveformCheckbox = new OsuCheckbox {
                                                LabelText = "Waveform"
                                            }
                                        }
                                    }
                                }
                            },
                            new Container
                            {
                                RelativeSizeAxes = Axes.Y,
                                AutoSizeAxes     = Axes.X,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = Color4Extensions.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.Solid.SearchPlus,
                                                Action           = () => changeZoom(1)
                                            },
                                            new TimelineButton
                                            {
                                                Anchor           = Anchor.BottomLeft,
                                                Origin           = Anchor.BottomLeft,
                                                RelativeSizeAxes = Axes.Y,
                                                Height           = 0.5f,
                                                Icon             = FontAwesome.Solid.SearchMinus,
                                                Action           = () => changeZoom(-1)
                                            },
                                        }
                                    }
                                }
                            },
                            timeline
                        },
                    },
                    ColumnDimensions = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.Distributed),
                    }
                }
            };

            waveformCheckbox.Current.Value = true;

            timeline.WaveformVisible.BindTo(waveformCheckbox.Current);
        }
Ejemplo n.º 9
0
 private void load(AudioManager audio)
 {
     InternalChildren = new Drawable[]
     {
         new SmoothCircularProgress
         {
             Name             = "Background circle",
             Anchor           = Anchor.Centre,
             Origin           = Anchor.Centre,
             RelativeSizeAxes = Axes.Both,
             Colour           = OsuColour.Gray(47),
             Alpha            = 0.5f,
             InnerRadius      = accuracy_circle_radius + 0.01f, // Extends a little bit into the circle
             Current          = { Value = 1 },
         },
         accuracyCircle = new SmoothCircularProgress
         {
             Name             = "Accuracy circle",
             Anchor           = Anchor.Centre,
             Origin           = Anchor.Centre,
             RelativeSizeAxes = Axes.Both,
             Colour           = ColourInfo.GradientVertical(Color4Extensions.FromHex("#7CF6FF"), Color4Extensions.FromHex("#BAFFA9")),
             InnerRadius      = accuracy_circle_radius,
         },
         new BufferedContainer
         {
             Name             = "Graded circles",
             Anchor           = Anchor.Centre,
             Origin           = Anchor.Centre,
             RelativeSizeAxes = Axes.Both,
             Size             = new Vector2(0.8f),
             Padding          = new MarginPadding(2),
             Children         = new Drawable[]
             {
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = OsuColour.ForRank(ScoreRank.X),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 1 }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = OsuColour.ForRank(ScoreRank.S),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 1 - virtual_ss_percentage }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = OsuColour.ForRank(ScoreRank.A),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 0.95f }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = OsuColour.ForRank(ScoreRank.B),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 0.9f }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = OsuColour.ForRank(ScoreRank.C),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 0.8f }
                 },
                 new SmoothCircularProgress
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = OsuColour.ForRank(ScoreRank.D),
                     InnerRadius      = RANK_CIRCLE_RADIUS,
                     Current          = { Value = 0.7f }
                 },
                 new RankNotch(0),
                 new RankNotch((float)(1 - virtual_ss_percentage)),
                 new RankNotch(0.95f),
                 new RankNotch(0.9f),
                 new RankNotch(0.8f),
                 new RankNotch(0.7f),
                 new BufferedContainer
                 {
                     Name             = "Graded circle mask",
                     RelativeSizeAxes = Axes.Both,
                     Padding          = new MarginPadding(1),
                     Blending         = new BlendingParameters
                     {
                         Source           = BlendingType.DstColor,
                         Destination      = BlendingType.OneMinusSrcAlpha,
                         SourceAlpha      = BlendingType.One,
                         DestinationAlpha = BlendingType.SrcAlpha
                     },
                     Child = innerMask = new SmoothCircularProgress
                     {
                         RelativeSizeAxes = Axes.Both,
                         InnerRadius      = RANK_CIRCLE_RADIUS - 0.01f,
                     }
                 }
             }
         },
         badges = new Container <RankBadge>
         {
             Name             = "Rank badges",
             RelativeSizeAxes = Axes.Both,
             Padding          = new MarginPadding {
                 Vertical = -15, Horizontal = -20
             },
             Children = new[]
             {
                 new RankBadge(1f, getRank(ScoreRank.X)),
                 new RankBadge(0.95f, getRank(ScoreRank.S)),
                 new RankBadge(0.9f, getRank(ScoreRank.A)),
                 new RankBadge(0.8f, getRank(ScoreRank.B)),
                 new RankBadge(0.7f, getRank(ScoreRank.C)),
                 new RankBadge(0.35f, getRank(ScoreRank.D)),
             }
         },
         rankText = new RankText(score.Rank)
     };
 }
Ejemplo n.º 10
0
 private void load()
 {
     InternalChildren = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = Color4.White
         },
         new SpriteText
         {
             Origin = Anchor.TopLeft,
             Anchor = Anchor.TopLeft,
             Margin = new MarginPadding {
                 Top = 20, Left = 100
             },
             Text   = "ganen. 2020.",
             Font   = FontsManager.GetFont(weight: FontWeight.SemiBold),
             Colour = Color4.Black
         },
         new GridContainer
         {
             RelativeSizeAxes = Axes.Both,
             ColumnDimensions = new[]
             {
                 new Dimension(GridSizeMode.Absolute, size: 500),
                 new Dimension(GridSizeMode.Distributed)
             },
             Content = new[]
             {
                 new Drawable[]
                 {
                     new Container
                     {
                         RelativeSizeAxes = Axes.Both,
                         Children         = new Drawable[]
                         {
                             new Container
                             {
                                 Origin           = Anchor.Centre,
                                 Anchor           = Anchor.Centre,
                                 RelativeSizeAxes = Axes.Y,
                                 Width            = 300,
                                 Margin           = new MarginPadding {
                                     Top = 300
                                 },
                                 Masking      = true,
                                 CornerRadius = 20,
                                 Children     = new Drawable[]
                                 {
                                     new Box
                                     {
                                         RelativeSizeAxes = Axes.Both,
                                         Colour           = Color4Extensions.FromHex(@"358879"),
                                     },
                                     new Box
                                     {
                                         RelativeSizeAxes = Axes.Both,
                                         Colour           = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.6f)),
                                     }
                                 },
                             },
                             new AlbumArt
                             {
                                 Origin = Anchor.Centre,
                                 Anchor = Anchor.Centre,
                                 Margin = new MarginPadding {
                                     Left = 100
                                 },
                                 Size = new Vector2(300),
                             }
                         }
                     },
                     new GridContainer
                     {
                         RelativeSizeAxes = Axes.Both,
                         RowDimensions    = new[]
                         {
                             new Dimension(GridSizeMode.AutoSize),
                             new Dimension(GridSizeMode.Distributed)
                         },
                         Content = new[]
                         {
                             new Drawable[]
                             {
                                 // Add hacky way to add space on first grid
                                 new Container
                                 {
                                     RelativeSizeAxes = Axes.X,
                                     Height           = 150
                                 }
                             },
                             new Drawable[]
                             {
                                 new FillFlowContainer
                                 {
                                     RelativeSizeAxes = Axes.Both,
                                     Direction        = FillDirection.Vertical,
                                     Children         = new Drawable[]
                                     {
                                         new SongHeader(),
                                         new TrackListScreen
                                         {
                                             Margin = new MarginPadding {
                                                 Top = 40
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 },
             }
         }
     };
 }
Ejemplo n.º 11
0
        private void load()
        {
            // ScorePanel doesn't include the top extruding area in its own size.
            // Adding a manual offset here allows the expanded version to take on an "acceptable" vertical centre when at 100% UI scale.
            const float vertical_fudge = 20;

            InternalChild = content = new Container
            {
                Anchor   = Anchor.Centre,
                Origin   = Anchor.Centre,
                Size     = new Vector2(40),
                Y        = vertical_fudge,
                Children = new Drawable[]
                {
                    topLayerContainer = new Container
                    {
                        Name             = "Top layer",
                        RelativeSizeAxes = Axes.X,
                        Alpha            = 0,
                        Height           = 120,
                        Children         = new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                CornerRadius     = 20,
                                CornerExponent   = 2.5f,
                                Masking          = true,
                                Child            = topLayerBackground = new Box {
                                    RelativeSizeAxes = Axes.Both
                                }
                            },
                            topLayerContentContainer = new Container {
                                RelativeSizeAxes = Axes.Both
                            }
                        }
                    },
                    middleLayerContainer = new Container
                    {
                        Name             = "Middle layer",
                        RelativeSizeAxes = Axes.Both,
                        Children         = new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                CornerRadius     = 20,
                                CornerExponent   = 2.5f,
                                Masking          = true,
                                Children         = new[]
                                {
                                    middleLayerBackground = new Box {
                                        RelativeSizeAxes = Axes.Both
                                    },
                                    new UserCoverBackground
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        User             = Score.User,
                                        Colour           = ColourInfo.GradientVertical(Color4.White.Opacity(0.5f), Color4Extensions.FromHex("#444").Opacity(0))
                                    }
                                }
                            },
                            middleLayerContentContainer = new Container {
                                RelativeSizeAxes = Axes.Both
                            }
                        }
                    }
                }
            };
        }
Ejemplo n.º 12
0
        protected OnlinePlayScreen()
        {
            Anchor           = Anchor.Centre;
            Origin           = Anchor.Centre;
            RelativeSizeAxes = Axes.Both;
            Padding          = new MarginPadding {
                Horizontal = -HORIZONTAL_OVERFLOW_PADDING
            };

            var backgroundColour = Color4Extensions.FromHex(@"3e3a44");

            InternalChild = waves = new MultiplayerWaveContainer
            {
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = backgroundColour,
                    },
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Padding          = new MarginPadding {
                            Top = Header.HEIGHT
                        },
                        Children = new[]
                        {
                            header = new Container
                            {
                                RelativeSizeAxes = Axes.X,
                                Height           = 400,
                                Children         = new[]
                                {
                                    headerBackground = new Container
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Width            = 1.25f,
                                        Masking          = true,
                                        Children         = new Drawable[]
                                        {
                                            new HeaderBackgroundSprite
                                            {
                                                RelativeSizeAxes = Axes.X,
                                                Height           = 400 // Keep a static height so the header doesn't change as it's resized between subscreens
                                            },
                                        }
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Padding          = new MarginPadding {
                                            Bottom = -1
                                        },                                           // 1px padding to avoid a 1px gap due to masking
                                        Child = new Box
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Colour           = ColourInfo.GradientVertical(backgroundColour.Opacity(0.5f), backgroundColour)
                                        },
                                    }
                                }
                            },
                            screenStack = new OnlinePlaySubScreenStack {
                                RelativeSizeAxes = Axes.Both
                            }
                        }
                    },
                    new Header(ScreenTitle, screenStack),
                    createButton = CreateNewMultiplayerGameButton().With(button =>
                    {
                        button.Anchor = Anchor.TopRight;
                        button.Origin = Anchor.TopRight;
                        button.Size   = new Vector2(150, Header.HEIGHT - 20);
                        button.Margin = new MarginPadding
                        {
                            Top   = 10,
                            Right = 10 + HORIZONTAL_OVERFLOW_PADDING,
                        };
                        button.Action = () => OpenNewRoom();
                    }),
                    RoomManager             = CreateRoomManager(),
                    ongoingOperationTracker = new OngoingOperationTracker()
                }
            };

            screenStack.ScreenPushed += screenPushed;
            screenStack.ScreenExited += screenExited;

            screenStack.Push(loungeSubScreen = CreateLounge());
        }
Ejemplo n.º 13
0
        public ModSelectOverlay()
        {
            Waves.FirstWaveColour  = Color4Extensions.FromHex(@"19b0e2");
            Waves.SecondWaveColour = Color4Extensions.FromHex(@"2280a2");
            Waves.ThirdWaveColour  = Color4Extensions.FromHex(@"005774");
            Waves.FourthWaveColour = Color4Extensions.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.AutoSize),
                    },
                    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.X,
                                AutoSizeAxes     = Axes.Y,
                                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,
                                        Spacing          = new Vector2(footer_button_spacing, footer_button_spacing / 2),
                                        LayoutDuration   = 100,
                                        LayoutEasing     = Easing.OutQuint,
                                        Padding          = new MarginPadding
                                        {
                                            Vertical   = 15,
                                            Horizontal = OsuScreen.HORIZONTAL_OVERFLOW_PADDING
                                        },
                                        Children = new Drawable[]
                                        {
                                            DeselectAllButton = new TriangleButton
                                            {
                                                Width  = 180,
                                                Text   = "Deselect All",
                                                Action = DeselectAll,
                                                Origin = Anchor.CentreLeft,
                                                Anchor = Anchor.CentreLeft,
                                            },
                                            CustomiseButton = new TriangleButton
                                            {
                                                Width   = 180,
                                                Text    = "Customisation",
                                                Action  = () => ModSettingsContainer.Alpha = ModSettingsContainer.Alpha == 1 ? 0 : 1,
                                                Enabled = { Value = false },
                                                Origin  = Anchor.CentreLeft,
                                                Anchor  = Anchor.CentreLeft,
                                            },
                                            CloseButton = new TriangleButton
                                            {
                                                Width  = 180,
                                                Text   = "Close",
                                                Action = Hide,
                                                Origin = Anchor.CentreLeft,
                                                Anchor = Anchor.CentreLeft,
                                            },
                                            new FillFlowContainer
                                            {
                                                AutoSizeAxes = Axes.Both,
                                                Spacing      = new Vector2(footer_button_spacing / 2, 0),
                                                Origin       = Anchor.CentreLeft,
                                                Anchor       = Anchor.CentreLeft,
                                                Children     = new Drawable[]
                                                {
                                                    new OsuSpriteText
                                                    {
                                                        Text   = @"Score Multiplier:",
                                                        Font   = OsuFont.GetFont(size: 30),
                                                        Origin = Anchor.CentreLeft,
                                                        Anchor = Anchor.CentreLeft,
                                                    },
                                                    MultiplierLabel = new OsuSpriteText
                                                    {
                                                        Font   = OsuFont.GetFont(size: 30, weight: FontWeight.Bold),
                                                        Origin = Anchor.CentreLeft,
                                                        Anchor = Anchor.CentreLeft,
                                                        Width  = 70, // make width fixed so reflow doesn't occur when multiplier number changes.
                                                    },
                                                },
                                            },
                                        }
                                    }
                                },
                            }
                        },
                    },
                },
                ModSettingsContainer = new ModSettingsContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.BottomRight,
                    Origin           = Anchor.BottomRight,
                    Width            = 0.25f,
                    Alpha            = 0,
                    X            = -100,
                    SelectedMods = { BindTarget = SelectedMods },
                }
            };

            ((IBindable <bool>)CustomiseButton.Enabled).BindTo(ModSettingsContainer.HasSettingsForSelection);
        }
        public ChannelSelectionOverlay()
        {
            RelativeSizeAxes = Axes.X;

            Waves.FirstWaveColour  = Color4Extensions.FromHex("353535");
            Waves.SecondWaveColour = Color4Extensions.FromHex("434343");
            Waves.ThirdWaveColour  = Color4Extensions.FromHex("515151");
            Waves.FourthWaveColour = Color4Extensions.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;
        }
        private void load(BeatmapManager manager, SongSelect songSelect)
        {
            Header.Height = height;

            if (songSelect != null)
            {
                startRequested = b => songSelect.FinaliseSelection(b);
                if (songSelect.AllowEditing)
                {
                    editRequested = songSelect.Edit;
                }
            }

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

            Header.Children = new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                },
                triangles = new Triangles
                {
                    TriangleScale    = 2,
                    RelativeSizeAxes = Axes.Both,
                    ColourLight      = Color4Extensions.FromHex(@"3a7285"),
                    ColourDark       = Color4Extensions.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, shouldShowTooltip: false)
                        {
                            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
                                        {
                                            Text   = beatmap.Version,
                                            Font   = OsuFont.GetFont(size: 20),
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Text   = "mapped by",
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Text   = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author.Username}",
                                            Font   = OsuFont.GetFont(italics: true),
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                    }
                                },
                                new FillFlowContainer
                                {
                                    Direction    = FillDirection.Horizontal,
                                    Spacing      = new Vector2(4, 0),
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new Drawable[]
                                    {
                                        new TopLocalRank(beatmap)
                                        {
                                            Scale = new Vector2(0.8f),
                                            Size  = new Vector2(40, 20)
                                        },
                                        starCounter = new StarCounter
                                        {
                                            Scale = new Vector2(0.8f),
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            };
        }
        public MedalOverlay(Medal medal)
        {
            this.medal       = medal;
            RelativeSizeAxes = Axes.Both;

            Child = content = new Container
            {
                Alpha            = 0,
                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           = Color4Extensions.FromHex(@"05262f"),
                            },
                            new Triangles
                            {
                                RelativeSizeAxes = Axes.Both,
                                TriangleScale    = 2,
                                ColourDark       = Color4Extensions.FromHex(@"04222b"),
                                ColourLight      = Color4Extensions.FromHex(@"052933"),
                            },
                            innerSpin = new Sprite
                            {
                                Anchor           = Anchor.Centre,
                                Origin           = Anchor.Centre,
                                RelativeSizeAxes = Axes.Both,
                                Size             = new Vector2(1.05f),
                                Alpha            = 0.25f,
                            },
                        },
                    },
                }
            };

            Show();
        }
Ejemplo n.º 17
0
 private void load()
 {
     BackgroundColour      = Color4Extensions.FromHex(@"593790");
     Triangles.ColourLight = Color4Extensions.FromHex(@"7247b6");
     Triangles.ColourDark  = Color4Extensions.FromHex(@"593790");
 }
Ejemplo n.º 18
0
        private void load()
        {
            normalPathColour = Color4Extensions.FromHex("#66D1FF");
            losersPathColour = Color4Extensions.FromHex("#FFC700");

            RelativeSizeAxes = Axes.Both;

            InternalChild = Content = new Container
            {
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    new TourneyVideo("ladder")
                    {
                        RelativeSizeAxes = Axes.Both,
                        Loop             = true,
                    },
                    new DrawableTournamentHeaderText
                    {
                        Y      = 100,
                        Anchor = Anchor.TopCentre,
                        Origin = Anchor.TopCentre,
                    },
                    ScrollContent = new LadderDragContainer
                    {
                        RelativeSizeAxes = Axes.Both,
                        Children         = new Drawable[]
                        {
                            paths = new Container <Path> {
                                RelativeSizeAxes = Axes.Both
                            },
                            headings = new Container {
                                RelativeSizeAxes = Axes.Both
                            },
                            MatchesContainer = new Container <DrawableTournamentMatch> {
                                RelativeSizeAxes = Axes.Both
                            },
                        }
                    },
                }
            };

            void addMatch(TournamentMatch match) =>
            MatchesContainer.Add(new DrawableTournamentMatch(match, this is LadderEditorScreen)
            {
                Changed = () => layout.Invalidate()
            });

            foreach (var match in LadderInfo.Matches)
            {
                addMatch(match);
            }

            LadderInfo.Rounds.CollectionChanged  += (_, __) => layout.Invalidate();
            LadderInfo.Matches.CollectionChanged += (_, args) =>
            {
                switch (args.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    foreach (var p in args.NewItems.Cast <TournamentMatch>())
                    {
                        addMatch(p);
                    }
                    break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (var p in args.OldItems.Cast <TournamentMatch>())
                    {
                        foreach (var d in MatchesContainer.Where(d => d.Match == p))
                        {
                            d.Expire();
                        }
                    }

                    break;
                }

                layout.Invalidate();
            };
        }
Ejemplo n.º 19
0
            private void load(OsuColour colours)
            {
                InternalChildren = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Color4Extensions.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 = WaveOverlayContainer.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,
                                                                LengthLimit = 100
                                                            },
                                                        },
                                                        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,
                                                            },
                                                        },
                                                        new Section("Password (optional)")
                                                        {
                                                            Alpha = disabled_alpha,
                                                            Child = new SettingsPasswordTextBox
                                                            {
                                                                RelativeSizeAxes         = Axes.X,
                                                                TabbableContentContainer = this,
                                                                ReadOnly = true,
                                                            },
                                                        },
                                                    },
                                                },
                                                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           = 500,
                                                                Content          = new[]
                                                                {
                                                                    new Drawable[]
                                                                    {
                                                                        playlist = new DrawableRoomPlaylist(true, true)
                                                                        {
                                                                            RelativeSizeAxes = Axes.Both
                                                                        }
                                                                    },
                                                                    new Drawable[]
                                                                    {
                                                                        playlistLength = new OsuSpriteText
                                                                        {
                                                                            Margin = new MarginPadding {
                                                                                Vertical = 5
                                                                            },
                                                                            Colour = colours.Yellow,
                                                                            Font   = OsuFont.GetFont(size: 12),
                                                                        }
                                                                    },
                                                                    new Drawable[]
                                                                    {
                                                                        new PurpleTriangleButton
                                                                        {
                                                                            RelativeSizeAxes = Axes.X,
                                                                            Height           = 40,
                                                                            Text             = "Edit playlist",
                                                                            Action           = () => EditPlaylist?.Invoke()
                                                                        }
                                                                    }
                                                                },
                                                                RowDimensions = new[]
                                                                {
                                                                    new Dimension(),
                                                                    new Dimension(GridSizeMode.AutoSize),
                                                                    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           = Color4Extensions.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(true)
                };

                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 ?? TimeSpan.FromMinutes(30), true);

                playlist.Items.BindTo(Playlist);
                Playlist.BindCollectionChanged(onPlaylistChanged, true);
            }
Ejemplo n.º 20
0
        private void load()
        {
            Children = new[]
            {
                spinner = new LoadingSpinner(true)
                {
                    Origin = Anchor.Centre,
                    Anchor = Anchor.Centre
                },
                content = new FillFlowContainer
                {
                    Alpha            = 0,
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Width            = 0.6f,
                    Origin           = Anchor.TopCentre,
                    Anchor           = Anchor.TopCentre,
                    Spacing          = new Vector2(15, 15),
                    Children         = new Drawable[]
                    {
                        new GridContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            Width            = 0.8f,
                            AutoSizeAxes     = Axes.Y,
                            Origin           = Anchor.TopCentre,
                            Anchor           = Anchor.TopCentre,
                            ColumnDimensions = new[]
                            {
                                new Dimension(),
                                new Dimension(GridSizeMode.AutoSize)
                            },
                            RowDimensions = new[]
                            {
                                new Dimension(GridSizeMode.AutoSize),
                                new Dimension(GridSizeMode.AutoSize)
                            },
                            Content = new[]
                            {
                                new Drawable[]
                                {
                                    new OsuSpriteText
                                    {
                                        Origin = Anchor.CentreLeft,
                                        Anchor = Anchor.CentreLeft,
                                        Font   = OsuFont.GetFont(weight: FontWeight.Regular, size: 18),
                                        Text   = "Achieved PP",
                                        Colour = Color4Extensions.FromHex("#66FFCC")
                                    },
                                    achievedPerformance = new OsuSpriteText
                                    {
                                        Origin = Anchor.CentreRight,
                                        Anchor = Anchor.CentreRight,
                                        Font   = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 18),
                                        Colour = Color4Extensions.FromHex("#66FFCC")
                                    }
                                },
                                new Drawable[]
                                {
                                    new OsuSpriteText
                                    {
                                        Origin = Anchor.CentreLeft,
                                        Anchor = Anchor.CentreLeft,
                                        Font   = OsuFont.GetFont(weight: FontWeight.Regular, size: 18),
                                        Text   = "Maximum",
                                        Colour = OsuColour.Gray(0.7f)
                                    },
                                    maximumPerformance = new OsuSpriteText
                                    {
                                        Origin = Anchor.CentreLeft,
                                        Anchor = Anchor.CentreLeft,
                                        Font   = OsuFont.GetFont(weight: FontWeight.Regular, size: 18),
                                        Colour = OsuColour.Gray(0.7f)
                                    }
                                }
                            }
                        },
                        chart = new GridContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Origin           = Anchor.TopCentre,
                            Anchor           = Anchor.TopCentre,
                            ColumnDimensions = new[]
                            {
                                new Dimension(GridSizeMode.AutoSize),
                                new Dimension(),
                                new Dimension(GridSizeMode.AutoSize)
                            }
                        }
                    }
                }
            };

            spinner.Show();

            new PerformanceBreakdownCalculator(playableBeatmap, difficultyCache, performanceCache)
            .CalculateAsync(score, cancellationTokenSource.Token)
            .ContinueWith(t => Schedule(() => setPerformanceValue(t.GetResultSafely())));
        }
Ejemplo n.º 21
0
        public Multiplayer()
        {
            Anchor           = Anchor.Centre;
            Origin           = Anchor.Centre;
            RelativeSizeAxes = Axes.Both;
            Padding          = new MarginPadding {
                Horizontal = -HORIZONTAL_OVERFLOW_PADDING
            };

            var backgroundColour = Color4Extensions.FromHex(@"3e3a44");

            InternalChild = waves = new MultiplayerWaveContainer
            {
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = backgroundColour,
                    },
                    new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Padding          = new MarginPadding {
                            Top = Header.HEIGHT
                        },
                        Children = new[]
                        {
                            header = new Container
                            {
                                RelativeSizeAxes = Axes.X,
                                Height           = 400,
                                Children         = new[]
                                {
                                    headerBackground = new Container
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Width            = 1.25f,
                                        Masking          = true,
                                        Children         = new Drawable[]
                                        {
                                            new HeaderBackgroundSprite
                                            {
                                                RelativeSizeAxes = Axes.X,
                                                Height           = 400 // Keep a static height so the header doesn't change as it's resized between subscreens
                                            },
                                        }
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Padding          = new MarginPadding {
                                            Bottom = -1
                                        },                                           // 1px padding to avoid a 1px gap due to masking
                                        Child = new Box
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Colour           = ColourInfo.GradientVertical(backgroundColour.Opacity(0.5f), backgroundColour)
                                        },
                                    }
                                }
                            },
                            screenStack = new MultiplayerSubScreenStack {
                                RelativeSizeAxes = Axes.Both
                            }
                        }
                    },
                    new Header(screenStack),
                    createButton = new CreateRoomButton
                    {
                        Anchor = Anchor.TopRight,
                        Origin = Anchor.TopRight,
                        Action = () => CreateRoom()
                    },
                    roomManager = new RoomManager()
                }
            };

            screenStack.Push(loungeSubScreen = new LoungeSubScreen());

            screenStack.ScreenPushed += screenPushed;
            screenStack.ScreenExited += screenExited;
        }
Ejemplo n.º 22
0
 protected override Drawable CreateContent() => new FillFlowContainer
 {
     AutoSizeAxes = Axes.Both,
     Direction    = FillDirection.Horizontal,
     Spacing      = new Vector2(10, 0),
     Children     = new[]
     {
         base.CreateContent().With(d =>
         {
             Anchor = Anchor.CentreLeft;
             Origin = Anchor.CentreLeft;
         }),
         perfectText = new OsuSpriteText
         {
             Anchor             = Anchor.CentreLeft,
             Origin             = Anchor.CentreLeft,
             Text               = "PERFECT",
             Font               = OsuFont.Torus.With(size: 11, weight: FontWeight.SemiBold),
             Colour             = ColourInfo.GradientVertical(Color4Extensions.FromHex("#66FFCC"), Color4Extensions.FromHex("#FF9AD7")),
             Alpha              = 0,
             UseFullGlyphHeight = false,
         }
     }
 };
Ejemplo n.º 23
0
        private void load()
        {
            var user = User.User;

            var backgroundColour = Color4Extensions.FromHex("#33413C");

            InternalChild = new GridContainer
            {
                RelativeSizeAxes = Axes.Both,
                ColumnDimensions = new[]
                {
                    new Dimension(GridSizeMode.Absolute, 18),
                    new Dimension(GridSizeMode.AutoSize),
                    new Dimension(),
                    new Dimension(GridSizeMode.AutoSize),
                },
                Content = new[]
                {
                    new Drawable[]
                    {
                        crown = new SpriteIcon
                        {
                            Anchor = Anchor.CentreLeft,
                            Origin = Anchor.CentreLeft,
                            Icon   = FontAwesome.Solid.Crown,
                            Size   = new Vector2(14),
                            Colour = Color4Extensions.FromHex("#F7E65D"),
                            Alpha  = 0
                        },
                        new TeamDisplay(User),
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Masking          = true,
                            CornerRadius     = 5,
                            Children         = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = backgroundColour
                                },
                                new UserCoverBackground
                                {
                                    Anchor           = Anchor.CentreRight,
                                    Origin           = Anchor.CentreRight,
                                    RelativeSizeAxes = Axes.Both,
                                    Width            = 0.75f,
                                    User             = user,
                                    Colour           = ColourInfo.GradientHorizontal(Color4.White.Opacity(0), Color4.White.Opacity(0.25f))
                                },
                                new FillFlowContainer
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Spacing          = new Vector2(10),
                                    Direction        = FillDirection.Horizontal,
                                    Children         = new Drawable[]
                                    {
                                        new UpdateableAvatar
                                        {
                                            Anchor           = Anchor.CentreLeft,
                                            Origin           = Anchor.CentreLeft,
                                            RelativeSizeAxes = Axes.Both,
                                            FillMode         = FillMode.Fit,
                                            User             = user
                                        },
                                        new UpdateableFlag
                                        {
                                            Anchor  = Anchor.CentreLeft,
                                            Origin  = Anchor.CentreLeft,
                                            Size    = new Vector2(30, 20),
                                            Country = user?.Country
                                        },
                                        new OsuSpriteText
                                        {
                                            Anchor = Anchor.CentreLeft,
                                            Origin = Anchor.CentreLeft,
                                            Font   = OsuFont.GetFont(weight: FontWeight.Bold, size: 18),
                                            Text   = user?.Username
                                        },
                                        userRankText = new OsuSpriteText
                                        {
                                            Anchor = Anchor.CentreLeft,
                                            Origin = Anchor.CentreLeft,
                                            Font   = OsuFont.GetFont(size: 14),
                                        }
                                    }
                                },
                                new Container
                                {
                                    Anchor       = Anchor.CentreRight,
                                    Origin       = Anchor.CentreRight,
                                    AutoSizeAxes = Axes.Both,
                                    Margin       = new MarginPadding {
                                        Right = 70
                                    },
                                    Child = userModsDisplay = new ModDisplay
                                    {
                                        Scale         = new Vector2(0.5f),
                                        ExpansionMode = ExpansionMode.AlwaysContracted,
                                    }
                                },
                                userStateDisplay = new StateDisplay
                                {
                                    Anchor = Anchor.CentreRight,
                                    Origin = Anchor.CentreRight,
                                    Margin = new MarginPadding {
                                        Right = 10
                                    },
                                }
                            }
                        },
                        kickButton = new KickButton
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,
                            Alpha  = 0,
                            Margin = new MarginPadding(4),
                            Action = () => Client.KickUser(User.UserID),
                        },
                    },
                }
            };
        }
Ejemplo n.º 24
0
        private void load(IAPIProvider api, OsuColour colour, ScoreManager scoreManager)
        {
            var user = score.User;

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

            ClickableAvatar innerAvatar;

            Children = new Drawable[]
            {
                new RankLabel(rank)
                {
                    RelativeSizeAxes = Axes.Y,
                    Width            = rank_width,
                },
                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 ClickableAvatar(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(87f, 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 = Color4Extensions.FromHex(@"83ccfa"),
                                            Current    = scoreManager.GetBindableTotalScoreString(score),
                                            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);
        }
Ejemplo n.º 25
0
 private void addCircleStep(ScoreInfo score) => AddStep("add panel", () =>
 {
     Children = new Drawable[]
     {
         new Container
         {
             Anchor   = Anchor.Centre,
             Origin   = Anchor.Centre,
             Size     = new Vector2(500, 700),
             Children = new Drawable[]
             {
                 new Box
                 {
                     RelativeSizeAxes = Axes.Both,
                     Colour           = ColourInfo.GradientVertical(Color4Extensions.FromHex("#555"), Color4Extensions.FromHex("#333"))
                 }
             }
         },
         new AccuracyCircle(score, true)
         {
             Anchor = Anchor.Centre,
             Origin = Anchor.Centre,
             Size   = new Vector2(230)
         }
     };
 });
Ejemplo n.º 26
0
        private void load()
        {
            InternalChildren = new[]
            {
                new ResultsScrollContainer
                {
                    Child = new ScorePanel(score)
                    {
                        Anchor = Anchor.Centre,
                        Origin = Anchor.Centre,
                        State  = PanelState.Expanded
                    },
                },
                bottomPanel = new Container
                {
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    Height           = TwoLayerButton.SIZE_EXTENDED.Y,
                    Alpha            = 0,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = Color4Extensions.FromHex("#333")
                        },
                        new FillFlowContainer
                        {
                            Anchor       = Anchor.Centre,
                            Origin       = Anchor.Centre,
                            AutoSizeAxes = Axes.Both,
                            Spacing      = new Vector2(5),
                            Direction    = FillDirection.Horizontal,
                            Children     = new Drawable[]
                            {
                                new ReplayDownloadButton(score)
                                {
                                    Width = 300
                                },
                                new RetryButton {
                                    Width = 300
                                },
                            }
                        }
                    }
                }
            };

            if (player != null)
            {
                AddInternal(new HotkeyRetryOverlay
                {
                    Action = () =>
                    {
                        if (!this.IsCurrentScreen())
                        {
                            return;
                        }

                        player?.Restart();
                    },
                });
            }
        }
Ejemplo n.º 27
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           = Color4Extensions.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 FillFlowContainer
                                                {
                                                    RelativeSizeAxes = Axes.X,
                                                    AutoSizeAxes     = Axes.Y,
                                                    Direction        = FillDirection.Vertical,
                                                    Spacing          = new Vector2(0, 10),
                                                    Children         = new Drawable[]
                                                    {
                                                        new Container
                                                        {
                                                            Anchor  = Anchor.TopCentre,
                                                            Origin  = Anchor.TopCentre,
                                                            Padding = new MarginPadding {
                                                                Horizontal = WaveOverlayContainer.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,
                                                                            },
                                                                        },
                                                                        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 SectionContainer
                                                                {
                                                                    Anchor  = Anchor.TopRight,
                                                                    Origin  = Anchor.TopRight,
                                                                    Padding = new MarginPadding {
                                                                        Left = FIELD_PADDING / 2
                                                                    },
                                                                    Children = new[]
                                                                    {
                                                                        new Section("Max participants")
                                                                        {
                                                                            Alpha = disabled_alpha,
                                                                            Child = MaxParticipantsField = new SettingsNumberTextBox
                                                                            {
                                                                                RelativeSizeAxes         = Axes.X,
                                                                                TabbableContentContainer = this,
                                                                                ReadOnly = true,
                                                                            },
                                                                        },
                                                                        new Section("Password (optional)")
                                                                        {
                                                                            Alpha = disabled_alpha,
                                                                            Child = new SettingsPasswordTextBox
                                                                            {
                                                                                RelativeSizeAxes         = Axes.X,
                                                                                TabbableContentContainer = this,
                                                                                ReadOnly = true,
                                                                            },
                                                                        },
                                                                    }
                                                                }
                                                            },
                                                        },
                                                        initialBeatmapControl = new BeatmapSelectionControl
                                                        {
                                                            Anchor           = Anchor.TopCentre,
                                                            Origin           = Anchor.TopCentre,
                                                            RelativeSizeAxes = Axes.X,
                                                            Width            = 0.5f
                                                        }
                                                    }
                                                }
                                            },
                                        },
                                    },
                                    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           = Color4Extensions.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 CreateOrUpdateButton
                                                        {
                                                            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);
                RoomID.BindValueChanged(roomId => initialBeatmapControl.Alpha       = roomId.NewValue == null ? 1 : 0, true);
            }
Ejemplo n.º 28
0
        private void load()
        {
            var user = User.User;

            var backgroundColour = Color4Extensions.FromHex("#33413C");

            InternalChildren = new Drawable[]
            {
                crown = new SpriteIcon
                {
                    Anchor = Anchor.CentreLeft,
                    Origin = Anchor.CentreLeft,
                    Icon   = FontAwesome.Solid.Crown,
                    Size   = new Vector2(14),
                    Colour = Color4Extensions.FromHex("#F7E65D"),
                    Alpha  = 0
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Padding          = new MarginPadding {
                        Left = 24
                    },
                    Child = new Container
                    {
                        RelativeSizeAxes = Axes.Both,
                        Masking          = true,
                        CornerRadius     = 5,
                        Children         = new Drawable[]
                        {
                            new Box
                            {
                                RelativeSizeAxes = Axes.Both,
                                Colour           = backgroundColour
                            },
                            new UserCoverBackground
                            {
                                Anchor           = Anchor.CentreRight,
                                Origin           = Anchor.CentreRight,
                                RelativeSizeAxes = Axes.Both,
                                Width            = 0.75f,
                                User             = user,
                                Colour           = ColourInfo.GradientHorizontal(Color4.White.Opacity(0), Color4.White.Opacity(0.25f))
                            },
                            new FillFlowContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                Spacing          = new Vector2(10),
                                Direction        = FillDirection.Horizontal,
                                Children         = new Drawable[]
                                {
                                    new UpdateableAvatar
                                    {
                                        Anchor           = Anchor.CentreLeft,
                                        Origin           = Anchor.CentreLeft,
                                        RelativeSizeAxes = Axes.Both,
                                        FillMode         = FillMode.Fit,
                                        User             = user
                                    },
                                    new UpdateableFlag
                                    {
                                        Anchor  = Anchor.CentreLeft,
                                        Origin  = Anchor.CentreLeft,
                                        Size    = new Vector2(30, 20),
                                        Country = user?.Country
                                    },
                                    new OsuSpriteText
                                    {
                                        Anchor = Anchor.CentreLeft,
                                        Origin = Anchor.CentreLeft,
                                        Font   = OsuFont.GetFont(weight: FontWeight.Bold, size: 18),
                                        Text   = user?.Username
                                    },
                                    new OsuSpriteText
                                    {
                                        Anchor = Anchor.CentreLeft,
                                        Origin = Anchor.CentreLeft,
                                        Font   = OsuFont.GetFont(size: 14),
                                        Text   = user?.CurrentModeRank != null ? $"#{user.CurrentModeRank}" : string.Empty
                                    }
                                }
                            },
                            new Container
                            {
                                Anchor       = Anchor.CentreRight,
                                Origin       = Anchor.CentreRight,
                                AutoSizeAxes = Axes.Both,
                                Margin       = new MarginPadding {
                                    Right = 70
                                },
                                Child = userModsDisplay = new ModDisplay
                                {
                                    Scale               = new Vector2(0.5f),
                                    ExpansionMode       = ExpansionMode.AlwaysContracted,
                                    DisplayUnrankedText = false,
                                }
                            },
                            userStateDisplay = new StateDisplay
                            {
                                Anchor = Anchor.CentreRight,
                                Origin = Anchor.CentreRight,
                                Margin = new MarginPadding {
                                    Right = 10
                                },
                            }
                        }
                    }
                }
            };
        }
Ejemplo n.º 29
0
        private void load(AudioManager audio)
        {
            sampleStart = audio.Samples.Get(@"SongSelect/confirm-selection");

            InternalChildren = new Drawable[]
            {
                BeatmapAvailabilityTracker,
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    RowDimensions    = new[]
                    {
                        new Dimension(),
                        new Dimension(GridSizeMode.Absolute, 50)
                    },
                    Content = new[]
                    {
                        // Padded main content (drawable room + main content)
                        new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding
                                {
                                    Horizontal = WaveOverlayContainer.WIDTH_PADDING,
                                    Bottom     = 30
                                },
                                Children = new[]
                                {
                                    mainContent = new GridContainer
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        RowDimensions    = new[]
                                        {
                                            new Dimension(GridSizeMode.AutoSize),
                                            new Dimension(GridSizeMode.Absolute, 10)
                                        },
                                        Content = new[]
                                        {
                                            new Drawable[]
                                            {
                                                new DrawableMatchRoom(Room, allowEdit)
                                                {
                                                    OnEdit       = () => settingsOverlay.Show(),
                                                    SelectedItem = { BindTarget = SelectedItem }
                                                }
                                            },
                                            null,
                                            new Drawable[]
                                            {
                                                new Container
                                                {
                                                    RelativeSizeAxes = Axes.Both,
                                                    Children         = new[]
                                                    {
                                                        new Container
                                                        {
                                                            RelativeSizeAxes = Axes.Both,
                                                            Masking          = true,
                                                            CornerRadius     = 10,
                                                            Child            = new Box
                                                            {
                                                                RelativeSizeAxes = Axes.Both,
                                                                Colour           = Color4Extensions.FromHex(@"3e3a44") // Temporary.
                                                            },
                                                        },
                                                        new Container
                                                        {
                                                            RelativeSizeAxes = Axes.Both,
                                                            Padding          = new MarginPadding(20),
                                                            Child            = CreateMainContent(),
                                                        },
                                                        new Container
                                                        {
                                                            Anchor           = Anchor.BottomLeft,
                                                            Origin           = Anchor.BottomLeft,
                                                            RelativeSizeAxes = Axes.X,
                                                            AutoSizeAxes     = Axes.Y,
                                                            Child            = userModsSelectOverlay = new UserModSelectOverlay
                                                            {
                                                                SelectedMods = { BindTarget = UserMods },
                                                                IsValidMod   = _ => false
                                                            }
                                                        },
                                                    }
                                                }
                                            }
                                        }
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        // Resolves 1px masking errors between the settings overlay and the room panel.
                                        Padding = new MarginPadding(-1),
                                        Child   = settingsOverlay = CreateRoomSettingsOverlay(Room)
                                    }
                                },
                            },
                        },
                        // Footer
                        new Drawable[]
                        {
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Children         = new Drawable[]
                                {
                                    new Box
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Colour           = Color4Extensions.FromHex(@"28242d") // Temporary.
                                    },
                                    new Container
                                    {
                                        RelativeSizeAxes = Axes.Both,
                                        Padding          = new MarginPadding(5),
                                        Child            = CreateFooter()
                                    },
                                }
                            }
                        }
                    }
                }
            };
        }
Ejemplo n.º 30
0
 private void load()
 {
     InternalChild = new GridContainer
     {
         RelativeSizeAxes = Axes.Both,
         Content          = new[]
         {
             new Drawable[]
             {
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Masking          = true,
                     CornerExponent   = 2.5f,
                     CornerRadius     = 20,
                     EdgeEffect       = new EdgeEffectParameters
                     {
                         Colour = Color4.Black.Opacity(0.25f),
                         Type   = EdgeEffectType.Shadow,
                         Radius = 1,
                         Offset = new Vector2(0, 4)
                     },
                     Children = new Drawable[]
                     {
                         new Box
                         {
                             RelativeSizeAxes = Axes.Both,
                             Colour           = Color4Extensions.FromHex("444")
                         },
                         new UserCoverBackground
                         {
                             RelativeSizeAxes = Axes.Both,
                             User             = score.User,
                             Colour           = ColourInfo.GradientVertical(Color4.White.Opacity(0.5f), Color4Extensions.FromHex("#444").Opacity(0))
                         },
                         new FillFlowContainer
                         {
                             RelativeSizeAxes = Axes.Both,
                             Padding          = new MarginPadding(10),
                             Direction        = FillDirection.Vertical,
                             Spacing          = new Vector2(0, 10),
                             Children         = new Drawable[]
                             {
                                 new UpdateableAvatar(score.User)
                                 {
                                     Anchor         = Anchor.TopCentre,
                                     Origin         = Anchor.TopCentre,
                                     Size           = new Vector2(110),
                                     Masking        = true,
                                     CornerExponent = 2.5f,
                                     CornerRadius   = 20,
                                     EdgeEffect     = new EdgeEffectParameters
                                     {
                                         Colour = Color4.Black.Opacity(0.25f),
                                         Type   = EdgeEffectType.Shadow,
                                         Radius = 8,
                                         Offset = new Vector2(0, 4),
                                     }
                                 },
                                 new OsuSpriteText
                                 {
                                     Anchor = Anchor.TopCentre,
                                     Origin = Anchor.TopCentre,
                                     Text   = score.RealmUser.Username,
                                     Font   = OsuFont.GetFont(size: 16, weight: FontWeight.SemiBold)
                                 },
                                 new FillFlowContainer
                                 {
                                     RelativeSizeAxes   = Axes.X,
                                     AutoSizeAxes       = Axes.Y,
                                     Direction          = FillDirection.Vertical,
                                     Spacing            = new Vector2(0, 5),
                                     ChildrenEnumerable = score.GetStatisticsForDisplay().Where(s => !s.Result.IsBonus()).Select(createStatistic)
                                 },
                                 new FillFlowContainer
                                 {
                                     RelativeSizeAxes = Axes.X,
                                     AutoSizeAxes     = Axes.Y,
                                     Margin           = new MarginPadding {
                                         Top = 10
                                     },
                                     Direction = FillDirection.Vertical,
                                     Spacing   = new Vector2(0, 5),
                                     Children  = new[]
                                     {
                                         createStatistic("Max Combo", $"x{score.MaxCombo}"),
                                         createStatistic("Accuracy", $"{score.Accuracy.FormatAccuracy()}"),
                                     }
                                 },
                                 new ModFlowDisplay
                                 {
                                     Anchor           = Anchor.TopCentre,
                                     Origin           = Anchor.TopCentre,
                                     AutoSizeAxes     = Axes.Y,
                                     RelativeSizeAxes = Axes.X,
                                     Current          = { Value = score.Mods },
                                     IconScale        = 0.5f,
                                 }
                             }
                         }
                     }
                 },
             },
             new Drawable[]
             {
                 new Container
                 {
                     RelativeSizeAxes = Axes.Both,
                     Padding          = new MarginPadding {
                         Vertical = 5
                     },
                     Child = new GridContainer
                     {
                         RelativeSizeAxes = Axes.Both,
                         Content          = new[]
                         {
                             new Drawable[]
                             {
                                 new OsuSpriteText
                                 {
                                     Anchor  = Anchor.Centre,
                                     Origin  = Anchor.Centre,
                                     Current = scoreManager.GetBindableTotalScoreString(score),
                                     Font    = OsuFont.GetFont(size: 20, weight: FontWeight.Medium, fixedWidth: true),
                                     Spacing = new Vector2(-1, 0)
                                 },
                             },
                             new Drawable[]
                             {
                                 new Container
                                 {
                                     RelativeSizeAxes = Axes.Both,
                                     Padding          = new MarginPadding {
                                         Top = 2
                                     },
                                     Child = new DrawableRank(score.Rank)
                                     {
                                         Anchor = Anchor.Centre,
                                         Origin = Anchor.Centre,
                                     }
                                 }
                             },
                         },
                         RowDimensions = new[]
                         {
                             new Dimension(GridSizeMode.AutoSize),
                         }
                     }
                 }
             },
         },
         RowDimensions = new[]
         {
             new Dimension(),
             new Dimension(GridSizeMode.Absolute, 45),
         }
     };
 }