Skip to content

Rexshack-RedM/rsg-radialmenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

73 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

rsg_framework

๐Ÿงญ rsg-radialmenu

Radial interaction menu for RedM using RSG Core.

Platform License

A fully interactive radial menu system built for RSG Core.
Includes categories for player actions, horses, and walk styles.


๐Ÿ› ๏ธ Dependencies

  • rsg-core (framework & player data)
  • rsg-essentials (shared actions & menu hooks)
  • ox_lib (locale & notifications)

License: GPLโ€‘3.0


โœจ Features

  • ๐Ÿงญ Radial menu system for inโ€‘game quick actions.
  • ๐Ÿงโ€โ™‚๏ธ Player options โ€” access walk styles (normal, angry, drunk, etc.).
  • ๐ŸŽ Horse menu โ€” toggle horse lantern and other actions.
  • ๐ŸŽฎ Default keybind: F6 (changeable in config.lua).
  • ๐Ÿ”’ Hold to open option for better control.
  • โš™๏ธ Nested submenus supported for complex actions.
  • ๐Ÿงฉ Extensible: external scripts can register their own categories dynamically.
  • ๐ŸŒ Locale support (EN, FR, ES, etc.).

โš™๏ธ Configuration (config.lua)

Config = {}

-- Keybind for opening the radial menu
Config.Keybind = "F6"

-- Hold key instead of tap to open
Config.HoldToOpen = false

-- Menu definitions
Config.MenuItems = {
    [1] = {
        id = "citizen",
        title = "Citizen",
        icon = "user",
        items = {
            {
                id = "walkstyles",
                title = "Walk Styles",
                icon = "walking",
                items = {
                    { id = "normal", title = "Normal", icon = "circle" },
                    { id = "angry", title = "Angry", icon = "circle" },
                    { id = "brave", title = "Brave", icon = "circle" },
                    { id = "casual", title = "Casual", icon = "circle" },
                    { id = "drunk", title = "Drunk", icon = "circle" },
                    { id = "old", title = "Old", icon = "circle" },
                    { id = "injured", title = "Injured", icon = "circle" },
                }
            },
        }
    },
    [2] = {
        id = "horse",
        title = "Horse",
        icon = "horse",
        items = {
            { id = "lantern", title = "Lantern", icon = "lightbulb" }
        }
    },
}

๐Ÿ’ก You can add new menus or submenus by inserting entries inside Config.MenuItems.
For example, add an "admin" or "police" category for custom server roles.


๐Ÿ”Œ Injecting menu items from other resources

The resource exposes exports to add/remove dynamic menu entries at runtime:

-- โœ… Available exports
exports('AddOption', AddOption)
exports('RemoveOption', RemoveOption)

1) Add a new category (returns an id you can remove later)

-- client.lua (in your own resource)
local myCategory = {
  id = 'my_res',
  title = 'My Resource',
  icon = 'star',
  items = {
    { id = 'open_ui', title = 'Open UI', icon = 'window', type = 'client', event = 'my_res:client:openUI' },
    { id = 'do_action', title = 'Do Action', icon = 'hand', type = 'server', event = 'my_res:server:doAction' },
    { id = 'run_cmd', title = 'Run /help', icon = 'circle', type = 'command', event = 'help' },
    -- Optional: only show when a condition is true
    { id = 'police_only', title = 'Police Tools', icon = 'shield', type = 'client', event = 'my_res:client:policeTools',
      canOpen = function()
        local p = exports['rsg-core']:GetCoreObject().Functions.GetPlayerData()
        return p.job and p.job.name == 'police'
      end
    },
  }
}

local menuId = exports['rsg-radialmenu']:AddOption(myCategory)
-- store menuId to remove later if needed

2) Remove a previously added category

exports['rsg-radialmenu']:RemoveOption(menuId)

๐Ÿ’ก Item schema (leaf items)

A leaf must either provide an action function or a pair { type, event }:

  • type = 'client' โ†’ TriggerEvent(event, data)
  • type = 'server' โ†’ TriggerServerEvent(event, data)
  • type = 'command' โ†’ ExecuteCommand(event)
  • type = 'rsgcommand' โ†’ TriggerServerEvent('RSGCore:CallCommand', event, data)

Optional field: canOpen = function() return true/false end โ€” if present and false, the item is filtered out.

Internally, the selection handler calls your action(data) if provided; otherwise it routes by type/event as above.


๐Ÿ•น๏ธ Usage

  • Press F6 to open the radial menu.
  • Hover and click to select an action.
  • If Config.HoldToOpen = true, hold F6 instead of tapping.
  • Use submenus for walk styles or horse utilities.
  • You can register custom menu categories at runtime using the exports above.

๐Ÿ“‚ Installation

  1. Place rsg-radialmenu into your resources/[rsg] folder.
  2. Add to your server.cfg:
    ensure ox_lib
    ensure rsg-core
    ensure rsg-essentials
    ensure rsg-radialmenu
  3. Restart your server.
  4. (Optional) Edit config.lua to change keybind or add menu items.

๐Ÿ’Ž Credits

Releases

No releases published

Packages

 
 
 

Contributors