private static Drawable createHeader(StatisticItem item) { if (string.IsNullOrEmpty(item.Name)) { return(Empty()); } return(new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Horizontal, Spacing = new Vector2(5, 0), Children = new Drawable[] { new Circle { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Height = 9, Width = 4, Colour = Colour4Extensions.FromHex("#00FFAA") }, new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Text = item.Name, Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold), } } }); }
public EditorMenuBar() : base(Direction.Horizontal, true) { RelativeSizeAxes = Axes.X; MaskingContainer.CornerRadius = 0; ItemsContainer.Padding = new MarginPadding { Left = 100 }; BackgroundColour = Colour4Extensions.FromHex("111"); ScreenSelectionTabControl tabControl; AddRangeInternal(new Drawable[] { tabControl = new ScreenSelectionTabControl { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, X = -15 } }); Mode.BindTo(tabControl.Current); }
public RoomAvailabilityPickerItem(RoomAvailability value) : base(value) { RelativeSizeAxes = Axes.Y; Width = 102; Masking = true; CornerRadius = 5; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex(@"3d3943"), }, selection = new Box { RelativeSizeAxes = Axes.Both, Alpha = 0, }, hover = new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4.White, Alpha = 0, }, new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.GetFont(weight: FontWeight.Bold), Text = value.GetDescription(), }, }; }
/// <summary> /// Retrieves the colour for a <see cref="DifficultyRating"/>. /// </summary> /// <remarks> /// Sourced from the @diff-{rating} variables in https://github.com/ppy/osu-web/blob/71fbab8936d79a7929d13854f5e854b4f383b236/resources/assets/less/variables.less. /// </remarks> public Colour4 ForDifficultyRating(DifficultyRating difficulty, bool useLighterColour = false) { switch (difficulty) { case DifficultyRating.Easy: return(Colour4Extensions.FromHex("4ebfff")); case DifficultyRating.Normal: return(Colour4Extensions.FromHex("66ff91")); case DifficultyRating.Hard: return(Colour4Extensions.FromHex("f7e85d")); case DifficultyRating.Insane: return(Colour4Extensions.FromHex("ff7e68")); case DifficultyRating.Expert: return(Colour4Extensions.FromHex("fe3c71")); case DifficultyRating.ExpertPlus: return(Colour4Extensions.FromHex("6662dd")); default: throw new ArgumentOutOfRangeException(nameof(difficulty)); } }
public void Setup() => Schedule(() => { automaticAdditionDelegate?.Cancel(); automaticAdditionDelegate = null; Children = new[] { background = new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex("#333"), }, object1 = new BorderCircle { Position = new Vector2(256, 192), Colour = Colour4.Yellow, }, object2 = new BorderCircle { Position = new Vector2(100, 300), }, accuracyHeatmap = new TestAccuracyHeatmap(new ScoreInfo { BeatmapInfo = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo }) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(130) } }; });
/// <summary> /// Retrieves the grade text colour. /// </summary> private ColourInfo getRankNameColour() { switch (rank) { case ScoreRank.XH: case ScoreRank.SH: return(ColourInfo.GradientVertical(Colour4.White, Colour4Extensions.FromHex("afdff0"))); case ScoreRank.X: case ScoreRank.S: return(ColourInfo.GradientVertical(Colour4Extensions.FromHex(@"ffe7a8"), Colour4Extensions.FromHex(@"ffb800"))); case ScoreRank.A: return(Colour4Extensions.FromHex(@"275227")); case ScoreRank.B: return(Colour4Extensions.FromHex(@"553a2b")); case ScoreRank.C: return(Colour4Extensions.FromHex(@"473625")); default: return(Colour4Extensions.FromHex(@"512525")); } }
protected override Drawable CreateLayout() => new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Spacing = new Vector2(5, 0), Margin = new MarginPadding { Horizontal = 10, Vertical = 3, }, Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] { new CircularContainer { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Masking = true, Width = 4, Height = 13, Child = new Box { RelativeSizeAxes = Axes.Both, Colour = string.IsNullOrEmpty(User.Colour) ? Colour4Extensions.FromHex("0087ca") : Colour4Extensions.FromHex(User.Colour) } }, CreateUsername().With(u => { u.Anchor = Anchor.CentreLeft; u.Origin = Anchor.CentreLeft; u.Font = OsuFont.GetFont(size: 13, weight: FontWeight.Bold); }) } };
private void load() { BackgroundColour = Colour4Extensions.FromHex(@"094c5f"); Triangles.ColourLight = Colour4Extensions.FromHex(@"0f7c9b"); Triangles.ColourDark = Colour4Extensions.FromHex(@"094c5f"); Triangles.TriangleScale = 1.5f; }
public MultiplayerWaveContainer() { FirstWaveColour = Colour4Extensions.FromHex(@"654d8c"); SecondWaveColour = Colour4Extensions.FromHex(@"554075"); ThirdWaveColour = Colour4Extensions.FromHex(@"44325e"); FourthWaveColour = Colour4Extensions.FromHex(@"392850"); }
private void addCircleStep(ScoreInfo score) => AddStep("add panel", () => { Children = new Drawable[] { new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(500, 700), Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientVertical(Colour4Extensions.FromHex("#555"), Colour4Extensions.FromHex("#333")) } } }, new AccuracyCircle(score, true) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(230) } }; });
public void UpdateStatus(MultiplayerUserState state, BeatmapAvailability availability) { // the only case where the progress bar is used does its own local fade in. // starting by fading out is a sane default. progressBar.FadeOut(fade_time); this.FadeIn(fade_time); switch (state) { case MultiplayerUserState.Idle: showBeatmapAvailability(availability); break; case MultiplayerUserState.Ready: text.Text = "ready"; icon.Icon = FontAwesome.Solid.CheckCircle; icon.Colour = Colour4Extensions.FromHex("#AADD00"); break; case MultiplayerUserState.WaitingForLoad: text.Text = "loading"; icon.Icon = FontAwesome.Solid.PauseCircle; icon.Colour = colours.Yellow; break; case MultiplayerUserState.Loaded: text.Text = "loaded"; icon.Icon = FontAwesome.Solid.DotCircle; icon.Colour = colours.YellowLight; break; case MultiplayerUserState.Playing: text.Text = "playing"; icon.Icon = FontAwesome.Solid.PlayCircle; icon.Colour = colours.BlueLight; break; case MultiplayerUserState.FinishedPlay: text.Text = "results pending"; icon.Icon = FontAwesome.Solid.ArrowAltCircleUp; icon.Colour = colours.BlueLighter; break; case MultiplayerUserState.Results: text.Text = "results"; icon.Icon = FontAwesome.Solid.ArrowAltCircleUp; icon.Colour = colours.BlueLighter; break; case MultiplayerUserState.Spectating: text.Text = "spectating"; icon.Icon = FontAwesome.Solid.Binoculars; icon.Colour = colours.BlueLight; break; default: throw new ArgumentOutOfRangeException(nameof(state), state, null); } }
private void load(OsuColour colours) { bg.Colour = colours.Gray3; triangles.ColourDark = colours.Gray3; triangles.ColourLight = Colour4Extensions.FromHex(@"353535"); headerBg.Colour = colours.Gray2.Opacity(0.75f); }
private void load(OsuColour colours) { var user = Value.Users.First(); BackgroundActive = user.Colour != null?Colour4Extensions.FromHex(user.Colour) : colours.BlueDark; BackgroundInactive = BackgroundActive.Darken(0.5f); }
private void load(OsuColour colours, LadderEditorScreen ladderEditor) { this.ladderEditor = ladderEditor; colourWinner = losers ? Colour4Extensions.FromHex("#8E7F48") : Colour4Extensions.FromHex("#1462AA"); InternalChildren = new Drawable[] { background = new Box { RelativeSizeAxes = Axes.Both, }, new Container { Padding = new MarginPadding(5), RelativeSizeAxes = Axes.Both, Children = new Drawable[] { AcronymText, Flag, } }, new Container { Masking = true, Width = 0.3f, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, RelativeSizeAxes = Axes.Both, Children = new Drawable[] { backgroundRight = new Box { Colour = OsuColour.Gray(0.1f), Alpha = 0.8f, RelativeSizeAxes = Axes.Both, }, scoreText = new TournamentSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.Torus.With(size: 22), } } } }; completed.BindValueChanged(_ => updateWinStyle()); score.BindValueChanged(val => { scoreText.Text = val.NewValue?.ToString() ?? string.Empty; updateWinStyle(); }, true); }
private void updateWinStyle() { bool winner = completed.Value && isWinner?.Invoke() == true; background.FadeColour(winner ? Colour4.White : Colour4Extensions.FromHex("#444"), winner ? 500 : 0, Easing.OutQuint); backgroundRight.FadeColour(winner ? colourWinner : Colour4Extensions.FromHex("#333"), winner ? 500 : 0, Easing.OutQuint); AcronymText.Colour = winner ? Colour4.Black : Colour4.White; scoreText.Font = scoreText.Font.With(weight: winner ? FontWeight.Bold : FontWeight.Regular); }
private void load(AudioManager audio) { BackgroundColour = Colour4.Transparent; BackgroundColourHover = Colour4Extensions.FromHex(@"172023"); AddInternal(new HoverClickSounds()); updateTextColour(); Item.Action.BindDisabledChanged(_ => updateState(), true); }
private void load(OsuColour colours) { this.colours = colours; InternalChild = new FillFlowContainer { AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Spacing = new Vector2(5), Children = new Drawable[] { icon = new SpriteIcon { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Icon = FontAwesome.Solid.CheckCircle, Size = new Vector2(12), }, new CircularContainer { Masking = true, AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Children = new Drawable[] { progressBar = new ProgressBar(false) { RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, BackgroundColour = Colour4.Black.Opacity(0.4f), FillColour = colours.Blue, Alpha = 0f, }, text = new OsuSpriteText { Padding = new MarginPadding { Horizontal = 5f, Vertical = 1f }, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 12), Colour = Colour4Extensions.FromHex("#DDFFFF") }, } }, } }; }
public ScoreComponentLabel(LeaderboardScoreStatistic statistic) { TooltipText = statistic.Name; AutoSizeAxes = Axes.Both; Child = content = new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, Children = new Drawable[] { new Container { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, AutoSizeAxes = Axes.Both, Children = new[] { new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(icon_size), Rotation = 45, Colour = Colour4Extensions.FromHex(@"3087ac"), Icon = FontAwesome.Solid.Square, Shadow = true, }, new SpriteIcon { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(icon_size - 6), Colour = Colour4Extensions.FromHex(@"a4edff"), Icon = statistic.Icon, }, }, }, new GlowingSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, TextColour = Colour4.White, GlowColour = Colour4Extensions.FromHex(@"83ccfa"), Text = statistic.Value, Font = OsuFont.GetFont(size: 17, weight: FontWeight.Bold), }, }, }; }
public DrawableGameType(MatchType type) { this.type = type; Masking = true; Children = new[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex(@"545454"), }, }; }
private void load() { InternalChild = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, Children = new[] { new CircularContainer { RelativeSizeAxes = Axes.X, Height = 12, Masking = true, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex("#222") }, HeaderText = new OsuSpriteText { Anchor = Anchor.Centre, Origin = Anchor.Centre, Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold), Text = header.ToUpperInvariant(), } } }, new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, AutoSizeAxes = Axes.Both, Children = new[] { content = CreateContent().With(d => { d.Anchor = Anchor.TopCentre; d.Origin = Anchor.TopCentre; d.Alpha = 0; d.AlwaysPresent = true; }), } } } }; }
private void addMessageWithChecks(string text, int linkAmount = 0, bool isAction = false, bool isImportant = false, params LinkAction[] expectedActions) { int index = textContainer.Count + 1; var newLine = new ChatLine(new DummyMessage(text, isAction, isImportant, index)); textContainer.Add(newLine); AddAssert($"msg #{index} has {linkAmount} link(s)", () => newLine.Message.Links.Count == linkAmount); AddAssert($"msg #{index} has the right action", hasExpectedActions); //AddAssert($"msg #{index} is " + (isAction ? "italic" : "not italic"), () => newLine.ContentFlow.Any() && isAction == isItalic()); AddAssert($"msg #{index} shows {linkAmount} link(s)", isShowingLinks); bool hasExpectedActions() { var expectedActionsList = expectedActions.ToList(); if (expectedActionsList.Count != newLine.Message.Links.Count) { return(false); } for (int i = 0; i < newLine.Message.Links.Count; i++) { var action = newLine.Message.Links[i].Action; if (action != expectedActions[i]) { return(false); } } return(true); } //bool isItalic() => newLine.ContentFlow.Where(d => d is OsuSpriteText).Cast<OsuSpriteText>().All(sprite => sprite.Font.Italics); bool isShowingLinks() { bool hasBackground = !string.IsNullOrEmpty(newLine.Message.Sender.Colour); Colour4 textColour = isAction && hasBackground?Colour4Extensions.FromHex(newLine.Message.Sender.Colour) : Colour4.White; var linkCompilers = newLine.ContentFlow.Where(d => d is DrawableLinkCompiler).ToList(); var linkSprites = linkCompilers.SelectMany(comp => ((DrawableLinkCompiler)comp).Parts); return(linkSprites.All(d => d.Colour == linkColour) && newLine.ContentFlow.Except(linkSprites.Concat(linkCompilers)).All(d => d.Colour == textColour)); } }
private void createTest(List <HitEvent> events) => AddStep("create test", () => { Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex("#333") }, new HitEventTimingDistributionGraph(events) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(600, 130) } }; });
public ContractedPanelMiddleContentContainer(WorkingBeatmap beatmap, ScoreInfo score) { workingBeatmap = new Bindable <WorkingBeatmap>(beatmap); Anchor = Anchor.Centre; Origin = Anchor.Centre; Size = new Vector2(ScorePanel.CONTRACTED_WIDTH, 460); Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex("#353535"), }, new ContractedPanelMiddleContent(score), }; }
public Bar() { Anchor = Anchor.BottomCentre; Origin = Anchor.BottomCentre; RelativeSizeAxes = Axes.Both; Padding = new MarginPadding { Horizontal = 1 }; InternalChild = new Circle { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex("#66FFCC") }; }
private void updateTextColour() { switch ((Item as OsuMenuItem)?.Type) { default: case MenuItemType.Standard: text.Colour = Colour4.White; break; case MenuItemType.Destructive: text.Colour = Colour4.Red; break; case MenuItemType.Highlighted: text.Colour = Colour4Extensions.FromHex(@"ffcc22"); break; } }
public TestSceneExpandedPanelTopContent() { Child = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(500, 200), Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex("#444"), }, new ExpandedPanelTopContent(new TestScoreInfo(new OsuRuleset().RulesetInfo).User), } }; }
protected override Drawable CreateBackground() => new Container { RelativeSizeAxes = Axes.X, Height = 150, Masking = true, Children = new Drawable[] { coverContainer = new ProfileCoverBackground { RelativeSizeAxes = Axes.Both, }, new Box { RelativeSizeAxes = Axes.Both, Colour = ColourInfo.GradientVertical(Colour4Extensions.FromHex("222").Opacity(0.8f), Colour4Extensions.FromHex("222").Opacity(0.2f)) }, } };
public LightSquare() { Size = new Vector2(22.5f); InternalChildren = new Drawable[] { new Container { RelativeSizeAxes = Axes.Both, Masking = true, BorderColour = OsuColour.Gray(0.5f), BorderThickness = 3, Children = new Drawable[] { new Box { Colour = Colour4.Transparent, RelativeSizeAxes = Axes.Both, AlwaysPresent = true, }, } }, box = new Box { Colour = Colour4Extensions.FromHex("#FFE8AD"), RelativeSizeAxes = Axes.Both, }, }; Masking = true; EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Glow, Colour = Colour4Extensions.FromHex("#FFE8AD").Opacity(0.1f), Hollow = true, Radius = 20, Roundness = 10, }; }
public void SetUp() => Schedule(() => { Child = new Container { AutoSizeAxes = Axes.Y, Width = 700, Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex("#333"), }, container = new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding(20) } } }; });
public Spacer() { RelativeSizeAxes = Axes.Both; Padding = new MarginPadding { Vertical = 4 }; InternalChild = new CircularContainer { RelativeSizeAxes = Axes.Y, Width = 3, Origin = Anchor.Centre, Anchor = Anchor.Centre, CornerRadius = 2, Masking = true, Child = new Box { RelativeSizeAxes = Axes.Both, Colour = Colour4Extensions.FromHex("#222") } }; }