Skip to content

Commit

Permalink
Another improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamXZE committed Mar 26, 2023
1 parent 48321b7 commit fbb4513
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,18 @@ export const FightForStyleShowRoomMenu: FunctionComponent<FightForStyleShowRoomC
setCurrentDrawable(0);
});

const resetUnderShirt = async () => {
const componentIndex = FfsComponent.Undershirt.toString();
const component = state.clothConfig.Components[componentIndex];
component.Drawable = 0;
component.Texture = 25;

return await fetchNui(NuiEvent.FfsShowRoomChangeComponent, {
componentIndex,
component,
});
};

const onComponentChange = async (
componentIndex: FfsComponent | string,
key: 'drawable' | 'texture',
Expand Down Expand Up @@ -150,7 +162,7 @@ export const FightForStyleShowRoomMenu: FunctionComponent<FightForStyleShowRoomC
break;
}

await fetchNui(NuiEvent.FfsShowRoomChangeComponent, {
return await fetchNui(NuiEvent.FfsShowRoomChangeComponent, {
componentIndex,
component,
});
Expand Down Expand Up @@ -178,7 +190,7 @@ export const FightForStyleShowRoomMenu: FunctionComponent<FightForStyleShowRoomC
break;
}

await fetchNui(NuiEvent.FfsShowRoomChangeProp, {
return await fetchNui(NuiEvent.FfsShowRoomChangeProp, {
propIndex,
prop,
});
Expand Down Expand Up @@ -336,8 +348,8 @@ export const FightForStyleShowRoomMenu: FunctionComponent<FightForStyleShowRoomC
{parseInt(componentIndex) == FfsComponent.Undershirt ? (
<MenuItemButton
onConfirm={async () => {
await onComponentChange(componentIndex, 'drawable', 0);
await onComponentChange(componentIndex, 'texture', 25);
await resetUnderShirt();
navigate(-1);
}}
>{`Retirer l'Undershirt`}</MenuItemButton>
) : (
Expand Down

0 comments on commit fbb4513

Please sign in to comment.