Skip to content

Commit

Permalink
refactor(client/main): changed audios
Browse files Browse the repository at this point in the history
  • Loading branch information
ardelan869 committed Oct 15, 2024
1 parent 0dbac65 commit e0c60ea
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
29 changes: 23 additions & 6 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,26 @@ RESOURCE_NAME = 'ragemenu';
LAST_RESOURCE = nil;

local AUDIOS = {
OnSelect = 'SELECT',
OnChange = 'NAV_LEFT_RIGHT',
OnCheck = 'WAYPOINT_SET',
OnClick = 'SELECT',
Exit = 'TIMER'
OnSelect = {
name = 'NAV_UP_DOWN',
ref = 'HUD_FREEMODE_SOUNDSET'
},
OnChange = {
name = 'NAV_LEFT_RIGHT',
ref = 'HUD_FRONTEND_DEFAULT_SOUNDSET'
},
OnCheck = {
name = 'NAV_LEFT_RIGHT',
ref = 'HUD_FRONTEND_DEFAULT_SOUNDSET'
},
OnClick = {
name = 'SELECT',
ref = 'HUD_FRONTEND_DEFAULT_SOUNDSET',
},
Exit = {
name = 'BACK',
ref = 'HUD_FRONTEND_DEFAULT_SOUNDSET'
}
};

exports('SendNUIMessage', function(message)
Expand Down Expand Up @@ -48,7 +63,9 @@ for _, callback in next, {

import:Emit(callback, req);

PlaySoundFrontend(-1, AUDIOS[callback], 'HUD_FRONTEND_DEFAULT_SOUNDSET', true)
local audio = AUDIOS[callback];

PlaySoundFrontend(-1, audio.name, audio.ref, true)

resp('OK');
end);
Expand Down
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ game 'gta5'
lua54 'yes'

author 'ardelan869'
version 'refactor(nui/item): hid right arrow icons, when disabled'
version 'refactor(client/main): changed audios'
description 'FiveM native Rage Menu, made with React'

ui_page 'web/dist/index.html'
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/items/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function Badge({
name: BadgeName;
align?: 'left' | 'right';
}) {
const { selected } = useItem();
const { selected, disabled = false } = useItem();

if (!name) return null;

Expand All @@ -64,6 +64,7 @@ export default function Badge({
'w-5 h-5 object-contain',
align === 'left' ? 'mr-1' : 'ml-1',
selected && 'invert',
disabled && name !== 'shop_lock' && 'opacity-50',
className
)}
{...props}
Expand Down

0 comments on commit e0c60ea

Please sign in to comment.