feat(config): 更新四象丹相关配置并优化 JSON 转 Lua 脚本
- 在 RecyclingSettingConfig.json 中更新 7 品证明回收设置,增加四象丹 - 在 StdItems.json 中为四象青龙丹、白虎丹、朱雀丹、玄武丹添加 itemlevel 字段 - 优化 json2lua.js 脚本,增加配置范围并改进 JSON 对象处理方式
This commit is contained in:
@@ -714,7 +714,7 @@
|
|||||||
"tips": "一键回收7品证明,需要绿卡会员",
|
"tips": "一键回收7品证明,需要绿卡会员",
|
||||||
"Titletips": "绿卡会员可开启该道具一键回收",
|
"Titletips": "绿卡会员可开启该道具一键回收",
|
||||||
"value": 0,
|
"value": 0,
|
||||||
"name": "7品证明",
|
"name": "7品证明和四象丹",
|
||||||
"showQuality": 2,
|
"showQuality": 2,
|
||||||
"optionid": 49,
|
"optionid": 49,
|
||||||
"itemlevel": 91,
|
"itemlevel": 91,
|
||||||
|
|||||||
@@ -47792,6 +47792,7 @@
|
|||||||
"name": "四象青龙丹",
|
"name": "四象青龙丹",
|
||||||
"dealPrice": 10,
|
"dealPrice": 10,
|
||||||
"dropBroadcast": 0,
|
"dropBroadcast": 0,
|
||||||
|
"itemlevel": 91,
|
||||||
"itemlvl": 3,
|
"itemlvl": 3,
|
||||||
"shape": 0,
|
"shape": 0,
|
||||||
"existScenes": [
|
"existScenes": [
|
||||||
@@ -47838,6 +47839,7 @@
|
|||||||
"name": "四象白虎丹",
|
"name": "四象白虎丹",
|
||||||
"dealPrice": 10,
|
"dealPrice": 10,
|
||||||
"dropBroadcast": 0,
|
"dropBroadcast": 0,
|
||||||
|
"itemlevel": 91,
|
||||||
"itemlvl": 3,
|
"itemlvl": 3,
|
||||||
"shape": 0,
|
"shape": 0,
|
||||||
"existScenes": [
|
"existScenes": [
|
||||||
@@ -47885,6 +47887,7 @@
|
|||||||
"name": "四象朱雀丹",
|
"name": "四象朱雀丹",
|
||||||
"dealPrice": 10,
|
"dealPrice": 10,
|
||||||
"dropBroadcast": 0,
|
"dropBroadcast": 0,
|
||||||
|
"itemlevel": 91,
|
||||||
"itemlvl": 3,
|
"itemlvl": 3,
|
||||||
"shape": 0,
|
"shape": 0,
|
||||||
"existScenes": [
|
"existScenes": [
|
||||||
@@ -47932,6 +47935,7 @@
|
|||||||
"name": "四象玄武丹",
|
"name": "四象玄武丹",
|
||||||
"dealPrice": 10,
|
"dealPrice": 10,
|
||||||
"dropBroadcast": 0,
|
"dropBroadcast": 0,
|
||||||
|
"itemlevel": 91,
|
||||||
"itemlvl": 3,
|
"itemlvl": 3,
|
||||||
"shape": 0,
|
"shape": 0,
|
||||||
"existScenes": [
|
"existScenes": [
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ const { log } = require('console');
|
|||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const folderPath = "./configs"
|
const folderPath = "./configs"
|
||||||
|
const scope = ["StdItems", "ItemMergeConfig", "MergeConfig", "MergeTotal", "RecyclingSettingConfig", "UpstarConfig", "Monster"]
|
||||||
function jsonToLua(jsonObj, indent = '', linefeed = '\n') {
|
function jsonToLua(jsonObj, indent = '', linefeed = '\n') {
|
||||||
let luaStr = '';
|
let luaStr = '';
|
||||||
const strKey = key => isNaN(key) ? `${key}` : `[${key}]`;
|
const strKey = key => isNaN(key) ? `${key}` : `[${key}]`;
|
||||||
for (let key in jsonObj) {
|
Object.keys(jsonObj).sort().forEach(key => {
|
||||||
let value = jsonObj[key];
|
let value = jsonObj[key];
|
||||||
key = strKey(key)
|
key = strKey(key)
|
||||||
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
||||||
@@ -35,14 +36,14 @@ function jsonToLua(jsonObj, indent = '', linefeed = '\n') {
|
|||||||
luaStr += `${indent}${key} = ${value},${linefeed}`;
|
luaStr += `${indent}${key} = ${value},${linefeed}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
return luaStr;
|
return luaStr;
|
||||||
}
|
}
|
||||||
const start = () => {
|
const start = () => {
|
||||||
const files = fs.readdirSync(folderPath);
|
const files = fs.readdirSync(folderPath);
|
||||||
|
|
||||||
// 过滤出所有的 JSON 文件
|
// 过滤出所有的 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 => {
|
jsonFiles.forEach(file => {
|
||||||
const json = JSON.parse(fs.readFileSync(path.join(folderPath, file), 'utf8'))
|
const json = JSON.parse(fs.readFileSync(path.join(folderPath, file), 'utf8'))
|
||||||
const filename = path.basename(file, path.extname(file));
|
const filename = path.basename(file, path.extname(file));
|
||||||
|
|||||||
Reference in New Issue
Block a user