lzx 22 tuntia sitten
vanhempi
commit
d82ef3b121

+ 17 - 0
Assets/Scripts/GameLogic/Player/SummonManager.cs

@@ -18,6 +18,8 @@ namespace GameLogic.Player
         //积分规则
         public Map<int, List<OpenBoxScoreRule>> openBoxScoreRuleMap = new Map<int, List<OpenBoxScoreRule>>();
 
+        private static readonly System.Random random = new System.Random();
+
         public void CustomInit()
         {
             OpenBoxConfig[] openBoxConfigs = ConfigComponent.Instance.GetAll<OpenBoxConfig>();
@@ -252,9 +254,24 @@ namespace GameLogic.Player
 
 
             AccountFileInfo.Instance.SavePlayerData();
+            Shuffle(allItem);
             return allItem;
         }
 
+
+        public static void Shuffle<T>(IList<T> list)
+        {
+            int n = list.Count;
+            while (n > 1)
+            {
+                n--;
+                int k = random.Next(n + 1);
+                T value = list[k];
+                list[k] = list[n];
+                list[n] = value;
+            }
+        }
+
         // 计算保底物品集合
         private HashSet<int> CalculateBaodiItems(int rewardId)
         {

+ 5 - 10
Assets/Scripts/GameUI/UI/AppBarPanel/AppBarPanel.cs

@@ -111,15 +111,15 @@ namespace Fort23.Mono
             await DivineSenceInfoPanel.OpenPanel((count, useItems) => { Bnt_shengShi_onClick(count, useItems); });
         }
 
-        public async void Btn_Shop_Click(int shopId = 0,bool isQz = false)
+        public async void Btn_Shop_Click(int shopId = 0)
         {
             CloseMenu();
-            if (currentOpenUIPanel is ShopPanel && !isQz)
+            if (currentOpenUIPanel is ShopPanel)
             {
                 return;
             }
 
-    
+
             UIPanel uiPanel = currentOpenUIPanel;
 
             CombatDrive.Instance.CombatController.isUpdate = false;
@@ -127,11 +127,7 @@ namespace Fort23.Mono
             if (uiPanel is CaveMainPanel || uiPanel is SkillSelectPanel || uiPanel is ShopPanel ||
                 uiPanel is MainHeroPanel)
             {
-                if (!(currentOpenUIPanel is ShopPanel))
-                {
-                     UIManager.Instance.HideUIUIPanel(uiPanel, isBreadcrumbBarPanel: false);
-                }
-               
+                UIManager.Instance.HideUIUIPanel(uiPanel, isBreadcrumbBarPanel: false);
             }
 
             if (!shopPanel.IsClose)
@@ -221,8 +217,7 @@ namespace Fort23.Mono
                 PlayerGuideManager.Instance.StepInit();
                 PlayerGuideManager.Instance.SetOnClickMask(true);
             }
-                
-    
+
 
             EventSystemManager.Instance.isTriggerEvent = true;
             CombatDrive.Instance.CombatController.ChangeState(CombatController.idle);

+ 9 - 1
Assets/Scripts/GameUI/UI/GongFaUpgradePanel/GongFaUpgradePanel.cs

@@ -78,8 +78,16 @@ namespace Fort23.Mono
 
             Btn_UpGradeOkLongPress.longPress = () => { UpgradeClick(); };
 
-            Btn_Rest.onClick.AddListener(() =>
+            Btn_Rest.onClick.AddListener(async() =>
             {
+
+
+                bool relust = await TipsPanle.OpenPnael("提示","是否重置功法");
+                if (!relust)
+                {
+                    return;
+                }
+                
                 Dictionary<int, ItemInfo> itemInfo = new Dictionary<int, ItemInfo>();
 
                 for (int i = 1; i < _skillInfo.SkillPowerupConfig.ID; i++)

+ 24 - 2
Assets/Scripts/GameUI/UI/ShopPanel/ShopBuyItemPanel.cs

@@ -160,7 +160,18 @@ namespace Fort23.Mono
             }
             else
             {
-                Text_Price.text = _shopItemConfig.price.ToString();
+                
+                if (_shopItemConfig.price > PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId))
+                {
+                    Text_Price.text =
+                        $"<color=red>{PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId).ToStringEx()}</color>/{_shopItemConfig.price.ToStringEx()}";
+                }
+                else
+                {
+                    Text_Price.text = $"{PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId).ToStringEx()}/{_shopItemConfig.price.ToStringEx()}";
+                }
+                
+               
                 ImageCurrency.gameObject.SetActive(true);
             }
 
@@ -289,7 +300,18 @@ namespace Fort23.Mono
             }
             else
             {
-                Text_Price.text = $"{(count * _shopItemConfig.price).ToString()}";
+                int allCount = count * _shopItemConfig.price;
+                
+                if (allCount > PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId))
+                {
+                    Text_Price.text =
+                        $"<color=red>{PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId).ToStringEx()}</color>/{allCount.ToStringEx()}";
+                }
+                else
+                {
+                    Text_Price.text = $"{PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId).ToStringEx()}/{allCount.ToStringEx()}";
+                }
+                
                 ImageCurrency.gameObject.SetActive(true);
             }
 

+ 31 - 0
Assets/Scripts/GameUI/UI/ShopPanel/ShopPanel.cs

@@ -154,6 +154,37 @@ namespace Fort23.Mono
             return await base.AsyncInit(uiData);
         }
 
+
+        public void SelectWidget(int shopId)
+        {
+            this.shopId = shopId;
+            currentSelectedShopBtnWidget = null;
+            if (currentSelectedShopBtnWidget == null)
+            {
+                foreach (var shopBtnWidget in _shopBtnWidgets)
+                {
+                    if (shopBtnWidget.ShopGroupConfig.ID == shopId)
+                    {
+                        currentSelectedShopBtnWidget = shopBtnWidget;
+                        break;
+                    }
+                }
+
+                if (currentSelectedShopBtnWidget == null)
+                {
+                    _shopBtnWidgets[0]?.OnPointerClick();
+                }
+                else
+                {
+                    currentSelectedShopBtnWidget.OnPointerClick();
+                }
+            }
+            else
+            {
+                currentSelectedShopBtnWidget.OnPointerClick();
+            }
+        }
+
         private async void OnClick(ItemWidgetBasic obj)
         {
             ShopBtnWidget shopBtnWidget = obj as ShopBtnWidget;

+ 10 - 1
Assets/Scripts/GameUI/Utility/SkiptoHelper.cs

@@ -34,7 +34,16 @@ namespace Mono.Utility
                     return;
                 //商店界面
                 case 4:
-                    UIManager.Instance.GetComponent<AppBarPanel>().Btn_Shop_Click(skiptoConfig.SkipArguments[0], true);
+                    ShopPanel shopPanel = UIManager.Instance.GetComponent<ShopPanel>();
+                    if (shopPanel != null && !shopPanel.IsClose)
+                    {
+                        shopPanel.SelectWidget(skiptoConfig.SkipArguments[0]);
+                    }
+                    else
+                    {
+                        UIManager.Instance.GetComponent<AppBarPanel>().Btn_Shop_Click(skiptoConfig.SkipArguments[0]);
+                    }
+
                     return;
                 //实用神识界面
                 case 5: