界面调整 去掉技能大页面

This commit is contained in:
2024-12-18 15:58:44 +08:00
parent e7f5b44b1e
commit 25b8e384e7
16 changed files with 11112 additions and 7725 deletions

View File

@@ -4,6 +4,8 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { UIID } from "../common/config/GameUIConfig";
import { Items } from "../common/config/Items";
import { SkillSet } from "../common/config/SkillSet";
import { HeroInfo, HeroSet } from "../common/config/heroSet";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@@ -11,33 +13,63 @@ const { ccclass, property } = _decorator;
@ecs.register('ItemInfo', false)
export class ItemInfoComp extends CCComp {
onAdded(args: any) {
this.node.getChildByName("name").getComponent(Label).string=args.name
this.node.getChildByName("info").getComponent(Label).string=args.info
let url = "gui/items";
let pathName= args.path;
this.node.getChildByName("lv1").active = false;
this.node.getChildByName("lv2").active = false;
this.node.getChildByName("lv3").active = false;
this.node.getChildByName("lv4").active = false;
this.node.getChildByName("item").active = false;
this.node.getChildByName("skill").active = false;
this.node.getChildByName("hero").active = false;
if(args.type==0){
this.node.getChildByName("item").active = true;
this.node.getChildByName("name").getComponent(Label).string=Items[args.uuid].name
this.node.getChildByName("info").getComponent(Label).string=Items[args.uuid].info
let url = "gui/items";
let pathName= Items[args.uuid].path;
this.node.getChildByName("item").getChildByName("lv1").active = false;
this.node.getChildByName("item").getChildByName("lv2").active = false;
this.node.getChildByName("item").getChildByName("lv3").active = false;
this.node.getChildByName("item").getChildByName("lv4").active = false;
switch(Items[args.uuid].lv){
case 1:
this.node.getChildByName("lv1").active = true;
break;
case 2:
this.node.getChildByName("lv2").active = true;
break;
case 3:
this.node.getChildByName("lv3").active = true;
break;
case 4:
this.node.getChildByName("lv4").active = true;
break;
switch(Items[args.uuid].lv){
case 1:
this.node.getChildByName("item").getChildByName("lv1").active = true;
break;
case 2:
this.node.getChildByName("item").getChildByName("lv2").active = true;
break;
case 3:
this.node.getChildByName("item").getChildByName("lv3").active = true;
break;
case 4:
this.node.getChildByName("item").getChildByName("lv4").active = true;
break;
}
resources.load(url, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("item").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
});
}
resources.load(url, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
});
if(args.type==1){ //技能碎片
this.node.getChildByName("skill").active = true;
this.node.getChildByName("name").getComponent(Label).string=SkillSet[args.uuid].name+" 碎片"
this.node.getChildByName("info").getComponent(Label).string="「"+SkillSet[args.uuid].name+"」碎片,用于技能升星"
var icon_path = "game/skills/skill_icon"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("skill").getChildByName("skill").getChildByName("icon").getComponent(Sprite);
// console.log("update_data",atlas,sprite)
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[args.uuid].path);
});
}
if(args.type==2){ //英雄碎片
this.node.getChildByName("hero").active = true
this.node.getChildByName("name").getComponent(Label).string=HeroInfo[args.uuid].name+" 碎片"
this.node.getChildByName("info").getComponent(Label).string="「"+HeroInfo[args.uuid].name+"」碎片,用于英雄升星"
var icon_path = "game/heros/herois"
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
const sprite = this.node.getChildByName("hero").getChildByName("hero").getChildByName("icon").getComponent(Sprite);
sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[args.uuid].path);
});
}
}
private onTouchEnd(event: EventTouch) {