This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-05 03:26:09 +08:00
parent ec4d6a15d7
commit 0014eff5e0
4034 changed files with 623229 additions and 41 deletions

View File

@@ -25,6 +25,7 @@ import { TableGRoleAttackEffect } from "../resources/config/ts/TableGRoleAttackE
import { TableGRoleSkill } from "../resources/config/ts/TableGRoleSkill";
import { TableGRoleSkillEffect } from "../resources/config/ts/TableGRoleSkillEffect";
import { TableGMap } from "../resources/config/ts/TableGMap";
import Loading from "../../extensions/ngame/assets/ngame/util/Loading";
let IP = "kyu.jisol.cn";
@@ -106,6 +107,8 @@ export abstract class JNGSyncProtoBase<T> extends JNSyncFrameProtoComponent<T>{
//读写config
export class JNGConfig extends SystemBase{
static loading = "JNGConfig";
//配置JSON加载
jsons:JsonLoad[] = [
{name:TableGRole.TableName}, //角色
@@ -124,25 +127,40 @@ export class JNGConfig extends SystemBase{
});
async onInit(): Promise<any> {
app.loading.setCurrent(JNGConfig.loading);
for (const key in this.jsons) {
const load = this.jsons[key];
await JsonUtil.load(load);
}
app.loading.ok(JNGConfig.loading);
}
}
//角色初始器
export class JLoaderRole extends JLoaderSystem{
//资源初始器
export class JLoaderBattle extends JLoaderSystem{
static loading = "JLoaderBattle";
static loadingInit = "JLoaderBattle_Init";
skData:{[id:number]:sp.SkeletonData} = {}; //角色Spine
bullets:{[id:number]:SpriteFrame} = {};
bullets:{[id:number]:SpriteFrame} = {}; //子弹
effects:{[id:number]:sp.SkeletonData} = {}; //Spine特效
maps:{[id:number]:SpriteFrame[]} = {}; //地图
async onInit(): Promise<any> {
app.loading.setCurrent(JLoaderBattle.loading);
await super.onInit();
app.loading.ok(JLoaderBattle.loading);
app.loading.setCurrent(JLoaderBattle.loadingInit);
//将配置表的角色都读取出来
for (const info of Object.values(TableGRole.getAllConfig())) {
this.skData[info.id] = await (new Promise(r => {
@@ -193,6 +211,8 @@ export class JLoaderRole extends JLoaderSystem{
})))
}
app.loading.ok(JLoaderBattle.loadingInit);
}
@@ -208,6 +228,11 @@ export const app = {
baseURL: `http://${IP}:8080`,
}), //请求
battle : GBattleModeManager.getIns(), //战斗
config : new JNGConfig(),
battleRes : new JLoaderRole("battle"), //battle包
config : new JNGConfig(), //配置文件
battleRes : new JLoaderBattle("battle"), //battle包
loading: new Loading({
[JNGConfig.loading]:{title:"加载配置文件"},
[JLoaderBattle.loading]:{title:"加载战斗资源"},
[JLoaderBattle.loadingInit]:{title:"初始化战斗资源"},
})
}