diff --git a/configs/RecyclingSettingConfig.json b/configs/RecyclingSettingConfig.json index 4099a48..8e8bbe5 100644 --- a/configs/RecyclingSettingConfig.json +++ b/configs/RecyclingSettingConfig.json @@ -714,7 +714,7 @@ "tips": "一键回收7品证明,需要绿卡会员", "Titletips": "绿卡会员可开启该道具一键回收", "value": 0, - "name": "7品证明", + "name": "7品证明和四象丹", "showQuality": 2, "optionid": 49, "itemlevel": 91, diff --git a/configs/StdItems.json b/configs/StdItems.json index 295a0e1..48bf50b 100644 --- a/configs/StdItems.json +++ b/configs/StdItems.json @@ -47792,6 +47792,7 @@ "name": "四象青龙丹", "dealPrice": 10, "dropBroadcast": 0, + "itemlevel": 91, "itemlvl": 3, "shape": 0, "existScenes": [ @@ -47838,6 +47839,7 @@ "name": "四象白虎丹", "dealPrice": 10, "dropBroadcast": 0, + "itemlevel": 91, "itemlvl": 3, "shape": 0, "existScenes": [ @@ -47885,6 +47887,7 @@ "name": "四象朱雀丹", "dealPrice": 10, "dropBroadcast": 0, + "itemlevel": 91, "itemlvl": 3, "shape": 0, "existScenes": [ @@ -47932,6 +47935,7 @@ "name": "四象玄武丹", "dealPrice": 10, "dropBroadcast": 0, + "itemlevel": 91, "itemlvl": 3, "shape": 0, "existScenes": [ diff --git a/json2lua.js b/json2lua.js index d7b46dc..f18fa0f 100644 --- a/json2lua.js +++ b/json2lua.js @@ -2,10 +2,11 @@ const { log } = require('console'); const fs = require('fs') const path = require('path'); const folderPath = "./configs" +const scope = ["StdItems", "ItemMergeConfig", "MergeConfig", "MergeTotal", "RecyclingSettingConfig", "UpstarConfig", "Monster"] function jsonToLua(jsonObj, indent = '', linefeed = '\n') { let luaStr = ''; const strKey = key => isNaN(key) ? `${key}` : `[${key}]`; - for (let key in jsonObj) { + Object.keys(jsonObj).sort().forEach(key => { let value = jsonObj[key]; key = strKey(key) if (typeof value === 'object' && value !== null && !Array.isArray(value)) { @@ -35,14 +36,14 @@ function jsonToLua(jsonObj, indent = '', linefeed = '\n') { luaStr += `${indent}${key} = ${value},${linefeed}`; } } - } + }) return luaStr; } const start = () => { const files = fs.readdirSync(folderPath); // 过滤出所有的 JSON 文件 - const jsonFiles = files.filter(file => path.extname(file) === '.json').filter(file => ["StdItems","ItemMergeConfig","MergeConfig","MergeTotal","RecyclingSettingConfig","UpstarConfig"].map(e => `${e}.json`).includes(file)); + const jsonFiles = files.filter(file => path.extname(file) === '.json').filter(file => scope.map(e => `${e}.json`).includes(file)); jsonFiles.forEach(file => { const json = JSON.parse(fs.readFileSync(path.join(folderPath, file), 'utf8')) const filename = path.basename(file, path.extname(file));