private void load(AudioManager audio, OsuColour colours) { sampleClick = audio.Sample.Get(@"Menu/menuback"); Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Width = 0.4f, Children = new Drawable[] { leftBox = new Box { RelativeSizeAxes = Axes.Both, Colour = colours.PinkDark, Shear = new Vector2(shear, 0), }, icon = new TextAwesome { Anchor = Anchor.Centre, TextSize = 25, Icon = FontAwesome.fa_osu_left_o }, } }, new Container { Origin = Anchor.TopRight, Anchor = Anchor.TopRight, RelativeSizeAxes = Axes.Both, Width = 0.6f, Children = new Drawable[] { rightBox = new Box { Colour = colours.Pink, Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, RelativeSizeAxes = Axes.Both, Shear = new Vector2(shear, 0), EdgeSmoothness = new Vector2(1.5f, 0), }, new SpriteText { Origin = Anchor.Centre, Anchor = Anchor.Centre, Text = @"Back", } } } }; }
private void load(OsuColour colours) { summaryContainer.Colour = colours.Gray9; }
private void load(OsuColour colours) { IconHoverColour = colours.Red; }
private void load(OsuConfigManager config, NotificationOverlay notificationOverlay, OsuColour colours) { showHud = config.GetBindable <bool>(OsuSetting.ShowInterface); showHud.ValueChanged += hudVisibility => content.FadeTo(hudVisibility ? 1 : 0, duration); showHud.TriggerChange(); if (!showHud && !hasShownNotificationOnce) { hasShownNotificationOnce = true; notificationOverlay?.Post(new SimpleNotification { Text = @"The score overlay is currently disabled. You can toggle this by pressing Shift+Tab." }); } // todo: the stuff below should probably not be in this base implementation, but in each individual class. ComboCounter.AccentColour = colours.BlueLighter; AccuracyCounter.AccentColour = colours.BlueLighter; ScoreCounter.AccentColour = colours.BlueLighter; var shd = HealthDisplay as StandardHealthDisplay; if (shd != null) { shd.AccentColour = colours.BlueLighter; shd.GlowColour = colours.BlueDarker; } }
public PauseButton() { Children = new Drawable[] { backgroundContainer = new Container { RelativeSizeAxes = Axes.Both, Width = 1f, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour } } }, glowContainer = new Container { RelativeSizeAxes = Axes.Both, Width = 1f, Alpha = 0f, Children = new Drawable[] { leftGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Width = 0.125f }, centerGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = 0.75f }, rightGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopRight, Anchor = Anchor.TopRight, Width = 0.125f } } }, new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Masking = true, Children = new Drawable[] { colourContainer = new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = 0.8f, Masking = true, MaskingSmoothness = 2, EdgeEffect = new EdgeEffect { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.2f), Radius = 5 }, Colour = ButtonColour, Shear = new Vector2(0.2f, 0), Children = new Drawable[] { new Box { EdgeSmoothness = new Vector2(2, 0), RelativeSizeAxes = Axes.Both }, new Container { RelativeSizeAxes = Axes.Both, Masking = true, MaskingSmoothness = 0, Children = new[] { new Triangles { RelativeSizeAxes = Axes.Both, TriangleScale = 4, ColourDark = OsuColour.Gray(0.88f), Shear = new Vector2(-0.2f, 0) } } }, } } } }, spriteText = new OsuSpriteText { Text = Text, Anchor = Anchor.Centre, Origin = Anchor.Centre, TextSize = 28, Font = "Exo2.0-Bold", Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.1f), Colour = Color4.White } }; updateGlow(); }
private void load(OsuColour colours) { BackgroundColour = colours.Yellow; Triangles.ColourLight = colours.YellowLight; Triangles.ColourDark = colours.YellowDark; }
private void load(OsuColour colours) { BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () => Edit()); ((PlayBeatmapDetailArea)BeatmapDetails).Leaderboard.ScoreSelected += PresentScore; }
private void load(OsuColour colours) { OsuSpriteText summary; Container flagContainer; LinkFlowContainer hostText; InternalChildren = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.X, RelativeSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, Spacing = new Vector2(5f, 0f), Children = new Drawable[] { flagContainer = new Container { Width = 22f, RelativeSizeAxes = Axes.Y, }, hostText = new LinkFlowContainer { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both } }, }, new FillFlowContainer { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Colour = colours.Gray9, Children = new[] { summary = new OsuSpriteText { Text = "0 participants", } }, }, }; Host.BindValueChanged(host => { hostText.Clear(); flagContainer.Clear(); if (host.NewValue != null) { hostText.AddText("hosted by "); hostText.AddUserLink(host.NewValue, s => s.Font = s.Font.With(Typeface.Torus, weight: FontWeight.Bold, italics: true)); flagContainer.Child = new UpdateableFlag(host.NewValue.Country) { RelativeSizeAxes = Axes.Both }; } }, true); ParticipantCount.BindValueChanged(count => summary.Text = "participant".ToQuantity(count.NewValue), true); }
private void load(BeatmapDatabase beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours) { if (Footer != null) { Footer.AddButton(@"random", colours.Green, SelectRandom, Key.F2); Footer.AddButton(@"options", colours.Blue, BeatmapOptions.ToggleVisibility, Key.F3); BeatmapOptions.AddButton(@"Delete", @"Beatmap", FontAwesome.fa_trash, colours.Pink, promptDelete, Key.Number4, float.MaxValue); } if (database == null) { database = beatmaps; } if (osu != null) { ruleset.BindTo(osu.Ruleset); } database.BeatmapSetAdded += onBeatmapSetAdded; database.BeatmapSetRemoved += onBeatmapSetRemoved; trackManager = audio.Track; dialogOverlay = dialog; sampleChangeDifficulty = audio.Sample.Get(@"SongSelect/select-difficulty"); sampleChangeBeatmap = audio.Sample.Get(@"SongSelect/select-expand"); initialAddSetsTask = new CancellationTokenSource(); carousel.BeatmapsChanged = beatmapsLoaded; carousel.Beatmaps = database.GetAllWithChildren <BeatmapSetInfo>(b => !b.DeletePending); }
private void load(OsuColour colours) { hoverColour = colours.Yellow; }
private void load(OsuColour colours) { MainPiece.AccentColour = AccentColour = colours.YellowDark; accentDarkColour = colours.YellowDarker; }
private void load(OsuColour colours, LocalisationEngine localisation) { Content.CornerRadius = 4; AddRange(new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black.Opacity(0.5f), }, bottomPanel = new FillFlowContainer { Anchor = Anchor.BottomLeft, Origin = Anchor.TopLeft, Direction = FillDirection.Vertical, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(0f, vertical_padding), Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Padding = new MarginPadding { Left = horizontal_padding, Right = horizontal_padding }, Direction = FillDirection.Vertical, Children = new[] { new OsuSpriteText { Text = localisation.GetUnicodePreference(SetInfo.Metadata.TitleUnicode, SetInfo.Metadata.Title), TextSize = 18, Font = @"Exo2.0-BoldItalic", }, new OsuSpriteText { Text = localisation.GetUnicodePreference(SetInfo.Metadata.ArtistUnicode, SetInfo.Metadata.Artist), Font = @"Exo2.0-BoldItalic", }, }, }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, }, progressBar = new Box { Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, BypassAutoSizeAxes = Axes.Both, Size = new Vector2(0, 3), Alpha = 0, Colour = colours.Yellow, }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Padding = new MarginPadding { Top = vertical_padding, Bottom = vertical_padding, Left = horizontal_padding, Right = horizontal_padding, }, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new[] { new OsuSpriteText { Text = "mapped by ", TextSize = 14, Shadow = false, Colour = colours.Gray5, }, new OsuSpriteText { Text = SetInfo.Metadata.Author.Username, TextSize = 14, Font = @"Exo2.0-SemiBoldItalic", Shadow = false, Colour = colours.BlueDark, }, }, }, new Container { AutoSizeAxes = Axes.X, Height = 14, Children = new[] { new OsuSpriteText { Text = $"from {SetInfo.Metadata.Source}", TextSize = 14, Shadow = false, Colour = colours.Gray5, Alpha = string.IsNullOrEmpty(SetInfo.Metadata.Source) ? 0f : 1f, }, }, }, new FillFlowContainer { AutoSizeAxes = Axes.X, Height = 20, Margin = new MarginPadding { Top = vertical_padding, Bottom = vertical_padding }, Children = GetDifficultyIcons(), }, }, }, new DownloadButton { Size = new Vector2(30), Margin = new MarginPadding(horizontal_padding), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Colour = colours.Gray5, Action = StartDownload }, }, }, }, }, new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Vertical, Margin = new MarginPadding { Top = vertical_padding, Right = vertical_padding }, Children = new[] { new Statistic(FontAwesome.fa_play_circle, SetInfo.OnlineInfo?.PlayCount ?? 0) { Margin = new MarginPadding { Right = 1 }, }, new Statistic(FontAwesome.fa_heart, SetInfo.OnlineInfo?.FavouriteCount ?? 0), }, }, playButton = new PlayButton(SetInfo) { Margin = new MarginPadding { Top = 5, Left = 10 }, Size = new Vector2(30), Alpha = 0, }, statusContainer = new FillFlowContainer { AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Top = 5, Left = 5 }, Spacing = new Vector2(5), }, }); if (SetInfo.OnlineInfo?.HasVideo ?? false) { statusContainer.Add(new IconPill(FontAwesome.fa_film)); } statusContainer.Add(new BeatmapSetOnlineStatusPill(12, new MarginPadding { Horizontal = 10, Vertical = 5 }) { Status = SetInfo.OnlineInfo?.Status ?? BeatmapSetOnlineStatus.None, }); }
private void load(OsuColour colours) { TabControl.AccentColour = colours.Violet; }
private void load(OsuColour colours) { AccentColour = colours.Violet; }
private void load(OsuColour colours) { IdleColour = overlayColourProvider?.Light2 ?? colours.Blue; }
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 { 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 = "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.Font = cp.Font.With(size: 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 load(OsuColour colours, BeatmapDifficultyCache difficultyCache) { Colour = colours.BlueLighter; valid.BindValueChanged(e => DrawableCount.FadeTo(e.NewValue ? 1 : alpha_when_invalid, 1000, Easing.OutQuint)); }
private void load(OsuColour colours) { selectionIndicator.Colour = colours.Yellow; }
public MatchSettingsOverlay(Room room) { this.room = room; bindings.Room = room; Masking = true; Child = content = new Container { RelativeSizeAxes = Axes.Both, RelativePositionAxes = Axes.Y, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex(@"28242d"), }, new GridContainer { RelativeSizeAxes = Axes.Both, RowDimensions = new[] { new Dimension(GridSizeMode.Distributed), new Dimension(GridSizeMode.AutoSize), }, Content = new[] { new Drawable[] { new ScrollContainer { Padding = new MarginPadding { Vertical = 10 }, RelativeSizeAxes = Axes.Both, Children = new[] { new Container { Padding = new MarginPadding { Horizontal = SearchableListOverlay.WIDTH_PADDING }, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { new SectionContainer { Padding = new MarginPadding { Right = field_padding / 2 }, Children = new[] { new Section("Room name") { Child = NameField = new SettingsTextBox { RelativeSizeAxes = Axes.X, TabbableContentContainer = this, OnCommit = (sender, text) => apply(), }, }, new Section("Room visibility") { Alpha = disabled_alpha, Child = AvailabilityPicker = new RoomAvailabilityPicker(), }, new Section("Game type") { Alpha = disabled_alpha, Child = new FillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, Spacing = new Vector2(7), Children = new Drawable[] { TypePicker = new GameTypePicker { RelativeSizeAxes = Axes.X, }, typeLabel = new OsuSpriteText { TextSize = 14, }, }, }, }, }, }, new SectionContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Padding = new MarginPadding { Left = field_padding / 2 }, Children = new[] { new Section("Max participants") { Alpha = disabled_alpha, Child = MaxParticipantsField = new SettingsNumberTextBox { RelativeSizeAxes = Axes.X, TabbableContentContainer = this, OnCommit = (sender, text) => apply(), }, }, new Section("Duration") { Child = DurationField = new DurationDropdown { RelativeSizeAxes = Axes.X, Items = new[] { TimeSpan.FromMinutes(30), TimeSpan.FromHours(1), TimeSpan.FromHours(2), TimeSpan.FromHours(4), TimeSpan.FromHours(8), TimeSpan.FromHours(12), //TimeSpan.FromHours(16), TimeSpan.FromHours(24), TimeSpan.FromDays(3), TimeSpan.FromDays(7) } } }, new Section("Password (optional)") { Alpha = disabled_alpha, Child = PasswordField = new SettingsPasswordTextBox { RelativeSizeAxes = Axes.X, TabbableContentContainer = this, OnCommit = (sender, text) => apply() }, }, }, }, }, } }, }, }, new Drawable[] { new Container { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Y = 2, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = OsuColour.FromHex(@"28242d").Darken(0.5f).Opacity(1f), }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Spacing = new Vector2(0, 20), Margin = new MarginPadding { Vertical = 20 }, Children = new Drawable[] { ApplyButton = new CreateRoomButton { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Size = new Vector2(230, 55), Action = apply, }, ErrorText = new OsuSpriteText { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Alpha = 0, Depth = 1 } } } } } } } }, processingOverlay = new ProcessingOverlay { Alpha = 0 } }, }; TypePicker.Current.ValueChanged += t => typeLabel.Text = t.Name; bindings.Name.BindValueChanged(n => NameField.Text = n, true); bindings.Availability.BindValueChanged(a => AvailabilityPicker.Current.Value = a, true); bindings.Type.BindValueChanged(t => TypePicker.Current.Value = t, true); bindings.MaxParticipants.BindValueChanged(m => MaxParticipantsField.Text = m?.ToString(), true); bindings.Duration.BindValueChanged(d => DurationField.Current.Value = d, true); }
public BeatmapPanel(BeatmapInfo beatmap) { Beatmap = beatmap; Height *= 0.60f; Children = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, }, triangles = new Triangles { TriangleScale = 2, RelativeSizeAxes = Axes.Both, ColourLight = OsuColour.FromHex(@"3a7285"), ColourDark = OsuColour.FromHex(@"123744") }, new FillFlowContainer { Padding = new MarginPadding(5), Direction = FillDirection.Horizontal, AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Children = new Drawable[] { new DifficultyIcon(beatmap) { Scale = new Vector2(1.8f), }, new FillFlowContainer { Padding = new MarginPadding { Left = 5 }, Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Both, Children = new Drawable[] { new FillFlowContainer { Direction = FillDirection.Horizontal, Spacing = new Vector2(4, 0), AutoSizeAxes = Axes.Both, Children = new[] { new OsuSpriteText { Font = @"Exo2.0-Medium", Text = beatmap.Version, TextSize = 20, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, new OsuSpriteText { Font = @"Exo2.0-Medium", Text = "mapped by", TextSize = 16, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, new OsuSpriteText { Font = @"Exo2.0-MediumItalic", Text = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author}", TextSize = 16, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft }, } }, starCounter = new StarCounter { Count = (float)beatmap.StarDifficulty, Scale = new Vector2(0.8f), } } } } } }; }
public DialogButton() { RelativeSizeAxes = Axes.X; Children = new Drawable[] { backgroundContainer = new Container { RelativeSizeAxes = Axes.Both, Width = 1f, Children = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = backgroundColour, }, }, }, glowContainer = new Container { RelativeSizeAxes = Axes.Both, Width = 1f, Alpha = 0f, Children = new Drawable[] { leftGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopLeft, Anchor = Anchor.TopLeft, Width = 0.125f, }, centerGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = 0.75f, }, rightGlow = new Box { RelativeSizeAxes = Axes.Both, Origin = Anchor.TopRight, Anchor = Anchor.TopRight, Width = 0.125f, }, }, }, new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Masking = true, Children = new Drawable[] { colourContainer = new Container { RelativeSizeAxes = Axes.Both, Origin = Anchor.Centre, Anchor = Anchor.Centre, Width = idle_width, Masking = true, MaskingSmoothness = 2, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Colour = Color4.Black.Opacity(0.2f), Radius = 5, }, Colour = ButtonColour, Shear = new Vector2(0.2f, 0), Children = new Drawable[] { new Box { EdgeSmoothness = new Vector2(2, 0), RelativeSizeAxes = Axes.Both, }, new Container { RelativeSizeAxes = Axes.Both, Masking = true, MaskingSmoothness = 0, Children = new[] { new Triangles { RelativeSizeAxes = Axes.Both, TriangleScale = 4, ColourDark = OsuColour.Gray(0.88f), Shear = new Vector2(-0.2f, 0), }, }, }, }, }, }, }, spriteText = new OsuSpriteText { Text = Text, Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.GetFont(size: 28, weight: FontWeight.Bold), Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.1f), Colour = Color4.White, }, }; updateGlow(); Selected.ValueChanged += selectionChanged; }
private void load(OsuColour colours) { Height = 150; InternalChildren = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = colours.CommunityUserGrayGreenDarker, }, new FillFlowContainer { Direction = FillDirection.Horizontal, Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }, Height = avatar_size, AutoSizeAxes = Axes.X, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Children = new[] { avatar = new UpdateableAvatar { Size = new Vector2(avatar_size), Masking = true, CornerRadius = avatar_size * 0.25f, OpenOnClick = { Value = false }, }, new Container { RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Padding = new MarginPadding { Left = 10 }, Children = new Drawable[] { new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new Drawable[] { usernameText = new OsuSpriteText { Font = OsuFont.GetFont(size: 24, weight: FontWeight.Regular) }, openUserExternally = new ExternalLinkButton { Margin = new MarginPadding { Left = 5 }, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, }, } }, new FillFlowContainer { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Both, Children = new Drawable[] { titleText = new OsuSpriteText { Font = OsuFont.GetFont(size: 18, weight: FontWeight.Regular) }, supporterTag = new SupporterIcon { Height = 20, Margin = new MarginPadding { Top = 5 } }, new Box { RelativeSizeAxes = Axes.X, Height = 1.5f, Margin = new MarginPadding { Top = 10 }, Colour = colours.CommunityUserGrayGreenLighter, }, new Container { AutoSizeAxes = Axes.Both, Margin = new MarginPadding { Top = 5 }, Children = new Drawable[] { userFlag = new DrawableFlag { Size = new Vector2(30, 20) }, userCountryText = new OsuSpriteText { Font = OsuFont.GetFont(size: 17.5f, weight: FontWeight.Regular), Margin = new MarginPadding { Left = 40 }, Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, Colour = colours.CommunityUserGrayGreenLighter, } } }, } } } } } }, userStats = new FillFlowContainer { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, AutoSizeAxes = Axes.Y, Width = 300, Margin = new MarginPadding { Right = UserProfileOverlay.CONTENT_X_MARGIN }, Padding = new MarginPadding { Vertical = 15 }, Spacing = new Vector2(0, 2) } }; User.BindValueChanged(user => updateUser(user.NewValue)); }
private void load(OsuColour colour) { Colour = colour.YellowLight; }
private void updateBlockingOverlayFade() => screenContainer.FadeColour(visibleBlockingOverlays.Any() ? OsuColour.Gray(0.5f) : Color4.White, 500, Easing.OutQuint);
public override Color4 GetAppropriateColour(OsuColour colours) => colours.Yellow;
private void load(OsuColour colours, OsuConfigManager config) { var loadableBeatmap = Beatmap.Value; if (loadableBeatmap is DummyWorkingBeatmap) { isNewBeatmap = true; loadableBeatmap = beatmapManager.CreateNew(Ruleset.Value, api.LocalUser.Value); // required so we can get the track length in EditorClock. // this is safe as nothing has yet got a reference to this new beatmap. loadableBeatmap.LoadTrack(); // this is a bit haphazard, but guards against setting the lease Beatmap bindable if // the editor has already been exited. if (!ValidForPush) { return; } } try { playableBeatmap = loadableBeatmap.GetPlayableBeatmap(loadableBeatmap.BeatmapInfo.Ruleset); // clone these locally for now to avoid incurring overhead on GetPlayableBeatmap usages. // eventually we will want to improve how/where this is done as there are issues with *not* cloning it in all cases. playableBeatmap.ControlPointInfo = playableBeatmap.ControlPointInfo.CreateCopy(); } catch (Exception e) { Logger.Error(e, "Could not load beatmap successfully!"); // couldn't load, hard abort! this.Exit(); return; } beatDivisor.Value = playableBeatmap.BeatmapInfo.BeatDivisor; beatDivisor.BindValueChanged(divisor => playableBeatmap.BeatmapInfo.BeatDivisor = divisor.NewValue); // Todo: should probably be done at a DrawableRuleset level to share logic with Player. clock = new EditorClock(playableBeatmap, beatDivisor) { IsCoupled = false }; UpdateClockSource(); dependencies.CacheAs(clock); AddInternal(clock); clock.SeekingOrStopped.BindValueChanged(_ => updateSampleDisabledState()); // todo: remove caching of this and consume via editorBeatmap? dependencies.Cache(beatDivisor); AddInternal(editorBeatmap = new EditorBeatmap(playableBeatmap, loadableBeatmap.Skin)); dependencies.CacheAs(editorBeatmap); changeHandler = new EditorChangeHandler(editorBeatmap); dependencies.CacheAs <IEditorChangeHandler>(changeHandler); updateLastSavedHash(); Schedule(() => { // we need to avoid changing the beatmap from an asynchronous load thread. it can potentially cause weirdness including crashes. // this assumes that nothing during the rest of this load() method is accessing Beatmap.Value (loadableBeatmap should be preferred). // generally this is quite safe, as the actual load of editor content comes after menuBar.Mode.ValueChanged is fired in its own LoadComplete. Beatmap.Value = loadableBeatmap; }); OsuMenuItem undoMenuItem; OsuMenuItem redoMenuItem; EditorMenuItem cutMenuItem; EditorMenuItem copyMenuItem; EditorMenuItem pasteMenuItem; AddInternal(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, Children = new[] { new Container { Name = "Screen container", RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = 40, Bottom = 60 }, Child = screenContainer = new Container <EditorScreen> { RelativeSizeAxes = Axes.Both, Masking = true } }, new Container { Name = "Top bar", RelativeSizeAxes = Axes.X, Height = 40, Child = menuBar = new EditorMenuBar { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.Both, Mode = { Value = isNewBeatmap ? EditorScreenMode.SongSetup : EditorScreenMode.Compose }, Items = new[] { new MenuItem("File") { Items = createFileMenuItems() }, new MenuItem("Edit") { Items = new[] { undoMenuItem = new EditorMenuItem("Undo", MenuItemType.Standard, Undo), redoMenuItem = new EditorMenuItem("Redo", MenuItemType.Standard, Redo), new EditorMenuItemSpacer(), cutMenuItem = new EditorMenuItem("Cut", MenuItemType.Standard, Cut), copyMenuItem = new EditorMenuItem("Copy", MenuItemType.Standard, Copy), pasteMenuItem = new EditorMenuItem("Paste", MenuItemType.Standard, Paste), } }, new MenuItem("View") { Items = new[] { new WaveformOpacityMenu(config) } } } } }, new Container { Name = "Bottom bar", Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, RelativeSizeAxes = Axes.X, Height = 60, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = colours.Gray2 }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Vertical = 5, Horizontal = 10 }, Child = new GridContainer { RelativeSizeAxes = Axes.Both, ColumnDimensions = new[] { new Dimension(GridSizeMode.Absolute, 220), new Dimension(), new Dimension(GridSizeMode.Absolute, 220) }, Content = new[] { new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Right = 10 }, Child = new TimeInfoContainer { RelativeSizeAxes = Axes.Both }, }, new SummaryTimeline { RelativeSizeAxes = Axes.Both, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = 10 }, Child = new PlaybackControl { RelativeSizeAxes = Axes.Both }, } }, } }, } } }, } }); changeHandler.CanUndo.BindValueChanged(v => undoMenuItem.Action.Disabled = !v.NewValue, true); changeHandler.CanRedo.BindValueChanged(v => redoMenuItem.Action.Disabled = !v.NewValue, true); editorBeatmap.SelectedHitObjects.BindCollectionChanged((_, __) => { var hasObjects = editorBeatmap.SelectedHitObjects.Count > 0; cutMenuItem.Action.Disabled = !hasObjects; copyMenuItem.Action.Disabled = !hasObjects; }, true); clipboard.BindValueChanged(content => pasteMenuItem.Action.Disabled = string.IsNullOrEmpty(content.NewValue)); menuBar.Mode.ValueChanged += onModeChanged; }
private void load(OsuColour colours) { Children = new Drawable[] { new SettingsCheckbox { LabelText = CommonStrings.Enabled, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Current = enabled, }, noTabletMessage = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Padding = new MarginPadding { Horizontal = SettingsPanel.CONTENT_MARGINS }, Spacing = new Vector2(5f), Children = new Drawable[] { new OsuSpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Text = TabletSettingsStrings.NoTabletDetected, }, new SettingsNoticeText(colours) { TextAnchor = Anchor.TopCentre, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }.With(t => { if (RuntimeInfo.OS == RuntimeInfo.Platform.Windows || RuntimeInfo.OS == RuntimeInfo.Platform.Linux) { t.NewLine(); t.AddText("If your tablet is not detected, please read "); t.AddLink("this FAQ", LinkAction.External, RuntimeInfo.OS == RuntimeInfo.Platform.Windows ? @"https://github.com/OpenTabletDriver/OpenTabletDriver/wiki/Windows-FAQ" : @"https://github.com/OpenTabletDriver/OpenTabletDriver/wiki/Linux-FAQ"); t.AddText(" for troubleshooting steps."); } }), } }, mainSettings = new FillFlowContainer { Alpha = 0, RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Spacing = new Vector2(0, 8), Direction = FillDirection.Vertical, Children = new Drawable[] { new TabletAreaSelection(tabletHandler) { RelativeSizeAxes = Axes.X, Height = 300, }, new DangerousSettingsButton { Text = TabletSettingsStrings.ResetToFullArea, Action = () => { aspectLock.Value = false; areaOffset.SetDefault(); areaSize.SetDefault(); }, }, new SettingsButton { Text = TabletSettingsStrings.ConformToCurrentGameAspectRatio, Action = () => { forceAspectRatio((float)host.Window.ClientSize.Width / host.Window.ClientSize.Height); } }, new SettingsSlider <float> { TransferValueOnCommit = true, LabelText = TabletSettingsStrings.XOffset, Current = offsetX }, new SettingsSlider <float> { TransferValueOnCommit = true, LabelText = TabletSettingsStrings.YOffset, Current = offsetY }, new SettingsSlider <float> { TransferValueOnCommit = true, LabelText = TabletSettingsStrings.Rotation, Current = rotation }, new RotationPresetButtons(tabletHandler), new SettingsSlider <float> { TransferValueOnCommit = true, LabelText = TabletSettingsStrings.AspectRatio, Current = aspectRatio }, new SettingsCheckbox { LabelText = TabletSettingsStrings.LockAspectRatio, Current = aspectLock }, new SettingsSlider <float> { TransferValueOnCommit = true, LabelText = CommonStrings.Width, Current = sizeX }, new SettingsSlider <float> { TransferValueOnCommit = true, LabelText = CommonStrings.Height, Current = sizeY }, } }, }; }
private void load(OsuColour colours) { const float user_header_height = 120; Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = user_header_height }, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.White, }, } }, new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new Drawable[] { new UserHeader(Score.User) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, Height = user_header_height, }, new DrawableRank(Score.Rank) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Size = new Vector2(150, 60), Margin = new MarginPadding(20), }, scoreContainer = new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, RelativeSizeAxes = Axes.X, Height = 60, Children = new Drawable[] { new SongProgressGraph { RelativeSizeAxes = Axes.Both, Alpha = 0.5f, Objects = Beatmap.Beatmap.HitObjects, }, scoreCounter = new SlowScoreCounter(6) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Colour = colours.PinkDarker, Y = 10, TextSize = 56, }, } }, new OsuSpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = colours.PinkDarker, Shadow = false, Font = OsuFont.GetFont(weight: FontWeight.Bold), Text = "total score", Margin = new MarginPadding { Bottom = 15 }, }, new BeatmapDetails(Beatmap.BeatmapInfo) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Margin = new MarginPadding { Bottom = 10 }, }, new DateTimeDisplay(Score.Date.LocalDateTime) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }, new Container { RelativeSizeAxes = Axes.X, Size = new Vector2(0.75f, 1), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Margin = new MarginPadding { Top = 10, Bottom = 10 }, Children = new Drawable[] { new Box { Colour = ColourInfo.GradientHorizontal( colours.GrayC.Opacity(0), colours.GrayC.Opacity(0.9f)), RelativeSizeAxes = Axes.Both, Size = new Vector2(0.5f, 1), }, new Box { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Colour = ColourInfo.GradientHorizontal( colours.GrayC.Opacity(0.9f), colours.GrayC.Opacity(0)), RelativeSizeAxes = Axes.Both, Size = new Vector2(0.5f, 1), }, } }, statisticsContainer = new FillFlowContainer <DrawableScoreStatistic> { AutoSizeAxes = Axes.Both, Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Direction = FillDirection.Horizontal, LayoutDuration = 200, LayoutEasing = Easing.OutQuint } } } }; statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s)); }
private void load(OsuColour colours) { breadcrumbs.StripColour = colours.Blue; }
private void load() { Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Y, Width = rank_width, Children = new[] { new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = @"Exo2.0-MediumItalic", TextSize = 22, // ReSharper disable once ImpureMethodCallOnReadonlyValueField Text = RankPosition.ToString(), }, }, }, content = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = rank_width, }, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, CornerRadius = corner_radius, Masking = true, Children = new[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = background_alpha, }, }, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(edge_margin), Children = new[] { avatar = new DelayedLoadWrapper( new Avatar(Score.User) { RelativeSizeAxes = Axes.Both, CornerRadius = corner_radius, Masking = true, OnLoadComplete = d => d.FadeInFromZero(200), EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, }) { RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), }, new Container { RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Position = new Vector2(HEIGHT - edge_margin, 0f), Children = new Drawable[] { nameLabel = new OsuSpriteText { Text = Score.User.Username, Font = @"Exo2.0-BoldItalic", TextSize = 23, }, new FillFlowContainer { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(10f, 0f), Children = new Drawable[] { flagBadgeContainer = new Container { Size = new Vector2(87f, 20f), Masking = true, Children = new Drawable[] { new DrawableFlag(Score.User?.Country) { Width = 30, RelativeSizeAxes = Axes.Y, }, }, }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(10f, 0f), Margin = new MarginPadding { Left = edge_margin, }, Children = new Drawable[] { maxCombo = new ScoreComponentLabel(FontAwesome.fa_link, Score.MaxCombo.ToString()), accuracy = new ScoreComponentLabel(FontAwesome.fa_crosshairs, string.Format(Score.Accuracy % 1 == 0 ? @"{0:P0}" : @"{0:P2}", Score.Accuracy)), }, }, }, }, }, }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Direction = FillDirection.Horizontal, Spacing = new Vector2(5f, 0f), Children = new Drawable[] { scoreLabel = new GlowingSpriteText(Score.TotalScore.ToString(@"N0"), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa")), new Container { Size = new Vector2(40f, 20f), Children = new[] { scoreRank = new DrawableRank(Score.Rank) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(40f), }, }, }, }, }, modsContainer = new FillFlowContainer <ModIcon> { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, ChildrenEnumerable = Score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) }) }, }, }, }, }, }; }
private void load(OsuColour colours) { Colour = colours.BlueDark; }
private void load(IAPIProvider api, OsuColour colour) { var user = score.User; statisticsLabels = GetStatistics(score).Select(s => new ScoreComponentLabel(s)).ToList(); DrawableAvatar innerAvatar; Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Y, Width = rank_width, Children = new[] { new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.GetFont(size: 20, italics: true), Text = rank.ToMetric(decimals: rank < 100000 ? 1 : 0), }, }, }, content = new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Left = rank_width, }, Children = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, CornerRadius = corner_radius, Masking = true, Children = new[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = user.Id == api.LocalUser.Value.Id && allowHighlight ? colour.Green : Color4.Black, Alpha = background_alpha, }, }, }, new Container { RelativeSizeAxes = Axes.Both, Padding = new MarginPadding(edge_margin), Children = new[] { avatar = new DelayedLoadWrapper( innerAvatar = new DrawableAvatar(user) { RelativeSizeAxes = Axes.Both, CornerRadius = corner_radius, Masking = true, EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, Radius = 1, Colour = Color4.Black.Opacity(0.2f), }, }) { RelativeSizeAxes = Axes.None, Size = new Vector2(HEIGHT - edge_margin * 2, HEIGHT - edge_margin * 2), }, new Container { RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Position = new Vector2(HEIGHT - edge_margin, 0f), Children = new Drawable[] { nameLabel = new OsuSpriteText { Text = user.Username, Font = OsuFont.GetFont(size: 23, weight: FontWeight.Bold, italics: true) }, new FillFlowContainer { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(10f, 0f), Children = new Drawable[] { flagBadgeContainer = new Container { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, Size = new Vector2(87f, 20f), Masking = true, Children = new Drawable[] { new UpdateableFlag(user.Country) { Width = 30, RelativeSizeAxes = Axes.Y, }, }, }, new FillFlowContainer { Origin = Anchor.BottomLeft, Anchor = Anchor.BottomLeft, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(10f, 0f), Margin = new MarginPadding { Left = edge_margin }, Children = statisticsLabels }, }, }, }, }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Direction = FillDirection.Horizontal, Spacing = new Vector2(5f, 0f), Children = new Drawable[] { scoreLabel = new GlowingSpriteText { TextColour = Color4.White, GlowColour = OsuColour.FromHex(@"83ccfa"), Text = score.TotalScore.ToString(@"N0"), Font = OsuFont.Numeric.With(size: 23), }, RankContainer = new Container { Size = new Vector2(40f, 20f), Children = new[] { scoreRank = new UpdateableRank(score.Rank) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(40f) }, }, }, }, }, modsContainer = new FillFlowContainer <ModIcon> { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(1), ChildrenEnumerable = score.Mods.Select(mod => new ModIcon(mod) { Scale = new Vector2(0.375f) }) }, }, }, }, }, }; innerAvatar.OnLoadComplete += d => d.FadeInFromZero(200); }