Skip to content

Commit

Permalink
[Fight For Style] Ajout d'un Show Room et la création de vetement sou…
Browse files Browse the repository at this point in the history
…s forme d'item

Added conversion in package.json and move file and add picture
  • Loading branch information
DreamXZE committed Sep 29, 2023
1 parent 3f22046 commit ddc08cd
Show file tree
Hide file tree
Showing 33 changed files with 27,311 additions and 1,108 deletions.
30 changes: 28 additions & 2 deletions resources/[qb]/qb-core/shared/items.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3193,8 +3193,8 @@ QBShared.Items = {
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['description'] = 'Pour rester au sec sous la drache',
['illustrator'] = '.Sniteur'
['itemExtraLabel'] = '[Homme]',
['description'] = 'Tenue réalisée spécialement pour: '
},
['protestsign'] = {
['name'] = 'protestsign',
Expand All @@ -3208,6 +3208,32 @@ QBShared.Items = {
['description'] = 'Pas content ! Pas content !',
['illustrator'] = '.Poulpito'
},
['ffs_crafted_outfit_m'] = {
['name'] = 'ffs_crafted_outfit_m',
['label'] = 'Tenue Sur-mesure',
['weight'] = 1000,
['type'] = 'item',
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['itemExtraLabel'] = '[Homme]',
['description'] = 'Tenue réalisée spécialement pour: ',
['illustrator'] = '.Crash'
},
['ffs_crafted_outfit_f'] = {
['name'] = 'ffs_crafted_outfit_f',
['label'] = 'Tenue Sur-mesure',
['weight'] = 1000,
['type'] = 'item',
['unique'] = false,
['useable'] = true,
['shouldClose'] = true,
['combinable'] = nil,
['itemExtraLabel'] = '[Femme]',
['description'] = 'Tenue réalisée spécialement pour: ',
['illustrator'] = '.Crash'
},
-- Vehicle Tools
['repairkit'] = {
['name'] = 'repairkit',
Expand Down
58 changes: 58 additions & 0 deletions resources/[soz]/soz-core/data/showRoom/conversion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Executed with `yarn build-showroom`
const csvtojson = require('csvtojson');
const fs = require('fs');

async function run() {
const showRoomListJSON = await csvtojson().fromFile('./data/showRoom/showroomList.csv');

const ShowRoomFreeElement = {
mp_m_freemode_01: {
Components: {},
Props: {},
},
mp_f_freemode_01: {
Components: {},
Props: {},
},
};

const showRoomClothesList = {
mp_m_freemode_01: {
Components: {},
Props: {},
},
mp_f_freemode_01: {
Components: {},
Props: {},
},
};

for (const cloth of showRoomListJSON) {
const clothDrawable = parseInt(cloth.Drawable);
showRoomClothesList[cloth.Model][cloth.Type][cloth.Index] ||= {};
ShowRoomFreeElement[cloth.Model][cloth.Type][cloth.Index] ||= [];
if (cloth['UseDrawable'] == 'TRUE') {
const clothConfig = [];
for (let i = 0; i <= 25; i++) {
if (cloth['Texture' + i] == 'TRUE') clothConfig.push(i);
}
showRoomClothesList[cloth.Model][cloth.Type][cloth.Index][clothDrawable] = clothConfig;
}
if (cloth['Free'] == 'TRUE') ShowRoomFreeElement[cloth.Model][cloth.Type][cloth.Index].push(clothDrawable);
}

let string = `export const ShowRoomFreeElement = ${JSON.stringify(
ShowRoomFreeElement,
(k, v) => (Array.isArray(v) ? JSON.stringify(v) : v),
4
).replace(/"\[[^"\]]*]"/g, r => JSON.stringify(JSON.parse(r)).substr(1).slice(0, -1))};\n\n`;
string += `export const ffsClothConfig = ${JSON.stringify(
showRoomClothesList,
(k, v) => (Array.isArray(v) ? JSON.stringify(v) : v),
4
).replace(/"\[[^"\]]*]"/g, r => JSON.stringify(JSON.parse(r)).substr(1).slice(0, -1))};\n\n`;

fs.writeFileSync('./src/shared/showRoom/ffsClothConfig.ts', string);
}

run();
4,074 changes: 4,074 additions & 0 deletions resources/[soz]/soz-core/data/showRoom/showroomList.csv

Large diffs are not rendered by default.

Loading

0 comments on commit ddc08cd

Please sign in to comment.