-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fight For Style] Ajout d'un Show Room et la création de vetement sou…
…s forme d'item Added conversion in package.json and move file and add picture
- Loading branch information
Showing
33 changed files
with
27,311 additions
and
1,108 deletions.
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
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 |
---|---|---|
@@ -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
4,074
resources/[soz]/soz-core/data/showRoom/showroomList.csv
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.