Browse Source

修改商店

lzx 1 week ago
parent
commit
72174d50f3

+ 1 - 1
Assets/Art/VFX/Materials/UIMat/ui_ob_yindao_glow_add.mat

@@ -57,7 +57,7 @@ Material:
         m_Offset: {x: 0, y: 0}
         m_Offset: {x: 0, y: 0}
     m_Ints: []
     m_Ints: []
     m_Floats:
     m_Floats:
-    - _Alpha: 0.00825125
+    - _Alpha: 0.11649536
     - _AlphaCutoff: 0.5
     - _AlphaCutoff: 0.5
     - _ColorMask: 15
     - _ColorMask: 15
     - _EnableExternalAlpha: 0
     - _EnableExternalAlpha: 0

+ 42 - 0
Assets/Res/UI/ShopPanel/ShopBuyItemPanel.prefab

@@ -1642,6 +1642,7 @@ GameObject:
   - component: {fileID: 8986685959622995071}
   - component: {fileID: 8986685959622995071}
   - component: {fileID: 8099809648833845961}
   - component: {fileID: 8099809648833845961}
   - component: {fileID: 2814981318285203683}
   - component: {fileID: 2814981318285203683}
+  - component: {fileID: 612931872748925225}
   m_Layer: 0
   m_Layer: 0
   m_HasEditorInfo: 1
   m_HasEditorInfo: 1
   m_Name: Text_Title
   m_Name: Text_Title
@@ -1711,6 +1712,19 @@ MonoBehaviour:
     m_VerticalOverflow: 0
     m_VerticalOverflow: 0
     m_LineSpacing: 1
     m_LineSpacing: 1
   m_Text: "\u7528\u56FE"
   m_Text: "\u7528\u56FE"
+--- !u!114 &612931872748925225
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4421624734917338975}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: d272e2a31d4cd8c408dc4d1c8963f314, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  id: 10367
 --- !u!1 &4600936787556439174
 --- !u!1 &4600936787556439174
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -2655,6 +2669,7 @@ GameObject:
   - component: {fileID: 6086569560218178807}
   - component: {fileID: 6086569560218178807}
   - component: {fileID: 8222933101076642453}
   - component: {fileID: 8222933101076642453}
   - component: {fileID: 5720279122955918844}
   - component: {fileID: 5720279122955918844}
+  - component: {fileID: 6463934290641258330}
   m_Layer: 0
   m_Layer: 0
   m_HasEditorInfo: 1
   m_HasEditorInfo: 1
   m_Name: Text (Legacy) (1)
   m_Name: Text (Legacy) (1)
@@ -2724,6 +2739,19 @@ MonoBehaviour:
     m_VerticalOverflow: 0
     m_VerticalOverflow: 0
     m_LineSpacing: 1
     m_LineSpacing: 1
   m_Text: "\u8D2D\u4E70"
   m_Text: "\u8D2D\u4E70"
+--- !u!114 &6463934290641258330
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7483183420122722035}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: d272e2a31d4cd8c408dc4d1c8963f314, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  id: 10368
 --- !u!1 &7711143027347006985
 --- !u!1 &7711143027347006985
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0
@@ -2772,6 +2800,7 @@ GameObject:
   - component: {fileID: 2980301551769529947}
   - component: {fileID: 2980301551769529947}
   - component: {fileID: 186436975627440937}
   - component: {fileID: 186436975627440937}
   - component: {fileID: 7258802916437755773}
   - component: {fileID: 7258802916437755773}
+  - component: {fileID: 7798939367883031472}
   m_Layer: 0
   m_Layer: 0
   m_HasEditorInfo: 1
   m_HasEditorInfo: 1
   m_Name: Text_Function
   m_Name: Text_Function
@@ -2856,6 +2885,19 @@ MonoBehaviour:
   m_EffectColor: {r: 0.427451, g: 0.24705884, b: 0.0627451, a: 1}
   m_EffectColor: {r: 0.427451, g: 0.24705884, b: 0.0627451, a: 1}
   m_EffectDistance: {x: 1, y: -1}
   m_EffectDistance: {x: 1, y: -1}
   m_UseGraphicAlpha: 1
   m_UseGraphicAlpha: 1
+--- !u!114 &7798939367883031472
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7742152475391071874}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: d272e2a31d4cd8c408dc4d1c8963f314, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  id: 10368
 --- !u!1 &8103780915703377457
 --- !u!1 &8103780915703377457
 GameObject:
 GameObject:
   m_ObjectHideFlags: 0
   m_ObjectHideFlags: 0

+ 1 - 1
Assets/Scripts/Core/Utility/GlobalParam.cs

@@ -10,7 +10,7 @@ namespace Core.Utility
         public static int Item_Diamond_ID = 1002;
         public static int Item_Diamond_ID = 1002;
         public static int Item_HeroExp_ID = 1003;
         public static int Item_HeroExp_ID = 1003;
 
 
-        public static int RMB_1031 = 1031;
+        public static int RMB_1031 = 9999;
         /// <summary>
         /// <summary>
         /// 英雄最大上阵数量
         /// 英雄最大上阵数量
         /// </summary>
         /// </summary>

+ 10 - 1
Assets/Scripts/GameUI/UI/DivineSence/DivineSenceRestoredWidget.cs

@@ -37,7 +37,16 @@ namespace Fort23.Mono
                 {
                 {
                     if (ShopItemConfig.buyCount != -1 && shopItem.buyCount >= ShopItemConfig.buyCount)
                     if (ShopItemConfig.buyCount != -1 && shopItem.buyCount >= ShopItemConfig.buyCount)
                     {
                     {
-                        TipMessagePanel.OpenTipMessagePanel(811, Vector2.zero);
+                        TipMessagePanel.OpenTipMessagePanel(10366, Vector2.zero);
+                        return;
+                    }
+
+                    if (ShopItemConfig.price != 0 &&
+                        !PlayerManager.Instance.BagController.IsEnough(ShopItemConfig.costItemId,
+                            ShopItemConfig.price * 1))
+                    {
+                        ItemSourcePanel.OpenPanel(ShopItemConfig.costItemId);
+                        // TipMessagePanel.OpenTipMessagePanel(829, Vector2.zero);
                         return;
                         return;
                     }
                     }
 
 

+ 36 - 7
Assets/Scripts/GameUI/UI/ShopPanel/ShopBuyItemPanel.cs

@@ -36,12 +36,14 @@ namespace Fort23.Mono
 
 
             _shopItemConfig = ConfigComponent.Instance.Get<ShopItemConfig>(shopItem.id);
             _shopItemConfig = ConfigComponent.Instance.Get<ShopItemConfig>(shopItem.id);
             _callback = callback;
             _callback = callback;
-            WidgetItem itemWidget = await UIManager.Instance.CreateGComponent<WidgetItem>(null, ItemRoot, poolName: _poolName);
+            WidgetItem itemWidget =
+                await UIManager.Instance.CreateGComponent<WidgetItem>(null, ItemRoot, poolName: _poolName);
             itemWidget.InitWidget(new ItemInfo(_shopItemConfig.itemId[0], _shopItemConfig.itemCount[0]));
             itemWidget.InitWidget(new ItemInfo(_shopItemConfig.itemId[0], _shopItemConfig.itemCount[0]));
             ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(_shopItemConfig.itemId[0]);
             ItemConfig itemConfig = ConfigComponent.Instance.Get<ItemConfig>(_shopItemConfig.itemId[0]);
             Text_name.text = LanguageManager.Instance.Text(itemConfig.itemName);
             Text_name.text = LanguageManager.Instance.Text(itemConfig.itemName);
-            Text_desc.text = LanguageManager.Instance.Text(itemWidget.itemInfo.config.itemName);
-            Text_ItemCount.text = "当前持有:" + PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.itemId[0]);
+            Text_desc.text = LanguageManager.Instance.Text(itemWidget.itemInfo.config.itemDesc);
+            Text_ItemCount.text =
+                "当前持有:" + PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.itemId[0]);
             // UseSlider.value = 1;
             // UseSlider.value = 1;
             // UseSlider.minValue = 1;
             // UseSlider.minValue = 1;
             Text_BuyCount.text = "1";
             Text_BuyCount.text = "1";
@@ -59,7 +61,8 @@ namespace Fort23.Mono
                 Text_LimitCount.text = "无";
                 Text_LimitCount.text = "无";
                 if (_shopItemConfig.price != 0)
                 if (_shopItemConfig.price != 0)
                 {
                 {
-                    int total = (int)(PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId) / _shopItemConfig.price);
+                    int total = (int)(PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId) /
+                                      _shopItemConfig.price);
                     maxCount = total >= 10 ? 10 : total;
                     maxCount = total >= 10 ? 10 : total;
                 }
                 }
 
 
@@ -80,7 +83,8 @@ namespace Fort23.Mono
                 maxCount = _shopItemConfig.buyCount - _shopItem.buyCount;
                 maxCount = _shopItemConfig.buyCount - _shopItem.buyCount;
                 if (_shopItemConfig.price != 0)
                 if (_shopItemConfig.price != 0)
                 {
                 {
-                    int temp = (int)(PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId) / _shopItemConfig.price);
+                    int temp = (int)(PlayerManager.Instance.BagController.GetItemCount(_shopItemConfig.costItemId) /
+                                     _shopItemConfig.price);
                     if (temp < maxCount)
                     if (temp < maxCount)
                     {
                     {
                         maxCount = temp;
                         maxCount = temp;
@@ -98,13 +102,20 @@ namespace Fort23.Mono
                 // UseSlider.value = 1;
                 // UseSlider.value = 1;
             }
             }
 
 
-            Text_Price.text = _shopItemConfig.price.ToString();
+
             if (_shopItemConfig.costItemId == GlobalParam.RMB_1031)
             if (_shopItemConfig.costItemId == GlobalParam.RMB_1031)
             {
             {
+                Text_Price.text = "¥" + _shopItemConfig.price.ToString();
                 ImageCurrency.gameObject.SetActive(false);
                 ImageCurrency.gameObject.SetActive(false);
             }
             }
+            else if (_shopItemConfig.costItemId == 0)
+            {
+                ImageCurrency.gameObject.SetActive(false);
+                Text_Price.text = "免费";
+            }
             else
             else
             {
             {
+                Text_Price.text = _shopItemConfig.price.ToString();
                 ImageCurrency.gameObject.SetActive(true);
                 ImageCurrency.gameObject.SetActive(true);
             }
             }
 
 
@@ -214,7 +225,25 @@ namespace Fort23.Mono
             int count = (int)arg0;
             int count = (int)arg0;
             currentSelectCount = count;
             currentSelectCount = count;
             Text_BuyCount.text = count.ToString();
             Text_BuyCount.text = count.ToString();
-            Text_Price.text = $"{(count * _shopItemConfig.price).ToString()}";
+
+
+            if (_shopItemConfig.costItemId == GlobalParam.RMB_1031)
+            {
+                Text_Price.text = $"¥{(count * _shopItemConfig.price).ToString()}";
+
+                ImageCurrency.gameObject.SetActive(false);
+            }
+            else if (_shopItemConfig.costItemId == 0)
+            {
+                Text_Price.text = "免费";
+            }
+            else
+            {
+                Text_Price.text = $"{(count * _shopItemConfig.price).ToString()}";
+                ImageCurrency.gameObject.SetActive(true);
+            }
+
+            // Text_Price.text = $"{(count * _shopItemConfig.price).ToString()}";
         }
         }
 
 
         public async override CTask Close()
         public async override CTask Close()

+ 26 - 25
Assets/Scripts/GameUI/UI/ShopPanel/ShopItemWidgetType2.cs

@@ -32,28 +32,28 @@ namespace Fort23.Mono
         {
         {
             Btn_Buy.onClick.AddListener(async () =>
             Btn_Buy.onClick.AddListener(async () =>
             {
             {
-                //人名币和看广告一个一个购买
-                if (_shopItemConfig.costItemId == 9999 || _shopItemConfig.costItemId == 1032)
-                {
-                    if (_shopItemConfig.buyCount != -1 && _shopItem.buyCount >= _shopItemConfig.buyCount)
-                    {
-                        TipMessagePanel.OpenTipMessagePanel(811, Vector2.zero);
-                        return;
-                    }
-
-                    List<ItemInfo> itemInfos = await ShopManger.Instance.BuyItem(_shopItemConfig.ID, 1);
-                    if (itemInfos != null)
-                    {
-                        RewardsPanel.OpenPanel(itemInfos);
-                    }
-                    else
-                    {
-                        TipMessagePanel.OpenTipMessagePanel(833, Vector2.zero);
-                    }
-
-                    CustomInit(_shopItem);
-                }
-                else
+                // //人名币和看广告一个一个购买
+                // if (_shopItemConfig.costItemId == 9999 || _shopItemConfig.costItemId == 1032)
+                // {
+                //     if (_shopItemConfig.buyCount != -1 && _shopItem.buyCount >= _shopItemConfig.buyCount)
+                //     {
+                //         TipMessagePanel.OpenTipMessagePanel(10366, Vector2.zero);
+                //         return;
+                //     }
+                //
+                //     List<ItemInfo> itemInfos = await ShopManger.Instance.BuyItem(_shopItemConfig.ID, 1);
+                //     if (itemInfos != null)
+                //     {
+                //         RewardsPanel.OpenPanel(itemInfos);
+                //     }
+                //     else
+                //     {
+                //         TipMessagePanel.OpenTipMessagePanel(833, Vector2.zero);
+                //     }
+                //
+                //     CustomInit(_shopItem);
+                // }
+                // else
                 {
                 {
                     ShopBuyItemPanel shopBuyItemPanel =
                     ShopBuyItemPanel shopBuyItemPanel =
                         await UIManager.Instance.LoadAndOpenPanel<ShopBuyItemPanel>(null, isShowBG: true,
                         await UIManager.Instance.LoadAndOpenPanel<ShopBuyItemPanel>(null, isShowBG: true,
@@ -66,13 +66,14 @@ namespace Fort23.Mono
                                 !PlayerManager.Instance.BagController.IsEnough(_shopItemConfig.costItemId,
                                 !PlayerManager.Instance.BagController.IsEnough(_shopItemConfig.costItemId,
                                     _shopItemConfig.price * count))
                                     _shopItemConfig.price * count))
                             {
                             {
-                                TipMessagePanel.OpenTipMessagePanel(829, Vector2.zero);
+                                ItemSourcePanel.OpenPanel(_shopItemConfig.costItemId);
+                                // TipMessagePanel.OpenTipMessagePanel(829, Vector2.zero);
                                 return;
                                 return;
                             }
                             }
 
 
                             if (_shopItemConfig.buyCount != -1 && _shopItem.buyCount >= _shopItemConfig.buyCount)
                             if (_shopItemConfig.buyCount != -1 && _shopItem.buyCount >= _shopItemConfig.buyCount)
                             {
                             {
-                                TipMessagePanel.OpenTipMessagePanel(811, Vector2.zero);
+                                TipMessagePanel.OpenTipMessagePanel(10366, Vector2.zero);
                                 return;
                                 return;
                             }
                             }
 
 
@@ -231,7 +232,7 @@ namespace Fort23.Mono
             {
             {
                 Icon_Skill.gameObject.SetActive(false);
                 Icon_Skill.gameObject.SetActive(false);
                 Icon_Item.icon_name = "icon_shenshitishengfu";
                 Icon_Item.icon_name = "icon_shenshitishengfu";
-                Icon_Item2.icon_name =_itemConfig.icon;
+                Icon_Item2.icon_name = _itemConfig.icon;
                 Icon_Item2.gameObject.SetActive(true);
                 Icon_Item2.gameObject.SetActive(true);
             }
             }
             else
             else