Bläddra i källkod

好友体力领取显示

zhaoyang 2 år sedan
förälder
incheckning
895cd1524d

+ 1 - 0
FGUIProject/assets/Friend/FriendUI.xml

@@ -32,5 +32,6 @@
       <relation target="" sidePair="right-right,bottom-bottom"/>
       <Button title="一键领取"/>
     </component>
+    <text id="n22_duuf" name="txtPowerCount" xy="694,1860" pivot="0.5,0" size="339,44" fontSize="32" color="#f8e7e7" align="center" letterSpacing="-2" vars="true" autoSize="none" text="今日剩余领取体力:{value=0}/{maxValue=20}"/>
   </displayList>
 </component>

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Friend/UI_FriendUI.cs

@@ -15,6 +15,7 @@ namespace UI.Friend
         public GButton m_btnAdd;
         public GList m_list;
         public GButton m_btnSendAll;
+        public GTextField m_txtPowerCount;
         public const string URL = "ui://wez2ujnnjdju0";
         public const string PACKAGE_NAME = "Friend";
         public const string RES_NAME = "FriendUI";
@@ -70,6 +71,7 @@ namespace UI.Friend
             m_btnAdd = (GButton)comp.GetChild("btnAdd");
             m_list = (GList)comp.GetChild("list");
             m_btnSendAll = (GButton)comp.GetChild("btnSendAll");
+            m_txtPowerCount = (GTextField)comp.GetChild("txtPowerCount");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -81,6 +83,7 @@ namespace UI.Friend
             m_btnAdd = null;
             m_list = null;
             m_btnSendAll = null;
+            m_txtPowerCount = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Views/Friend/FriendView.cs

@@ -137,6 +137,8 @@ namespace GFGGame
             _ui.m_list.RefreshVirtualList();
             _ui.m_txtCount.text = string.Format("好友数:{0}/{1}", _ui.m_list.numItems, GlobalCfgArray.globalCfg.maxFriendCount);
             _ui.m_btnSendAll.text = RedDotDataManager.Instance.GetFriendGiftRed() ? "一键领取并赠送" : "一键赠送";
+            _ui.m_txtPowerCount.SetVar("value", FriendDataManager.Instance.Count.ToString()).FlushVars();
+            _ui.m_txtPowerCount.SetVar("maxValue", FriendDataManager.Instance.maxGetPowerCount.ToString()).FlushVars();
         }
 
 

BIN
GameClient/Assets/ResIn/UI/Friend/Friend_fui.bytes