Skip to content

Commit

Permalink
Ajout modif sourcils coiffeurs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kedrihan committed Oct 20, 2023
1 parent d8db879 commit a0f6754
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 8 deletions.
15 changes: 8 additions & 7 deletions resources/[soz]/soz-core/src/client/shop/barber.shop.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,13 @@ export class BarberShopProvider {

this.barberShopContent[PlayerPedHash.Male][0].items = this.barberShopLabels.HairMale;
this.barberShopContent[PlayerPedHash.Male][1].items = this.barberShopLabels.BeardMale;
this.barberShopContent[PlayerPedHash.Male][2].items = this.barberShopLabels.Makeup;
this.barberShopContent[PlayerPedHash.Male][2].items = this.barberShopLabels.Eyebrow;
this.barberShopContent[PlayerPedHash.Male][3].items = this.barberShopLabels.Makeup;
this.barberShopContent[PlayerPedHash.Female][0].items = this.barberShopLabels.HairFemale;
this.barberShopContent[PlayerPedHash.Female][1].items = this.barberShopLabels.Blush;
this.barberShopContent[PlayerPedHash.Female][2].items = this.barberShopLabels.Lipstick;
this.barberShopContent[PlayerPedHash.Female][3].items = this.barberShopLabels.Makeup;
this.barberShopContent[PlayerPedHash.Female][1].items = this.barberShopLabels.Eyebrow;
this.barberShopContent[PlayerPedHash.Female][2].items = this.barberShopLabels.Blush;
this.barberShopContent[PlayerPedHash.Female][3].items = this.barberShopLabels.Lipstick;
this.barberShopContent[PlayerPedHash.Female][4].items = this.barberShopLabels.Makeup;
}

public async openShop() {
Expand All @@ -85,7 +87,6 @@ export class BarberShopProvider {
const player_data = this.playerService.getPlayer();

this.setupShop();

this.nuiMenu.openMenu(MenuType.BarberShop, {
shop_content,
shop_colors,
Expand Down Expand Up @@ -119,7 +120,7 @@ export class BarberShopProvider {
price: price,
overlay: overlay,
} as BarberShopItem,
ShopBrand.Barber
ShopBrand.Barber,
);
}

Expand All @@ -136,7 +137,7 @@ export class BarberShopProvider {
y + PositionInBarberShop.CAMERA_OFFSET_Y,
z + PositionInBarberShop.CAMERA_OFFSET_Z,
] as Vector3,
[x, y, z + PositionInBarberShop.CAMERA_TARGET_Z] as Vector3
[x, y, z + PositionInBarberShop.CAMERA_TARGET_Z] as Vector3,
);

// Play idle animation
Expand Down
16 changes: 16 additions & 0 deletions resources/[soz]/soz-core/src/config/barber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export const BarberShopItems: BarberShopContent = {
components: { ['BeardType']: true, ['BeardColor']: true, ['BeardOpacity']: true },
items: undefined,
},
{
price: 15,
category: 'Eyebrow',
label: 'Sourcils',
overlay: 'Hair',
components: { ['EyebrowType']: true, ['EyebrowColor']: true, ['EyebrowOpacity']: true },
items: undefined,
},
{
price: 20,
category: 'Makeup',
Expand All @@ -51,6 +59,14 @@ export const BarberShopItems: BarberShopContent = {
components: { ['HairType']: true, ['HairColor']: true, ['HairSecondaryColor']: true },
items: undefined,
},
{
price: 15,
category: 'Eyebrow',
label: 'Sourcils',
overlay: 'Hair',
components: { ['EyebrowType']: true, ['EyebrowColor']: true, ['EyebrowOpacity']: true },
items: undefined,
},
{
price: 15,
category: 'Blush',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ export const BarberShopMenu: FunctionComponent<MenuBarberShopStateProps> = ({ da
cat={content.find(cat => cat.category === 'Beard')}
config={configuration['Beard']}
/>
<MenuBarberEyebrowComponent
cat={content.find(cat => cat.category === 'Eyebrow')}
player_data={data.player_data}
shop_colors={data.shop_colors}
updateConfiguration={updateConfiguration}
/>
<MenuBarberValidateButton
cat={content.find(cat => cat.category === 'Eyebrow')}
config={configuration['Eyebrow']}
/>
<MenuBarberMakeupComponent
cat={content.find(cat => cat.category === 'Makeup')}
player_data={data.player_data}
Expand Down Expand Up @@ -246,7 +256,65 @@ const MenuBarberBeardComponent: FunctionComponent<{
</>
);
};

const MenuBarberEyebrowComponent: FunctionComponent<{
cat: BarberShopCategory;
player_data: PlayerData;
shop_colors: BarberShopColors;
updateConfiguration: (cat: string, overlay: string, field: string, v: any) => void;
}> = ({ cat, player_data, shop_colors, updateConfiguration }) => {
if (!cat) {
return null;
}
return (
<>
<MenuTitle>{cat.label}</MenuTitle>
<MenuItemSelect
title="Type"
onChange={async (_, type) => {
updateConfiguration(cat.category, cat.overlay, 'EyebrowType', type);
}}
value={player_data.skin.Hair.EyebrowType}
>
{cat.items.map(entry => (
<MenuItemSelectOption key={entry.value} value={entry.value}>
{entry.label}
</MenuItemSelectOption>
))}
</MenuItemSelect>
<MenuItemSelect
title="Densité"
onChange={async (_, density) => {
updateConfiguration(cat.category, cat.overlay, 'EyebrowOpacity', density / 100);
}}
value={player_data.skin.Hair.EyebrowOpacity * 100}
>
{[...Array(20)]
.map((_, i) => i * 5)
.map(entry => (
<MenuItemSelectOption key={entry} value={entry}>
{entry}
</MenuItemSelectOption>
))}
</MenuItemSelect>
<MenuItemSelect
title="Couleur"
distance={3}
onChange={async (_, color) => {
updateConfiguration(cat.category, cat.overlay, 'EyebrowColor', color);
}}
value={player_data.skin.Hair.EyebrowColor}
>
{shop_colors.Hair.map(entry => (
<MenuItemSelectOptionColor
key={entry.value}
value={entry.value}
color={[entry.r, entry.g, entry.b]}
></MenuItemSelectOptionColor>
))}
</MenuItemSelect>
</>
);
};
const MenuBarberMakeupComponent: FunctionComponent<{
cat: BarberShopCategory;
player_data: PlayerData;
Expand Down
3 changes: 3 additions & 0 deletions resources/[soz]/soz-core/src/shared/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ export type Skin = {
BeardType?: number;
BeardOpacity?: number;
BeardColor?: number;
EyebrowType?: number;
EyebrowOpacity?: number;
EyebrowColor?: number;
};
Makeup: {
BeardType?: number;
Expand Down
2 changes: 2 additions & 0 deletions resources/[soz]/soz-core/src/shared/shop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ export type BarberConfiguration = {
HairSecondaryColor?: number;
BeardType?: number;
BeardColor?: number;
EyebrowType?: number;
EyebrowColor?: number;
};
Makeup: {
FullMakeupType?: number;
Expand Down

0 comments on commit a0f6754

Please sign in to comment.