甘艺伟 2 napja
szülő
commit
19a4e1a378

BIN
assets/bundle/FGUI/Home/Home.bin


BIN
assets/bundle/FGUI/Home/Home_atlas0.png


+ 5 - 12
assets/script/logic/fgui/Home/Home/UIHeadTopView.ts

@@ -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() {

+ 2 - 2
fgui-project/assets/Home/Components/HeadTopCom.xml

@@ -18,8 +18,8 @@
     <component id="n35_un8b" name="ItemDiamond" src="zlutc4i" fileName="Components/ItemCount.xml" pkg="rd135cfr" xy="533,100" pivot="0.5,0.5" anchor="true" scale="0.7,0.7">
       <Button icon="ui://1xjqm8v2rnf9y" selectedIcon="ui://1xjqm8v2rnf9y"/>
     </component>
-    <component id="n36_un8b" name="ItemSp" src="zlutc4i" fileName="Components/ItemCount.xml" pkg="rd135cfr" xy="675,100" pivot="0.5,0.5" anchor="true" scale="0.7,0.7">
-      <Button icon="ui://1xjqm8v2rnf917" selectedIcon="ui://1xjqm8v2rnf917"/>
+    <component id="n36_un8b" name="ItemSp" src="ul8q3e" fileName="Components/PbSpTop.xml" xy="676,100" pivot="0.5,0.5" anchor="true">
+      <ProgressBar value="50" max="100"/>
     </component>
   </displayList>
 </component>

+ 14 - 0
fgui-project/assets/Home/Components/PbSpTop.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="150,28" extention="ProgressBar">
+  <displayList>
+    <loader id="n0_sp2x" name="n0" xy="19,2" size="110,28" url="ui://rd135cfrrnf918" fill="scaleFree"/>
+    <loader id="n1_sp2x" name="bar" xy="20,3" size="150,26" scale="0.7,1" url="ui://1xjqm8v2rnf91x" vAlign="middle" fill="scaleFree" useResize="true">
+      <relation target="" sidePair="width-width,height-height"/>
+    </loader>
+    <text id="n2_sp2x" name="title" xy="32,1" size="94,29" font="ui://1xjqm8v2ul8q2y" fontSize="20" color="#ffffff" align="center" vAlign="middle" autoSize="shrink" text="">
+      <relation target="" sidePair="width-width,height-height"/>
+    </text>
+    <loader id="n3_ul8q" name="icon" xy="12,16" pivot="0.5,0.5" anchor="true" size="38,37" url="ui://1xjqm8v2rnf917" autoSize="true"/>
+  </displayList>
+  <ProgressBar titleType="valueAndmax"/>
+</component>

+ 2 - 1
fgui-project/assets/Home/package.xml

@@ -57,7 +57,7 @@
     <image id="rnf91u" name="ProBar_zjm_nengliang.png" path="/Images/home/"/>
     <image id="rnf91v" name="ProBar_zjm_nengliang01.png" path="/Images/home/"/>
     <image id="rnf91w" name="ProBar_zjm_nengliangdi.png" path="/Images/home/"/>
-    <image id="rnf91x" name="ProBar_zjm_tilitiao.png" path="/Images/home/"/>
+    <image id="rnf91x" name="ProBar_zjm_tilitiao.png" path="/Images/home/" scale="9grid" scale9grid="9,8,8,2" duplicatePadding="true" disableTrim="true"/>
     <image id="rnf91y" name="Scrbar_zjm_gundongtiao.png" path="/Images/home/"/>
     <image id="rnf91z" name="Scrbar_zjm_gundongtiao01.png" path="/Images/home/"/>
     <image id="rnf920" name="Com_ty_pinzhi01.png" path="/Images/"/>
@@ -109,6 +109,7 @@
     <image id="ul8q3b" name="Txt_zhandou_6.png" path="/Images/home/PowerFont/"/>
     <image id="ul8q3c" name="Txt_zhandou_7.png" path="/Images/home/PowerFont/"/>
     <font id="ul8q3d" name="PowerFont.fnt" path="/Images/home/PowerFont/" exported="true"/>
+    <component id="ul8q3e" name="PbSpTop.xml" path="/Components/"/>
   </resources>
   <publish name="" genCode="true"/>
 </packageDescription>