Example #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;
            });
        }
Example #2
0
        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);
            });
        }
Example #3
0
        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));
        }
Example #4
0
        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;
        }
Example #5
0
        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!",
                    });
                }
            }
        }