浏览代码

图鉴红点

zhaoyang 3 年之前
父节点
当前提交
9271b1cd97

+ 3 - 3
FGUIProject/assets/FieldGuide/SuitShowUI.xml

@@ -9,7 +9,7 @@
     </graph>
     <image id="n11_qr4e" name="n11" src="kztethr" fileName="imagesExport/hyhy_btbt_1.png" pkg="eg2y0ldp" xy="302,70" group="n13_qr4e"/>
     <text id="n2_pjip" name="txtTypeName" xy="275,82" size="530,62" group="n13_qr4e" fontSize="46" color="#8f6e30" align="center" autoSize="none" text="分类名称"/>
-    <group id="n13_qr4e" name="n13" xy="275,70" size="530,85"/>
+    <group id="n13_qr4e" name="n13" xy="275,70" size="530,85" visible="false" advanced="true"/>
     <image id="n4_pjip" name="n4" src="pjip1d" fileName="images/tujian_tzk_1.png" xy="145,1186">
       <relation target="n3_pjip" sidePair="center-center,middle-middle"/>
     </image>
@@ -26,9 +26,9 @@
     <loader id="n6_pjip" name="btnChangeAction" xy="940,329" size="99,98" group="n12_qr4e" url="ui://vqq9h9h4pjip1e" autoSize="true">
       <relation target="" sidePair="center-center,middle-middle"/>
     </loader>
-    <loader id="n5_pjip" name="imgBonusBox" xy="940,450" size="94,95" group="n12_qr4e" url="ui://vqq9h9h4pjip1j">
+    <component id="n5_pjip" name="imgBonusBox" src="jj4d1o" fileName="components/Button4.xml" xy="940,450" size="94,95" group="n12_qr4e">
       <relation target="" sidePair="center-center,middle-middle"/>
-    </loader>
+    </component>
     <group id="n12_qr4e" name="n12" xy="940,329" size="99,216" advanced="true" layout="vt" lineGap="23" excludeInvisibles="true"/>
   </displayList>
 </component>

+ 15 - 0
FGUIProject/assets/FieldGuide/components/Button4.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="99,98" extention="Button">
+  <controller name="button" pages="0,up,1,down" selected="0"/>
+  <controller name="c1" pages="0,,1," selected="1"/>
+  <displayList>
+    <image id="n0_jj4d" name="n0" src="pjip1j" fileName="imagesExport/tujian_lwlw_1.png" xy="0,0">
+      <gearDisplay controller="c1" pages="1"/>
+      <relation target="" sidePair="width-width,height-height"/>
+    </image>
+    <image id="n1_jj4d" name="n1" src="pjip1c" fileName="imagesExport/tujian_lwlw_2.png" xy="0,0">
+      <gearDisplay controller="c1" pages="0"/>
+    </image>
+  </displayList>
+  <Button/>
+</component>

+ 1 - 0
FGUIProject/assets/FieldGuide/package.xml

@@ -52,6 +52,7 @@
     <image id="u6p31m" name="tujian_tup_1.jpg" path="/imagesExport/" exported="true"/>
     <image id="qr4e1n" name="tujian_tztub_4.png" path="/images/"/>
     <component id="z3os0" name="SuitGuideUI.xml" path="/" exported="true"/>
+    <component id="jj4d1o" name="Button4.xml" path="/components/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\FieldGuide" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 2 - 0
GameClient/Assets/Game/HotUpdate/Constant/ConstMessage.cs

@@ -61,5 +61,7 @@ namespace GFGGame
         public const string NOTICE_SYSTOM_ADD = "NOTICE_SYSTOM_ADD";//新增公告
         public const string NOTICE_SYSTOM_REMOVE = "NOTICE_SYSTOM_REMOVE";//删除公告
 
+        public const string SUIT_GUIDE_BOX_BONUS = "SUIT_GUIDE_BOX_BONUS";//领取套装收集奖励
+
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -104,6 +104,7 @@ namespace GFGGame
 
             await InstanceZonesSProxy.GetInstanceZonesInfos();
             await StorageSProxy.ReqGetClientValues();
+            await SuitFosterProxy.SendGetSuitInfos();
             await ActivitySProxy.ReqDailyLoginInfos();
 
             GameGlobal.lastLoginTime = StorageDataManager.Instance.GetStorageValue(ConstStorageId.LAST_LOGIN_TIME);
@@ -220,7 +221,6 @@ namespace GFGGame
         private static async void AfterEnterGame(object param)
         {
             ItemHelper.GetItemAttributeInfos().Coroutine();
-            SuitFosterProxy.SendGetSuitInfos().Coroutine();
             MainStorySProxy.GetStoryInfos().Coroutine();
             CardSProxy.GetCardInfos().Coroutine();
             RechargeSProxy.ReqRechargeInfo().Coroutine();

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/DressUpMenuSuitDataManager.cs

@@ -208,7 +208,7 @@ namespace GFGGame
             {
                 status = _suitGuideBoxBonusStatus[suitId];
             }
-            if (status == ConstBonusStatus.CAN_NOT_GET)
+            if (status == ConstBonusStatus.CAN_NOT_GET)//游戏过程中收集完成套装,不会有奖励可领状态不会有推送,需要前端判断
             {
                 if (CheckHaveSuit(suitId))
                 {

+ 18 - 0
GameClient/Assets/Game/HotUpdate/Data/RedDotDataManager.cs

@@ -56,5 +56,23 @@ namespace GFGGame
 
             return false;
         }
+
+        /// <summary>
+        /// 套装收集奖励可领
+        /// </summary>
+        /// <returns></returns>
+        public bool GetFieldGuideRed()
+        {
+            List<int> _suitIds = SuitUtil.GetSuitIdList(false, true, 0, 3);//全部已获得套装按照收集度高排序
+            for (int i = 0; i < _suitIds.Count; i++)
+            {
+                int status = DressUpMenuSuitDataManager.GetSuitGuideBonusStatus(_suitIds[i]);
+                if (status == ConstBonusStatus.CAN_GET)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
     }
 }

+ 71 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/FieldGuide/UI_Button4.cs

@@ -0,0 +1,71 @@
+/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
+
+using FairyGUI;
+
+namespace UI.FieldGuide
+{
+    public partial class UI_Button4
+    {
+        public GButton target;
+        public Controller m_c1;
+        public const string URL = "ui://vqq9h9h4jj4d1o";
+        public const string PACKAGE_NAME = "FieldGuide";
+        public const string RES_NAME = "Button4";
+        private static UI_Button4 _proxy;
+
+        public static UI_Button4 Create(GObject gObject = null)
+        {
+            var ui = new UI_Button4();
+            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_Button4 Proxy(GObject gObject = null)
+        {
+            if(_proxy == null)
+            {
+                _proxy = new UI_Button4();
+            }
+            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_c1 = comp.GetController("c1");
+        }
+        public void Dispose(bool disposeTarget = false)
+        {
+            m_c1 = null;
+            if(disposeTarget && target != null)
+            {
+                target.RemoveFromParent();
+                target.Dispose();
+            }
+            target = null;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/FieldGuide/UI_Button4.cs.meta

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

+ 3 - 2
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/FieldGuide/UI_SuitShowUI.cs

@@ -15,7 +15,7 @@ namespace UI.FieldGuide
         public GButton m_btnLeft;
         public GButton m_btnBack;
         public GLoader m_btnChangeAction;
-        public GLoader m_imgBonusBox;
+        public UI_Button4 m_imgBonusBox;
         public const string URL = "ui://vqq9h9h4pjip1b";
         public const string PACKAGE_NAME = "FieldGuide";
         public const string RES_NAME = "SuitShowUI";
@@ -71,7 +71,7 @@ namespace UI.FieldGuide
             m_btnLeft = (GButton)comp.GetChild("btnLeft");
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_btnChangeAction = (GLoader)comp.GetChild("btnChangeAction");
-            m_imgBonusBox = (GLoader)comp.GetChild("imgBonusBox");
+            m_imgBonusBox = (UI_Button4)UI_Button4.Create(comp.GetChild("imgBonusBox"));
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -83,6 +83,7 @@ namespace UI.FieldGuide
             m_btnLeft = null;
             m_btnBack = null;
             m_btnChangeAction = null;
+            m_imgBonusBox.Dispose();
             m_imgBonusBox = null;
             if(disposeTarget && target != null)
             {

+ 2 - 1
GameClient/Assets/Game/HotUpdate/ServerProxy/SuitSProxy.cs

@@ -10,11 +10,12 @@ namespace GFGGame
             m2C_GetSuitGuideBoxBonus = (M2C_GetSuitGuideBoxBonus)await MessageHelper.SendToServer(new C2M_GetSuitGuideBoxBonus() { SuitId = suitId });
             if (m2C_GetSuitGuideBoxBonus != null)
             {
-                if(m2C_GetSuitGuideBoxBonus.Error == ErrorCode.ERR_Success)
+                if (m2C_GetSuitGuideBoxBonus.Error == ErrorCode.ERR_Success)
                 {
                     DressUpMenuSuitDataManager.SetSuitGuideBoxBonusCompleted(m2C_GetSuitGuideBoxBonus.SuitId);
                     SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
                     BonusController.TryShowBonusList(suitCfg.guideBoxBonusArr);
+                    EventAgent.DispatchEvent(ConstMessage.SUIT_GUIDE_BOX_BONUS);
                 }
             }
         }

+ 11 - 1
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/FieldGuideView.cs

@@ -7,9 +7,12 @@ namespace GFGGame
 {
     public class FieldGuideView : BaseWindow
     {
+        private delegate bool GetRedCall();
+
         private UI_FieldGuideUI _ui;
         private int[] _listBannerDatas = new int[3] { ConstBannerId.ZHAI_XING, ConstBannerId.ZHAI_XING, ConstBannerId.ZHAI_XING };
         private int[] _listGuideDatas = new int[1] { ConstFieldGuideId.SUIT_GUIDE };
+        GetRedCall[] actions = new GetRedCall[] { RedDotDataManager.Instance.GetFieldGuideRed };
 
         public override void Dispose()
         {
@@ -34,13 +37,18 @@ namespace GFGGame
             _ui.m_listGuide.onClickItem.Add(OnClickListGuideItem);
             _ui.m_compBanner.m_listTab.onClickItem.Add(OnClickListBannerItem);
             _ui.m_compBanner.m_loaderPic.onClick.Add(OnClickBannerPic);
+
+            EventAgent.AddEventListener(ConstMessage.SUIT_GUIDE_BOX_BONUS, () =>
+            {
+                _ui.m_listGuide.numItems = _listGuideDatas.Length;
+            });
         }
 
         protected override void OnShown()
         {
             base.OnShown();
             _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("gxhd_bjbj");
-
+            _ui.m_listGuide.numItems = _listGuideDatas.Length;
             UpdatePrgress();
             _ui.m_compBanner.m_listTab.selectedIndex = 0;
             UpdateBanner(_ui.m_compBanner.m_listTab.GetChildAt(_ui.m_compBanner.m_listTab.selectedIndex));
@@ -84,6 +92,8 @@ namespace GFGGame
             listItem.m_loaderTitle.url = "ui://FieldGuide/tujian_taoz_" + id;
             listItem.m_loaderPic.url = "ui://FieldGuide/tujian_tup_" + id;
             listItem.target.data = id;
+            bool red = actions[index]();
+            RedDotController.Instance.SetComRedDot(listItem.target, red, "", 20);
         }
 
         private void OnClickListBannerItem(EventContext context)

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/SuitGuideView.cs

@@ -199,6 +199,7 @@ namespace GFGGame
             bool haveSuit = DressUpMenuSuitDataManager.CheckHaveSuit(suitId);
             listItem.m_imgLock.visible = listItem.m_imgLockBg.visible = !haveSuit;
             int status = DressUpMenuSuitDataManager.GetSuitGuideBonusStatus(suitId);
+            RedDotController.Instance.SetComRedDot(listItem.target, status == ConstBonusStatus.CAN_GET, "", 0, 4, 0, 402);
             if (status == ConstBonusStatus.CAN_GET)
             {
                 listItem.m_loaderBonusBox.url = "ui://FieldGuide/tujian_lw_1";

+ 5 - 3
GameClient/Assets/Game/HotUpdate/Views/FieldGuide/SuitShowView.cs

@@ -46,7 +46,7 @@ namespace GFGGame
 
             _ui.m_btnBack.onClick.Add(OnClickBtnBack);
 
-            _ui.m_imgBonusBox.onClick.Add(OnClickImgBonusBox);
+            _ui.m_imgBonusBox.target.onClick.Add(OnClickImgBonusBox);
             _ui.m_btnChangeAction.onClick.Add(OnClickBtnChangeAction);
 
             _ui.m_btnLeft.onClick.Add(OnClickBtnLeft);
@@ -177,13 +177,15 @@ namespace GFGGame
             if (eventContext == null || _suitId == (int)eventContext.data)
             {
                 int status = DressUpMenuSuitDataManager.GetSuitGuideBonusStatus(_suitId);
+                RedDotController.Instance.SetComRedDot(_ui.m_imgBonusBox.target, status == ConstBonusStatus.CAN_GET);
+
                 if (status == ConstBonusStatus.CAN_GET)
                 {
-                    _ui.m_imgBonusBox.url = "ui://FieldGuide/tujian_lwlw_1";
+                    _ui.m_imgBonusBox.m_c1.selectedIndex = 1;
                 }
                 else
                 {
-                    _ui.m_imgBonusBox.url = "ui://FieldGuide/tujian_lwlw_2";
+                    _ui.m_imgBonusBox.m_c1.selectedIndex = 0;
                 }
             }
         }

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -395,6 +395,7 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_btnRenWu, RedDotDataManager.Instance.GetTaskRed());
             RedDotController.Instance.SetComRedDot(_ui.m_btnDailyLogin.target, RedDotDataManager.Instance.GetDailyLoginRed());
             RedDotController.Instance.SetComRedDot(_btnYouJian, RedDotDataManager.Instance.GetMailRed());
+            RedDotController.Instance.SetComRedDot(_btnTuJian, RedDotDataManager.Instance.GetFieldGuideRed());
         }
 
 

二进制
GameClient/Assets/ResIn/UI/FieldGuide/FieldGuide_fui.bytes