引导完善+ 说小贴士

This commit is contained in:
2025-08-25 23:42:31 +08:00
parent 6c95b3acc3
commit c3b9977b0c
11 changed files with 3973 additions and 2902 deletions

View File

@@ -189,7 +189,7 @@ export class GuideSetpComp extends CCComp {
/** 显示组件 */
private show() {
this.node.active = true;
if (this.tipNode) {
if (this.tipLabel.string!="") {
this.tipNode.active = true;
}
if (this.handNode) {

View File

@@ -15,12 +15,26 @@ export class HeroReadyCom extends Component {
protected onLoad(): void {
oops.message.on(GameEvent.UpdateHero,this.update_hero,this)
oops.message.on(GameEvent.UpdateFightHero,this.update_hero,this)
oops.message.on(GameEvent.HeroSpeek,this.to_speek,this)
}
start() {
this.hide_speek()
this.update_hero()
}
hide_speek(){
this.node.getChildByName("tooltip").active=false
}
to_speek(e:any,args:any){
console.log("[HeroReadyCom]:to_speek",args,this.slot)
if(args.slot!=this.slot) return
if(smc.fight_heros[this.slot]==0) return
this.node.getChildByName("tooltip").active=true
this.node.getChildByName("tooltip").getChildByName("words").getComponent(Label)!.string = args.words
this.scheduleOnce(()=>{
this.hide_speek()
},3)
}
update(deltaTime: number) {
}
@@ -45,6 +59,7 @@ export class HeroReadyCom extends Component {
// console.log("[HeroReadyCom]clip",this.node.getChildByName("icon").getComponent(Animation))
}
no_hero(){
this.node.getChildByName("lv").active=false
this.node.getChildByName("add").active=true

View File

@@ -6,6 +6,8 @@ import { smc } from "../common/SingletonModuleComp";
import { GameEvent } from "../common/config/GameEvent";
import { HeroPageComp } from "./HeroPageComp";
import { finishCurrGuide, GuideConfig, startGuide } from "../common/config/Guide";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
import { randomSpeek, Speeks } from "../common/config/Tasks";
const { ccclass, property } = _decorator;
@@ -13,7 +15,8 @@ const { ccclass, property } = _decorator;
@ccclass('MissionHomeComp')
@ecs.register('MissionHome', false)
export class MissionHomeComp extends CCComp {
speek_time:number=0
speek_cd:Timer=new Timer(10)
protected onLoad(): void {
this.on(GameEvent.MissionEnd,this.mission_end,this)
}
@@ -26,7 +29,14 @@ export class MissionHomeComp extends CCComp {
startGuide(1)
startGuide(2)
}
update(dt:number){
if(this.speek_cd.update(dt)){
let speek=randomSpeek()
let slot=Math.floor(Math.random()*2)
oops.message.dispatchEvent(GameEvent.HeroSpeek,{words:speek[0],slot:slot})
console.log("[MissionHomeComp]:speek",speek,slot)
}
}
/** 启动下一个引导 */
private startNextGuide() {
// 检查是否还有未完成的引导