From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/System/KnapSack/Logic/ComposeWin.cs | 82 +++++++++
Main/Component/UI/Common/SliderPanel.cs | 23 +
Main/System/KnapSack/PackManager.cs | 159 ++++++++++++-----
Main/Config/Configs/ChestsConfig.cs | 8
Main/Config/PartialConfigs/ItemCompoundConfig.cs | 29 +++
Main/System/KnapSack/Logic/RolePackWin.cs | 6
Main/Config/ConfigManager.cs | 3
Main/System/Store/BuyItemWin.cs | 1
Main/System/KnapSack/Logic/ComposeWin.cs.meta | 11 +
Main/System/Battle/BaseBattleWin.cs | 2
Main/System/Redpoint/MainRedDot.cs | 7
Main/Config/Configs/ItemCompoundConfig.cs | 47 +++++
Main/System/KnapSack/Logic/ComposeGirdCell.cs | 29 +++
Main/Core/NetworkPackage/ClientPack/CA3_Item/CA303_tagCMItemCompound.cs.meta | 11 +
Main/Config/Configs/ItemCompoundConfig.cs.meta | 11 +
Main/Core/NetworkPackage/ClientPack/CA3_Item/CA303_tagCMItemCompound.cs | 38 ++++
Main/System/ItemTip/BoxItemWin.cs | 1
Main/Config/PartialConfigs/ItemCompoundConfig.cs.meta | 11 +
Main/System/KnapSack/Logic/PackGirdCell.cs | 14 +
19 files changed, 422 insertions(+), 71 deletions(-)
diff --git a/Main/Component/UI/Common/SliderPanel.cs b/Main/Component/UI/Common/SliderPanel.cs
index 542e5ca..019107b 100644
--- a/Main/Component/UI/Common/SliderPanel.cs
+++ b/Main/Component/UI/Common/SliderPanel.cs
@@ -21,32 +21,35 @@
Action<int> OnChangeEvent;
void Start()
{
- slider.AddListener((value) => { Refresh(); });
+ slider.AddListener((value) =>
+ {
+ if (value == 0)
+ {
+ slider.value = 1;
+ return;
+ }
+ Refresh();
+ });
addBtn.AddListener(() =>
{
slider.value += 1;
- Refresh();
});
addBtn.onPress.AddListener(() =>
{
slider.value += 1;
- Refresh();
});
decBtn.AddListener(() =>
{
slider.value -= 1;
- Refresh();
});
decBtn.onPress.AddListener(() =>
{
slider.value -= 1;
- Refresh();
});
maxBtn.AddListener(() =>
{
slider.value = slider.maxValue;
- Refresh();
});
}
@@ -96,4 +99,12 @@
OnChangeEvent?.Invoke(count);
}
+ void OnDestroy()
+ {
+ OnChangeEvent = null;
+ }
+ void OnDisable()
+ {
+ OnChangeEvent = null;
+ }
}
diff --git a/Main/Config/ConfigManager.cs b/Main/Config/ConfigManager.cs
index bfc605f..3e738fb 100644
--- a/Main/Config/ConfigManager.cs
+++ b/Main/Config/ConfigManager.cs
@@ -56,6 +56,7 @@
typeof(HeroLineupHaloConfig),
typeof(HeroQualityLVConfig),
typeof(InvestConfig),
+ typeof(ItemCompoundConfig),
typeof(ItemConfig),
typeof(MainChapterConfig),
typeof(MainLevelConfig),
@@ -259,6 +260,8 @@
ClearConfigDictionary<HeroQualityLVConfig>();
// 娓呯┖ InvestConfig 瀛楀吀
ClearConfigDictionary<InvestConfig>();
+ // 娓呯┖ ItemCompoundConfig 瀛楀吀
+ ClearConfigDictionary<ItemCompoundConfig>();
// 娓呯┖ ItemConfig 瀛楀吀
ClearConfigDictionary<ItemConfig>();
// 娓呯┖ MainChapterConfig 瀛楀吀
diff --git a/Main/Config/Configs/ChestsConfig.cs b/Main/Config/Configs/ChestsConfig.cs
index 75cc805..6267de2 100644
--- a/Main/Config/Configs/ChestsConfig.cs
+++ b/Main/Config/Configs/ChestsConfig.cs
@@ -1,6 +1,6 @@
锘�//--------------------------------------------------------
// [Author]: YYL
-// [ Date ]: 2025骞�8鏈�5鏃�
+// [ Date ]: 2025骞�10鏈�30鏃�
//--------------------------------------------------------
using System.Collections.Generic;
@@ -19,8 +19,8 @@
public int BoxID;
public int ExpendItemID;
public int ExpendCount;
+ public int OpenMoneyType;
public int OpenMoney;
- public int OpenShow;
public override int LoadKey(string _key)
{
@@ -38,9 +38,9 @@
int.TryParse(tables[2],out ExpendCount);
- int.TryParse(tables[3],out OpenMoney);
+ int.TryParse(tables[3],out OpenMoneyType);
- int.TryParse(tables[4],out OpenShow);
+ int.TryParse(tables[4],out OpenMoney);
}
catch (Exception exception)
{
diff --git a/Main/Config/Configs/ItemCompoundConfig.cs b/Main/Config/Configs/ItemCompoundConfig.cs
new file mode 100644
index 0000000..023d22b
--- /dev/null
+++ b/Main/Config/Configs/ItemCompoundConfig.cs
@@ -0,0 +1,47 @@
+锘�//--------------------------------------------------------
+// [Author]: YYL
+// [ Date ]: Thursday, October 30, 2025
+//--------------------------------------------------------
+
+using System.Collections.Generic;
+using System;
+using UnityEngine;
+using LitJson;
+
+public partial class ItemCompoundConfig : ConfigBase<int, ItemCompoundConfig>
+{
+ static ItemCompoundConfig()
+ {
+ // 璁块棶杩囬潤鎬佹瀯閫犲嚱鏁�
+ visit = true;
+ }
+
+ public int id;
+ public int makeID;
+ public int itemID;
+ public int itemCount;
+
+ public override int LoadKey(string _key)
+ {
+ int key = GetKey(_key);
+ return key;
+ }
+
+ public override void LoadConfig(string input)
+ {
+ try {
+ string[] tables = input.Split('\t');
+ int.TryParse(tables[0],out id);
+
+ int.TryParse(tables[1],out makeID);
+
+ int.TryParse(tables[2],out itemID);
+
+ int.TryParse(tables[3],out itemCount);
+ }
+ catch (Exception exception)
+ {
+ Debug.LogError(exception);
+ }
+ }
+}
diff --git a/Main/Config/Configs/ItemCompoundConfig.cs.meta b/Main/Config/Configs/ItemCompoundConfig.cs.meta
new file mode 100644
index 0000000..56f857f
--- /dev/null
+++ b/Main/Config/Configs/ItemCompoundConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cf342cf33d0492143a273cb6282a6d8b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Config/PartialConfigs/ItemCompoundConfig.cs b/Main/Config/PartialConfigs/ItemCompoundConfig.cs
new file mode 100644
index 0000000..64d1d64
--- /dev/null
+++ b/Main/Config/PartialConfigs/ItemCompoundConfig.cs
@@ -0,0 +1,29 @@
+锘縰sing System.Collections.Generic;
+
+public partial class ItemCompoundConfig : ConfigBase<int, ItemCompoundConfig>
+{
+ public static Dictionary<int, ItemCompoundConfig> itemCompoundDict = new Dictionary<int, ItemCompoundConfig>();
+
+ protected override void OnConfigParseCompleted()
+ {
+ itemCompoundDict.Add(makeID, this);
+ }
+
+ public static ItemCompoundConfig GetItemCompoundConfig(int makeID)
+ {
+ ItemCompoundConfig itemCompoundConfig = null;
+ itemCompoundDict.TryGetValue(makeID, out itemCompoundConfig);
+ return itemCompoundConfig;
+ }
+
+ public static bool IsCompoundItem(int itemID)
+ {
+ return itemCompoundDict.ContainsKey(itemID);
+ }
+
+}
+
+
+
+
+
diff --git a/Main/Config/PartialConfigs/ItemCompoundConfig.cs.meta b/Main/Config/PartialConfigs/ItemCompoundConfig.cs.meta
new file mode 100644
index 0000000..f6d9301
--- /dev/null
+++ b/Main/Config/PartialConfigs/ItemCompoundConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 736c0787c9619e84ca00569bfac71c4a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/Core/NetworkPackage/ClientPack/CA3_Item/CA303_tagCMItemCompound.cs b/Main/Core/NetworkPackage/ClientPack/CA3_Item/CA303_tagCMItemCompound.cs
new file mode 100644
index 0000000..8f3cbd8
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CA3_Item/CA303_tagCMItemCompound.cs
@@ -0,0 +1,38 @@
+using UnityEngine;
+using System.Collections;
+
+//A3 03 鐗╁搧鍚堟垚 #tagCMItemCompound
+
+public class CA303_tagCMItemCompound : GameNetPackBasic {
+ public uint ID; // 鍚堟垚ID
+ public ushort CompoundCnt; //鍚堟垚鏁伴噺(娆℃暟)
+ public byte UnfixedItemIndexCnt; // 涓嶅浐瀹氱墿鍝佸湪鑳屽寘涓储寮曚釜鏁�
+ public byte[] UnfixedItemIndex; // 涓嶅浐瀹氱墿鍝佸湪鑳屽寘鐨勭储寮曞垪琛�
+ public byte FixedItemIndexCnt; // 鍥哄畾鐗╁搧鍦ㄨ儗鍖呬腑绱㈠紩涓暟
+ public byte[] FixedItemIndex; // 鍥哄畾鐗╁搧鍦ㄨ儗鍖呯殑绱㈠紩鍒楄〃
+ public byte AddonsItemIndexCnt; // 闄勫姞鐗╁搧鍦ㄨ儗鍖呬腑绱㈠紩涓暟
+ public byte[] AddonsItemIndex; // 闄勫姞鐗╁搧鍦ㄨ儗鍖呯殑绱㈠紩鍒楄〃
+ public byte[] AddonsItemCount; // 闄勫姞鐗╁搧鍦ㄨ儗鍖呯殑绱㈠紩瀵瑰簲鎵i櫎鏁伴噺鍒楄〃
+ public byte RateIncreaseItemIndexCnt; // 鎻愬崌姒傜巼鐗╁搧鍦ㄨ儗鍖呬腑绱㈠紩涓暟
+ public byte[] RateIncreaseItemIndex; // 鎻愬崌姒傜巼鐗╁搧鍦ㄨ儗鍖呯殑绱㈠紩鍒楄〃
+
+ public CA303_tagCMItemCompound () {
+ combineCmd = (ushort)0x03FE;
+ _cmd = (ushort)0xA303;
+ }
+
+ public override void WriteToBytes () {
+ WriteBytes (ID, NetDataType.DWORD);
+ WriteBytes (CompoundCnt, NetDataType.WORD);
+ WriteBytes (UnfixedItemIndexCnt, NetDataType.BYTE);
+ WriteBytes (UnfixedItemIndex, NetDataType.BYTE, UnfixedItemIndexCnt);
+ WriteBytes (FixedItemIndexCnt, NetDataType.BYTE);
+ WriteBytes (FixedItemIndex, NetDataType.BYTE, FixedItemIndexCnt);
+ WriteBytes (AddonsItemIndexCnt, NetDataType.BYTE);
+ WriteBytes (AddonsItemIndex, NetDataType.BYTE, AddonsItemIndexCnt);
+ WriteBytes (AddonsItemCount, NetDataType.BYTE, AddonsItemIndexCnt);
+ WriteBytes (RateIncreaseItemIndexCnt, NetDataType.BYTE);
+ WriteBytes (RateIncreaseItemIndex, NetDataType.BYTE, RateIncreaseItemIndexCnt);
+ }
+
+}
diff --git a/Main/Core/NetworkPackage/ClientPack/CA3_Item/CA303_tagCMItemCompound.cs.meta b/Main/Core/NetworkPackage/ClientPack/CA3_Item/CA303_tagCMItemCompound.cs.meta
new file mode 100644
index 0000000..909f7dd
--- /dev/null
+++ b/Main/Core/NetworkPackage/ClientPack/CA3_Item/CA303_tagCMItemCompound.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 214c48bd178466b4caaba754e983d8d3
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/Battle/BaseBattleWin.cs b/Main/System/Battle/BaseBattleWin.cs
index 0e37401..3d127bb 100644
--- a/Main/System/Battle/BaseBattleWin.cs
+++ b/Main/System/Battle/BaseBattleWin.cs
@@ -199,7 +199,7 @@
return;
int passRound = BattleManager.Instance.passRound;
int nowRound = battleField.round;
- if (nowRound <= passRound)
+ if (nowRound < passRound)
{
SysNotifyMgr.Instance.ShowTip("BattlePass", passRound - nowRound);
return;
diff --git a/Main/System/ItemTip/BoxItemWin.cs b/Main/System/ItemTip/BoxItemWin.cs
index 4dc8d28..955bf02 100644
--- a/Main/System/ItemTip/BoxItemWin.cs
+++ b/Main/System/ItemTip/BoxItemWin.cs
@@ -69,6 +69,7 @@
sliderPanel.SetActive(true);
}
+ useCnt = 1;
sliderPanel.Init((value) => { useCnt = value; }, itemCount);
diff --git a/Main/System/KnapSack/Logic/ComposeGirdCell.cs b/Main/System/KnapSack/Logic/ComposeGirdCell.cs
index 3ee472c..4827c80 100644
--- a/Main/System/KnapSack/Logic/ComposeGirdCell.cs
+++ b/Main/System/KnapSack/Logic/ComposeGirdCell.cs
@@ -10,16 +10,43 @@
[SerializeField] Image fillImage;
[SerializeField] Image fullImage;
[SerializeField] Text processText;
+ [SerializeField] Image redImg;
public void Display(int index)
{
+ if (index >= PackManager.Instance.composeItemGuidList.Count)
+ {
+ return;
+ }
var guid = PackManager.Instance.composeItemGuidList[index];
var item = PackManager.Instance.GetItemByGuid(guid);
if (item == null)
return;
itemCell.Init(item);
- itemCell.button.AddListener(()=>
+ itemCell.button.AddListener(() =>
{
//鍚堟垚鐣岄潰
+ ComposeWin.guid = guid;
+ UIManager.Instance.OpenWindow<ComposeWin>();
});
+
+ var config = ItemCompoundConfig.GetItemCompoundConfig(item.itemId);
+ var targetID = config.itemID;
+ var targetCnt = config.itemCount;
+ var haveCnt = PackManager.Instance.GetItemCountByID(PackType.Item, targetID);
+ if (haveCnt >= targetCnt)
+ {
+ fullImage.SetActive(true);
+ fillImage.SetActive(false);
+ redImg.SetActive(true);
+ }
+ else
+ {
+ fullImage.SetActive(false);
+ fillImage.SetActive(true);
+ redImg.SetActive(false);
+ fillImage.fillAmount = haveCnt / (float)targetCnt;
+ }
+ processText.text = haveCnt+ "/" + targetCnt;
+
}
}
diff --git a/Main/System/KnapSack/Logic/ComposeWin.cs b/Main/System/KnapSack/Logic/ComposeWin.cs
new file mode 100644
index 0000000..52f8344
--- /dev/null
+++ b/Main/System/KnapSack/Logic/ComposeWin.cs
@@ -0,0 +1,82 @@
+锘縰sing System;
+using System.Collections.Generic;
+using LitJson;
+using UnityEngine;
+using UnityEngine.UI;
+
+//鍚堟垚鐣岄潰
+public class ComposeWin : UIBase
+{
+
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] Text nameText;
+ [SerializeField] Text descText;
+ [SerializeField] ItemCell needItemCell;
+ [SerializeField] Text haveCntText;
+ [SerializeField] SliderPanel sliderPanel;
+ [SerializeField] Button composeButton;
+
+
+ public static string guid;
+ int useCnt;
+ int targetCnt;
+ int targetID;
+ int itemID;
+ protected override void InitComponent()
+ {
+ composeButton.AddListener(() =>
+ {
+ if (!ItemLogicUtility.CheckItemCount(PackType.Item, targetID, useCnt * targetCnt, 2))
+ {
+ return;
+ }
+
+ CloseWindow();
+
+ var pack = new CA303_tagCMItemCompound();
+ pack.ID = (uint)ItemCompoundConfig.GetItemCompoundConfig(itemID).id;
+ pack.CompoundCnt = (ushort)useCnt;
+ GameNetSystem.Instance.SendInfo(pack);
+
+ });
+ }
+
+
+ protected override void OnPreOpen()
+ {
+ var item = PackManager.Instance.GetItemByGuid(guid);
+ itemID = item.itemId;
+ var config = ItemCompoundConfig.GetItemCompoundConfig(itemID);
+ targetID = config.itemID;
+ targetCnt = config.itemCount;
+
+ itemCell.Init(new ItemCellModel(itemID, false, item.count));
+ nameText.text = item.config.ItemName;
+ descText.text = item.config.Description;
+
+ needItemCell.Init(new ItemCellModel(targetID, false, 0));
+ needItemCell.button.AddListener(() =>
+ {
+ ItemTipUtility.Show(targetID);
+ });
+
+ var haveCnt = PackManager.Instance.GetItemCountByID(PackType.Item, targetID);
+ var haveStr = Language.Get("storename12", haveCnt + "/" + targetCnt);
+ haveCntText.text = haveCnt < targetCnt ? UIHelper.AppendColor(TextColType.Red, haveStr) : haveStr;
+
+ useCnt = 1;
+ sliderPanel.Init((value) => {
+ useCnt = value;
+ var haveStr = Language.Get("storename12", haveCnt + "/" + targetCnt * value);
+ haveCntText.text = haveCnt < targetCnt * value ? UIHelper.AppendColor(TextColType.Red, haveStr) : haveStr;
+
+ }, Math.Max(1, (int)haveCnt/targetCnt));
+
+
+ }
+
+
+
+
+
+}
\ No newline at end of file
diff --git a/Main/System/KnapSack/Logic/ComposeWin.cs.meta b/Main/System/KnapSack/Logic/ComposeWin.cs.meta
new file mode 100644
index 0000000..6eecb37
--- /dev/null
+++ b/Main/System/KnapSack/Logic/ComposeWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fa99a55f62debbe4c9ec44bc91cbc9b2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Main/System/KnapSack/Logic/PackGirdCell.cs b/Main/System/KnapSack/Logic/PackGirdCell.cs
index aac05c3..d56381c 100644
--- a/Main/System/KnapSack/Logic/PackGirdCell.cs
+++ b/Main/System/KnapSack/Logic/PackGirdCell.cs
@@ -17,11 +17,19 @@
var item = PackManager.Instance.GetItemByGuid(guid);
itemCell.Init(item);
- itemCell.button.AddListener(()=>
+ itemCell.button.AddListener(() =>
{
ItemTipUtility.Show(guid);
});
-
- redPoint.SetActive(false);
+
+ var chestConfig = ChestsConfig.Get(item.itemId);
+ if (chestConfig != null && chestConfig.ExpendItemID == 0 && chestConfig.OpenMoney == 0)
+ {
+ redPoint.SetActive(true);
+ }
+ else
+ {
+ redPoint.SetActive(false);
+ }
}
}
diff --git a/Main/System/KnapSack/Logic/RolePackWin.cs b/Main/System/KnapSack/Logic/RolePackWin.cs
index 3941699..af6fb3b 100644
--- a/Main/System/KnapSack/Logic/RolePackWin.cs
+++ b/Main/System/KnapSack/Logic/RolePackWin.cs
@@ -8,7 +8,7 @@
{
[SerializeField] ScrollerController packScroller;
- [SerializeField] ScrollerController composeScroller; //寰呯瓥鍒掔‘瀹�
+ [SerializeField] ScrollerController composeScroller;
[SerializeField] GroupButtonEx packBtn;
[SerializeField] GroupButtonEx composeBtn;
@@ -83,6 +83,7 @@
}
//寤惰繜0.2绉掑埛鏂� 璁剧疆 isRefreshPack涓簍rue
isRefreshPack = true;
+ cdTime = Time.time;
}
@@ -93,6 +94,7 @@
return;
}
isRefreshPack = true;
+ cdTime = Time.time;
}
@@ -199,6 +201,6 @@
void RefreshComposeItemData()
{
- PackManager.Instance.composeItemGuidList.Clear();
+ PackManager.Instance.RefreshItemComposeList();
}
}
\ No newline at end of file
diff --git a/Main/System/KnapSack/PackManager.cs b/Main/System/KnapSack/PackManager.cs
index 3de93fb..afefa1c 100644
--- a/Main/System/KnapSack/PackManager.cs
+++ b/Main/System/KnapSack/PackManager.cs
@@ -49,7 +49,8 @@
string RoleEquipLocalSave = "";
List<int> LocalSavePlaceArray { get; set; }
Dictionary<int, List<int>> sharedUseCountItemDict { get; set; }
- bool isUpdatePlayerLv = false;
+ // bool isUpdatePlayerLv = false;
+ bool isItemChange = false; //寤惰繜澶勭悊鐗╁搧鍙樺寲
public int[] gameCashShow; //浠i噾鍒哥壒娈婃樉绀� 闄や互100
public int[] autoUseItemIDs;
@@ -102,7 +103,7 @@
public void OnBeforePlayerDataInitialize()
{
GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
- PlayerDatas.Instance.playerDataRefreshEvent -= UpdatePlayerLv;
+ // PlayerDatas.Instance.playerDataRefreshEvent -= UpdatePlayerLv;
LocalSave.DeleteKey(RecordKnapsackTitle);
playerPackDict.Clear();
itemDayUseCntDict.Clear();
@@ -127,8 +128,8 @@
LocalSavePlaceArray = null;
}
GlobalTimeEvent.Instance.secondEvent += UpdateSecond;
- PlayerDatas.Instance.playerDataRefreshEvent += UpdatePlayerLv;
- isUpdatePlayerLv = true;
+ // PlayerDatas.Instance.playerDataRefreshEvent += UpdatePlayerLv;
+ // isUpdatePlayerLv = true;
FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
}
@@ -192,8 +193,8 @@
{
refrechPackEvent(packType);
}
-
- UpdatePackRedpoint(packType);
+
+ DelayNotifyPackChange(packType);
}
public void UpdateItem(H0704_tagRolePackRefresh serverItem)
@@ -236,8 +237,8 @@
// ItemOperateUtility.Instance.ShowPutOnNewEquipRemind(itemInfo.itemId);
// }
// }
-
- UpdatePackRedpoint(type);
+
+ DelayNotifyPackChange(type);
//EquipDecomRedCtrl();
AutoUseItem(itemInfo.itemId, serverItem.ItemGUID);
}
@@ -302,7 +303,8 @@
gridRefreshEvent(type);
}
- UpdatePackRedpoint(type);
+
+ DelayNotifyPackChange(type);
}
@@ -329,6 +331,7 @@
}
}
+ DelayNotifyPackChange(type);
}
@@ -382,7 +385,7 @@
}
- UpdatePackRedpoint(type);
+ DelayNotifyPackChange(type);
if (GetItemByGuid(guid) == null)
{
@@ -562,18 +565,19 @@
private void UpdateSecond()
{
- if (isUpdatePlayerLv)
+ if (isItemChange)
{
- isUpdatePlayerLv = false;
+ isItemChange = false;
+ DelayRefreshItemPackEvent();
}
}
- private void UpdatePlayerLv(PlayerDataType type)
- {
- if (type != PlayerDataType.LV) return;
+ // private void UpdatePlayerLv(PlayerDataType type)
+ // {
+ // if (type != PlayerDataType.LV) return;
- isUpdatePlayerLv = true;
- }
+ // isUpdatePlayerLv = true;
+ // }
#endregion
@@ -871,48 +875,103 @@
return useCnt;
}
- public void GotoWashAttributePoint(string guid)
- {
- // ItemModel itemModel = GetItemByGuid(guid);
- // if (itemModel == null) return;
-
- // WashAttrPointWin.itemModel = itemModel;
- // WindowCenter.Instance.Open<WashAttrPointWin>();
- }
#region 绾㈢偣閫昏緫鍒ゆ柇
- const int ITEMPACK_REDKEY = 102011003;
- Redpoint redpointItemPack = new Redpoint(MainRedDot.RedPoint_BagFuncKey, ITEMPACK_REDKEY);
+ Redpoint redpointItemPack = new Redpoint(MainRedDot.RedPoint_MainPackKey, MainRedDot.RedPoint_BagFuncKey);
+ Redpoint redpointComposePack = new Redpoint(MainRedDot.RedPoint_MainPackKey, MainRedDot.RedPoint_ComposeFuncKey);
-
- private void UpdatePackRedpoint(PackType type)
+ //寤惰繜閫氱煡鑳屽寘鍙樺寲锛岄伩鍏嶅湪鍚屼竴甯у唴澶氭閫氱煡
+ private void DelayNotifyPackChange(PackType type)
{
- var singlePack = GetSinglePack(type);
- if (singlePack == null)
+ if (type == PackType.Item)
{
- return;
- }
-
- switch (type)
- {
- case PackType.Item:
- if (singlePack.GetEmptyGridCount() <= 0)
- {
- redpointItemPack.state = RedPointState.Full;
- //SysNotifyMgr.Instance.ShowTip("BagFull");
- }
- else
- {
- redpointItemPack.state = RedPointState.None;
- }
-
- break;
-
+ isItemChange = true;
}
}
-
+
+ void DelayRefreshItemPackEvent()
+ {
+ //鍚堟垚绾㈢偣
+ SinglePack singlePack = GetSinglePack(PackType.Item);
+ var items = singlePack.GetAllItems();
+
+ foreach (var item in items.Values)
+ {
+ if (ItemCompoundConfig.IsCompoundItem(item.itemId))
+ {
+ var config = ItemCompoundConfig.GetItemCompoundConfig(item.itemId);
+ var targetID = config.itemID;
+ var targetCnt = config.itemCount;
+ if (GetItemCountByID(PackType.Item, targetID) >= targetCnt)
+ {
+ redpointComposePack.state = RedPointState.Simple;
+ break;
+ }
+ }
+ }
+
+
+ //鑳屽寘绾㈢偣
+ if (singlePack.GetEmptyGridCount() <= 0)
+ {
+ redpointItemPack.state = RedPointState.Full;
+ SysNotifyMgr.Instance.ShowTip("BagFull");
+ }
+ else
+ {
+ redpointItemPack.state = RedPointState.None;
+
+ //鏃犳潯浠跺紑鍚殑瀹濈绾㈢偣
+ foreach (var item in items.Values)
+ {
+ var chestConfig = ChestsConfig.Get(item.itemId);
+ if (chestConfig != null && chestConfig.ExpendItemID == 0 && chestConfig.OpenMoney == 0)
+ {
+ redpointItemPack.state = RedPointState.Simple;
+ break;
+ }
+ }
+ }
+
+
+ }
+
+ public void RefreshItemComposeList()
+ {
+ //鏀堕泦鍚堟垚鐗╁搧
+ composeItemGuidList.Clear();
+
+ SinglePack singlePack = GetSinglePack(PackType.Item);
+ var items = singlePack.GetAllItems();
+
+ foreach (var item in items.Values)
+ {
+ if (ItemCompoundConfig.IsCompoundItem(item.itemId))
+ {
+ composeItemGuidList.Add(item.guid);
+ }
+ }
+
+ composeItemGuidList.Sort(SortItemCompose);
+ }
+
+ int SortItemCompose(string guidA, string guidB)
+ {
+ var itemA = GetItemByGuid(guidA);
+ var itemB = GetItemByGuid(guidB);
+
+ var colorA = itemA.config.ItemColor;
+ var colorB = itemB.config.ItemColor;
+ if (colorA != colorB)
+ {
+ return colorB - colorA;
+ }
+
+ return itemA.itemId - itemB.itemId;
+ }
+
#endregion
#region 鏌ョ湅鏌愪釜浣嶇疆鐨勭墿鍝�
diff --git a/Main/System/Redpoint/MainRedDot.cs b/Main/System/Redpoint/MainRedDot.cs
index 1855f64..8dbae1d 100644
--- a/Main/System/Redpoint/MainRedDot.cs
+++ b/Main/System/Redpoint/MainRedDot.cs
@@ -47,9 +47,10 @@
#region 鑳屽寘绾㈢偣
public const int RedPoint_MainPackKey = 102;
- public const int RedPoint_BagFuncKey = 10201;
- public Redpoint redPointMainPack = new Redpoint(RedPoint_MainPackKey);
- public Redpoint redPointBagFunc = new Redpoint(RedPoint_MainPackKey, RedPoint_BagFuncKey);
+ public const int RedPoint_BagFuncKey = 10201; //鑳屽寘鍔熻兘
+ public const int RedPoint_ComposeFuncKey = 10202; //鍚堟垚
+ public Redpoint redPointMainPack = new Redpoint(MainAffairsRedpoint, RedPoint_MainPackKey);
+
#endregion
//瀹樿亴
diff --git a/Main/System/Store/BuyItemWin.cs b/Main/System/Store/BuyItemWin.cs
index 571cd4b..649f0d0 100644
--- a/Main/System/Store/BuyItemWin.cs
+++ b/Main/System/Store/BuyItemWin.cs
@@ -17,7 +17,6 @@
[SerializeField] Button buyButton;
- int itemCount;
int useCnt;
int maxCnt;
protected override void InitComponent()
--
Gitblit v1.8.0