ui继续
This commit is contained in:
@@ -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})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user