private void load(OsuColour color) { textFlow.AddIcon(FontAwesome.Solid.Wrench, t => { t.Font = t.Font.With(size: 50); }); textFlow.NewParagraph(); textFlow.AddParagraph("Disclaimer", t => { t.Font = t.Font.With(size: 30f); }); textFlow.AddParagraph("This is a WIP, so don't expect things to work as expected."); textFlow.AddParagraph("Tip: " + disclaimer_tips[RNG.Next(0, disclaimer_tips.Length)], t => { t.Colour = color.BlueLighter; }); textFlow.NewParagraph(); textFlow.AddParagraph("Press your (A) (B), (Select) (Start) button to skip this.", t => { t.Colour = color.YellowLighter; t.Font = t.Font.With(size: 12f); }); }
private void load(SettingsOverlay settings) { textFlow.AddIcon(FontAwesome.Solid.DoorOpen, t => { t.Font = t.Font.With(size: 50); }); textFlow.NewLine(); textFlow.AddParagraph("gamebosu! moved to the settings overlay", t => { t.Font = t.Font.With(size: 24); t.Colour = Color4.Yellow; }); textFlow.AddParagraph("Open the settings to access the rom listing", t => t.Font = t.Font.With(size: 16)); textFlow.AddParagraph("Search for \"open rom listing\" ", t => t.Font = t.Font.With(size: 12)); }
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); }
private void showResults() { mainArea.Clear(); resultsArea.Clear(); settings.Hide(); var displayMode = host.Window?.CurrentDisplayMode.Value; string exclusive = "unknown"; if (host.Window is WindowsWindow windowsWindow) { exclusive = windowsWindow.FullscreenCapability.ToString(); } statusText.Clear(); float successRate = (float)correctAtCurrentDifficulty / attemptsAtCurrentDifficulty; bool isPass = successRate == 1; statusText.AddParagraph($"You scored {correctAtCurrentDifficulty} out of {attemptsAtCurrentDifficulty} ({successRate:0%})!", cp => cp.Colour = isPass ? colours.Green : colours.Red); statusText.AddParagraph($"Level {DifficultyLevel} ({mapDifficultyToTargetFrameRate(DifficultyLevel):N0} Hz)", cp => cp.Font = OsuFont.Default.With(size: 24)); statusText.AddParagraph(string.Empty); statusText.AddParagraph(string.Empty); statusText.AddIcon(isPass ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.TimesCircle, cp => cp.Colour = isPass ? colours.Green : colours.Red); statusText.AddParagraph(string.Empty); if (!isPass && DifficultyLevel > 1) { statusText.AddParagraph("To complete certification, the difficulty level will now decrease until you can get 20 rounds correct in a row!", cp => cp.Font = OsuFont.Default.With(size: 24, weight: FontWeight.SemiBold)); statusText.AddParagraph(string.Empty); } statusText.AddParagraph($"Polling: {pollingMax} Hz Monitor: {displayMode?.RefreshRate ?? 0:N0} Hz Exclusive: {exclusive}", cp => cp.Font = OsuFont.Default.With(size: 15, weight: FontWeight.SemiBold)); statusText.AddParagraph($"Input: {host.InputThread.Clock.FramesPerSecond} Hz " + $"Update: {host.UpdateThread.Clock.FramesPerSecond} Hz " + $"Draw: {host.DrawThread.Clock.FramesPerSecond} Hz" , cp => cp.Font = OsuFont.Default.With(size: 15, weight: FontWeight.SemiBold)); if (isCertifying && isPass) { showCertifiedScreen(); return; } string cannotIncreaseReason = string.Empty; if (mapDifficultyToTargetFrameRate(DifficultyLevel + 1) > target_host_update_frames) { cannotIncreaseReason = "You've reached the maximum level."; } else if (mapDifficultyToTargetFrameRate(DifficultyLevel + 1) > Clock.FramesPerSecond) { cannotIncreaseReason = "Game is not running fast enough to test this level"; } FillFlowContainer buttonFlow; resultsArea.Add(buttonFlow = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Spacing = new Vector2(20), Padding = new MarginPadding(20), }); if (isPass) { buttonFlow.Add(new ButtonWithKeyBind(Key.Enter) { Text = "Continue to next level", BackgroundColour = colours.Green, Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = () => changeDifficulty(DifficultyLevel + 1), Enabled = { Value = string.IsNullOrEmpty(cannotIncreaseReason) }, TooltipText = cannotIncreaseReason }); } else { if (DifficultyLevel == 1) { buttonFlow.Add(new ButtonWithKeyBind(Key.Enter) { Text = "Retry", TooltipText = "Are you even trying..?", BackgroundColour = colours.Pink2, Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = () => { isCertifying = false; changeDifficulty(1); }, }); } else { buttonFlow.Add(new ButtonWithKeyBind(Key.Enter) { Text = "Begin certification at last level", BackgroundColour = colours.Yellow, Anchor = Anchor.Centre, Origin = Anchor.Centre, Action = () => { isCertifying = true; changeDifficulty(DifficultyLevel - 1); }, TooltipText = isPass ? $"Chain {rounds_to_complete_certified} rounds to confirm your perception!" : "You've reached your limits. Go to the previous level to complete certification!", }); } } }