|
@@ -20,7 +20,7 @@ export default class UIHeadTopView {
|
|
|
private _PbLv: fairygui.GProgressBar;
|
|
|
ItemGold: ItemCount;
|
|
|
ItemDiamond: ItemCount;
|
|
|
- ItemSp: ItemCount;
|
|
|
+ ItemSp: fairygui.GProgressBar;
|
|
|
public constructor(vm: fgui.GComponent) {
|
|
|
this._HeadBtn = vm.getChild("HeadBtn")
|
|
|
this._NameFont = vm.getChild("NameFont")
|
|
@@ -30,7 +30,7 @@ export default class UIHeadTopView {
|
|
|
this._PbLv = vm.getChild("PbLv") as fgui.GProgressBar;
|
|
|
this.ItemGold = new ItemCount(vm.getChild("ItemGold") as fgui.GButton);
|
|
|
this.ItemDiamond = new ItemCount(vm.getChild("ItemDiamond") as fgui.GButton);
|
|
|
- this.ItemSp = new ItemCount(vm.getChild("ItemSp") as fgui.GButton);
|
|
|
+ this.ItemSp = vm.getChild("ItemSp") as fgui.GProgressBar;
|
|
|
// FguiLoadMgr.loadItemIcon(vm.getChild("GoldImg").asLoader, ConstItem.coin, () => { }, 0.3);
|
|
|
// FguiLoadMgr.loadItemIcon(vm.getChild("DiamondImg").asLoader, ConstItem.gem, () => { }, 0.3);
|
|
|
}
|
|
@@ -38,7 +38,6 @@ export default class UIHeadTopView {
|
|
|
public onEnable(): void {
|
|
|
this.ItemGold.onEnable();
|
|
|
this.ItemDiamond.onEnable();
|
|
|
- this.ItemSp.onEnable();
|
|
|
GameDataCenter.item.sendItemInfo();
|
|
|
EventMng.on(ItemEvent.UP_ITEM, this.onUpItem, this)
|
|
|
EventMng.on(GridEvent.HC_SP_UP, this.onUpSp, this)
|
|
@@ -54,7 +53,6 @@ export default class UIHeadTopView {
|
|
|
public onDisable(): void {
|
|
|
this.ItemGold.onDisable();
|
|
|
this.ItemDiamond.onDisable();
|
|
|
- this.ItemSp.onDisable();
|
|
|
EventMng.off(ItemEvent.UP_ITEM, this.onUpItem, this)
|
|
|
EventMng.off(GridEvent.HC_SP_UP, this.onUpSp, this)
|
|
|
EventMng.off(ZhanLiEvent.ZHANLI_UP_HOME_ZHANLI, this.onUpZhanLi, this)
|
|
@@ -103,14 +101,9 @@ export default class UIHeadTopView {
|
|
|
|
|
|
onUpSp() {
|
|
|
//体力单独读取
|
|
|
- let spInfo = [ConstItem.sp[0], ConstItem.sp[1], GameDataCenter.gridMap.hcInfo?.tili];
|
|
|
- let param: ItemCountExtraParam = {
|
|
|
- showAddBtn: true,
|
|
|
- fullNumberShow: true,
|
|
|
- isBuyItem: true,
|
|
|
- notEnoughRed: false
|
|
|
- }
|
|
|
- this.ItemSp.setData(spInfo, null, param, "ui://Home/Img_zjm_tili");
|
|
|
+ let hcInfo = GameDataCenter.gridMap?.hcInfo;
|
|
|
+ this.ItemSp.max = hcInfo?.maxTili;
|
|
|
+ this.ItemSp.value = hcInfo?.tili;
|
|
|
}
|
|
|
|
|
|
onUpZhanLi() {
|