Ejemplo n.º 1
0
        private IEnumerable <Drawable> createLink(IEnumerable <Drawable> drawables, string text, string url = null, LinkAction linkType = LinkAction.External, string linkArgument = null, string tooltipText = null, Action action = null)
        {
            AddInternal(new DrawableLinkCompiler(drawables.OfType <SpriteText>().ToList())
            {
                RelativeSizeAxes = Axes.Both,
                TooltipText      = tooltipText ?? (url != text ? url : string.Empty),
                Action           = action ?? (() =>
                {
                    switch (linkType)
                    {
                    case LinkAction.OpenBeatmap:
                        // TODO: proper query params handling
                        if (linkArgument != null && int.TryParse(linkArgument.Contains('?') ? linkArgument.Split('?')[0] : linkArgument, out int beatmapId))
                        {
                            game?.ShowBeatmap(beatmapId);
                        }
                        break;

                    case LinkAction.OpenBeatmapSet:
                        if (int.TryParse(linkArgument, out int setId))
                        {
                            game?.ShowBeatmapSet(setId);
                        }
                        break;

                    case LinkAction.OpenChannel:
                        try
                        {
                            channelManager?.OpenChannel(linkArgument);
                        }
                        catch (ChannelNotFoundException)
                        {
                            Logger.Log($"The requested channel \"{linkArgument}\" does not exist");
                        }

                        break;

                    case LinkAction.OpenEditorTimestamp:
                    case LinkAction.JoinMultiplayerMatch:
                    case LinkAction.Spectate:
                        showNotImplementedError?.Invoke();
                        break;

                    case LinkAction.External:
                        game?.OpenUrlExternally(url);
                        break;

                    case LinkAction.OpenUserProfile:
                        if (long.TryParse(linkArgument, out long userId))
                        {
                            game?.ShowUser(userId);
                        }
                        break;

                    default:
                        throw new NotImplementedException($"This {nameof(LinkAction)} ({linkType.ToString()}) is missing an associated action.");
                    }
                }),
            });
Ejemplo n.º 2
0
        private void load(OsuColour colours, APIAccess api, OsuGame game, TextureStore textures)
        {
            this.api = api;

            if (string.IsNullOrEmpty(api.ProvidedUsername))
            {
                return;
            }

            InternalChildren = new Drawable[]
            {
                new Sprite
                {
                    Anchor  = Anchor.TopCentre,
                    Origin  = Anchor.TopCentre,
                    Texture = textures.Get(@"Menu/dev-build-footer"),
                },
                new Sprite
                {
                    Anchor  = Anchor.BottomCentre,
                    Origin  = Anchor.BottomCentre,
                    Texture = textures.Get(@"Menu/dev-build-footer"),
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Vertical,
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopCentre,
                    Padding          = new MarginPadding(20),
                    Spacing          = new Vector2(0, 5),
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = 150,
                            Child            = new OsuLogo
                            {
                                Scale     = new Vector2(0.1f),
                                Anchor    = Anchor.Centre,
                                Triangles = false,
                            },
                        },
                        new OsuSpriteText
                        {
                            TextSize = 28,
                            Font     = "Exo2.0-Light",
                            Anchor   = Anchor.TopCentre,
                            Origin   = Anchor.TopCentre,
                            Colour   = Color4.Red,
                            Text     = "Warning! 注意!",
                        },
                        multiAccountExplanationText = new OsuTextFlowContainer(cp => { cp.TextSize = 12; })
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y
                        },
                        new SettingsButton
                        {
                            Text   = "Help, I can't access my account!",
                            Margin = new MarginPadding {
                                Top = 50
                            },
                            Action = () => game?.OpenUrlExternally(help_centre_url)
                        },
                        new DangerousSettingsButton
                        {
                            Text   = "I understand. This account isn't for me.",
                            Action = () => this.Push(new ScreenEntry())
                        },
                        furtherAssistance = new LinkFlowContainer(cp => { cp.TextSize = 12; })
                        {
                            Margin = new MarginPadding {
                                Top = 20
                            },
                            Anchor       = Anchor.TopCentre,
                            Origin       = Anchor.TopCentre,
                            AutoSizeAxes = Axes.Both
                        },
                    }
                }
            };

            multiAccountExplanationText.AddText("Are you ");
            multiAccountExplanationText.AddText(api.ProvidedUsername, cp => cp.Colour = colours.BlueLight);
            multiAccountExplanationText.AddText("? osu! has a policy of ");
            multiAccountExplanationText.AddText("one account per person!", cp => cp.Colour = colours.Yellow);
            multiAccountExplanationText.AddText(" Please be aware that creating more than one account per person may result in ");
            multiAccountExplanationText.AddText("permanent deactivation of accounts", cp => cp.Colour = colours.Yellow);
            multiAccountExplanationText.AddText(".");

            furtherAssistance.AddText("Need further assistance? Contact us via our ");
            furtherAssistance.AddLink("support system", help_centre_url);
            furtherAssistance.AddText(".");
        }
Ejemplo n.º 3
0
        private void load(OsuColour colours, OsuGame game, TextureStore textures)
        {
            if (string.IsNullOrEmpty(api?.ProvidedUsername))
            {
                return;
            }

            InternalChildren = new Drawable[]
            {
                new Sprite
                {
                    Anchor  = Anchor.TopCentre,
                    Origin  = Anchor.TopCentre,
                    Texture = textures.Get(@"Menu/dev-build-footer"),
                },
                new Sprite
                {
                    Anchor  = Anchor.BottomCentre,
                    Origin  = Anchor.BottomCentre,
                    Texture = textures.Get(@"Menu/dev-build-footer"),
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Vertical,
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopCentre,
                    Padding          = new MarginPadding(20),
                    Spacing          = new Vector2(0, 5),
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = 150,
                            Child            = new OsuLogo
                            {
                                Scale     = new Vector2(0.1f),
                                Anchor    = Anchor.Centre,
                                Triangles = false,
                            },
                        },
                        new OsuSpriteText
                        {
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.TopCentre,
                            Colour = Color4.Red,
                            Font   = OsuFont.GetFont(size: 28, weight: FontWeight.Light),
                            Text   = "Warning! 注意!",
                        },
                        multiAccountExplanationText = new OsuTextFlowContainer(cp => cp.Font = cp.Font.With(size: 12))
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y
                        },
                        new SettingsButton
                        {
                            Text   = "幫幫我, 我沒有辦法訪問我的帳號!",
                            Margin = new MarginPadding {
                                Top = 50
                            },
                            Action = () => game?.OpenUrlExternally(help_centre_url)
                        },
                        new DangerousSettingsButton
                        {
                            Text   = "我知道, 那個不是我的帳號.",
                            Action = () => this.Push(new ScreenEntry())
                        },
                        furtherAssistance = new LinkFlowContainer(cp => cp.Font = cp.Font.With(size: 12))
                        {
                            Margin = new MarginPadding {
                                Top = 20
                            },
                            Anchor       = Anchor.TopCentre,
                            Origin       = Anchor.TopCentre,
                            AutoSizeAxes = Axes.Both
                        },
                    }
                }
            };

            multiAccountExplanationText.AddText("你是 ");
            multiAccountExplanationText.AddText(api.ProvidedUsername, cp => cp.Colour = colours.BlueLight);
            multiAccountExplanationText.AddText("嗎? osu! 有一條 ");
            multiAccountExplanationText.AddText("每人只能有一個 osu! 帳號的規則!", cp => cp.Colour = colours.Yellow);
            multiAccountExplanationText.AddText(" 請避免註冊多於一個帳號 否則帳號會被");
            multiAccountExplanationText.AddText("永久禁止訪問", cp => cp.Colour = colours.Yellow);
            multiAccountExplanationText.AddText(".");

            furtherAssistance.AddText("需要協助嗎? 使用");
            furtherAssistance.AddLink("協助系統", help_centre_url);
            furtherAssistance.AddText(".");
        }
Ejemplo n.º 4
0
        private void load(OsuGame game)
        {
            background.Colour = colours.Pink;

            Action = () => game?.OpenUrlExternally(@"/home/support");
        }
Ejemplo n.º 5
0
        private void load(OsuColour colours, IAPIProvider api, OsuGame game, TextureStore textures)
        {
            this.api = api;

            if (string.IsNullOrEmpty(api.ProvidedUsername))
            {
                return;
            }

            InternalChildren = new Drawable[]
            {
                new Sprite
                {
                    Anchor  = Anchor.TopCentre,
                    Origin  = Anchor.TopCentre,
                    Texture = textures.Get(@"Menu/dev-build-footer"),
                },
                new Sprite
                {
                    Anchor  = Anchor.BottomCentre,
                    Origin  = Anchor.BottomCentre,
                    Texture = textures.Get(@"Menu/dev-build-footer"),
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Direction        = FillDirection.Vertical,
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopCentre,
                    Padding          = new MarginPadding(20),
                    Spacing          = new Vector2(0, 5),
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Height           = 150,
                            Child            = new OsuLogo
                            {
                                Scale     = new Vector2(0.1f),
                                Anchor    = Anchor.Centre,
                                Triangles = false,
                            },
                        },
                        new OsuSpriteText
                        {
                            Anchor = Anchor.TopCentre,
                            Origin = Anchor.TopCentre,
                            Colour = Color4.Red,
                            Font   = OsuFont.GetFont(size: 28, weight: FontWeight.Light),
                            Text   = "Warning! 注意!",
                        },
                        multiAccountExplanationText = new OsuTextFlowContainer(cp => cp.Font = cp.Font.With(size: 16))
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y
                        },
                        new SettingsButton
                        {
                            Text   = "我没法登录我的账号!",
                            Margin = new MarginPadding {
                                Top = 50
                            },
                            Action = () => game?.OpenUrlExternally(help_centre_url)
                        },
                        new DangerousSettingsButton
                        {
                            Text   = "我了解. 但我是为别人创建账号的.",
                            Action = () => this.Push(new ScreenEntry())
                        },
                        furtherAssistance = new LinkFlowContainer(cp => cp.Font = cp.Font.With(size: 16))
                        {
                            Margin = new MarginPadding {
                                Top = 20
                            },
                            Anchor       = Anchor.TopCentre,
                            Origin       = Anchor.TopCentre,
                            AutoSizeAxes = Axes.Both
                        },
                    }
                }
            };

            multiAccountExplanationText.AddText("你是 ");
            multiAccountExplanationText.AddText(api.ProvidedUsername, cp => cp.Colour = colours.BlueLight);
            multiAccountExplanationText.AddText("吗? 如果是,osu! 不允许 ");
            multiAccountExplanationText.AddText("多开账号!", cp => cp.Colour = colours.Yellow);
            multiAccountExplanationText.AddText("请注意,多开账号行为将会导致您的osu!账号被");
            multiAccountExplanationText.AddText("一起封禁", cp => cp.Colour = colours.Yellow);
            multiAccountExplanationText.AddText(".");

            furtherAssistance.AddText("需要进一步的帮助?请联系我们的");
            furtherAssistance.AddLink("帮助中心", help_centre_url);
            furtherAssistance.AddText(".");
        }