Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

help with loading RNUI menu

Featured Replies

so for the past few days, I've been trying to learn how to load an RNUI menu but whenever I press the open key which is K it just crashes my game. I've read the log its an issue with processmenus() line 37 in particular which is  if (menu.Visible) 

BTW I've read https://github.com/alexguirre/RAGENativeUI/wiki/Menus-Overview still no luck.

Any help would be greatly appreciated

Thanks.

Spoiler

using Rage;
using RAGENativeUI.PauseMenu;
using RAGENativeUI;
using System.Windows.Forms;


namespace test
{
    public class MenuController
    {
        private MenuPool menuPool;
        private UIMenu menu;

        public MenuController()
        {
            menuPool = new MenuPool();
        }

        public UIMenu CreateMenu(string test, string subtitle)
        {
            UIMenu menu = new UIMenu(test, subtitle);
            menuPool.Add(menu);
            return menu;
        }

        public void ProcessMenus()
        {
            while (true)
            {
                GameFiber.Yield();

                menuPool.ProcessMenus();

                if (Game.IsKeyDown(Keys.K))

                {
                    if (menu.Visible)
                    {
                        menu.Visible = false;
                    }

                    else if ((!UIMenu.IsAnyMenuVisible && !TabView.IsAnyPauseMenuVisible))
                    {
                        menu.Visible = true;
                    }

                }
            }
        }

        public void CloseAllMenus()
        {
            menuPool.CloseAllMenus();
        }

      
    }
}
 

 

Edited by uali

  • Management Team

You're never actually creating a menu. You create a variable called menu but your function CreateMenu is never called. 

 

This probably isn't the only issue, just the one most obvious to me while looking at your code from a phone. I'd recommend looking at the examples to learn how RAGENativeUI works as well. https://github.com/alexguirre/RAGENativeUI/tree/master/Source/Examples

"Work and ideas get stolen, then you keep moving on doing your thing."

  • Author

yup, I realized that almost immediately after posting that I was doing the wrong thing and fixed it by looking at other people's menus that were open source after that it worked. Thanks for your help!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.