继续整理UI
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
export const EVENT_TYPES = {
|
||||
NOT_UPDATE_MISTAKE: "NOT_UPDATE_MISTAKE",//更新分数
|
||||
NOT_UPDATE_PAUSE: "NOT_UPDATE_PAUSE",//更新暂停状态
|
||||
|
||||
NOT_SET_TROPHY_BUTTON: "NOT_SET_TROPHY_BUTTON",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ export class TopBar extends Laya.Script {
|
||||
}
|
||||
|
||||
onClickTab(isClassic: boolean): void {
|
||||
this.isClassic = true
|
||||
this.isClassic = isClassic
|
||||
if (isClassic) {
|
||||
UIManager.getInstance().closeTrophyUI()
|
||||
UIManager.getInstance().closeDCUI()
|
||||
|
||||
@@ -5,6 +5,7 @@ import { CalendarUnit } from "./CalendarUnit";
|
||||
import { UIManager } from "../../models/UIManager";
|
||||
import { respath } from "../../constants/respath";
|
||||
import { MONTH_LIST } from "../../models/DCManager";
|
||||
import { EVENT_TYPES, EventManager } from "../../models/EventManager";
|
||||
|
||||
|
||||
const { regClass, property } = Laya;
|
||||
@@ -59,7 +60,10 @@ export class DailyChallenge extends Laya.Script {
|
||||
private currentIndex: number
|
||||
private indexMax: number
|
||||
|
||||
private static _instance: DailyChallenge
|
||||
onAwake(): void {
|
||||
DailyChallenge._instance = this
|
||||
|
||||
if (this.btn_back) {
|
||||
this.btn_back.on(Laya.Event.CLICK, this, ()=>{
|
||||
UIManager.getInstance().loadHomeUI()
|
||||
@@ -126,6 +130,18 @@ export class DailyChallenge extends Laya.Script {
|
||||
this.loadWithIndex(this.currentIndex)
|
||||
}
|
||||
})
|
||||
|
||||
EventManager.getInstance().RegisterEvent(EVENT_TYPES.NOT_SET_TROPHY_BUTTON, DailyChallenge.EventUpdateTrophyButton)
|
||||
}
|
||||
|
||||
onDestroy(): void {
|
||||
EventManager.getInstance().UnregisterEvent(EVENT_TYPES.NOT_SET_TROPHY_BUTTON, DailyChallenge.EventUpdateTrophyButton)
|
||||
}
|
||||
|
||||
public static EventUpdateTrophyButton(arg: any): void {
|
||||
if (DailyChallenge._instance) {
|
||||
DailyChallenge._instance.btn_trophy.visible = arg
|
||||
}
|
||||
}
|
||||
|
||||
loadWithMonth(): void {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { config } from "../../constants/config";
|
||||
import { respath } from "../../constants/respath";
|
||||
import { MONTH_LIST } from "../../models/DCManager";
|
||||
import { EVENT_TYPES, EventManager } from "../../models/EventManager";
|
||||
import { UIManager } from "../../models/UIManager";
|
||||
import { TrophyUnit } from "./TrophyUnit";
|
||||
|
||||
@@ -105,6 +106,11 @@ export class TrophyRoom extends Laya.Script {
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
EventManager.getInstance().DispatchEvent(EVENT_TYPES.NOT_SET_TROPHY_BUTTON, false)
|
||||
}
|
||||
|
||||
onDestroy(): void {
|
||||
EventManager.getInstance().DispatchEvent(EVENT_TYPES.NOT_SET_TROPHY_BUTTON, true)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user