zhaoyang 2 rokov pred
rodič
commit
e76cf4e494

+ 2 - 2
FGUIProject/assets/CommonGame/components/BtnStyle1Big.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <component size="187,56" extention="Button">
 <component size="187,56" extention="Button">
-  <controller name="button" pages="0,up,1,down,4,disable" selected="2"/>
+  <controller name="button" pages="0,up,1,down,4,,5,,6,disable" selected="4"/>
   <displayList>
   <displayList>
     <loader id="n4_u2u3" name="icon" xy="0,0" size="187,56" aspect="true" url="ui://eg2y0ldpwm603g" fill="scale" autoSize="true">
     <loader id="n4_u2u3" name="icon" xy="0,0" size="187,56" aspect="true" url="ui://eg2y0ldpwm603g" fill="scale" autoSize="true">
-      <gearIcon controller="button" pages="4" values="ui://eg2y0ldpwm603g" default="ui://eg2y0ldpwm603f"/>
+      <gearIcon controller="button" pages="4,6" values="|ui://eg2y0ldpwm603g" default="ui://eg2y0ldpwm603f"/>
     </loader>
     </loader>
     <text id="n3_u2u3" name="title" xy="71,8" pivot="0.5,0" size="44,39" font="ui://eg2y0ldpa0cftky" fontSize="28" color="#683c28" align="center" vars="true" text="{value=0}/{maxValue=0}">
     <text id="n3_u2u3" name="title" xy="71,8" pivot="0.5,0" size="44,39" font="ui://eg2y0ldpa0cftky" fontSize="28" color="#683c28" align="center" vars="true" text="{value=0}/{maxValue=0}">
       <relation target="" sidePair="middle-middle,left-right"/>
       <relation target="" sidePair="middle-middle,left-right"/>

+ 5 - 4
FGUIProject/assets/DailyWelfare/components/ComSupply.xml

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<component size="222,353">
+<component size="222,422">
   <displayList>
   <displayList>
-    <component id="n22_fqor" name="comItem" src="j48o98" fileName="components/ComItem.xml" pkg="eg2y0ldp" xy="0,0" size="222,225"/>
-    <component id="n23_fqor" name="btnGet" src="rv091p" fileName="components/BtnStyle1Big.xml" pkg="eg2y0ldp" xy="17,230">
+    <text id="n25_fqor" name="txtTime" xy="91,5" pivot="0.5,0" size="40,42" fontSize="30" align="center" text=""/>
+    <component id="n22_fqor" name="comItem" src="j48o98" fileName="components/ComItem.xml" pkg="eg2y0ldp" xy="0,65" size="222,225"/>
+    <component id="n23_fqor" name="btnGet" src="rv091p" fileName="components/BtnStyle1Big.xml" pkg="eg2y0ldp" xy="17,295">
       <Button title="补领"/>
       <Button title="补领"/>
     </component>
     </component>
-    <component id="n24_fqor" name="comCost" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="46,307" pivot="0.5,0" controller="c1,1"/>
+    <component id="n24_fqor" name="comCost" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="46,372" pivot="0.5,0" controller="c1,1"/>
   </displayList>
   </displayList>
 </component>
 </component>

+ 0 - 77
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ComCostColor1.cs

@@ -1,77 +0,0 @@
-/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
-
-using FairyGUI;
-
-namespace UI.CommonGame
-{
-    public partial class UI_ComCostColor1
-    {
-        public GComponent target;
-        public Controller m_c1;
-        public GLoader m_loaIcon;
-        public GTextField m_txtNeed;
-        public const string URL = "ui://eg2y0ldpo9ghtln";
-        public const string PACKAGE_NAME = "CommonGame";
-        public const string RES_NAME = "ComCostColor1";
-        private static UI_ComCostColor1 _proxy;
-
-        public static UI_ComCostColor1 Create(GObject gObject = null)
-        {
-            var ui = new UI_ComCostColor1();
-            if(gObject == null)
-            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
-            else
-            	ui.target =  (GComponent)gObject;
-            ui.Init(ui.target);
-            return ui;
-        }
-
-        public static UI_ComCostColor1 Proxy(GObject gObject = null)
-        {
-            if(_proxy == null)
-            {
-                _proxy = new UI_ComCostColor1();
-            }
-            var ui = _proxy;
-            if(gObject == null)
-            	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
-            else
-            	ui.target =  (GComponent)gObject;
-            ui.Init(ui.target);
-            return ui;
-        }
-
-        public static void ProxyEnd()
-        {
-            if (_proxy != null)
-            {
-                _proxy.Dispose();
-            }
-        }
-
-        public static void ClearProxy()
-        {
-            ProxyEnd();
-            _proxy = null;
-        }
-
-        private void Init(GComponent comp)
-        {
-            m_c1 = comp.GetController("c1");
-            m_loaIcon = (GLoader)comp.GetChild("loaIcon");
-            m_txtNeed = (GTextField)comp.GetChild("txtNeed");
-        }
-        public void Dispose(bool disposeTarget = false)
-        {
-            m_c1 = null;
-            m_loaIcon = null;
-            m_txtNeed = null;
-            if(disposeTarget && target != null)
-            {
-                target.RemoveFromParent();
-                target.Dispose();
-            }
-            target = null;
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_ComCostColor1.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 38e87674cfc1c04459ea377b3e0b4c79
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DailyWelfare/UI_ComSupply.cs

@@ -7,6 +7,7 @@ namespace UI.DailyWelfare
     public partial class UI_ComSupply
     public partial class UI_ComSupply
     {
     {
         public GComponent target;
         public GComponent target;
+        public GTextField m_txtTime;
         public GComponent m_comItem;
         public GComponent m_comItem;
         public GButton m_btnGet;
         public GButton m_btnGet;
         public GComponent m_comCost;
         public GComponent m_comCost;
@@ -57,12 +58,14 @@ namespace UI.DailyWelfare
 
 
         private void Init(GComponent comp)
         private void Init(GComponent comp)
         {
         {
+            m_txtTime = (GTextField)comp.GetChild("txtTime");
             m_comItem = (GComponent)comp.GetChild("comItem");
             m_comItem = (GComponent)comp.GetChild("comItem");
             m_btnGet = (GButton)comp.GetChild("btnGet");
             m_btnGet = (GButton)comp.GetChild("btnGet");
             m_comCost = (GComponent)comp.GetChild("comCost");
             m_comCost = (GComponent)comp.GetChild("comCost");
         }
         }
         public void Dispose(bool disposeTarget = false)
         public void Dispose(bool disposeTarget = false)
         {
         {
+            m_txtTime = null;
             m_comItem = null;
             m_comItem = null;
             m_btnGet = null;
             m_btnGet = null;
             m_comCost = null;
             m_comCost = null;

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Utils/TimeUtil.cs

@@ -158,7 +158,7 @@ namespace GFGGame
         }
         }
         /// <summary>
         /// <summary>
         /// <summary>
         /// <summary>
-        /// 将时间戳转换成HH:mm格式
+        /// 将时间戳转换成mm:ss格式
         /// </summary>
         /// </summary>
         /// <param name="timeMsec">毫秒</param>
         /// <param name="timeMsec">毫秒</param>
         public static string FormattingTime7(long timeMsec)
         public static string FormattingTime7(long timeMsec)

+ 85 - 7
GameClient/Assets/Game/HotUpdate/Views/DailyWelfare/DailyWelfareView.cs

@@ -47,6 +47,11 @@ namespace GFGGame
             _ui.m_list.itemRenderer = ListItemRender;
             _ui.m_list.itemRenderer = ListItemRender;
 
 
         }
         }
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, UpdateView);
+        }
 
 
         protected override void OnShown()
         protected override void OnShown()
         {
         {
@@ -57,7 +62,7 @@ namespace GFGGame
             _month = DateTime.Now.Month;
             _month = DateTime.Now.Month;
             _day = DateTime.Now.Day;
             _day = DateTime.Now.Day;
             // _ui.m_list.ScrollToView(0);
             // _ui.m_list.ScrollToView(0);
-            UpdateSgignView();
+            UpdateView();
         }
         }
 
 
         protected override void OnHide()
         protected override void OnHide()
@@ -65,10 +70,21 @@ namespace GFGGame
             _valueBarController.OnHide();
             _valueBarController.OnHide();
             base.OnHide();
             base.OnHide();
         }
         }
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, UpdateView);
+        }
+
         private void OnBtnBackClick()
         private void OnBtnBackClick()
         {
         {
             ViewManager.GoBackFrom(typeof(DailyWelfareView).FullName);
             ViewManager.GoBackFrom(typeof(DailyWelfareView).FullName);
         }
         }
+        private void UpdateView()
+        {
+            UpdateSgignView();
+            UpdateSupplyView();
+        }
         private void UpdateSgignView()
         private void UpdateSgignView()
         {
         {
             _signCount = MathHelper.CountOnes(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay));
             _signCount = MathHelper.CountOnes(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignDay));
@@ -94,14 +110,27 @@ namespace GFGGame
             }
             }
             _ui.m_list.numItems = signBonusCfgs.Count;
             _ui.m_list.numItems = signBonusCfgs.Count;
         }
         }
-        private void OnBtnGetProBonus(EventContext context)
+        private async void OnBtnGetProBonus(EventContext context)
         {
         {
             GObject obj = context.sender as GObject;
             GObject obj = context.sender as GObject;
             DailySignCfg signCfg = obj.data as DailySignCfg;
             DailySignCfg signCfg = obj.data as DailySignCfg;
+            if (_signCount < signCfg.day || MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.SignReward), signCfg.day))
+            {
+                GoodsItemTipsController.ShowItemTips(signCfg.bonusArr[0][1]);
+            }
+            else
+            {
+                bool result = await DailyWelfareSProxy.ReqGetSignReward(signCfg.day);
+                if (result)
+                {
+                    UpdateSgignView();
+                }
+            }
         }
         }
         private void UpdateSupplyView()
         private void UpdateSupplyView()
         {
         {
-
+            UpdateReward(_ui.m_comSupply0.target, DailySupplyCfgArray.Instance.dataArray[0].id);
+            UpdateReward(_ui.m_comSupply1.target, DailySupplyCfgArray.Instance.dataArray[1].id);
         }
         }
 
 
         private void ListItemRender(int index, GObject obj)
         private void ListItemRender(int index, GObject obj)
@@ -148,7 +177,7 @@ namespace GFGGame
             }
             }
             if (result)
             if (result)
             {
             {
-                _ui.m_list.numItems = DailySignCfgArray.Instance.GetCfgsBymonth(_month).Count;
+                _ui.m_list.numItems = DailySignBonusCfgArray.Instance.GetCfgsBymonth(_month).Count;
             }
             }
         }
         }
         private void UpdateReward(GObject obj, int id)
         private void UpdateReward(GObject obj, int id)
@@ -157,12 +186,61 @@ namespace GFGGame
 
 
             UI_ComSupply item = UI_ComSupply.Proxy(obj);
             UI_ComSupply item = UI_ComSupply.Proxy(obj);
 
 
+            long openTime = TimeUtil.GetCurDayTime(TimeUtil.GetDateTime(supplyCfg.openTime).ToString("HH:mm:ss"));
+            long endTime = TimeUtil.GetCurDayTime(TimeUtil.GetDateTime(supplyCfg.endTime).ToString("HH:mm:ss"));
+            item.m_txtTime.text = TimeUtil.FormattingTime6(openTime) + "-" + TimeUtil.FormattingTime6(endTime);
+            if (item.m_comItem.data == null)
+            {
+                item.m_comItem.data = new ItemView(item.m_comItem);
+            }
+            ItemData itemData = ItemUtil.createItemData(supplyCfg.bonusArr[0]);
+            (item.m_comItem.data as ItemView).SetData(itemData);
+            (item.m_comItem.data as ItemView).ShowTips = false;
+            ItemUtil.UpdateItemNeedNum(item.m_comCost, GlobalCfgArray.globalCfg.dailySupplyConsumeArr[0]);
+            item.m_comCost.visible = false;
+
+            if (MathHelper.isBitSet(GameGlobal.myNumericComponent.GetAsInt(NumericType.DailySupplyReward), supplyCfg.id))
+            {
+                item.m_btnGet.title = "已领取";
+                item.m_btnGet.enabled = false;
+                return;
+            }
+
+            long curTime = TimeHelper.ServerNow();
+            if (curTime < openTime)
+            {
+                item.m_btnGet.title = "领取";
+                item.m_btnGet.enabled = false;
+            }
+            else if (curTime > openTime && curTime < endTime)
+            {
+                item.m_btnGet.title = "领取";
+                item.m_btnGet.enabled = true;
+            }
+            else
+            {
+                item.m_comCost.visible = true;
+                item.m_btnGet.title = "补领";
+                item.m_btnGet.enabled = true;
+            }
+            if (item.m_btnGet.data == null)
+            {
+                item.m_btnGet.onClick.Add(OnBtnGetSupplyClick);
+            }
+            item.m_btnGet.data = supplyCfg;
             UI_ComSupply.ProxyEnd();
             UI_ComSupply.ProxyEnd();
         }
         }
-        private void ListBonusItemRender(int index, GObject obj)
+        private async void OnBtnGetSupplyClick(EventContext context)
         {
         {
-
+            GObject obj = context.sender as GObject;
+            DailySupplyCfg supplyCfg = obj.data as DailySupplyCfg;
+            long openTime = TimeUtil.GetCurDayTime(TimeUtil.GetDateTime(supplyCfg.openTime).ToString("HH:mm:ss"));
+            long endTime = TimeUtil.GetCurDayTime(TimeUtil.GetDateTime(supplyCfg.endTime).ToString("HH:mm:ss"));
+            bool result = await DailyWelfareSProxy.ReqGetSupplyReward(supplyCfg.id);
+            if (result)
+            {
+                UpdateSupplyView();
+            }
         }
         }
-
     }
     }
 }
 }

BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.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_fui.bytes


BIN
GameClient/Assets/ResIn/UI/DailyWelfare/DailyWelfare_fui.bytes