| System/Dogz/DogzCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Dogz/DogzEquip.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Dogz/DogzItemCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Dogz/DogzModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/Logic/EquipTip.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/Logic/ItemTipsModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/Logic/PackModelInterface.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/Logic/PackSendQuestMgr.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/KnapSack/Logic/PlayerPackModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| UI/Common/SortTable.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/Dogz/DogzCell.cs
@@ -28,10 +28,21 @@ m_DogzIcon.SetSprite(_dogzCfg.HeadIcon); m_DogzIcon.SetNativeSize(); var _dogzEquips = model.GetDogzEquips(_dogzCfg.ID); m_DogzIcon.material = (_dogzEquips == null || _dogzEquips.Count < 5) ? MaterialUtility.GetDefaultSpriteGrayMaterial() : MaterialUtility.GetUIDefaultGraphicMaterial(); bool isActive = (_dogzEquips == null || _dogzEquips.Count < 5) ? false : true; m_DogzName.text = _dogzCfg.Name; //m_DogzGrade.text = StringUtility.Contact("评分:", 100); m_DogzGrade.text = StringUtility.Contact("评分:", 100); if (isActive) { m_DogzIcon.material = MaterialUtility.GetUIDefaultGraphicMaterial(); m_DogzName.material = MaterialUtility.GetUIDefaultGraphicMaterial(); m_DogzGrade.material = MaterialUtility.GetUIDefaultGraphicMaterial(); } else { m_DogzIcon.material = MaterialUtility.GetDefaultSpriteGrayMaterial(); m_DogzName.material = MaterialUtility.GetDefaultSpriteGrayMaterial(); m_DogzGrade.material = MaterialUtility.GetDefaultSpriteGrayMaterial(); } m_DogzBtn.image.color = model.presentSelectDogz == _dogzCfg.ID ? Color.blue : Color.white; m_DogzAssist.gameObject.SetActive(model.TryGetAssistDogzState(_dogzCfg.ID)); m_DogzBtn.onClick.RemoveAllListeners(); System/Dogz/DogzEquip.cs
@@ -32,9 +32,9 @@ itemBaisc.cellBtn.RemoveAllListeners(); itemBaisc.cellBtn.AddListener(()=> { ItemAttrData attrData = new ItemAttrData(model.itemId,false,(ulong)model.itemInfo.ItemCount,model.itemInfo.ItemPlace, model.itemInfo.IsBind,false,PackType.rptDogzEquip,model.itemInfo.ItemGUID); tipsModel.SetItemTipsModel(attrData); tipsModel.SetItemTipsModel(model.packType,model.itemInfo.ItemGUID,false,false); tipsModel.SetDogzEquipBtn(tipsModel.curAttrData); tipsModel.ShowUICtrl(); }); } } System/Dogz/DogzItemCell.cs
@@ -46,9 +46,9 @@ itemBaisc.cellBtn.RemoveAllListeners(); itemBaisc.cellBtn.AddListener(()=> { ItemAttrData attrData = new ItemAttrData(model.itemId, false, (ulong)model.itemInfo.ItemCount, model.itemInfo.ItemPlace, model.itemInfo.IsBind, false, PackType.rptDogzItem, model.itemInfo.ItemGUID); tipsModel.SetItemTipsModel(attrData); tipsModel.SetItemTipsModel(model.packType, model.itemInfo.ItemGUID, false, false); tipsModel.SetDogzItemBtn(tipsModel.curAttrData); tipsModel.ShowUICtrl(); }); } } System/Dogz/DogzModel.cs
@@ -69,7 +69,7 @@ AddAssistItem = int.Parse(_funcCfg.Numerical2); AddAssistItemCnt = ConfigParse.GetMultipleStr<int>(_funcCfg.Numerical3); m_DogzEquipStrenLimit = ConfigParse.GetDic<int, int>(_funcCfg.Numerical4); _funcCfg = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("DogzPack"); _funcCfg = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("DogzPack"); DogzPackGridCnt = int.Parse(_funcCfg.Numerical1); } /// <summary> @@ -236,28 +236,48 @@ ItemModel itemModel = playerPack.GetItemModelByIndex(type, index); int dogzId = GetDogzIDByIndex(index); if (itemModel != null) List<ItemModel> modellist = GetDogzEquips(dogzId); if(modellist != null) { for (int i = 0; i < m_DogzEquipDict[dogzId].Count; i++) if (itemModel != null) { if (m_DogzEquipDict[dogzId][i].itemInfo.ItemPlace == index) bool isAdd = true; for (int i = 0; i < modellist.Count; i++) { m_DogzEquipDict[dogzId][i] = itemModel; return; if (modellist[i].itemInfo.ItemPlace == index) { isAdd = false; modellist[i] = itemModel; break; } } if(isAdd) { modellist.Add(itemModel); } } else { for (int i = 0; i < modellist.Count; i++) { if (modellist[i].itemInfo.ItemPlace == index) { modellist.RemoveAt(i); break; } } } } else { for (int i = 0; i < m_DogzEquipDict[dogzId].Count; i++) if(itemModel != null) { if (m_DogzEquipDict[dogzId][i].itemInfo.ItemPlace == index) { m_DogzEquipDict[dogzId].RemoveAt(i); return; } List<ItemModel> equipDatas = new List<ItemModel>(); equipDatas.Add(itemModel); m_DogzEquipDict.Add(dogzId,equipDatas); } } if(RefreshDogzEquipAct != null) { System/KnapSack/Logic/EquipTip.cs
@@ -179,7 +179,8 @@ yield return null; if(itemAttrData.isCompare) { if (itemAttrData.packType != PackType.rptEquip) if (itemAttrData.packType != PackType.rptEquip && itemAttrData.packType != PackType.rptDogzEquip) { itemTipsModel.SetCurTips(this.GetComponent<RectTransform>()); } @@ -205,7 +206,8 @@ ItemCellModel cellModel = new ItemCellModel(itemAttrData.itemId,itemAttrData.isPreview, (ulong)itemAttrData.count, itemAttrData.isBind, itemAttrData.guid,itemAttrData.packType,itemAttrData.isCompare, itemAttrData.useDataDict); itemCell.Init(cellModel); if(itemAttrData.packType == PackType.rptEquip) if(itemAttrData.packType == PackType.rptEquip || itemAttrData.packType == PackType.rptDogzEquip) { putOnIcon.SetActive(true); } @@ -262,7 +264,8 @@ if (itemAttrData.isCompare) { if(itemAttrData.packType != PackType.rptEquip) if(itemAttrData.packType != PackType.rptEquip && itemAttrData.packType != PackType.rptDogzEquip) { CreateFuncBtn(); } System/KnapSack/Logic/ItemTipsModel.cs
@@ -71,6 +71,8 @@ get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); } } DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } } public override void Init() { m_storeModel.RefreshTCBPlayerDataEvent += RefreshOfflinePluginTime; @@ -637,11 +639,7 @@ switch (attrData.winType) { case ItemWinType.equipWin: attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn, attrData.guid); }); break; case ItemWinType.wingsWin: attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn, attrData.guid); }); break; case ItemWinType.guardWin: attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendPutOnQuest(ItemWinBtnType.putOn, attrData.guid); }); break; @@ -688,6 +686,36 @@ } public void SetDogzItemBtn(ItemAttrData attrData) { if (attrData == null) return; if (attrData.itemConfig.CanSell == 1) { attrData.SetTipsFuncBtn(ItemWinBtnType.sell, (ItemWinBtnType, ItemAttrData) => { PackSendQuestMgr.Instance.SendSellQuest(ItemWinBtnType.sell, attrData); }); } switch (attrData.winType) { case ItemWinType.equipWin: attrData.SetTipsFuncBtn(ItemWinBtnType.putOn, (ItemWinBtnType, ItemAttrData) => { dogzModel.SendPutOnEquip(dogzModel.presentSelectDogz, attrData.index); }); break; } } public void SetDogzEquipBtn(ItemAttrData attrData) { if (attrData == null) return; attrData.SetTipsFuncBtn(ItemWinBtnType.putOff, (ItemWinBtnType, ItemAttrData) => { dogzModel.SendPutOffEquip(dogzModel.presentSelectDogz,dogzModel.GetDogzEquipPlaceByIndex(attrData.index)); }); attrData.SetTipsFuncBtn(ItemWinBtnType.strength, (ItemWinBtnType, ItemAttrData) => { WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.StrengthFunc1); }); } /// <summary> /// 设置仓库弹框按钮 /// </summary> System/KnapSack/Logic/PackModelInterface.cs
@@ -588,7 +588,7 @@ SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem); if (singlePack == null) return false; int startLockIndex = singlePack.openGridCount - GetInitGridCount(PackType.rptItem); int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt; FuncConfigConfig _tagFuncModel = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("OpenBagItem"); int haveCount = playerPack.GetItemCountByID(PackType.rptItem,itemId); Equation.Instance.Clear(); @@ -779,22 +779,20 @@ #region 解锁格子 public int GetInitGridCount(PackType type) { FuncConfigConfig initGridCount = null; if (type == PackType.rptItem) initGridCount = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitBagCellCount"); else if (type == PackType.rptWarehouse) initGridCount = ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitDepotCellCount"); return int.Parse(initGridCount.Numerical1); } public void OpenGrid(int chooseGridCount, PackType type) { SinglePackModel singlePack = playerPack.GetSinglePackModel(type); int openCount = chooseGridCount - singlePack.openGridCount; int index = chooseGridCount - GetInitGridCount(type); int index = 0; switch(type) { case PackType.rptItem: index = chooseGridCount - playerPack.InitBagGridCnt; break; case PackType.rptWarehouse: index = chooseGridCount - playerPack.InitDepotGridCnt; break; } itemTipsModel.SetExtendGirdModel(openCount,index, type); WindowCenter.Instance.Open<ExtendWin>(); } System/KnapSack/Logic/PackSendQuestMgr.cs
@@ -680,7 +680,7 @@ if (useItemModel.itemId == 951) { int startLockIndex = singlePack.openGridCount - modelInterface.GetInitGridCount(PackType.rptItem); int startLockIndex = singlePack.openGridCount - playerPack.InitBagGridCnt; int chooseGridCnt = singlePack.openGridCount + GetExtendGridCnt(startLockIndex); modelInterface.OpenGrid(chooseGridCnt, PackType.rptItem); return; @@ -776,6 +776,11 @@ { extendCnt = 1; } int remianLock = playerPack.MaxBagGridCnt - playerPack.GetSinglePackModel(PackType.rptItem).openGridCount; if(extendCnt > remianLock) { extendCnt = remianLock; } return extendCnt; } } System/KnapSack/Logic/PlayerPackModels.cs
@@ -17,6 +17,11 @@ public Dictionary<int, Dictionary<int, int>> decomposeAttrDict = new Dictionary<int, Dictionary<int, int>>(); public static string StrengthAttrShift_RecordKey = "StrengthAttrShift"; public const string RecordKnapsackTitle = "RecordKnapsackTitle"; public int MaxBagGridCnt { get; private set; } public int InitBagGridCnt { get; private set; } public int MaxDepotGridCnt { get; private set; } public int InitDepotGridCnt { get; private set; } public override void Init() { List<DungeonOpenTimeConfig> dungeonlist = ConfigManager.Instance.GetAllValues<DungeonOpenTimeConfig>(); @@ -71,6 +76,11 @@ minDecomposeNum = int.Parse(equipDecompose.Numerical1); defaultUnSelectlist = ConfigParse.GetMultipleStr<int>(equipDecompose.Numerical2); InitDepotGridCnt = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitDepotCellCount").Numerical1); InitBagGridCnt = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("InitBagCellCount").Numerical1); MaxBagGridCnt = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("MaxBagCellCount").Numerical1); MaxDepotGridCnt = int.Parse(ConfigManager.Instance.GetTemplate<FuncConfigConfig>("MaxDepotCellCount").Numerical1); } public void OnBeforePlayerDataInitialize() UI/Common/SortTable.cs
@@ -1,67 +1,67 @@ using EnhancedUI.EnhancedScroller; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class SortTable : MonoBehaviour { [SerializeField] SortType m_SortType; public SortType sortType { get { return m_SortType; } set { m_SortType = value; } } [SerializeField] List<SortElement> m_SortElements; [SerializeField] ScrollerController m_Controller; [SerializeField] ClickScreenOtherSpace m_ClickOtherSpace; [SerializeField] Text m_TargetDisplay; public event Action<int> onSelectSortEvent; public event Action onSortCloseEvent; DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } } private void Awake() { m_Controller.OnRefreshCell += OnRefreshCell; } private void OnEnable() { m_Controller.Refresh(); if (m_SortElements != null) { for (int i = 0; i < m_SortElements.Count; i++) { m_Controller.AddCell(ScrollerDataType.Header, i, OnSortSelect); } } m_Controller.Restart(); if (m_ClickOtherSpace != null) { m_ClickOtherSpace.RemoveAllListeners(); m_ClickOtherSpace.AddListener(() => { if (onSortCloseEvent != null) { onSortCloseEvent(); } }); } } private void OnSortSelect(CellView _cell) { var _index = _cell.index; var type = m_SortElements[_index].type; using EnhancedUI.EnhancedScroller; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace Snxxz.UI { public class SortTable : MonoBehaviour { [SerializeField] SortType m_SortType; public SortType sortType { get { return m_SortType; } set { m_SortType = value; } } [SerializeField] List<SortElement> m_SortElements; [SerializeField] ScrollerController m_Controller; [SerializeField] ClickScreenOtherSpace m_ClickOtherSpace; [SerializeField] Text m_TargetDisplay; public event Action<int> onSelectSortEvent; public event Action onSortCloseEvent; DogzModel dogzModel { get { return ModelCenter.Instance.GetModel<DogzModel>(); } } private void Awake() { m_Controller.OnRefreshCell += OnRefreshCell; } private void OnEnable() { m_Controller.Refresh(); if (m_SortElements != null) { for (int i = 0; i < m_SortElements.Count; i++) { m_Controller.AddCell(ScrollerDataType.Header, i, OnSortSelect); } } m_Controller.Restart(); if (m_ClickOtherSpace != null) { m_ClickOtherSpace.RemoveAllListeners(); m_ClickOtherSpace.AddListener(() => { if (onSortCloseEvent != null) { onSortCloseEvent(); } }); } } private void OnSortSelect(CellView _cell) { var _index = _cell.index; var type = m_SortElements[_index].type; switch (sortType) { case SortType.EquipQuality: @@ -70,48 +70,48 @@ case SortType.EquipStar: dogzModel.SelectDogzItemStart = type; break; } if (onSelectSortEvent != null) { onSelectSortEvent(type); } if (onSortCloseEvent != null) { onSortCloseEvent(); } if (m_TargetDisplay != null) { m_TargetDisplay.text = Language.Get(m_SortElements[_index].textKey); } this.gameObject.SetActive(false); } private void OnRefreshCell(ScrollerDataType type, CellView cell) { var _sortCell = cell as SortCell; _sortCell.sortTypeTxt.text = Language.Get(m_SortElements[cell.index].textKey); } public void SetDefault() { if (m_TargetDisplay != null && m_SortElements != null && m_SortElements.Count > 0) { m_TargetDisplay.text = Language.Get(m_SortElements[0].textKey); } } } public enum SortType { EquipQuality, EquipStar, } [Serializable] public struct SortElement { [Header("语言表key")] public string textKey; public int type; } } } if (onSelectSortEvent != null) { onSelectSortEvent(type); } if (onSortCloseEvent != null) { onSortCloseEvent(); } if (m_TargetDisplay != null) { m_TargetDisplay.text = Language.Get(m_SortElements[_index].textKey); } this.gameObject.SetActive(false); } private void OnRefreshCell(ScrollerDataType type, CellView cell) { var _sortCell = cell as SortCell; _sortCell.sortTypeTxt.text = Language.Get(m_SortElements[cell.index].textKey); } public void SetDefault() { if (m_TargetDisplay != null && m_SortElements != null && m_SortElements.Count > 0) { m_TargetDisplay.text = Language.Get(m_SortElements[0].textKey); } } } public enum SortType { EquipQuality, EquipStar, } [Serializable] public struct SortElement { [Header("语言表key")] public string textKey; public int type; } }