feat(界面): 添加排行榜界面的打开与关闭功能

- 在 MissionHomeComp 中添加 openRanks 方法以打开排行榜界面
- 在 RanksComp 中添加 closeRanks 方法以关闭排行榜界面
- 调整 ranks.prefab 布局并添加关闭按钮的事件绑定
- 移除 MissionHomeComp 中未使用的页面节点引用和废弃代码
This commit is contained in:
panw
2026-04-02 11:15:12 +08:00
parent 85d9e7c55a
commit 0f602e7e45
5 changed files with 5301 additions and 1637 deletions

View File

@@ -6,6 +6,7 @@ import { smc } from "../common/SingletonModuleComp";
import { GameEvent } from "../common/config/GameEvent";
import { Timer } from "db://oops-framework/core/common/timer/Timer";
import { mLogger } from "../common/Logger";
import { UIID } from "../common/config/GameUIConfig";
const { ccclass, property } = _decorator;
@@ -15,10 +16,6 @@ const { ccclass, property } = _decorator;
export class MissionHomeComp extends CCComp {
debugMode: boolean = false;
@property(Node)
heros_page=null!
@property(Node)
rank_page=null!
@property(Node)
home_btn=null!
@@ -42,11 +39,13 @@ export class MissionHomeComp extends CCComp {
}
start_mission() {
mLogger.log(this.debugMode, 'MissionHomeComp', "start_mission")
oops.message.dispatchEvent(GameEvent.MissionStart, {})
this.node.active=false;
mLogger.log(this.debugMode, 'MissionHomeComp', "start_mission")
oops.message.dispatchEvent(GameEvent.MissionStart, {})
this.node.active=false;
}
openRanks(){
oops.gui.open(UIID.Ranks)
}
mission_end(){
mLogger.log(this.debugMode, 'MissionHomeComp', "[MissionHomeComp]=>mission_end")
this.home_active()
@@ -55,7 +54,6 @@ export class MissionHomeComp extends CCComp {
home_active(){
this.uodate_data()
this.node.active=true
// this.switch_tab('home')
}
uodate_data(){
@@ -63,25 +61,7 @@ export class MissionHomeComp extends CCComp {
isWxClient(){
return typeof wx !== 'undefined' && typeof (wx as any).getSystemInfoSync === 'function';
}
// btn_func(e: any, data: string){
// if (['home', 'hero', 'rank'].includes(data)) {
// this.switch_tab(data);
// }
// }
// switch_tab(tab: string) {
// if (this.heros_page) this.heros_page.active = tab === 'hero';
// if (this.rank_page) this.rank_page.active = tab === 'rank';
// const setBtnActive = (btn: Node, isActive: boolean) => {
// const activeNode = btn?.getChildByName('active');
// if (activeNode) activeNode.active = isActive;
// }
// setBtnActive(this.home_btn, tab === 'home');
// setBtnActive(this.hero_btn, tab === 'hero');
// setBtnActive(this.rank_btn, tab === 'rank');
// }
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */

View File

@@ -36,7 +36,9 @@ export class RanksComp extends CCComp {
onDestroy() {
}
closeRanks(){
oops.gui.remove(UIID.Ranks)
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {