后台:修复部分遗漏

This commit is contained in:
luying
2021-05-12 20:07:47 +08:00
parent 148a11edab
commit 388d82991f
10 changed files with 65 additions and 57 deletions

View File

@@ -81,6 +81,7 @@ import { dicGacha, loadGacha } from "./dictionary/DicGacha";
import { dicGachaContent, dicGachaContentHero, loadGachaContent } from "./dictionary/DicGachaContent";
import { dicGiftPackage, loadGiftPackage } from "./dictionary/DicGiftPackage";
import { dicRecruit, loadRecruit } from './dictionary/DicRecruit';
import { loadRMB } from './dictionary/DicRMB';
export const gameData = {
blurprtCompose: dicBlueprtCompose,
@@ -756,34 +757,37 @@ function loadDatas() {
loadGachaContent();
loadGiftPackage();
loadRecruit();
loadRMB();
}
// 重载dicParam
export function reloadDicParam() {
let file = readTsFile('dicParam');
let lines = file.split('\n');
let outer = '';
lines.forEach(line => {
if(line.replace(/ /g, '')) {
if(line.indexOf('export') != -1) {
outer = line.split(' ')[2];
// console.log(outer)
}
if(line.indexOf('export') == -1 && line.indexOf('}') == -1) {
let s = line.split(', //')[0].split(':');
let key = s[0].replace(/ /g, '');
let value = s[1].replace(/ /g, '');
let isString = value.match(/(?<=')[^']*/);
if(isString) {
param[outer][key] = isString[0];
} else {
param[outer][key] = parseFloat(value);
if(file) {
let lines = file.split('\n');
let outer = '';
lines.forEach(line => {
if(line.replace(/ /g, '')) {
if(line.indexOf('export') != -1) {
outer = line.split(' ')[2];
// console.log(outer)
}
if(line.indexOf('export') == -1 && line.indexOf('}') == -1) {
let s = line.split(', //')[0].split(':');
let key = s[0].replace(/ /g, '');
let value = s[1].replace(/ /g, '');
let isString = value.match(/(?<=')[^']*/);
if(isString) {
param[outer][key] = isString[0];
} else {
param[outer][key] = parseFloat(value);
}
}
}
}
});
parseDicParam();
});
parseDicParam();
}
}
// 后台调用重载资源