Browse Source

每日登录

zhaoyang 3 years ago
parent
commit
2bf195c06b
30 changed files with 153 additions and 31 deletions
  1. 5 5
      FGUIProject/assets/DailyLogin/DailyLoginUI.xml
  2. 1 0
      FGUIProject/assets/DailyLogin/components/ListItem.xml
  3. BIN
      FGUIProject/assets/DailyLogin/images/yzhd_ditu.png
  4. BIN
      FGUIProject/assets/DailyLogin/images/yzhd_dyt_7.png
  5. 3 3
      FGUIProject/assets/Main/MainUI.xml
  6. 11 0
      FGUIProject/assets/Main/components/Button2.xml
  7. BIN
      FGUIProject/assets/Main/images/zjm_hdhd_3.png
  8. 2 0
      FGUIProject/assets/Main/package.xml
  9. 8 2
      GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs
  10. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DailyLogin/UI_ListItem.cs
  11. 71 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_Button2.cs
  12. 11 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_Button2.cs.meta
  13. 2 2
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_MainUI.cs
  14. 17 9
      GameClient/Assets/Game/HotUpdate/Views/DailyLogin/DailyLoginView.cs
  15. 12 10
      GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs
  16. 6 0
      GameClient/Assets/Game/HotUpdate/Views/ViewManager.cs
  17. BIN
      GameClient/Assets/ResIn/UI/DailyLogin/DailyLogin_atlas0.png
  18. BIN
      GameClient/Assets/ResIn/UI/DailyLogin/DailyLogin_fui.bytes
  19. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0!a.png
  20. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0.png
  21. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_1!a.png
  22. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_1.png
  23. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_3!a.png
  24. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_3.png
  25. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_4!a.png
  26. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_4.png
  27. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_5!a.png
  28. BIN
      GameClient/Assets/ResIn/UI/Main/Main_atlas0_5.png
  29. BIN
      GameClient/Assets/ResIn/UI/Main/Main_fui.bytes
  30. 1 0
      GameClient/Assets/ThirdParty/FairyGUI/Scripts/UI/Window.cs

+ 5 - 5
FGUIProject/assets/DailyLogin/DailyLoginUI.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="1080,1596">
+<component size="994,1393">
   <displayList>
-    <image id="n4_ox5b" name="n4" src="ox5b9" fileName="images/yzhd_ditu.png" xy="43,101"/>
-    <list id="n0_lh8v" name="list" xy="120,167" size="839,693" layout="flow_hz" overflow="scroll" lineGap="15" colGap="10" defaultItem="ui://5uawdql9jyml7">
+    <image id="n4_ox5b" name="n4" src="ox5b9" fileName="images/yzhd_ditu.png" xy="0,0"/>
+    <list id="n0_lh8v" name="list" xy="77,66" size="839,693" layout="flow_hz" overflow="hidden" lineGap="15" colGap="10" defaultItem="ui://5uawdql9jyml7">
       <item/>
       <item/>
       <item/>
@@ -10,7 +10,7 @@
       <item/>
       <item/>
     </list>
-    <loader id="n5_ox5b" name="loaIcon" xy="288,868" size="553,492" url="ui://5uawdql9ox5bg" autoSize="true"/>
-    <image id="n3_ox5b" name="n3" src="ox5bi" fileName="images/yzhd_zszs.png" xy="0,0"/>
+    <loader id="n5_ox5b" name="loaIcon" xy="248,767" size="553,492" url="ui://5uawdql9ox5bg" autoSize="true"/>
+    <image id="n3_ox5b" name="n3" src="ox5bi" fileName="images/yzhd_zszs.png" xy="-43,-101"/>
   </displayList>
 </component>

+ 1 - 0
FGUIProject/assets/DailyLogin/components/ListItem.xml

@@ -3,6 +3,7 @@
   <displayList>
     <loader id="n2_ox5b" name="loaBg" xy="0,0" size="270,334" url="ui://5uawdql9ox5ba" autoSize="true"/>
     <loader id="n3_ox5b" name="loaIcon" xy="60,98" size="150,150" aspect="true" url="ui://eg2y0ldpm9wm8v" fill="scaleMatchHeight"/>
+    <text id="n6_ox5b" name="txtNum" xy="173,218" size="67,44" fontSize="32" color="#be675e" text="X88"/>
     <text id="n5_ox5b" name="txtName" xy="99,281" pivot="0.5,0" size="71,46" fontSize="34" color="#91a08b" text="名字"/>
     <image id="n4_ox5b" name="imgGot" src="ox5b8" fileName="images/yzhl_yqd.png" xy="0,0"/>
   </displayList>

BIN
FGUIProject/assets/DailyLogin/images/yzhd_ditu.png


BIN
FGUIProject/assets/DailyLogin/images/yzhd_dyt_7.png


+ 3 - 3
FGUIProject/assets/Main/MainUI.xml

@@ -5,13 +5,13 @@
     <remark page="1" value="down"/>
   </controller>
   <displayList>
-    <component id="n2_q08x" name="headBar" src="slb416" fileName="components/ComponentHeadBar.xml" xy="18,116"/>
+    <component id="n2_q08x" name="headBar" src="slb416" fileName="components/ComponentHeadBar.xml" xy="17,150"/>
     <component id="n21_q08x" name="valueBar" src="v3541v" fileName="components/ComponentValueBar.xml" pkg="eg2y0ldp" xy="159,90"/>
     <image id="n9_q08x" name="n9" src="q08xk" fileName="images/zjm_yying.png" xy="0,1491" size="1080,429">
       <relation target="" sidePair="bottom-bottom"/>
     </image>
-    <component id="n46_lh8v" name="btnDailyLogin" src="q08xu" fileName="components/ButtonModle1.xml" xy="6,508">
-      <relation target="" sidePair="bottom-bottom"/>
+    <component id="n46_lh8v" name="btnDailyLogin" src="ox5bf5" fileName="components/Button2.xml" xy="522,170">
+      <relation target="" sidePair="right-right,top-top"/>
     </component>
     <component id="n7_q08x" name="btnXiuFang" src="q08xu" fileName="components/ButtonModle1.xml" xy="6,790">
       <relation target="" sidePair="bottom-bottom"/>

+ 11 - 0
FGUIProject/assets/Main/components/Button2.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="472,101" extention="Button">
+  <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
+  <displayList>
+    <image id="n0_ox5b" name="n0" src="ox5bf4" fileName="images/zjm_hdhd_3.png" xy="0,0">
+      <relation target="" sidePair="width-width,height-height"/>
+    </image>
+    <graph id="n1_ox5b" name="holder" xy="235,50" size="1,1" touchable="false"/>
+  </displayList>
+  <Button/>
+</component>

BIN
FGUIProject/assets/Main/images/zjm_hdhd_3.png


+ 2 - 0
FGUIProject/assets/Main/package.xml

@@ -380,6 +380,8 @@
     <component id="sd8cei" name="Component6.xml" path="/components/"/>
     <component id="wet2ew" name="ComRewardEffect.xml" path="/components/" exported="true"/>
     <movieclip id="wet2f3" name="MovieClip4.jta" path="/Movie/"/>
+    <image id="ox5bf4" name="zjm_hdhd_3.png" path="/images/"/>
+    <component id="ox5bf5" name="Button2.xml" path="/components/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\Main" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 8 - 2
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -38,7 +38,13 @@ namespace GFGGame
             return false;
         }
 
-
-
+        /// <summary>
+        /// 七天签到
+        /// </summary>
+        /// <returns></returns>
+        public bool GetDailyLoginRed()
+        {
+            return ActivityDataManager.Instance.dailyLoginBonusStatus == ConstBonusStatus.CAN_GET;
+        }
     }
 }

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/DailyLogin/UI_ListItem.cs

@@ -9,6 +9,7 @@ namespace UI.DailyLogin
         public GComponent target;
         public GLoader m_loaBg;
         public GLoader m_loaIcon;
+        public GTextField m_txtNum;
         public GTextField m_txtName;
         public GImage m_imgGot;
         public const string URL = "ui://5uawdql9jyml7";
@@ -60,6 +61,7 @@ namespace UI.DailyLogin
         {
             m_loaBg = (GLoader)comp.GetChild("loaBg");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
+            m_txtNum = (GTextField)comp.GetChild("txtNum");
             m_txtName = (GTextField)comp.GetChild("txtName");
             m_imgGot = (GImage)comp.GetChild("imgGot");
         }
@@ -67,6 +69,7 @@ namespace UI.DailyLogin
         {
             m_loaBg = null;
             m_loaIcon = null;
+            m_txtNum = null;
             m_txtName = null;
             m_imgGot = null;
             if(disposeTarget && target != null)

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_Button2.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.Main
+{
+    public partial class UI_Button2
+    {
+        public GButton target;
+        public GGraph m_holder;
+        public const string URL = "ui://mfvz4q8kox5bf5";
+        public const string PACKAGE_NAME = "Main";
+        public const string RES_NAME = "Button2";
+        private static UI_Button2 _proxy;
+
+        public static UI_Button2 Create(GObject gObject = null)
+        {
+            var ui = new UI_Button2();
+            if(gObject == null)
+            	ui.target =  (GButton)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GButton)gObject;
+            ui.Init(ui.target);
+            return ui;
+        }
+
+        public static UI_Button2 Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_Button2();
+            }
+            var ui = _proxy;
+            if(gObject == null)
+            	ui.target =  (GButton)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
+            else
+            	ui.target =  (GButton)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_holder = (GGraph)comp.GetChild("holder");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_holder = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_Button2.cs.meta

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

+ 2 - 2
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Main/UI_MainUI.cs

@@ -10,7 +10,7 @@ namespace UI.Main
         public Controller m_c1;
         public UI_ComponentHeadBar m_headBar;
         public GComponent m_valueBar;
-        public UI_ButtonModle1 m_btnDailyLogin;
+        public UI_Button2 m_btnDailyLogin;
         public UI_ButtonModle1 m_btnXiuFang;
         public UI_ButtonModle1 m_btnMain;
         public UI_ButtonModle1 m_btnHuanZhuang;
@@ -70,7 +70,7 @@ namespace UI.Main
             m_c1 = comp.GetController("c1");
             m_headBar = (UI_ComponentHeadBar)UI_ComponentHeadBar.Create(comp.GetChild("headBar"));
             m_valueBar = (GComponent)comp.GetChild("valueBar");
-            m_btnDailyLogin = (UI_ButtonModle1)UI_ButtonModle1.Create(comp.GetChild("btnDailyLogin"));
+            m_btnDailyLogin = (UI_Button2)UI_Button2.Create(comp.GetChild("btnDailyLogin"));
             m_btnXiuFang = (UI_ButtonModle1)UI_ButtonModle1.Create(comp.GetChild("btnXiuFang"));
             m_btnMain = (UI_ButtonModle1)UI_ButtonModle1.Create(comp.GetChild("btnMain"));
             m_btnHuanZhuang = (UI_ButtonModle1)UI_ButtonModle1.Create(comp.GetChild("btnHuanZhuang"));

+ 17 - 9
GameClient/Assets/Game/HotUpdate/Views/DailyLogin/DailyLoginView.cs

@@ -9,7 +9,7 @@ namespace GFGGame
     public class DailyLoginView : BaseWindow
     {
         private UI_DailyLoginUI _ui;
-        private DailyLoginCfg[] _cfgs;
+        private List<DailyLoginCfg> _cfgs;
 
         public override void Dispose()
         {
@@ -22,22 +22,24 @@ namespace GFGGame
             packageName = UI_DailyLoginUI.PACKAGE_NAME;
             _ui = UI_DailyLoginUI.Create();
             this.viewCom = _ui.target;
-            this.viewCom.Center();
             this.modal = true;
+            this.viewCom.Center();
+
             viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
             _ui.m_list.itemRenderer = ListItemRender;
-            _ui.m_list.onClickItem.Add(OnListItemClick);
             _ui.m_loaIcon.onClick.Add(OnListItemClick);
+
         }
 
         protected override void OnShown()
         {
             base.OnShown();
-            _cfgs = DailyLoginCfgArray.Instance.dataArray;
-            _ui.m_list.numItems = _cfgs.Length;
+
+            _cfgs = DailyLoginCfgArray.Instance.GetCfgs("1");
+            _ui.m_list.numItems = _cfgs.Count;
             _ui.m_loaIcon.url = "ui://DailyLogin/yzhd_dyt_7";
-            _ui.m_loaIcon.data = _cfgs[_cfgs.Length - 1];
+            _ui.m_loaIcon.data = _cfgs[_cfgs.Count - 1];
         }
 
         protected override void OnHide()
@@ -52,11 +54,17 @@ namespace GFGGame
             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.rewardsArr[0][0]);
             item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
             item.m_txtName.text = itemCfg.name;
-            item.m_imgGot.visible = cfg.id < ActivityDataManager.Instance.dailyLoginId;
-            if (cfg.id == ActivityDataManager.Instance.dailyLoginId)
+            item.m_txtNum.text = "x" + cfg.rewardsArr[0][1];
+            int dailyLoginId = ActivityDataManager.Instance.dailyLoginId;
+            item.m_imgGot.visible = cfg.id < dailyLoginId || cfg.id == dailyLoginId && ActivityDataManager.Instance.dailyLoginBonusStatus == ConstBonusStatus.GOT;
+            if (cfg.id == dailyLoginId)
             {
                 RedDotController.Instance.SetComRedDot(item.target, ActivityDataManager.Instance.dailyLoginBonusStatus == ConstBonusStatus.CAN_GET);
             }
+            if (item.target.data == null)
+            {
+                item.target.onClick.Add(OnListItemClick);
+            }
             item.target.data = cfg;
             UI_ListItem.ClearProxy();
         }
@@ -69,7 +77,7 @@ namespace GFGGame
                 bool result = await ActivitySProxy.ReqGetDailyLoginRewards(cfg.id);
                 if (result)
                 {
-                    _ui.m_list.numItems = _cfgs.Length;
+                    _ui.m_list.numItems = _cfgs.Count;
                 }
             }
             else

+ 12 - 10
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -88,7 +88,7 @@ namespace GFGGame
             _btnJInShu.visible = false;
             _btnTianGong.visible = false;
 
-            _btns = new UI_ButtonModle1[] { _ui.m_btnHuanZhuang, _ui.m_btnZhaiXing, _ui.m_btnDailyLogin, _ui.m_btnXiuFang, _ui.m_btnCiPai, _ui.m_btnStudio, _ui.m_btnField };
+            _btns = new UI_ButtonModle1[] { _ui.m_btnHuanZhuang, _ui.m_btnZhaiXing, _ui.m_btnXiuFang, _ui.m_btnCiPai, _ui.m_btnStudio, _ui.m_btnField };
             _ui.m_btnMain.target.onTouchBegin.Add(OnClickBtnMain);
             _ui.m_btnHuanZhuang.target.onTouchBegin.Add(OnClickBtnHuanZhuang);
             _ui.m_btnZhaiXing.target.onTouchBegin.Add(OnClickBtnZhaiXing);
@@ -235,15 +235,16 @@ namespace GFGGame
         }
         private void OnClickBtnDailyLogin()
         {
-            if (isOpen) return;
-            isOpen = true;
-            _ui.m_btnDailyLogin.m_holder1.visible = true;
-            Timers.inst.Add(effectTime, 1, (param) =>
-            {
-                _ui.m_btnDailyLogin.m_holder1.visible = false;
-                ViewManager.Show<DailyLoginView>(null, new object[] { ViewName.MAINUI_VIEW, this.viewData });
-                isOpen = false;
-            });
+            // if (isOpen) return;
+            // isOpen = true;
+            _ui.m_btnDailyLogin.m_holder.visible = true;
+            // Timers.inst.Add(effectTime, 1, (param) =>
+            // {
+            //     _ui.m_btnDailyLogin.m_holder.visible = false;
+            ViewManager.Show<DailyLoginView>(null, new object[] { ViewName.MAINUI_VIEW, this.viewData });
+            ViewManager.SetMaskAlpha(0.8f);
+            //     isOpen = false;
+            // });
         }
         private void OnClickBtnCiPai()
         {
@@ -356,6 +357,7 @@ namespace GFGGame
         {
             RedDotController.Instance.SetComRedDot(_btnGongGao, RedDotDataManager.Instance.GetNoticeRed());
             RedDotController.Instance.SetComRedDot(_btnRenWu, RedDotDataManager.Instance.GetTaskRed());
+            RedDotController.Instance.SetComRedDot(_ui.m_btnDailyLogin.target, RedDotDataManager.Instance.GetDailyLoginRed());
         }
 
 

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/ViewManager.cs

@@ -294,5 +294,11 @@ namespace GFGGame
             string name = names[names.Length - 1];
             return name;
         }
+
+        public static void SetMaskAlpha(float alpha)
+        {
+            GRoot.inst.modalLayer.alpha = alpha;
+
+        }
     }
 }

BIN
GameClient/Assets/ResIn/UI/DailyLogin/DailyLogin_atlas0.png


BIN
GameClient/Assets/ResIn/UI/DailyLogin/DailyLogin_fui.bytes


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_1!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_1.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_3!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_3.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_4!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_4.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_5!a.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_atlas0_5.png


BIN
GameClient/Assets/ResIn/UI/Main/Main_fui.bytes


+ 1 - 0
GameClient/Assets/ThirdParty/FairyGUI/Scripts/UI/Window.cs

@@ -207,6 +207,7 @@ namespace FairyGUI
         /// </summary>
         public void Hide()
         {
+            GRoot.inst.modalLayer.alpha = 0.6f;
             if (this.isShowing)
                 DoHideAnimation();
         }