-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c9830e
commit ce1bfe0
Showing
1 changed file
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
``` |