feat: add gacha banner id (#45)

This commit is contained in:
Dang Hoang Phuc 2022-08-05 03:27:30 +07:00 committed by GitHub
parent 7577f0e273
commit 76a1273128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import fs from 'fs';
import {resolve} from 'path';
import Logger from './Logger';
const c = new Logger("Banner");
type Banner = {
@ -24,9 +25,15 @@ export default class Banners {
private static readConfig() {
let config: Banner[];
const defaultConfig: Banner[] = [
{
gachaId: 1001,
const defaultConfig: Banner[] = [];
// TODO: figure where is GachaBasicInfoConfigExcelTable. Temporary hardcode
const bannersID = [1001, 2001, 2002, 3001, 3002, 4001]
for (let i = 0; i < bannersID.length; i++) {
defaultConfig.push({
gachaId: bannersID[i],
detailWebview: "",
rateUpItems4: [
1001, 1103
@ -35,8 +42,8 @@ export default class Banners {
1102
],
costItemId: 101 // Star Rail Pass
} as Banner
];
} as Banner)
}
try {
config = JSON.parse(fs.readFileSync(r('../../banners.json')).toString());