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.

RageNativeUI / LemonUI - help

Featured Replies

Hey there guys I am wanting to implement some ui menus to a few callouts of mine and maybe make a few extra things... but I can't seem to find any tutorials or guides that are up-to-date as of now.. is there a demo version that can be downloaded to see how it all works or am I missing something.

 

 

I don't mind using RageNativeUI or LemonUI but would prefer RageNativeUI

  • Author
6 hours ago, LMS said:

RageNativeUI comes with quite a few examples, what are you looking for?

I'm trying to make like a Ped Interaction Menu, sorta like STP but a basic one.. and something that I can use in my callout pack to ask and answer questions with.

  • Author
11 hours ago, LMS said:

I think this might be a good starting point then: https://github.com/alexguirre/RAGENativeUI/wiki/Menus-Overview

Yeah I have looked at that and I have some sorta code but its not working at all and I have followed the demos and stuff but yeah nothing. 

 

Heres the code I have. I followed the example code there and changed slight things but left it pretty much the same just to get it to show up and work... But nothing

 

namespace Ped_Interaction_Menu
{
    using System;
    using System.Linq;
    using System.Windows.Forms;
    using LSPD_First_Response.Mod.API;
    using Rage;
    using Rage.Attributes;
    using Rage.Native;
    using RAGENativeUI;
    using RAGENativeUI.Elements;
    using RAGENativeUI.PauseMenu;

    internal static class PedInteractionMenu
    {
        private static MenuPool pool;
        private static UIMenu mainMenu;

        private static readonly Keys Keybinding = Keys.K;

        private static void Main()
        {
            pool = new MenuPool();
            mainMenu = new UIMenu("Ped Interactions", "Version ~o~1.0.0");
            {
                var cb = new UIMenuCheckboxItem("Checkbox", false, "A Checkbox menu Item");
                cb.CheckboxEvent += (item, isChecked) => Game.DisplaySubtitle($"The Checkbox is {(isChecked ? "" : "~r~not~s~")} checked");

                var spawnCar = new UIMenuItem("Spawn car", "Spawns a random car after 5 seconds.");
                spawnCar.Activated += (menu, item) =>
                {
                    // disable the item so the user cannot activate it again until the car has spawned
                    spawnCar.Enabled = false;

                    GameFiber.StartNew(() =>
                    {
                        // 5 second countdown
                        for (int sec = 5; sec > 0; sec--)
                        {
                            // show the countdown in the menu description
                            mainMenu.DescriptionOverride = $"The car will spawn in ~b~{sec}~s~ second(s).";

                            GameFiber.Sleep(1000); // sleep for 1 second
                        }

                        // remove the countdown from the description
                        mainMenu.DescriptionOverride = null;

                        // spawn the random car
                        new Vehicle(m => m.IsCar, Game.LocalPlayer.Character.GetOffsetPositionFront(5.0f)).Dismiss();

                        // wait a bit and re-enable the item
                        GameFiber.Sleep(500);
                        spawnCar.Enabled = true;
                    });
                };
                mainMenu.AddItems(cb, spawnCar);
            }

            // create a child menu
            UIMenu childMenu = new UIMenu("RAGENativeUI", "CHILD MENU");

            // create a new item in the main menu and bind the child menu to it
            {
                UIMenuItem bindItem = new UIMenuItem("Go to child menu");

                mainMenu.AddItem(bindItem);
                mainMenu.BindMenuToItem(childMenu, bindItem);


                bindItem.RightBadge = UIMenuItem.BadgeStyle.Star;
                mainMenu.OnIndexChange += (menu, index) => mainMenu.MenuItems[index].RightBadge = UIMenuItem.BadgeStyle.None;
            }

            // create the child menu items
            childMenu.AddItems(Enumerable.Range(1, 50).Select(i => new UIMenuItem($"Item #{i}")));

            // add all the menus to the pool
            pool.Add(mainMenu, childMenu);

            // start the fiber which will handle drawing and processing the menus
            GameFiber.StartNew(ProcessMenus);

            // continue with the plugin...
            Game.Console.Print($"  Press {Keybinding} to open the menu.");
            Game.DisplayHelp($"Press ~{Keybinding.GetInstructionalId()}~ to open the menu.");
        }
        private static void ProcessMenus()
        {
            // draw the menu banners (only needed if UIMenu.SetBannerType(Rage.Texture) is used)
            // Game.RawFrameRender += (s, e) => pool.DrawBanners(e.Graphics);

            while (true)
            {
                GameFiber.Yield();

                pool.ProcessMenus();

                if (Game.IsKeyDown(Keybinding) && !UIMenu.IsAnyMenuVisible && !TabView.IsAnyPauseMenuVisible)
                {
                    mainMenu.Visible = true;
                    Game.LogTrivial("Loaded");
                }
            }
        }


        // a command that simulates loading the plugin
        [ConsoleCommand("LoadPI")]
        private static void RunMenuExample() => GameFiber.StartNew(Main);
    }
}

 

  • Author

No sadly I haven't, I'm not sure why it's not loading, I've pleaced the .dll and .pdb file in my plugins folder and also lspdfr folder but nothing... I eventually want the plugin to only work when player is on duty but that's a nothing issue

  • Management Team

RAGENativeUI most likely needs to be placed in the game root folder. Move the example code from above into one of your callout plugins which you already have working. Then see if you can get the menu working there or what the error message is.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author

Oh yeah I'll try that, I have RageNativeUI already there because I use StopThePed and UltimateBackup anyways but yeah  I'll try put it in my callout pack

  • Author
13 hours ago, LMS said:

RAGENativeUI most likely needs to be placed in the game root folder. Move the example code from above into one of your callout plugins which you already have working. Then see if you can get the menu working there or what the error message is.

I just tried placing it into one a script in the callouts pack I made but still nothing, no error nothing. Its not even being loaded in the game

 

  • Management Team
3 hours ago, Eli180sx said:

I just tried placing it into one a script in the callouts pack I made but still nothing, no error nothing. Its not even being loaded in the game

 

 

What do you mean, not even loaded? If you put just the code from above in your project and recompile, what is not being loaded? Also, add some logging to the LoadPi command and other calls down the call chain. Keep in mind you probably have to register the console command via RPH first.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author

Oh OK, I have it in my Public Intoxication Callout just at the end after the Public Override Void End() statement.

 

How do I register the console command throight RPH? And I've also added logging and subtitles to show if the pool has even tried to load it, in the "Main" Argument, but yeah nothing

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.