ソースを参照

新年活动合成修改

huangxiaoyue 1 年間 前
コミット
2e9fec0102

+ 9 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/ActivityAfternoonTea/UI_ActivitySyntheticUI.cs

@@ -8,8 +8,11 @@ namespace UI.ActivityAfternoonTea
     {
         public GComponent target;
         public GLoader m_loaBg;
+        public GComponent m_valueBar;
         public GButton m_btnBack;
+        public GTextField m_txtTime;
         public GList m_listSynthetic;
+        public GTextField m_txtTips;
         public const string URL = "ui://wpsqkdbzyo402e";
         public const string PACKAGE_NAME = "ActivityAfternoonTea";
         public const string RES_NAME = "ActivitySyntheticUI";
@@ -58,14 +61,20 @@ namespace UI.ActivityAfternoonTea
         private void Init(GComponent comp)
         {
             m_loaBg = (GLoader)comp.GetChild("loaBg");
+            m_valueBar = (GComponent)comp.GetChild("valueBar");
             m_btnBack = (GButton)comp.GetChild("btnBack");
+            m_txtTime = (GTextField)comp.GetChild("txtTime");
             m_listSynthetic = (GList)comp.GetChild("listSynthetic");
+            m_txtTips = (GTextField)comp.GetChild("txtTips");
         }
         public void Dispose(bool disposeTarget = false)
         {
             m_loaBg = null;
+            m_valueBar = null;
             m_btnBack = null;
+            m_txtTime = null;
             m_listSynthetic = null;
+            m_txtTips = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 2 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/ActivityTeaSProxy.cs

@@ -50,10 +50,10 @@ namespace GFGGame
         }
 
         //部件合成
-        public static async ETTask<bool> ReqItemSynthetic(int itemId)
+        public static async ETTask<bool> ReqItemSynthetic(int activityId ,int itemId)
         {
             S2C_ItemSynthetic response = null;
-            response = (S2C_ItemSynthetic)await MessageHelper.SendToServer(new C2S_ItemSynthetic() { ItemId = itemId });
+            response = (S2C_ItemSynthetic)await MessageHelper.SendToServer(new C2S_ItemSynthetic() { ActivityId = activityId,ItemId = itemId });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)

+ 24 - 2
GameClient/Assets/Game/HotUpdate/Views/ActivityAfternoonTea/ActivitySyntheticView.cs

@@ -5,16 +5,23 @@ using UI.DressUp;
 using FairyGUI;
 using UI.ActivityAfternoonTea;
 using UI.CommonGame;
+using ET;
 
 namespace GFGGame
 {
     public class ActivitySyntheticView : BaseWindow
     {
         private UI_ActivitySyntheticUI _ui;
+        private ValueBarController _valueBarController;
         private SuitCfg _suitCfg;
 
         public override void Dispose()
         {
+            if (_valueBarController != null)
+            {
+                _valueBarController.Dispose();
+                _valueBarController = null;
+            }
             if (_ui != null)
             {
                 _ui.Dispose();
@@ -31,6 +38,7 @@ namespace GFGGame
             this.viewCom = _ui.target;
             isfullScreen = true;
             isReturnView = true;
+            _valueBarController = new ValueBarController(_ui.m_valueBar);
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
             _ui.m_listSynthetic.itemRenderer = RenderListSyntheticItem;
         }
@@ -38,9 +46,15 @@ namespace GFGGame
         protected override void OnShown()
         {
             base.OnShown();
+
+            _valueBarController.OnShown();
+            _valueBarController.Controller(6);
+
             ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(5005);
             _suitCfg = SuitCfgArray.Instance.GetCfg(activityOpenCfg.paramsArr[0]);
             _ui.m_listSynthetic.numItems = _suitCfg.partsArr.Length;
+            RefreshTimeText();
+            _ui.m_txtTips.SetVar("name", _suitCfg.name).FlushVars();
         }
 
         private void OnClickBtnBack()
@@ -48,6 +62,14 @@ namespace GFGGame
             ViewManager.GoBackFrom(typeof(ActivitySyntheticView).FullName);
         }
 
+        private void RefreshTimeText()
+        {
+            ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(5005);
+            long time = TimeUtil.DateTimeToTimestamp(activityOpenCfg.endTime) - TimeHelper.ServerNow();
+            string strTime = TimeUtil.FormattingTimeTo_DDHHmm(time);
+            _ui.m_txtTime.text = "Ê£Óà:" + strTime;
+        }
+        
         private void RenderListSyntheticItem(int index, GObject obj)
         {
             UI_SyntheticItemUI comBox = UI_SyntheticItemUI.Proxy(obj);
@@ -93,7 +115,7 @@ namespace GFGGame
             {
                 comBox.m_btnType.selectedIndex = 2;
             }
-            else if (materiarsArr[0][1] >= ItemDataManager.GetItemNum(materiarsArr[0][0]) && materiarsArr[1][1] >= ItemDataManager.GetItemNum(materiarsArr[1][0]))
+            else if (ItemDataManager.GetItemNum(materiarsArr[0][0]) >= materiarsArr[0][1] && ItemDataManager.GetItemNum(materiarsArr[1][0]) >= materiarsArr[1][1])
             {
                 comBox.m_btnType.selectedIndex = 1;
                 if(comBox.m_btnMake.data == null)
@@ -115,7 +137,7 @@ namespace GFGGame
         {
             if (!(context.sender is GObject obj)) return;
             int itemID = (int)obj.data;
-            bool result = await ActivityTeaSProxy.ReqItemSynthetic(itemID);
+            bool result = await ActivityTeaSProxy.ReqItemSynthetic( 5005 , itemID);
             if (result)
             {
                 _ui.m_listSynthetic.numItems = _suitCfg.partsArr.Length;

BIN
GameClient/Assets/ResIn/UI/ActivityAfternoonTea/ActivityAfternoonTea_fui.bytes


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0.png


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/CommonGame/CommonGame_fui.bytes


BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0.png


BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0_2!a.png


BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0_2.png


BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes