|
@@ -9,6 +9,7 @@ import { config } from '../../config';
|
|
|
import { userDataManager } from '../../manager/userDataManager';
|
|
|
import { user_results } from '../../data';
|
|
|
import { GameManager } from '../../GameManager';
|
|
|
+import { home_modules } from './home_modules';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('home')
|
|
@@ -16,6 +17,7 @@ export class home extends Component {
|
|
|
@property(Node) home_car:Node = null
|
|
|
@property(Node) top:Node = null
|
|
|
@property(Node) bottom:Node = null
|
|
|
+ @property(Node) modules:Node = null
|
|
|
@property(Node) btn_start_game:Node = null
|
|
|
|
|
|
protected start(): void {
|
|
@@ -27,13 +29,17 @@ export class home extends Component {
|
|
|
this.node.parent.active = false
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
+ ClientEvent.on(config.UI_EVENT.GAME_OVER_SETTLE_ACCOUNT,this.onGameOverSettleAccount.bind(this),this)
|
|
|
ClientEvent.on(config.UI_EVENT.GET_NEW_CAR,this.onGetNewCar.bind(this),this)
|
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_USER_DEFAULT_CAR,this.onUpdateUserDefaultCar.bind(this),this)
|
|
|
- ClientEvent.on(config.UI_EVENT.GAME_OVER_SETTLE_ACCOUNT,this.onGameOverSettleAccount.bind(this),this)
|
|
|
ClientEvent.on(config.EVENT_TYPE.MSG_GUANGBO_RANK,this.onMsgGuangboRank.bind(this),this)
|
|
|
ClientEvent.on(config.UI_EVENT.UPDATE_USER_INFO,this.onUpdateUserInfo.bind(this),this)
|
|
|
+ ClientEvent.on(config.UI_EVENT.UPDATE_SIGN_RED_DOT_STATUS,this.onUpdateSignRedDotStatus.bind(this),this)
|
|
|
+ ClientEvent.on(config.UI_EVENT.UPDATE_MAIL_RED_DOT_STATUS,this.onUpdateMailRedDotStatus.bind(this),this)
|
|
|
+ ClientEvent.on(config.UI_EVENT.UPDATE_ANNOUNCEMENT_RED_DOT_STATUS,this.onUpdateAnnouncementRedDotStatus.bind(this),this)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
onGameOverSettleAccount(res:user_results){
|
|
|
// 更新本周分数、荣誉
|
|
|
tools.mine_rank_data.score = res.max_integral
|
|
@@ -82,10 +88,23 @@ export class home extends Component {
|
|
|
this.top.getComponent(home_top).reloadUserInfo()
|
|
|
}
|
|
|
|
|
|
+ onUpdateSignRedDotStatus(is_show:boolean) {
|
|
|
+ this.modules.getComponent(home_modules).showRedDotQiandao(is_show)
|
|
|
+ }
|
|
|
+
|
|
|
+ onUpdateMailRedDotStatus(is_show:boolean) {
|
|
|
+ this.modules.getComponent(home_modules).showRedDotYoujian(is_show)
|
|
|
+ }
|
|
|
+
|
|
|
+ onUpdateAnnouncementRedDotStatus(is_show:boolean) {
|
|
|
+ this.modules.getComponent(home_modules).showRedDotGonggao(is_show)
|
|
|
+ }
|
|
|
+
|
|
|
public init(){
|
|
|
this.top.getComponent(home_top).init()
|
|
|
this.home_car.getComponent(home_car).updateCar()
|
|
|
this.bottom.getComponent(home_bottom).init()
|
|
|
+ this.modules.getComponent(home_modules).init()
|
|
|
}
|
|
|
}
|
|
|
|