Ver Fonte

摘星弹窗增加本次登录不再提醒选项

huangxiaoyue há 1 ano atrás
pai
commit
f8d59bb2c0

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Controller/BuyTipsController.cs

@@ -7,13 +7,13 @@ namespace GFGGame
     {
         private static BuyTipsView _buyTipsView;
 
-        public static void Show(int itemId, long count, Action onSuccess = null)
+        public static void Show(int itemId, long count, Action onSuccess = null,bool showCheck = false)
         {
             if (_buyTipsView == null)
             {
                 _buyTipsView = new BuyTipsView();
             }
-            _buyTipsView.SetParams(itemId, count, onSuccess);
+            _buyTipsView.SetParams(itemId, count, onSuccess, showCheck);
             _buyTipsView.Show();
         }
 

+ 20 - 4
GameClient/Assets/Game/HotUpdate/Data/LuckyBoxDataManager.cs

@@ -16,6 +16,8 @@ namespace GFGGame
 
         public const float ANIMATION_TIME = 1.2f; //翻牌获得物品展示时间
 
+        public bool CHECK_TIPS_OPEN = false; //提示弹窗是否打开
+
         private List<ItemData> _rewardsList;//当前奖励,每次抽奖后刷新
         private Dictionary<int, ItemData> _firstRewardsList = new Dictionary<int, ItemData>();//首次获得的奖励
         private Dictionary<int, List<LuckyBoxBonusData>> _dicShowList = new Dictionary<int, List<LuckyBoxBonusData>>();
@@ -242,7 +244,10 @@ namespace GFGGame
             }
             else if (hasNum >= costNum)
             {
-                AlertUI.Show(string.Format("是否花费{0}个{1}摘星{2}次?", costNum, itemCfg.name, times)).SetLeftButton(true).SetRightButton(true, "确定", (object data) => { onSuccess(); });
+                if(LuckyBoxDataManager.Instance.CHECK_TIPS_OPEN == false)
+                    AlertUI.Show(string.Format("是否花费{0}个{1}摘星{2}次?", costNum, itemCfg.name, times)).SetLeftButton(true).SetRightButton(true, "确定", (object data) => { onSuccess(); });
+                else
+                    onSuccess();
             }
             else
             {
@@ -269,9 +274,13 @@ namespace GFGGame
                     {
                         ItemUtil.ExchangeItemById(costId, needNum, false, onSuccess);
                     }
-                    else
-                    {
-                        BuyTipsController.Show(costId, needNum, onSuccess);
+                    else {
+                        if (LuckyBoxDataManager.Instance.CHECK_TIPS_OPEN == false)
+                            BuyTipsController.Show(costId, needNum, onSuccess, true);
+                        else
+                        {
+                            OnBuyItem(costId, needNum, onSuccess);
+                        }
                     }
                 }
                 else//购买消耗品的道具不足,提示购买 购买消耗品的道具
@@ -281,6 +290,13 @@ namespace GFGGame
             }
         }
 
+        private async void OnBuyItem(int itemId, long count, Action onSuccess = null)
+        {
+            var _result = await ItemExchangeSProxy.ItemExchange(itemId, count);
+            if (_result)
+                BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(itemId, count), onSuccess);
+        }
+
         private int GetCostNum(int boxId, int times)
         {
             LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/Common/UI_AlertUI.cs

@@ -12,6 +12,7 @@ namespace UI.Common
         public GTextField m_txtTips;
         public GButton m_btnLeft;
         public GButton m_btnRight;
+        public GButton m_btnCheck;
         public const string URL = "ui://mk0fwx0xl55o0";
         public const string PACKAGE_NAME = "Common";
         public const string RES_NAME = "AlertUI";
@@ -64,6 +65,7 @@ namespace UI.Common
             m_txtTips = (GTextField)comp.GetChild("txtTips");
             m_btnLeft = (GButton)comp.GetChild("btnLeft");
             m_btnRight = (GButton)comp.GetChild("btnRight");
+            m_btnCheck = (GButton)comp.GetChild("btnCheck");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -72,6 +74,7 @@ namespace UI.Common
             m_txtTips = null;
             m_btnLeft = null;
             m_btnRight = null;
+            m_btnCheck = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/CommonGame/UI_BuyTipsUI.cs

@@ -7,12 +7,14 @@ namespace UI.CommonGame
     public partial class UI_BuyTipsUI
     {
         public GComponent target;
+        public Controller m_checkType;
         public GComponent m_bg;
         public GTextField m_txtNeed;
         public GTextField m_txtCost;
         public GLoader m_loaNeed;
         public GButton m_btnCancel;
         public GButton m_btnSure;
+        public GButton m_btnCheck;
         public const string URL = "ui://eg2y0ldpds629g";
         public const string PACKAGE_NAME = "CommonGame";
         public const string RES_NAME = "BuyTipsUI";
@@ -60,21 +62,25 @@ namespace UI.CommonGame
 
         private void Init(GComponent comp)
         {
+            m_checkType = comp.GetController("checkType");
             m_bg = (GComponent)comp.GetChild("bg");
             m_txtNeed = (GTextField)comp.GetChild("txtNeed");
             m_txtCost = (GTextField)comp.GetChild("txtCost");
             m_loaNeed = (GLoader)comp.GetChild("loaNeed");
             m_btnCancel = (GButton)comp.GetChild("btnCancel");
             m_btnSure = (GButton)comp.GetChild("btnSure");
+            m_btnCheck = (GButton)comp.GetChild("btnCheck");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_checkType = null;
             m_bg = null;
             m_txtNeed = null;
             m_txtCost = null;
             m_loaNeed = null;
             m_btnCancel = null;
             m_btnSure = null;
+            m_btnCheck = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 9 - 0
GameClient/Assets/Game/HotUpdate/Views/Common/Alert/AlertWindow.cs

@@ -66,6 +66,8 @@ namespace GFGGame
                 this.Hide();
                 m_rightButtonCallback?.Invoke(m_data);
             });
+
+            _ui.m_btnCheck.onClick.Add(OnBtnCheckClick);
         }
 
         protected override void OnShown()
@@ -92,12 +94,19 @@ namespace GFGGame
         //        }
         //    }
         //}
+
+        private void OnBtnCheckClick()
+        {
+            LuckyBoxDataManager.Instance.CHECK_TIPS_OPEN = _ui.m_btnCheck.selected;
+        }
+
         public IAlert SetLayer(string setlayer)
         {
             layer = setlayer;
             return this;
 
         }
+
         private void updateButtonPosition()
         {
             float xLeftButton = m_xLeftButton;

+ 19 - 2
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyTipsView.cs

@@ -14,6 +14,7 @@ namespace GFGGame
         private int _costCount;
         private bool _result = false;
         private Action _onSuccess;
+        private bool _showCheck = false;
 
         public override void Dispose()
         {
@@ -37,19 +38,25 @@ namespace GFGGame
 
             _ui.m_btnSure.onClick.Add(OnClickBtnSure);
             _ui.m_btnCancel.onClick.Add(OnClickBtnCancel);
+            _ui.m_btnCancel.onClick.Add(OnClickBtnCancel);
+            _ui.m_btnCheck.onClick.Add(OnBtnCheckClick);
         }
-        public void SetParams(int itemId, long count, Action onSuccess = null)
+
+        public void SetParams(int itemId, long count, Action onSuccess = null, bool showCheck = false)
         {
             _itemId = itemId;
             _count = count;
 
             _onSuccess = onSuccess;
+            _showCheck = showCheck;
         }
+
         protected override void OnShown()
         {
             base.OnShown();
             UpdateView();
         }
+
         private void UpdateView()
         {
             ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, ItemDataManager.GetItemExchangeTimes(_itemId), (int)_count, out _costId, out _costCount, out int buyNum);
@@ -58,7 +65,13 @@ namespace GFGGame
             _ui.m_loaNeed.url = ResPathUtil.GetCommonGameResPath(itemCfg.res);
             ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(_costId);
             _ui.m_txtCost.text = string.Format("是否花费{0}{1}购买?", _costCount, costCfg.name);
+
+            if (_showCheck)
+                _ui.m_checkType.selectedIndex = 1;
+            else
+                _ui.m_checkType.selectedIndex = 0;
         }
+
         private async void OnClickBtnSure()
         {
 
@@ -70,11 +83,15 @@ namespace GFGGame
 
             this.Hide();
         }
+
         private void OnClickBtnCancel()
         {
             this.Hide();
         }
 
+        private void OnBtnCheckClick()
+        {
+            LuckyBoxDataManager.Instance.CHECK_TIPS_OPEN = _ui.m_btnCheck.selected;
+        }
     }
-
 }

BIN
GameClient/Assets/ResIn/UI/Common/Common_fui.bytes


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