Переглянути джерело

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

zhaoyang 2 роки тому
батько
коміт
4266cd978c

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

@@ -808,5 +808,47 @@ namespace GFGGame
             }
             return false;
         }
+
+        /// <summary>
+        /// 常驻礼包是否有需要领取的金币
+        /// </summary>
+        /// <returns></returns>
+        public bool GetGoldRed()
+        {
+            var shopCfgList = ShopCfgArray.Instance
+                .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_GOLD)
+                .OrderBy(a => a.refreshType).ToList();
+            foreach (var shopCfg in shopCfgList)
+            {
+                var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
+                if (weekGiftBoxState)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+        
+        /// <summary>
+        /// 常驻礼包是否有需要领取的体力
+        /// </summary>
+        /// <returns></returns>
+        public bool GetPowerRed()
+        {
+            var shopCfgList = ShopCfgArray.Instance
+                .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_POWER)
+                .OrderBy(a => a.refreshType).ToList();
+            foreach (var shopCfg in shopCfgList)
+            {
+                var weekGiftBoxState = EnduringGiftBoxDataManager.Instance.DayIsRebateGiftBox(shopCfg.itemId);
+                if (weekGiftBoxState)
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
     }
 }

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Views/Common/Controller/ValueBarController.cs

@@ -173,6 +173,12 @@ namespace GFGGame
             _valueBar.m_list.numItems = itemIds.Count;
         }
 
+        public void UpRead()
+        {
+            RedDotController.Instance.SetComRedDot(_valueBar.m_btnPower.target, RedDotDataManager.Instance.GetPowerRed());
+            RedDotController.Instance.SetComRedDot(_valueBar.m_btnGold.target, RedDotDataManager.Instance.GetGoldRed());
+        }
+
         private void RenderListItem(int index, GObject obj)
         {
             int itemId = (obj.parent.data as List<int>)[index];

+ 15 - 0
GameClient/Assets/Game/HotUpdate/Views/DressUp/PhotographSaveView.cs

@@ -65,14 +65,29 @@ namespace GFGGame
 
         private void OnClickBtnSave()
         {
+            if(LocalCache.GetBool(GameConst.WRITE_EXTERNAL_STORAGE_FORBIDDEN, false))
+            {
+                AlertSystem.Show("保存至本地需要使用存储权限,您已经禁止!请前往手机系统设置开启应用存储权限。");
+                return;
+            }
             //检查用户是否已授予对需要授权的设备资源或信息的访问权。
             if (!Permission.HasUserAuthorizedPermission(Permission.ExternalStorageWrite))
             {
+                PromptController.Instance.ShowFloatTextPrompt("保存至本地需要使用存储权限,请同意!");
                 //请求用户授权访问需要授权的设备资源或信息.
                 PermissionCallbacks permissionCallbacks = new PermissionCallbacks();
                 permissionCallbacks.PermissionGranted += (string a) => {
                     TrySavePicturoToLocal();
                 };
+                permissionCallbacks.PermissionDenied += (string a) =>
+                {
+                    PromptController.Instance.ShowFloatTextPrompt("由于被禁止存储权限,保存失败!");
+                };
+                permissionCallbacks.PermissionDeniedAndDontAskAgain += (string a) =>
+                {
+                    LocalCache.SetBool(GameConst.WRITE_EXTERNAL_STORAGE_FORBIDDEN, true);
+                    PromptController.Instance.ShowFloatTextPrompt("由于被禁止存储权限,保存失败!");
+                };
                 Permission.RequestUserPermission(Permission.ExternalStorageWrite, permissionCallbacks);
             }
             TrySavePicturoToLocal();

+ 7 - 2
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/EnduringGiftBoxView.cs

@@ -294,6 +294,8 @@ namespace GFGGame
 
                 numItems = childItemCfg.param1Arr.Length;
 
+                //领取加红点
+                RedDotController.Instance.SetComRedDot(item.m_btnCurReceive.target, weekGiftBoxState);
                 //是否需要领取
                 if (weekGiftBoxState)
                 {
@@ -376,6 +378,7 @@ namespace GFGGame
                 GuideController.TryCompleteGuideIndex(ConstGuideId.BUY_POWER, 1);
                 GuideController.TryCompleteGuide(ConstGuideId.BUY_POWER, 1);
             }
+
             GObject sender = context.sender as GObject;
             GObject obj = sender.parent;
             ShopCfg cfg = obj.data as ShopCfg;
@@ -549,10 +552,12 @@ namespace GFGGame
             // Dispose();
             this.Hide();
         }
+
         private void CheckGuide()
         {
             Timers.inst.AddUpdate(CheckGuide);
         }
+
         private void CheckGuide(object param)
         {
             if (GuideDataManager.IsGuideFinish(ConstGuideId.BUY_POWER) <= 0)
@@ -570,9 +575,9 @@ namespace GFGGame
             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
             if (_itemId == ConstItemID.POWER)
             {
-                GuideController.TryGuide(_ui.m_list.GetChildAt(1).asCom.GetChild("btnCurReceive").asButton, ConstGuideId.BUY_POWER, 1, "花点小钱可以购买体力超值返利包,每天都能领体力哦~");
+                GuideController.TryGuide(_ui.m_list.GetChildAt(1).asCom.GetChild("btnCurReceive").asButton,
+                    ConstGuideId.BUY_POWER, 1, "花点小钱可以购买体力超值返利包,每天都能领体力哦~");
             }
-
         }
     }
 }

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

@@ -1008,6 +1008,7 @@ namespace GFGGame
 
         private void UpdateRedDot()
         {
+            _valueBarController.UpRead();
             RedDotController.Instance.SetComRedDot(_btnGongGao, RedDotDataManager.Instance.GetNoticeRed());
             RedDotController.Instance.SetComRedDot(_btnRenWu, RedDotDataManager.Instance.GetTaskRed());
             // RedDotController.Instance.SetComRedDot(_ui.m_btnDailyLogin.target,

+ 1 - 2
GameClient/Assets/Game/Launcher/LauncherController.cs

@@ -30,7 +30,6 @@ namespace GFGGame
             }
             else
             {
-                LauncherView.Instance.SetDesc("正在请求权限...");
                 LauncherAgreeView.Instance.Open(() => {
                     InitBugly();
                     onSuccess?.Invoke();
@@ -96,7 +95,7 @@ namespace GFGGame
 
         private static void StartGame()
         {
-            LauncherView.Instance.SetDesc($"正在启动游戏...");
+            LauncherView.Instance.SetDesc($"稍等片刻,精彩立刻呈现...");
             HotUpdateCodeLoader.Instance.StartLoad();
         }