This commit is contained in:
2025-08-13 23:52:44 +08:00
parent 672e987c70
commit 66acc50c49
14 changed files with 21201 additions and 4322 deletions

View File

@@ -50,7 +50,7 @@ export class MissionComp extends CCComp {
smc.vmdata.mission_data.mon_num--
console.log("[MissionComp] do_mon_dead",smc.vmdata.mission_data.mon_num)
if(smc.vmdata.mission_data.mon_num<=0) {
smc.setGameProperty("mission",smc.data.mission+1,true)
smc.addMission()
oops.message.dispatchEvent(GameEvent.FightEnd,{victory:true})
}
}

View File

@@ -31,22 +31,51 @@ export class MissionHomeComp extends CCComp {
home_active(){
this.uodate_data()
this.node.active=true
this.btn_func("","fight")
oops.message.dispatchEvent(GameEvent.UpdateHero, {})
}
uodate_data(){
smc.syncData()
}
btn_func(e:string,data:any){
let btns=this.node.getChildByName("btns")
let btn=btns.getChildByName(data)
let act=btn.getChildByName("act")
console.log("[MissionHomeComp]:btn_func",e,data)
if(act.active){
act.active=false
}else{
act.active=true
let btns=this.node.getChildByName("btns")
let shop =btns.getChildByName("shop")
let heros =btns.getChildByName("heros")
let fight =btns.getChildByName("fight")
let skill =btns.getChildByName("skill")
let set =btns.getChildByName("set")
shop.getChildByName("act").active=false
heros.getChildByName("act").active=false
fight.getChildByName("act").active=false
skill.getChildByName("act").active=false
set.getChildByName("act").active=false
this.node.getChildByName("shop").active=false
// this.node.getChildByName("heros").active=false
// this.node.getChildByName("fight").active=false
// this.node.getChildByName("skill").active=false
// this.node.getChildByName("set").active=false
switch(data){
case "shop":
this.node.getChildByName("shop").active=true
shop.getChildByName("act").active=true
break
case "heros":
heros.getChildByName("act").active=true
break
case "fight":
fight.getChildByName("act").active=true
break
case "skill":
skill.getChildByName("act").active=true
break
case "set":
set.getChildByName("act").active=true
break
default:
fight.getChildByName("act").active=true
break
}
}