|
@@ -28,6 +28,7 @@ import ConfigM from "../../scripts/api/ConfigM";
|
|
|
import { Sprite } from "cc";
|
|
|
import AB from "../../scripts/base/AB";
|
|
|
import { SpriteFrame } from "cc";
|
|
|
+import FamilyM from "../../scripts/api/FamilyM";
|
|
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
@@ -56,9 +57,10 @@ export class HallTitleBar extends BaseUI {
|
|
|
ItemsM.ins.on(GoodsId.POG, this.onPogChange, this);
|
|
|
ItemsM.ins.on(GoodsId.GEM, this.onGemChange, this);
|
|
|
|
|
|
- EV.ins.on(EV_TYPE.USER_GOOD_REFRESH, this.onUserGoodRefresh, this);
|
|
|
-
|
|
|
this.refreshUI();
|
|
|
+
|
|
|
+ EV.ins.on(EV_TYPE.USER_GOOD_REFRESH, this.onUserGoodRefresh, this);
|
|
|
+ EV.ins.on(EV_TYPE.FAMILY_STATUS_UPDATE, this.setFamilyInfo, this);
|
|
|
}
|
|
|
|
|
|
onUserGoodRefresh(goodList: GoodInfo[]) {
|
|
@@ -87,8 +89,8 @@ export class HallTitleBar extends BaseUI {
|
|
|
"lbl_hall_title_season_time",
|
|
|
UserM.ins.getSeasonEndTimeText()
|
|
|
);
|
|
|
- this.setText("lbl_pog", Utils.formatNumber(this._pog, 0));
|
|
|
- this.setText("lbl_gem", Utils.formatNumber(this._gem, 0));
|
|
|
+ this.setText("lbl_pog", UserM.ins.getPogDisplay());
|
|
|
+ this.setText("lbl_gem", Utils.formatNumber(this._gem, 1));
|
|
|
|
|
|
let gamePassCount = UserM.ins.getGamePassCount();
|
|
|
this.FindNode("lbl_game_pass_count").active = gamePassCount > 0;
|
|
@@ -96,14 +98,26 @@ export class HallTitleBar extends BaseUI {
|
|
|
this.setText("lbl_game_pass_count", "x" + gamePassCount);
|
|
|
}
|
|
|
|
|
|
- this.setGradeIcon();
|
|
|
+ this.setFamilyInfo();
|
|
|
|
|
|
- // if(UserM.ins.data.)
|
|
|
+ this.setGradeIcon();
|
|
|
+ }
|
|
|
+ async setFamilyInfo() {
|
|
|
+ if (UserM.ins.data.familyId != null && UserM.ins.data.familyId != "") {
|
|
|
+ let family = await FamilyM.ins.getFamilyInfo(UserM.ins.data.familyId);
|
|
|
+ if (UserM.ins.data.userId == family?.ownerDto?.ownerId) {
|
|
|
+ this.setText("lbl_title_player_family_name", "👑" + family.familyName);
|
|
|
+ } else {
|
|
|
+ this.setText("lbl_title_player_family_name", "👤" + family.familyName);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.setText("lbl_title_player_family_name", "");
|
|
|
+ }
|
|
|
}
|
|
|
async setGradeIcon() {
|
|
|
let data: RankDto = await RankM.ins.rankData(PageRank.RankTypeSeason);
|
|
|
let grade = data.rankInfo.badgeId;
|
|
|
-// grade=3
|
|
|
+ // grade=3
|
|
|
if (grade <= 0 || grade > 7) {
|
|
|
return;
|
|
|
}
|