Ejemplo n.º 1
0
            private void onError(string text)
            {
                ErrorText.Text = text;
                ErrorText.FadeIn(50);

                processingOverlay.Hide();
            }
Ejemplo n.º 2
0
            private void onError(string text)
            {
                // see https://github.com/ppy/osu-web/blob/2c97aaeb64fb4ed97c747d8383a35b30f57428c7/app/Models/Multiplayer/PlaylistItem.php#L48.
                const string not_found_prefix = "beatmaps not found:";

                if (text.StartsWith(not_found_prefix, StringComparison.Ordinal))
                {
                    ErrorText.Text = "One or more beatmaps were not available online. Please remove or replace the highlighted items.";

                    int[] invalidBeatmapIDs = text
                                              .Substring(not_found_prefix.Length + 1)
                                              .Split(", ")
                                              .Select(int.Parse)
                                              .ToArray();

                    foreach (var item in Playlist)
                    {
                        if (invalidBeatmapIDs.Contains(item.BeatmapID))
                        {
                            item.MarkInvalid();
                        }
                    }
                }
                else
                {
                    ErrorText.Text = text;
                }

                ErrorText.FadeIn(50);
                loadingLayer.Hide();
            }
Ejemplo n.º 3
0
 protected override bool OnHover(InputState state)
 {
     sampleHover.Play();
     textBold.FadeIn(transition_length, EasingTypes.OutQuint);
     text.FadeOut(transition_length, EasingTypes.OutQuint);
     return(base.OnHover(state));
 }
Ejemplo n.º 4
0
            private void onError(string text)
            {
                ErrorText.Text = text;
                ErrorText.FadeIn(50);

                loadingLayer.Hide();
            }
Ejemplo n.º 5
0
            protected override bool OnHover(HoverEvent e)
            {
                box.Colour = colourProvider.Colour0;

                box.FadeTo(0.2f, 100, Easing.OutQuint);
                text.FadeIn(100, Easing.OutQuint);
                return(true);
            }
Ejemplo n.º 6
0
        protected override void OnLoadFinished()
        {
            votesCounter.FadeIn(duration, Easing.OutQuint);

            if (IsHovered)
            {
                onHoverAction();
            }
        }
Ejemplo n.º 7
0
        private void onTeamSelected(DrawingsTeam team)
        {
            groupsContainer.AddTeam(team);

            fullTeamNameText.Text = team.FullName;
            fullTeamNameText.FadeIn(200);

            writeResults(groupsContainer.GetStringRepresentation());
        }
Ejemplo n.º 8
0
            public override void Show()
            {
                this.FadeIn(100, Easing.OutQuint);

                text
                .FadeIn().Then().Delay(600)
                .FadeOut().Then().Delay(600)
                .Loop();
            }
Ejemplo n.º 9
0
            private void onError(string text)
            {
                Debug.Assert(applyingSettingsOperation != null);

                ErrorText.Text = text;
                ErrorText.FadeIn(50);

                applyingSettingsOperation.Dispose();
                applyingSettingsOperation = null;
            }
Ejemplo n.º 10
0
 private void updateMax()
 {
     if (MaxParticipants.Value == null)
     {
         slash.FadeOut(transition_duration);
         maxText.FadeOut(transition_duration);
     }
     else
     {
         slash.FadeIn(transition_duration);
         maxText.Text = MaxParticipants.Value.ToString();
         maxText.FadeIn(transition_duration);
     }
 }
Ejemplo n.º 11
0
        public void MarkUnavailable()
        {
            loadFailedIcon
            .FadeIn(250, Easing.In)
            .Then(800)
            .FadeOut(400, Easing.Out);

            loadFailedText
            .FadeIn(250, Easing.In)
            .Then(800)
            .FadeOut(400, Easing.Out);

            romNameText
            .FadeColour(Color4.Red, 250, Easing.In)
            .Then(800)
            .FadeColour(Color4.White, 400, Easing.Out);
        }
Ejemplo n.º 12
0
        public override void Show()
        {
            foreach (var d in new[] { avatar, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, modsContainer }.Concat(statisticsLabels))
            {
                d.FadeOut();
            }

            Alpha = 0;

            content.MoveToY(75);
            avatar.MoveToX(75);
            nameLabel.MoveToX(150);

            this.FadeIn(200);
            content.MoveToY(0, 800, Easing.OutQuint);

            using (BeginDelayedSequence(100))
            {
                avatar.FadeIn(300, Easing.OutQuint);
                nameLabel.FadeIn(350, Easing.OutQuint);

                avatar.MoveToX(0, 300, Easing.OutQuint);
                nameLabel.MoveToX(0, 350, Easing.OutQuint);

                using (BeginDelayedSequence(250))
                {
                    scoreLabel.FadeIn(200);
                    scoreRank.FadeIn(200);

                    using (BeginDelayedSequence(50))
                    {
                        var drawables = new Drawable[] { flagBadgeContainer, modsContainer }.Concat(statisticsLabels).ToArray();
                        for (int i = 0; i < drawables.Length; i++)
                        {
                            drawables[i].FadeIn(100 + i * 50);
                        }
                    }
                }
            }
        }
Ejemplo n.º 13
0
            private void onError(string text)
            {
                Debug.Assert(applyingSettingsOperation != null);

                // see https://github.com/ppy/osu-web/blob/2c97aaeb64fb4ed97c747d8383a35b30f57428c7/app/Models/Multiplayer/PlaylistItem.php#L48.
                const string not_found_prefix = "beatmaps not found:";

                if (text.StartsWith(not_found_prefix, StringComparison.Ordinal))
                {
                    ErrorText.Text = "The selected beatmap is not available online.";
                    CurrentPlaylistItem.Value.MarkInvalid();
                }
                else
                {
                    ErrorText.Text = text;
                }

                ErrorText.FadeIn(50);

                applyingSettingsOperation.Dispose();
                applyingSettingsOperation = null;
            }
Ejemplo n.º 14
0
        private void updateStatistics(UserStatistics statistics)
        {
            placeholder.FadeIn(fade_duration, Easing.Out);

            if (statistics?.Ranks.Global == null)
            {
                graph.FadeOut(fade_duration, Easing.Out);
                ranks = null;
                return;
            }

            int[] userRanks = statistics.RankHistory?.Data ?? new[] { statistics.Ranks.Global.Value };
            ranks = userRanks.Select((x, index) => new KeyValuePair <int, int>(index, x)).Where(x => x.Value != 0).ToArray();

            if (ranks.Length > 1)
            {
                placeholder.FadeOut(fade_duration, Easing.Out);

                graph.DefaultValueCount = ranks.Length;
                graph.Values            = ranks.Select(x => - (float)Math.Log(x.Value));
            }

            graph.FadeTo(ranks.Length > 1 ? 1 : 0, fade_duration, Easing.Out);
        }
Ejemplo n.º 15
0
 protected override void OnHoverLost(InputState state)
 {
     textBold.FadeOut(transition_length, EasingTypes.OutQuint);
     text.FadeIn(transition_length, EasingTypes.OutQuint);
     base.OnHoverLost(state);
 }
Ejemplo n.º 16
0
 protected override void HideGraph()
 {
     base.HideGraph();
     placeholder.FadeIn(FADE_DURATION, Easing.Out);
 }
Ejemplo n.º 17
0
 protected override void OnLoadFinished() => drawableText.FadeIn(duration, Easing.OutQuint);
Ejemplo n.º 18
0
        private void load(OsuColour colours, LocalisationEngine localisation)
        {
            this.colours = colours;

            ModeTypeInfo  modeTypeInfo;
            OsuSpriteText participants, participantsSlash, maxParticipants, beatmapTitle, beatmapDash, beatmapArtist, beatmapAuthor;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex(@"343138"),
                },
                topFlow = new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Direction        = FillDirection.Vertical,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = 200,
                            Masking          = true,
                            Children         = new Drawable[]
                            {
                                new Container
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Children         = new Drawable[]
                                    {
                                        new Box
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                            Colour           = Color4.Black,
                                        },
                                        coverContainer = new Container
                                        {
                                            RelativeSizeAxes = Axes.Both,
                                        },
                                    },
                                },
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = ColourInfo.GradientVertical(Color4.Black.Opacity(0.5f), Color4.Black.Opacity(0)),
                                },
                                new Container
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Padding          = new MarginPadding(20),
                                    Children         = new Drawable[]
                                    {
                                        participantNumbersFlow = new FillFlowContainer
                                        {
                                            Anchor         = Anchor.TopRight,
                                            Origin         = Anchor.TopRight,
                                            AutoSizeAxes   = Axes.Both,
                                            Direction      = FillDirection.Horizontal,
                                            LayoutDuration = transition_duration,
                                            Children       = new[]
                                            {
                                                participants = new OsuSpriteText
                                                {
                                                    TextSize = 30,
                                                    Font     = @"Exo2.0-Bold"
                                                },
                                                participantsSlash = new OsuSpriteText
                                                {
                                                    Text     = @"/",
                                                    TextSize = 30,
                                                    Font     = @"Exo2.0-Light"
                                                },
                                                maxParticipants = new OsuSpriteText
                                                {
                                                    TextSize = 30,
                                                    Font     = @"Exo2.0-Light"
                                                },
                                            },
                                        },
                                        name = new OsuSpriteText
                                        {
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft,
                                            TextSize = 30,
                                        },
                                    },
                                },
                            },
                        },
                        statusStrip = new Box
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = 5,
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Children         = new Drawable[]
                            {
                                new Box
                                {
                                    RelativeSizeAxes = Axes.Both,
                                    Colour           = OsuColour.FromHex(@"28242d"),
                                },
                                new FillFlowContainer
                                {
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Direction        = FillDirection.Vertical,
                                    LayoutDuration   = transition_duration,
                                    Padding          = contentPadding,
                                    Spacing          = new Vector2(0f, 5f),
                                    Children         = new Drawable[]
                                    {
                                        status = new OsuSpriteText
                                        {
                                            TextSize = 14,
                                            Font     = @"Exo2.0-Bold",
                                        },
                                        infoPanelFlow = new FillFlowContainer
                                        {
                                            AutoSizeAxes   = Axes.X,
                                            Height         = 30,
                                            Direction      = FillDirection.Horizontal,
                                            LayoutDuration = transition_duration,
                                            Spacing        = new Vector2(5f, 0f),
                                            Children       = new Drawable[]
                                            {
                                                modeTypeInfo = new ModeTypeInfo(),
                                                new Container
                                                {
                                                    AutoSizeAxes     = Axes.X,
                                                    RelativeSizeAxes = Axes.Y,
                                                    Margin           = new MarginPadding {
                                                        Left = 5
                                                    },
                                                    Children = new[]
                                                    {
                                                        new FillFlowContainer
                                                        {
                                                            AutoSizeAxes = Axes.Both,
                                                            Direction    = FillDirection.Horizontal,
                                                            Children     = new[]
                                                            {
                                                                beatmapTitle = new OsuSpriteText
                                                                {
                                                                    Font = @"Exo2.0-BoldItalic",
                                                                },
                                                                beatmapDash = new OsuSpriteText
                                                                {
                                                                    Font = @"Exo2.0-BoldItalic",
                                                                },
                                                                beatmapArtist = new OsuSpriteText
                                                                {
                                                                    Font = @"Exo2.0-RegularItalic",
                                                                },
                                                            },
                                                        },
                                                        beatmapAuthor = new OsuSpriteText
                                                        {
                                                            Anchor   = Anchor.BottomLeft,
                                                            Origin   = Anchor.BottomLeft,
                                                            TextSize = 14,
                                                            Colour   = colours.Gray9,
                                                        },
                                                    },
                                                },
                                            },
                                        },
                                    },
                                },
                            },
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Padding          = contentPadding,
                            Children         = new Drawable[]
                            {
                                participantInfo = new ParticipantInfo(@"Rank Range "),
                            },
                        },
                    },
                },
                participantsScroll = new OsuScrollContainer
                {
                    Anchor           = Anchor.BottomLeft,
                    Origin           = Anchor.BottomLeft,
                    RelativeSizeAxes = Axes.X,
                    Padding          = new MarginPadding {
                        Top = contentPadding.Top, Left = 38, Right = 37
                    },
                    Children = new[]
                    {
                        participantsFlow = new FillFlowContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            LayoutDuration   = transition_duration,
                            Spacing          = new Vector2(5f),
                        },
                    },
                },
            };

            nameBind.ValueChanged   += n => name.Text = n;
            hostBind.ValueChanged   += h => participantInfo.Host = h;
            typeBind.ValueChanged   += t => modeTypeInfo.Type = t;
            statusBind.ValueChanged += displayStatus;

            beatmapBind.ValueChanged += b =>
            {
                modeTypeInfo.Beatmap = b;

                if (b != null)
                {
                    coverContainer.FadeIn(transition_duration);

                    LoadComponentAsync(new BeatmapSetCover(b.BeatmapSet)
                    {
                        RelativeSizeAxes = Axes.Both,
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        FillMode         = FillMode.Fill,
                        OnLoadComplete   = d => d.FadeInFromZero(400, Easing.Out),
                    }, coverContainer.Add);

                    beatmapTitle.Current  = localisation.GetUnicodePreference(b.Metadata.TitleUnicode, b.Metadata.Title);
                    beatmapDash.Text      = @" - ";
                    beatmapArtist.Current = localisation.GetUnicodePreference(b.Metadata.ArtistUnicode, b.Metadata.Artist);
                    beatmapAuthor.Text    = $"mapped by {b.Metadata.Author}";
                }
                else
                {
                    coverContainer.FadeOut(transition_duration);

                    beatmapTitle.Current  = null;
                    beatmapArtist.Current = null;

                    beatmapTitle.Text = "Changing map";
                    beatmapDash.Text  = beatmapArtist.Text = beatmapAuthor.Text = string.Empty;
                }
            };

            maxParticipantsBind.ValueChanged += m =>
            {
                if (m == null)
                {
                    participantsSlash.FadeOut(transition_duration);
                    maxParticipants.FadeOut(transition_duration);
                }
                else
                {
                    participantsSlash.FadeIn(transition_duration);
                    maxParticipants.FadeIn(transition_duration);
                    maxParticipants.Text = m.ToString();
                }
            };

            participantsBind.ValueChanged += p =>
            {
                participants.Text                   = p.Length.ToString();
                participantInfo.Participants        = p;
                participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u));
            };

            updateState();
        }
Ejemplo n.º 19
0
 protected override void OnLoadFinished() => text.FadeIn(200, Easing.OutQuint);