private void updateCount(object sender, NotifyCollectionChangedEventArgs e) { count.Clear(); count.AddText(Playlist.Count.ToLocalisableString(), s => s.Font = s.Font.With(weight: FontWeight.Bold)); count.AddText(" "); count.AddText("Beatmap".ToQuantity(Playlist.Count, ShowQuantityAs.None)); }
private void updateCount() { int activeItems = Playlist.Count > 0 || PlaylistItemStats.Value == null // For now, use the playlist as the source of truth if it has any items. // This allows the count to display correctly on the room screen (after joining a room). ? Playlist.Count(i => !i.Expired) : PlaylistItemStats.Value.CountActive; count.Clear(); count.AddText(activeItems.ToLocalisableString(), s => s.Font = s.Font.With(weight: FontWeight.Bold)); count.AddText(" "); count.AddText("Beatmap".ToQuantity(activeItems, ShowQuantityAs.None)); }
private void skinChanged() { headerText.Clear(); headerText.AddParagraph("Skin editor", cp => cp.Font = OsuFont.Default.With(size: 24)); headerText.NewParagraph(); headerText.AddText("Currently editing ", cp => { cp.Font = OsuFont.Default.With(size: 12); cp.Colour = colours.Yellow; }); headerText.AddText($"{currentSkin.Value.SkinInfo}", cp => { cp.Font = OsuFont.Default.With(size: 12, weight: FontWeight.Bold); cp.Colour = colours.Yellow; }); skins.EnsureMutableSkin(); hasBegunMutating = true; }
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); }
protected override void OnRoomUpdated() { base.OnRoomUpdated(); rankFlow.Clear(); if (Room == null || Room.Users.All(u => u.User == null)) { rankFlow.AddText("-"); return; } int minRank = Room.Users.Select(u => u.User?.Statistics.GlobalRank ?? 0).DefaultIfEmpty(0).Min(); int maxRank = Room.Users.Select(u => u.User?.Statistics.GlobalRank ?? 0).DefaultIfEmpty(0).Max(); rankFlow.AddText("#"); rankFlow.AddText(minRank.ToString("#,0"), s => s.Font = s.Font.With(weight: FontWeight.Bold)); rankFlow.AddText(" - "); rankFlow.AddText("#"); rankFlow.AddText(maxRank.ToString("#,0"), s => s.Font = s.Font.With(weight: FontWeight.Bold)); }
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("."); }
private void onQueueModeChanged(ValueChangedEvent <QueueMode> mode) { textFlow.Clear(); textFlow.AddText(mode.NewValue.GetLocalisableDescription()); }
private void onMatchTypeChanged(ValueChangedEvent <MatchType> type) { textFlow.Clear(); textFlow.AddText(type.NewValue.GetLocalisableDescription()); }
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("."); }
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("."); }