Пример #1
0
        private void load(OsuColour colours)
        {
            InternalChild = new OsuContextMenuContainer
            {
                RelativeSizeAxes = Axes.Both,
                Children         = new Drawable[]
                {
                    headerText = new OsuTextFlowContainer
                    {
                        TextAnchor       = Anchor.TopCentre,
                        Padding          = new MarginPadding(20),
                        Anchor           = Anchor.TopCentre,
                        Origin           = Anchor.TopCentre,
                        RelativeSizeAxes = Axes.X
                    },
                    new SkinBlueprintContainer(target),
                }
            };

            headerText.AddParagraph("Skin editor (preview)", cp => cp.Font = OsuFont.Default.With(size: 24));
            headerText.AddParagraph("This is a preview of what is to come. Changes are lost on changing screens.", cp =>
            {
                cp.Font   = OsuFont.Default.With(size: 12);
                cp.Colour = colours.Yellow;
            });
        }
Пример #2
0
 private void load()
 {
     InternalChild = new PillContainer
     {
         Child = new FillFlowContainer
         {
             Anchor       = Anchor.Centre,
             Origin       = Anchor.Centre,
             AutoSizeAxes = Axes.Both,
             Spacing      = new Vector2(4),
             Children     = new Drawable[]
             {
                 new SpriteIcon
                 {
                     Anchor = Anchor.CentreLeft,
                     Origin = Anchor.CentreLeft,
                     Size   = new Vector2(8),
                     Icon   = FontAwesome.Solid.User
                 },
                 rankFlow = new OsuTextFlowContainer(s => s.Font = OsuFont.GetFont(size: 12))
                 {
                     Anchor       = Anchor.CentreLeft,
                     Origin       = Anchor.CentreLeft,
                     AutoSizeAxes = Axes.Both,
                 }
             }
         }
     };
 }
Пример #3
0
 public SingerToolTip()
 {
     Child = new FillFlowContainer
     {
         AutoSizeAxes = Axes.Y,
         Width        = 300,
         Direction    = FillDirection.Vertical,
         Spacing      = new Vector2(15),
         Children     = new Drawable[]
         {
             avatar = new DrawableSingerAvatar
             {
                 Name = "Avatar",
                 Size = new Vector2(64)
             },
             new FillFlowContainer
             {
                 Name             = "Singer name",
                 AutoSizeAxes     = Axes.Y,
                 RelativeSizeAxes = Axes.X,
                 Direction        = FillDirection.Horizontal,
                 Spacing          = new Vector2(5),
                 Children         = new[]
                 {
                     singerName = new OsuSpriteText
                     {
                         Name = "Singer name",
                         Font = OsuFont.GetFont(weight: FontWeight.Bold, size: 20),
                     },
                     singerEnglishName = new OsuSpriteText
                     {
                         Name   = "English name",
                         Anchor = Anchor.BottomLeft,
                         Origin = Anchor.BottomLeft,
                         Font   = OsuFont.GetFont(weight: FontWeight.Bold, size: 13),
                         Margin = new MarginPadding {
                             Bottom = 1
                         }
                     }
                 }
             },
             singerRomajiName = new OsuSpriteText
             {
                 Name = "Romaji name"
             },
             singerDescription = new OsuTextFlowContainer(s => s.Font = s.Font.With(size: 14))
             {
                 RelativeSizeAxes = Axes.X,
                 AutoSizeAxes     = Axes.Y,
                 Colour           = Color4.White.Opacity(0.75f),
                 Name             = "Description",
             }
         }
     };
 }
Пример #4
0
 private void load()
 {
     InternalChild = new PillContainer
     {
         Child = textFlow = new OsuTextFlowContainer(s => s.Font = OsuFont.GetFont(size: 12))
         {
             Anchor       = Anchor.CentreLeft,
             Origin       = Anchor.CentreLeft,
             AutoSizeAxes = Axes.Both,
         }
     };
 }
Пример #5
0
        public EFToRealmMigrator()
        {
            RelativeSizeAxes = Axes.Both;

            InternalChildren = new Drawable[]
            {
                new FillFlowContainer
                {
                    AutoSizeAxes = Axes.Both,
                    Direction    = FillDirection.Vertical,
                    Anchor       = Anchor.Centre,
                    Origin       = Anchor.Centre,
                    Spacing      = new Vector2(10),
                    Children     = new Drawable[]
                    {
                        new OsuSpriteText
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,
                            Text   = "Database migration in progress",
                            Font   = OsuFont.Default.With(size: 40)
                        },
                        new OsuSpriteText
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,
                            Text   = "This could take a few minutes depending on the speed of your disk(s).",
                            Font   = OsuFont.Default.With(size: 30)
                        },
                        new OsuSpriteText
                        {
                            Anchor = Anchor.Centre,
                            Origin = Anchor.Centre,
                            Text   = "Please keep the window open until this completes!",
                            Font   = OsuFont.Default.With(size: 30)
                        },
                        new LoadingSpinner(true)
                        {
                            State = { Value = Visibility.Visible }
                        },
                        currentOperationText = new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 30))
                        {
                            Anchor           = Anchor.Centre,
                            Origin           = Anchor.Centre,
                            AutoSizeAxes     = Axes.Y,
                            RelativeSizeAxes = Axes.X,
                            TextAnchor       = Anchor.TopCentre,
                        },
                    }
                },
            };
        }
Пример #6
0
        private void load(OsuColour colours, KeyBindingStore store)
        {
            this.store = store;

            EdgeEffect = new EdgeEffectParameters
            {
                Radius = 2,
                Colour = colours.YellowDark.Opacity(0),
                Type   = EdgeEffectType.Shadow,
                Hollow = true,
            };

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Black,
                    Alpha            = 0.6f,
                },
                text = new OsuSpriteText
                {
                    Text   = action.GetDescription(),
                    Margin = new MarginPadding(padding),
                },
                buttons = new FillFlowContainer <KeyButton>
                {
                    AutoSizeAxes = Axes.Both,
                    Anchor       = Anchor.TopRight,
                    Origin       = Anchor.TopRight
                },
                pressAKey = new OsuTextFlowContainer
                {
                    Text             = "Press a key to change binding, Shift+Delete to delete, Escape to cancel.",
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Margin           = new MarginPadding(padding),
                    Padding          = new MarginPadding {
                        Top = height
                    },
                    Alpha  = 0,
                    Colour = colours.YellowDark
                }
            };

            foreach (var b in bindings)
            {
                buttons.Add(new KeyButton(b));
            }
        }
Пример #7
0
        public RoomInfo()
        {
            AutoSizeAxes = Axes.Y;

            RoomLocalUserInfo localUserInfo;
            RoomStatusInfo    statusInfo;
            ModeTypeInfo      typeInfo;
            ParticipantInfo   participantInfo;

            InternalChild = new FillFlowContainer
            {
                Anchor           = Anchor.CentreLeft,
                Origin           = Anchor.CentreLeft,
                RelativeSizeAxes = Axes.X,
                Spacing          = new Vector2(0, 10),
                AutoSizeAxes     = Axes.Y,
                Direction        = FillDirection.Vertical,
                Children         = new Drawable[]
                {
                    roomName = new OsuTextFlowContainer(t => t.Font = OsuFont.GetFont(size: 30))
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                    },
                    participantInfo = new ParticipantInfo(),
                    new Container
                    {
                        RelativeSizeAxes = Axes.X,
                        AutoSizeAxes     = Axes.Y,
                        Children         = new Drawable[]
                        {
                            statusInfo = new RoomStatusInfo(),
                            typeInfo   = new ModeTypeInfo
                            {
                                Anchor = Anchor.BottomRight,
                                Origin = Anchor.BottomRight
                            }
                        }
                    },
                    localUserInfo = new RoomLocalUserInfo(),
                }
            };

            statusElements.AddRange(new Drawable[]
            {
                statusInfo, typeInfo, participantInfo, localUserInfo
            });
        }
Пример #8
0
        public MovingNotice()
        {
            Masking      = true;
            CornerRadius = 16;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = Color4.Gray.Opacity(0.4f)
                },
                textFlow = new OsuTextFlowContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Origin           = Anchor.Centre,
                    Anchor           = Anchor.Centre,
                    TextAnchor       = Anchor.Centre,
                }
            };
        }
Пример #9
0
        private void load()
        {
            Content.Children = new Drawable[]
            {
                new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: CONTENT_FONT_SIZE))
                {
                    Colour           = OverlayColourProvider.Content1,
                    Text             = FirstRunOverlayImportFromStableScreenStrings.Description,
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y
                },
                stableLocatorTextBox = new StableLocatorLabelledTextBox
                {
                    Label           = FirstRunOverlayImportFromStableScreenStrings.LocateDirectoryLabel,
                    PlaceholderText = FirstRunOverlayImportFromStableScreenStrings.LocateDirectoryPlaceholder
                },
                new ImportCheckbox(CommonStrings.Beatmaps, StableContent.Beatmaps),
                new ImportCheckbox(CommonStrings.Scores, StableContent.Scores),
                new ImportCheckbox(CommonStrings.Skins, StableContent.Skins),
                new ImportCheckbox(CommonStrings.Collections, StableContent.Collections),
                importButton = new ProgressRoundedButton
                {
                    Size   = button_size,
                    Anchor = Anchor.TopCentre,
                    Origin = Anchor.TopCentre,
                    Text   = FirstRunOverlayImportFromStableScreenStrings.ImportButton,
                    Action = runImport
                },
                progressText = new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: CONTENT_FONT_SIZE))
                {
                    Colour           = OverlayColourProvider.Content1,
                    Text             = FirstRunOverlayImportFromStableScreenStrings.ImportInProgress,
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Alpha            = 0,
                },
            };

            stableLocatorTextBox.Current.BindValueChanged(_ => updateStablePath(), true);
        }
Пример #10
0
            public TableOfContentsEntry(string text, MarkdownHeading target, bool subtitle = false)
            {
                this.target = target;

                RelativeSizeAxes = Axes.X;
                AutoSizeAxes     = Axes.Y;
                Child            = textFlow = new OsuTextFlowContainer(t =>
                {
                    t.Font = OsuFont.GetFont(size: subtitle ? 12 : 15);
                }).With(f =>
                {
                    f.AddText(text);
                    f.RelativeSizeAxes = Axes.X;
                    f.AutoSizeAxes     = Axes.Y;
                    f.Margin           = new MarginPadding {
                        Bottom = 2
                    };
                });
                Padding = new MarginPadding {
                    Left = subtitle ? 10 : 0
                };
            }
Пример #11
0
        public DisclaimerSubScreen()
        {
            Child = textFlow = new OsuTextFlowContainer
            {
                RelativeSizeAxes = Axes.Both,
                Origin           = Anchor.Centre,
                Anchor           = Anchor.Centre,
                TextAnchor       = Anchor.Centre,
            };

            Child = new Container
            {
                AutoSizeAxes = Axes.Both,
                Origin       = Anchor.Centre,
                Anchor       = Anchor.Centre,
                Masking      = true,
                CornerRadius = 16,
                Children     = new Drawable[]
                {
                    new Box
                    {
                        RelativeSizeAxes = Axes.Both,
                        Colour           = Color4.Gray.Opacity(0.4f)
                    },
                    textFlow = new OsuTextFlowContainer
                    {
                        Margin       = new MarginPadding(16),
                        AutoSizeAxes = Axes.Both,
                        Origin       = Anchor.Centre,
                        Anchor       = Anchor.Centre,
                        TextAnchor   = Anchor.Centre,
                    }
                }
            };

            ValidForResume = false;
        }
        public ClickablePlaceholder(string actionMessage, IconUsage icon)
        {
            OsuTextFlowContainer textFlow;

            AddArbitraryDrawable(new OsuAnimatedButton
            {
                AutoSizeAxes = Framework.Graphics.Axes.Both,
                Child        = textFlow = new OsuTextFlowContainer(cp => cp.Font = cp.Font.With(size: TEXT_SIZE))
                {
                    AutoSizeAxes = Framework.Graphics.Axes.Both,
                    Margin       = new Framework.Graphics.MarginPadding(5)
                },
                Action = () => Action?.Invoke()
            });

            textFlow.AddIcon(icon, i =>
            {
                i.Padding = new Framework.Graphics.MarginPadding {
                    Right = 10
                };
            });

            textFlow.AddText(actionMessage);
        }
Пример #13
0
 private void load()
 {
     InternalChild = new OsuContextMenuContainer
     {
         RelativeSizeAxes = Axes.Both,
         Children         = new Drawable[]
         {
             headerText = new OsuTextFlowContainer
             {
                 TextAnchor       = Anchor.TopCentre,
                 Padding          = new MarginPadding(20),
                 Anchor           = Anchor.TopCentre,
                 Origin           = Anchor.TopCentre,
                 RelativeSizeAxes = Axes.X
             },
             new GridContainer
             {
                 RelativeSizeAxes = Axes.Both,
                 ColumnDimensions = new[]
                 {
                     new Dimension(GridSizeMode.AutoSize),
                     new Dimension()
                 },
                 Content = new[]
                 {
                     new Drawable[]
                     {
                         new SkinComponentToolbox(600)
                         {
                             Anchor           = Anchor.CentreLeft,
                             Origin           = Anchor.CentreLeft,
                             RequestPlacement = placeComponent
                         },
                         new Container
                         {
                             RelativeSizeAxes = Axes.Both,
                             Children         = new Drawable[]
                             {
                                 new SkinBlueprintContainer(targetScreen),
                                 new FillFlowContainer
                                 {
                                     Direction    = FillDirection.Horizontal,
                                     AutoSizeAxes = Axes.Both,
                                     Anchor       = Anchor.TopRight,
                                     Origin       = Anchor.TopRight,
                                     Spacing      = new Vector2(5),
                                     Padding      = new MarginPadding
                                     {
                                         Top  = 10,
                                         Left = 10,
                                     },
                                     Margin = new MarginPadding
                                     {
                                         Right  = 10,
                                         Bottom = 10,
                                     },
                                     Children = new Drawable[]
                                     {
                                         new TriangleButton
                                         {
                                             Text   = "Save Changes",
                                             Width  = 140,
                                             Action = Save,
                                         },
                                         new DangerousTriangleButton
                                         {
                                             Text   = "Revert to default",
                                             Width  = 140,
                                             Action = revert,
                                         },
                                     }
                                 },
                             }
                         },
                     }
                 }
             }
         }
     };
 }
Пример #14
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(".");
        }
Пример #15
0
        /// <summary>
        /// Creates a new <see cref="LabelledComponent"/>.
        /// </summary>
        /// <param name="padded">Whether the component should be padded or should be expanded to the bounds of this <see cref="LabelledComponent"/>.</param>
        protected LabelledComponent(bool padded)
        {
            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;

            CornerRadius = CORNER_RADIUS;
            Masking      = true;

            InternalChildren = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = OsuColour.FromHex("1c2125"),
                },
                new FillFlowContainer
                {
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                    Direction        = FillDirection.Vertical,
                    Padding          = padded
                        ? new MarginPadding {
                        Horizontal = CONTENT_PADDING_HORIZONTAL, Vertical = CONTENT_PADDING_VERTICAL
                    }
                        : new MarginPadding {
                        Left = CONTENT_PADDING_HORIZONTAL
                    },
                    Spacing  = new Vector2(0, 12),
                    Children = new Drawable[]
                    {
                        new GridContainer
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Content          = new[]
                            {
                                new Drawable[]
                                {
                                    labelText = new OsuTextFlowContainer(s => s.Font = OsuFont.GetFont(weight: FontWeight.Bold))
                                    {
                                        Anchor       = Anchor.CentreLeft,
                                        Origin       = Anchor.CentreLeft,
                                        AutoSizeAxes = Axes.Both,
                                        Padding      = new MarginPadding {
                                            Right = 20
                                        }
                                    },
                                    new Container
                                    {
                                        Anchor           = Anchor.CentreRight,
                                        Origin           = Anchor.CentreRight,
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Child            = Component = CreateComponent().With(d =>
                                        {
                                            d.Anchor = Anchor.CentreRight;
                                            d.Origin = Anchor.CentreRight;
                                        })
                                    }
                                },
                            },
                            RowDimensions    = new[] { new Dimension(GridSizeMode.AutoSize) },
                            ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize) }
                        },
                        descriptionText = new OsuTextFlowContainer(s => s.Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold, italics: true))
                        {
                            RelativeSizeAxes = Axes.X,
                            AutoSizeAxes     = Axes.Y,
                            Padding          = new MarginPadding {
                                Bottom = padded ? 0 : CONTENT_PADDING_VERTICAL
                            },
                            Alpha = 0,
                        }
                    }
                }
            };
        }
Пример #16
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(".");
        }
Пример #17
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(".");
        }
Пример #18
0
        private void load()
        {
            RelativeSizeAxes = Axes.Both;

            const float menu_height = 40;

            InternalChild = new OsuContextMenuContainer
            {
                RelativeSizeAxes = Axes.Both,
                Child            = new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    RowDimensions    = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(),
                    },

                    Content = new[]
                    {
                        new Drawable[]
                        {
                            new Container
                            {
                                Name             = "Menu container",
                                RelativeSizeAxes = Axes.X,
                                Depth            = float.MinValue,
                                Height           = menu_height,
                                Children         = new Drawable[]
                                {
                                    new EditorMenuBar
                                    {
                                        Anchor           = Anchor.CentreLeft,
                                        Origin           = Anchor.CentreLeft,
                                        RelativeSizeAxes = Axes.Both,
                                        Items            = new[]
                                        {
                                            new MenuItem("File")
                                            {
                                                Items = new[]
                                                {
                                                    new EditorMenuItem("Save", MenuItemType.Standard, Save),
                                                    new EditorMenuItem("Revert to default", MenuItemType.Destructive, revert),
                                                    new EditorMenuItemSpacer(),
                                                    new EditorMenuItem("Exit", MenuItemType.Standard, () => skinEditorOverlay?.Hide()),
                                                },
                                            },
                                        }
                                    },
                                    headerText = new OsuTextFlowContainer
                                    {
                                        TextAnchor       = Anchor.TopRight,
                                        Padding          = new MarginPadding(5),
                                        Anchor           = Anchor.TopRight,
                                        Origin           = Anchor.TopRight,
                                        AutoSizeAxes     = Axes.X,
                                        RelativeSizeAxes = Axes.Y,
                                    },
                                },
                            },
                        },
                        new Drawable[]
                        {
                            new SkinEditorSceneLibrary
                            {
                                RelativeSizeAxes = Axes.X,
                            },
                        },
                        new Drawable[]
                        {
                            new GridContainer
                            {
                                RelativeSizeAxes = Axes.Both,
                                ColumnDimensions = new[]
                                {
                                    new Dimension(GridSizeMode.AutoSize),
                                    new Dimension(),
                                    new Dimension(GridSizeMode.AutoSize),
                                },
                                Content = new[]
                                {
                                    new Drawable[]
                                    {
                                        componentsSidebar = new EditorSidebar(),
                                        content           = new Container
                                        {
                                            Depth            = float.MaxValue,
                                            RelativeSizeAxes = Axes.Both,
                                        },
                                        settingsSidebar = new EditorSidebar(),
                                    }
                                }
                            }
                        },
                    }
                }
            };
        }
Пример #19
0
 private void addSpacer(OsuTextFlowContainer textFlow) => textFlow.AddArbitraryDrawable(new Container {
     Width = 15
 });
Пример #20
0
        public ProfileHeader(User user)
        {
            RelativeSizeAxes = Axes.X;
            Height           = cover_height + info_height;

            Children = new Drawable[]
            {
                coverContainer = new Container
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = cover_height,
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f))
                        },
                        new Container
                        {
                            Anchor  = Anchor.BottomLeft,
                            Origin  = Anchor.BottomLeft,
                            Padding = new MarginPadding {
                                Left = UserProfileOverlay.CONTENT_X_MARGIN, Bottom = 20, Right = stats_width + UserProfileOverlay.CONTENT_X_MARGIN
                            },
                            AutoSizeAxes     = Axes.Y,
                            RelativeSizeAxes = Axes.X,
                            Children         = new Drawable[]
                            {
                                new UpdateableAvatar
                                {
                                    User         = user,
                                    Size         = new Vector2(avatar_size),
                                    Anchor       = Anchor.BottomLeft,
                                    Origin       = Anchor.BottomLeft,
                                    Masking      = true,
                                    CornerRadius = 5,
                                    EdgeEffect   = new EdgeEffectParameters
                                    {
                                        Type   = EdgeEffectType.Shadow,
                                        Colour = Color4.Black.Opacity(0.25f),
                                        Radius = 4,
                                    },
                                },
                                new Container
                                {
                                    Anchor       = Anchor.BottomLeft,
                                    Origin       = Anchor.BottomLeft,
                                    X            = avatar_size + 10,
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new Drawable[]
                                    {
                                        SupporterTag = new SupporterIcon
                                        {
                                            Alpha  = 0,
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft,
                                            Y      = -75,
                                            Size   = new Vector2(25, 25)
                                        },
                                        new ProfileLink(user)
                                        {
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft,
                                            Y      = -48,
                                        },
                                        countryFlag = new DrawableFlag(user.Country)
                                        {
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft,
                                            Width  = 30,
                                            Height = 20
                                        }
                                    }
                                },
                                badgeContainer = new BadgeContainer
                                {
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Origin           = Anchor.BottomLeft,
                                    Margin           = new MarginPadding {
                                        Bottom = 5
                                    },
                                    Alpha = 0,
                                },
                            }
                        },
                        colourBar = new Box
                        {
                            Anchor = Anchor.BottomLeft,
                            Origin = Anchor.BottomLeft,
                            X      = UserProfileOverlay.CONTENT_X_MARGIN,
                            Height = 5,
                            Width  = info_width,
                            Alpha  = 0
                        }
                    }
                },
                infoTextLeft = new OsuTextFlowContainer(t => t.TextSize = 14)
                {
                    X                = UserProfileOverlay.CONTENT_X_MARGIN,
                    Y                = cover_height + 20,
                    Width            = info_width,
                    AutoSizeAxes     = Axes.Y,
                    ParagraphSpacing = 0.8f,
                    LineSpacing      = 0.2f
                },
                infoTextRight = new LinkFlowContainer(t =>
                {
                    t.TextSize = 14;
                    t.Font     = @"Exo2.0-RegularItalic";
                })
                {
                    X                = UserProfileOverlay.CONTENT_X_MARGIN + info_width + 20,
                    Y                = cover_height + 20,
                    Width            = info_width,
                    AutoSizeAxes     = Axes.Y,
                    ParagraphSpacing = 0.8f,
                    LineSpacing      = 0.2f
                },
                new Container
                {
                    X = -UserProfileOverlay.CONTENT_X_MARGIN,
                    RelativeSizeAxes = Axes.Y,
                    Width            = stats_width,
                    Anchor           = Anchor.TopRight,
                    Origin           = Anchor.TopRight,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Y        = level_position,
                            Height   = level_height,
                            Children = new Drawable[]
                            {
                                new Box
                                {
                                    Colour           = Color4.Black.Opacity(0.5f),
                                    RelativeSizeAxes = Axes.Both
                                },
                                levelBadge = new Sprite
                                {
                                    Anchor = Anchor.Centre,
                                    Origin = Anchor.Centre,
                                    Height = 50,
                                    Width  = 50,
                                    Alpha  = 0
                                },
                                levelText = new OsuSpriteText
                                {
                                    Anchor   = Anchor.TopCentre,
                                    Origin   = Anchor.TopCentre,
                                    Y        = 11,
                                    TextSize = 20
                                }
                            }
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Y        = cover_height,
                            Anchor   = Anchor.TopCentre,
                            Origin   = Anchor.BottomCentre,
                            Height   = cover_height - level_height - level_position - 5,
                            Children = new Drawable[]
                            {
                                new Box
                                {
                                    Colour           = Color4.Black.Opacity(0.5f),
                                    RelativeSizeAxes = Axes.Both
                                },
                                scoreText = new FillFlowContainer <SpriteText>
                                {
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Direction        = FillDirection.Vertical,
                                    Padding          = new MarginPadding {
                                        Horizontal = 20, Vertical = 18
                                    },
                                    Spacing = new Vector2(0, 2)
                                },
                                scoreNumberText = new FillFlowContainer <SpriteText>
                                {
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Direction        = FillDirection.Vertical,
                                    Padding          = new MarginPadding {
                                        Horizontal = 20, Vertical = 18
                                    },
                                    Spacing = new Vector2(0, 2)
                                },
                                new FillFlowContainer <GradeBadge>
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Horizontal,
                                    Anchor       = Anchor.BottomCentre,
                                    Origin       = Anchor.BottomCentre,
                                    Y            = -64,
                                    Spacing      = new Vector2(20, 0),
                                    Children     = new[]
                                    {
                                        gradeSSPlus = new GradeBadge("SSPlus")
                                        {
                                            Alpha = 0
                                        },
                                        gradeSS = new GradeBadge("SS")
                                        {
                                            Alpha = 0
                                        },
                                    }
                                },
                                new FillFlowContainer <GradeBadge>
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Horizontal,
                                    Anchor       = Anchor.BottomCentre,
                                    Origin       = Anchor.BottomCentre,
                                    Y            = -18,
                                    Spacing      = new Vector2(20, 0),
                                    Children     = new[]
                                    {
                                        gradeSPlus = new GradeBadge("SPlus")
                                        {
                                            Alpha = 0
                                        },
                                        gradeS = new GradeBadge("S")
                                        {
                                            Alpha = 0
                                        },
                                        gradeA = new GradeBadge("A")
                                        {
                                            Alpha = 0
                                        },
                                    }
                                }
                            }
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Anchor           = Anchor.BottomCentre,
                            Origin           = Anchor.BottomCentre,
                            Height           = info_height - 15,
                            Children         = new Drawable[]
                            {
                                new Box
                                {
                                    Colour           = Color4.Black.Opacity(0.25f),
                                    RelativeSizeAxes = Axes.Both
                                },
                                rankGraph = new RankGraph
                                {
                                    RelativeSizeAxes = Axes.Both
                                }
                            }
                        }
                    }
                }
            };
        }
Пример #21
0
 private void load()
 {
     InternalChild = new OsuContextMenuContainer
     {
         RelativeSizeAxes = Axes.Both,
         Children         = new Drawable[]
         {
             new Container
             {
                 Name             = "Top bar",
                 RelativeSizeAxes = Axes.X,
                 Depth            = float.MinValue,
                 Height           = 40,
                 Children         = new Drawable[]
                 {
                     new EditorMenuBar
                     {
                         Anchor           = Anchor.CentreLeft,
                         Origin           = Anchor.CentreLeft,
                         RelativeSizeAxes = Axes.Both,
                         Items            = new[]
                         {
                             new MenuItem("File")
                             {
                                 Items = new[]
                                 {
                                     new EditorMenuItem("Save", MenuItemType.Standard, Save),
                                     new EditorMenuItem("Revert to default", MenuItemType.Destructive, revert),
                                     new EditorMenuItemSpacer(),
                                     new EditorMenuItem("Exit", MenuItemType.Standard, Hide),
                                 },
                             },
                         }
                     },
                     headerText = new OsuTextFlowContainer
                     {
                         TextAnchor       = Anchor.TopRight,
                         Padding          = new MarginPadding(5),
                         Anchor           = Anchor.TopRight,
                         Origin           = Anchor.TopRight,
                         AutoSizeAxes     = Axes.X,
                         RelativeSizeAxes = Axes.Y,
                     },
                 },
             },
             new GridContainer
             {
                 RelativeSizeAxes = Axes.Both,
                 ColumnDimensions = new[]
                 {
                     new Dimension(GridSizeMode.AutoSize),
                     new Dimension(),
                     new Dimension(GridSizeMode.AutoSize),
                 },
                 Content = new[]
                 {
                     new Drawable[]
                     {
                         new SkinComponentToolbox(600)
                         {
                             Anchor           = Anchor.CentreLeft,
                             Origin           = Anchor.CentreLeft,
                             RequestPlacement = placeComponent
                         },
                         content = new Container
                         {
                             RelativeSizeAxes = Axes.Both,
                         },
                         settingsToolbox = new SkinSettingsToolbox
                         {
                             Anchor = Anchor.CentreRight,
                             Origin = Anchor.CentreRight,
                         }
                     }
                 }
             }
         }
     };
 }
Пример #22
0
        private void load(OverlayColourProvider colourProvider)
        {
            RelativeSizeAxes = Axes.X;
            Height           = 60;

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = colourProvider.Background5,
                },
                new GridContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    ColumnDimensions = new[]
                    {
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(GridSizeMode.AutoSize),
                        new Dimension(),
                    },
                    Content = new[]
                    {
                        new Drawable[]
                        {
                            chattingTextContainer = new OsuTextFlowContainer(t => t.Font = t.Font.With(size: 20))
                            {
                                Masking = true,
                                Width   = chatting_text_width,
                                Padding = new MarginPadding {
                                    Left = 10
                                },
                                RelativeSizeAxes = Axes.Y,
                                TextAnchor       = Anchor.CentreRight,
                                Anchor           = Anchor.CentreLeft,
                                Origin           = Anchor.CentreLeft,
                                Colour           = colourProvider.Background1,
                            },
                            searchIconContainer = new Container
                            {
                                RelativeSizeAxes = Axes.Y,
                                Width            = search_icon_width,
                                Child            = new SpriteIcon
                                {
                                    Icon   = FontAwesome.Solid.Search,
                                    Origin = Anchor.CentreRight,
                                    Anchor = Anchor.CentreRight,
                                    Size   = new Vector2(20),
                                    Margin = new MarginPadding {
                                        Right = 2
                                    },
                                },
                            },
                            new Container
                            {
                                RelativeSizeAxes = Axes.Both,
                                Padding          = new MarginPadding {
                                    Right = 5
                                },
                                Child = chatTextBox = new ChatTextBox
                                {
                                    Anchor               = Anchor.CentreLeft,
                                    Origin               = Anchor.CentreLeft,
                                    RelativeSizeAxes     = Axes.X,
                                    ShowSearch           = { BindTarget = ShowSearch },
                                    HoldFocus            = true,
                                    ReleaseFocusOnCommit = false,
                                },
                            },
                        },
                    },
                },
            };
        }
Пример #23
0
        public ProfileHeader(User user)
        {
            RelativeSizeAxes = Axes.X;
            Height           = cover_height + info_height;

            Children = new Drawable[]
            {
                coverContainer = new Container
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = cover_height,
                    Children         = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            ColourInfo       = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f))
                        },
                        new Container
                        {
                            Anchor       = Anchor.BottomLeft,
                            Origin       = Anchor.BottomLeft,
                            X            = UserProfileOverlay.CONTENT_X_MARGIN,
                            Y            = -20,
                            AutoSizeAxes = Axes.Both,
                            Children     = new Drawable[]
                            {
                                new UpdateableAvatar
                                {
                                    User         = user,
                                    Size         = new Vector2(avatar_size),
                                    Anchor       = Anchor.BottomLeft,
                                    Origin       = Anchor.BottomLeft,
                                    Masking      = true,
                                    CornerRadius = 5,
                                    EdgeEffect   = new EdgeEffectParameters
                                    {
                                        Type   = EdgeEffectType.Shadow,
                                        Colour = Color4.Black.Opacity(0.25f),
                                        Radius = 4,
                                    },
                                },
                                new Container
                                {
                                    Anchor       = Anchor.BottomLeft,
                                    Origin       = Anchor.BottomLeft,
                                    X            = avatar_size + 10,
                                    AutoSizeAxes = Axes.Both,
                                    Children     = new Drawable[]
                                    {
                                        supporterTag = new CircularContainer
                                        {
                                            Anchor          = Anchor.BottomLeft,
                                            Origin          = Anchor.BottomLeft,
                                            Y               = -75,
                                            Size            = new Vector2(25, 25),
                                            Masking         = true,
                                            BorderThickness = 3,
                                            BorderColour    = Color4.White,
                                            Alpha           = 0,
                                            Children        = new Drawable[]
                                            {
                                                new Box
                                                {
                                                    RelativeSizeAxes = Axes.Both,
                                                    Alpha            = 0,
                                                    AlwaysPresent    = true
                                                },
                                                new TextAwesome
                                                {
                                                    Icon     = FontAwesome.fa_heart,
                                                    Anchor   = Anchor.Centre,
                                                    Origin   = Anchor.Centre,
                                                    TextSize = 12
                                                }
                                            }
                                        },
                                        new LinkFlowContainer.LinkText
                                        {
                                            Text     = user.Username,
                                            Url      = $@"https://osu.ppy.sh/users/{user.Id}",
                                            TextSize = 30,
                                            Font     = @"Exo2.0-RegularItalic",
                                            Anchor   = Anchor.BottomLeft,
                                            Origin   = Anchor.BottomLeft,
                                            Y        = -48
                                        },
                                        countryFlag = new DrawableFlag(user.Country?.FlagName ?? "__")
                                        {
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft,
                                            Width  = 30,
                                            Height = 20
                                        }
                                    }
                                }
                            }
                        },
                        colourBar = new Box
                        {
                            Anchor = Anchor.BottomLeft,
                            Origin = Anchor.BottomLeft,
                            X      = UserProfileOverlay.CONTENT_X_MARGIN,
                            Height = 5,
                            Width  = info_width,
                            Alpha  = 0
                        }
                    }
                },
                infoTextLeft = new OsuTextFlowContainer(t =>
                {
                    t.TextSize = 14;
                    t.Alpha    = 0.8f;
                })
                {
                    X                = UserProfileOverlay.CONTENT_X_MARGIN,
                    Y                = cover_height + 20,
                    Width            = info_width,
                    AutoSizeAxes     = Axes.Y,
                    ParagraphSpacing = 0.8f,
                    LineSpacing      = 0.2f
                },
                infoTextRight = new LinkFlowContainer(t =>
                {
                    t.TextSize = 14;
                    t.Font     = @"Exo2.0-RegularItalic";
                })
                {
                    X                = UserProfileOverlay.CONTENT_X_MARGIN + info_width + 20,
                    Y                = cover_height + 20,
                    Width            = info_width,
                    AutoSizeAxes     = Axes.Y,
                    ParagraphSpacing = 0.8f,
                    LineSpacing      = 0.2f
                },
                new Container
                {
                    X = -UserProfileOverlay.CONTENT_X_MARGIN,
                    RelativeSizeAxes = Axes.Y,
                    Width            = 280,
                    Anchor           = Anchor.TopRight,
                    Origin           = Anchor.TopRight,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Y        = level_position,
                            Height   = level_height,
                            Children = new Drawable[]
                            {
                                new Box
                                {
                                    Colour           = Color4.Black.Opacity(0.5f),
                                    RelativeSizeAxes = Axes.Both
                                },
                                levelBadge = new Sprite
                                {
                                    Anchor = Anchor.Centre,
                                    Origin = Anchor.Centre,
                                    Height = 50,
                                    Width  = 50,
                                    Alpha  = 0
                                },
                                levelText = new OsuSpriteText
                                {
                                    Anchor   = Anchor.TopCentre,
                                    Origin   = Anchor.TopCentre,
                                    Y        = 11,
                                    TextSize = 20
                                }
                            }
                        },
                        new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Y        = cover_height,
                            Anchor   = Anchor.TopCentre,
                            Origin   = Anchor.BottomCentre,
                            Height   = cover_height - level_height - level_position - 5,
                            Children = new Drawable[]
                            {
                                new Box
                                {
                                    Colour           = Color4.Black.Opacity(0.5f),
                                    RelativeSizeAxes = Axes.Both
                                },
                                scoreText = new FillFlowContainer <SpriteText>
                                {
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Direction        = FillDirection.Vertical,
                                    Padding          = new MarginPadding {
                                        Horizontal = 20, Vertical = 18
                                    },
                                    Spacing = new Vector2(0, 2)
                                },
                                scoreNumberText = new FillFlowContainer <SpriteText>
                                {
                                    RelativeSizeAxes = Axes.X,
                                    AutoSizeAxes     = Axes.Y,
                                    Direction        = FillDirection.Vertical,
                                    Padding          = new MarginPadding {
                                        Horizontal = 20, Vertical = 18
                                    },
                                    Spacing = new Vector2(0, 2)
                                },
                                new FillFlowContainer <GradeBadge>
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Horizontal,
                                    Anchor       = Anchor.BottomCentre,
                                    Origin       = Anchor.BottomCentre,
                                    Y            = -64,
                                    Spacing      = new Vector2(20, 0),
                                    Children     = new[]
                                    {
                                        gradeSSPlus = new GradeBadge("SSPlus")
                                        {
                                            Alpha = 0
                                        },
                                        gradeSS = new GradeBadge("SS")
                                        {
                                            Alpha = 0
                                        },
                                    }
                                },
                                new FillFlowContainer <GradeBadge>
                                {
                                    AutoSizeAxes = Axes.Both,
                                    Direction    = FillDirection.Horizontal,
                                    Anchor       = Anchor.BottomCentre,
                                    Origin       = Anchor.BottomCentre,
                                    Y            = -18,
                                    Spacing      = new Vector2(20, 0),
                                    Children     = new[]
                                    {
                                        gradeSPlus = new GradeBadge("SPlus")
                                        {
                                            Alpha = 0
                                        },
                                        gradeS = new GradeBadge("S")
                                        {
                                            Alpha = 0
                                        },
                                        gradeA = new GradeBadge("A")
                                        {
                                            Alpha = 0
                                        },
                                    }
                                }
                            }
                        },
                        chartContainer = new Container
                        {
                            RelativeSizeAxes = Axes.X,
                            Anchor           = Anchor.BottomCentre,
                            Origin           = Anchor.BottomCentre,
                            Height           = info_height - 15,
                            Children         = new Drawable[]
                            {
                                new Box
                                {
                                    Colour           = Color4.Black.Opacity(0.25f),
                                    RelativeSizeAxes = Axes.Both
                                }
                            }
                        }
                    }
                }
            };
        }
Пример #24
0
        public LatencyCertifierScreen()
        {
            InternalChildren = new Drawable[]
            {
                new Box
                {
                    Colour           = overlayColourProvider.Background6,
                    RelativeSizeAxes = Axes.Both,
                },
                mainArea = new Container <LatencyArea>
                {
                    RelativeSizeAxes = Axes.Both,
                },
                // Make sure the edge between the two comparisons can't be used to ascertain latency.
                new Box
                {
                    Name             = "separator",
                    Colour           = ColourInfo.GradientHorizontal(overlayColourProvider.Background6, overlayColourProvider.Background6.Opacity(0)),
                    Width            = 100,
                    RelativeSizeAxes = Axes.Y,
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopLeft,
                },
                new Box
                {
                    Name             = "separator",
                    Colour           = ColourInfo.GradientHorizontal(overlayColourProvider.Background6.Opacity(0), overlayColourProvider.Background6),
                    Width            = 100,
                    RelativeSizeAxes = Axes.Y,
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopRight,
                },
                settings = new FillFlowContainer
                {
                    Name         = "Settings",
                    AutoSizeAxes = Axes.Y,
                    Width        = 800,
                    Padding      = new MarginPadding(10),
                    Spacing      = new Vector2(2),
                    Direction    = FillDirection.Vertical,
                    Anchor       = Anchor.BottomCentre,
                    Origin       = Anchor.BottomCentre,
                    Children     = new Drawable[]
                    {
                        explanatoryText = new LinkFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 20))
                        {
                            AutoSizeAxes     = Axes.Y,
                            RelativeSizeAxes = Axes.X,
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            TextAnchor       = Anchor.TopCentre,
                        },
                        new SettingsSlider <double>
                        {
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            RelativeSizeAxes = Axes.None,
                            Width            = 400,
                            LabelText        = "bpm",
                            Current          = SampleBPM
                        },
                        new SettingsSlider <float>
                        {
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            RelativeSizeAxes = Axes.None,
                            Width            = 400,
                            LabelText        = "visual spacing",
                            Current          = SampleVisualSpacing
                        },
                        new SettingsSlider <double>
                        {
                            Anchor           = Anchor.TopCentre,
                            Origin           = Anchor.TopCentre,
                            RelativeSizeAxes = Axes.None,
                            Width            = 400,
                            LabelText        = "approach rate",
                            Current          = SampleApproachRate
                        },
                    },
                },
                resultsArea = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                },
                statusText = new OsuTextFlowContainer(cp => cp.Font = OsuFont.Default.With(size: 40))
                {
                    Anchor           = Anchor.TopCentre,
                    Origin           = Anchor.TopCentre,
                    TextAnchor       = Anchor.TopCentre,
                    Y                = 150,
                    RelativeSizeAxes = Axes.X,
                    AutoSizeAxes     = Axes.Y,
                },
            };

            explanatoryText.AddParagraph(@"Welcome to the latency certifier!");
            explanatoryText.AddParagraph(@"Do whatever you need to try and perceive the difference in latency, then choose your best side. Read more about the methodology ");
            explanatoryText.AddLink("here", "https://github.com/ppy/osu/wiki/Latency-and-unlimited-frame-rates#methodology");
            explanatoryText.AddParagraph(@"Use the arrow keys or Z/X/F/J to control the display.");
            explanatoryText.AddParagraph(@"Tab key to change focus. Space to change display mode");
        }