Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New UI: Radial menu #192

Closed
wants to merge 1 commit into from

Conversation

DocNITE
Copy link
Contributor

@DocNITE DocNITE commented Aug 1, 2023

Description

Well, for some reason it cannot be accept in main game repository.

It's add a new UI Radial menu, like radial from SS13

Media

2023-07-17.20-41-20.webm

Changelog

@github-actions github-actions bot added Status: Needs Review Someone please review this Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: UI Changes any XAML files labels Aug 1, 2023
@DocNITE
Copy link
Contributor Author

DocNITE commented Aug 1, 2023

Oh, and yeah. There is test code. You can put it in command object

string[] tips =
        {
            "Some title for button (i mean radial button/item huh)",
            "Iz okna dulo. Shtirlic zakril okno. Dule ischezlo",
            "XDDDD XD XD XD XD XD XD X DXD X DX DX DX DX DXD XD D "
        };

        // Create menu
        var radial = IoCManager.Resolve<IUserInterfaceManager>().GetUIController<RadialUiController>()
            .CreateRadialContainer();

        // Append items
        for (int i = 0; i < 8; i++)
        {
            var testButton = radial.AddButton("Action " + i, "/Textures/Interface/examine-star.png");
            testButton.Opacity = 210;
            testButton.Tooltip = tips[IoCManager.Resolve<IRobustRandom>().Next(0, 2)];
            testButton.Controller.OnPressed += (_) =>
            {
                Logger.Debug("RadialItem was pressed(fired)!");
                // Close menu
                radial.Dispose();
            };
        }

        // Just some close event
        radial.OnClose += (_) =>
        {
            Logger.Debug("Close event for your own logic");
        };

        // Open element
        radial.OpenCentered();

        // And, ofc, we can attach this element like SpeechBubble
        var plr = IoCManager.Resolve<IPlayerManager>().LocalPlayer;
        radial.AttachedEntity = plr?.ControlledEntity;

@DEATHB4DEFEAT
Copy link
Member

This shouldn't be done downstream, deal with the review issues upstream and get it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: C# Changes any cs files Changes: Localization Changes any ftl files Changes: UI Changes any XAML files Status: Needs Review Someone please review this
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants