英雄页面基本完成,todo 完善 数据显示

This commit is contained in:
2024-12-05 16:51:06 +08:00
parent f79ee64c23
commit a554c3dc0a
6 changed files with 1473 additions and 859 deletions

View File

@@ -4,19 +4,24 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { HeroList } from "../common/config/heroSet";
import { HeroCard } from "../hero/HeroCard";
import { smc } from "../common/SingletonModuleComp";
import { UIID } from "../common/config/GameUIConfig";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { Items } from "../common/config/Items";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('HeroHomeComp')
@ecs.register('HeroHome', false)
export class HeroHomeComp extends CCComp {
h_uuid:number=0
protected onLoad(): void {
}
start() {
// this.load_talents()
console.log("hero_home start")
this.h_uuid=9001
this.hero_show(this.h_uuid)
this.loads()
}
loads(){
@@ -33,6 +38,7 @@ export class HeroHomeComp extends CCComp {
}
hero_show(uuid:number) {
console.log("hero_home hero_show:",uuid)
this.h_uuid=uuid
var icon_path = "game/heros/herois"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("hero").getChildByName("icon").getComponent(Sprite);
@@ -40,7 +46,15 @@ export class HeroHomeComp extends CCComp {
});
this.node.getChildByName("name").getChildByName("value").getComponent(Label).string=smc.heros[uuid].name
}
lv_up(){
console.log("lvup h_uuid:",this.h_uuid)
}
slv_up(){
console.log("lvup slv_up:",this.h_uuid)
}
item_show(e:any,val:any){
oops.gui.open(UIID.ItemInfo, Items[val]);
}
reset() {
this.node.destroy();
}