Skip to content

Commit

Permalink
chore: updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ardelan869 committed Sep 26, 2024
1 parent 7c9830e commit ce1bfe0
Showing 1 changed file with 63 additions and 1 deletion.
64 changes: 63 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,64 @@
# ragemenu
FiveM native Rage Menu, made with React

FiveM native Rage Menu, built with React.

## Dependencies

- [Sumneko LLS for VSCode](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)

## Features

- High-performance script
- Cached component and menu state
- Runtime-editable menus and components
- Fully typed

## Installation

1. Download the [latest release](https://github.com/ardelan869/ragemenu/releases/latest) from GitHub.

2. Extract the contents of the zip file into your `resources` folder and remove `-main` from the folder name.

3. Add the path of `meta.lua` to your [Sumneko LLS](https://marketplace.visualstudio.com/items?itemName=sumneko.lua) `workspace.library` setting.

4. Add `ensure ragemenu` to your `server.cfg`.

## Example

> [!NOTE]
> The menu offers more components and functions.\
> DOCUMENTATION COMING SOON.
```lua
--- you can create a menu once and reopen it at any time
--- state will be cached and reused
local menu = Menu:Create('Example', 'Example Subtitle')

local exampleButton = menu:AddButton('Example Button', 'Example Description', {
left = 'shop_ammo_icon'
})

exampleButton:OnClick(function(component)
print(component.label .. ' Clicked!')
end)

local exampleSlider = menu:AddSlider('Example Slider', 'Example Description', nil, 100, 0, 10, 50)

local removeSliderHandler = exampleSlider:OnChange(function(current)
print('current slider progress', current)
end)

exampleSlider:OnClick(function()
removeSliderHandler() -- this function removes the OnChange handler, that's above

print('Removed slider `OnChange` handler')
end)

RegisterCommand('example', function()
if menu:IsOpen() then
menu:Close()
else
menu:Open()
end
end, false)
```

0 comments on commit ce1bfe0

Please sign in to comment.