From f6fa7aed62fb6db0ef6bcf21c1e2eac9679ba051 Mon Sep 17 00:00:00 2001
From: Client_PangDeRong <593317293@qq.com>
Date: 星期一, 21 一月 2019 20:49:16 +0800
Subject: [PATCH] 5930 子 【开发】【1.5.100】诛仙装备开发 / 【前端】【1.5.100】诛仙装备开发
---
System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs.meta | 12
System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs.meta | 12
System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs.meta | 12
UI/Common/SortTable.cs | 1
System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs | 115 ++++++
System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs | 81 ++++
System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs | 108 ++++++
System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs.meta | 12
System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs.meta | 12
System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs.meta | 12
System/JadeDynastyKnapSack.meta | 9
System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs | 97 +++++
System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs | 39 ++
System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs | 58 +++
System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs.meta | 12
System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs.meta | 12
System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs | 84 ++++
System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs | 142 ++++++++
System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs | 25 +
System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs | 76 ++++
System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs.meta | 12
System/KnapSack/Logic/EquipTip.cs | 37 ++
System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs.meta | 12
23 files changed, 992 insertions(+), 0 deletions(-)
diff --git a/System/JadeDynastyKnapSack.meta b/System/JadeDynastyKnapSack.meta
new file mode 100644
index 0000000..203467b
--- /dev/null
+++ b/System/JadeDynastyKnapSack.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: a3c2973f5500e1c46ab255e7d5247562
+folderAsset: yes
+timeCreated: 1547867772
+licenseType: Pro
+DefaultImporter:
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs b/System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs
new file mode 100644
index 0000000..f02b91b
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs
@@ -0,0 +1,76 @@
+锘縰sing System;
+using UnityEngine;
+using UnityEngine.UI;
+using EnhancedUI.EnhancedScroller;
+using System.Collections.Generic;
+
+namespace Snxxz.UI
+{
+ [XLua.Hotfix]
+ public class JadeDynastyDecomposeLineBeh : ScrollerUI
+ {
+ [SerializeField] List<DecomposeItemBeh> itemBehs = new List<DecomposeItemBeh>();
+ JadeDynastyDecomposeModel decomposeModel { get { return ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>(); } }
+ PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
+
+ public override void Refresh(CellView cell)
+ {
+ var decomposeGuids = decomposeModel.allGuids;
+ int length = itemBehs.Count;
+ for(int i = 0; i < length; i++)
+ {
+ var itemBeh = itemBehs[i];
+ int index = cell.index*length + i;
+ if(decomposeGuids != null
+ && index < decomposeGuids.Count)
+ {
+ var guid = decomposeGuids[index];
+ var model = playerPack.GetItemModelByGUID(guid);
+ itemBeh.SetDisplay(model,decomposeModel.selectGuids);
+ }
+ else
+ {
+ itemBeh.SetDisplay(null,null);
+ }
+
+ }
+ }
+
+ [Serializable]
+ public class DecomposeItemBeh
+ {
+ [SerializeField] CommonItemBaisc itemBaisc;
+ [SerializeField] GameObject selectObj;
+
+ JadeDynastyDecomposeModel decomposeModel { get { return ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>(); } }
+
+ public void SetDisplay(ItemModel itemModel,List<string> selectGuids)
+ {
+ if (itemModel == null || selectGuids == null)
+ {
+ itemBaisc.gameObject.SetActive(false);
+ selectObj.SetActive(false);
+ }
+ else
+ {
+ itemBaisc.gameObject.SetActive(true);
+ selectObj.SetActive(selectGuids.Contains(itemModel.itemInfo.ItemGUID));
+ itemBaisc.Init(itemModel);
+ itemBaisc.cellBtn.RemoveAllListeners();
+ itemBaisc.cellBtn.AddListener(()=>
+ {
+ if(selectObj.activeInHierarchy)
+ {
+ this.decomposeModel.RemoveSelectModel(itemModel.itemInfo.ItemGUID);
+ }
+ else
+ {
+ this.decomposeModel.AddSelectModel(itemModel.itemInfo.ItemGUID);
+ }
+ selectObj.SetActive(!selectObj.activeInHierarchy);
+ });
+ }
+ }
+ }
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs.meta b/System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs.meta
new file mode 100644
index 0000000..88ea450
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyDecomposeLineBeh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 6b9a652b72ad50041b82658a1246c004
+timeCreated: 1548072997
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs b/System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs
new file mode 100644
index 0000000..93ea6ea
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs
@@ -0,0 +1,142 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastyDecomposeModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk
+ {
+ public int selectEquipLv { get; private set; }
+ public bool isAutoDecompose { get; private set; }
+ public string LocalSaveSelectEquipLv { get; private set;}
+ public string LocalSaveAutoDecompose { get; private set;}
+ public List<string> selectGuids { get; private set; }
+ public List<string> allGuids { get; private set; }
+ public event Action UpdateSelectItemEvent;
+
+ PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
+ public override void Init()
+ {
+ selectGuids = new List<string>();
+ allGuids = new List<string>();
+ }
+
+ public void OnBeforePlayerDataInitialize()
+ {
+
+ }
+
+ public void OnAfterPlayerDataInitialize()
+ {
+ int playerId = (int)PlayerDatas.Instance.PlayerId;
+ LocalSaveSelectEquipLv = StringUtility.Contact("JadeDynastyDecomposeSelectEquipLv",playerId);
+ LocalSaveAutoDecompose = StringUtility.Contact("JadeDynastyAutoDecompose",playerId);
+ GetSelectEquipLvByLocalSave();
+ IsAutoDecomposeByLocalSave();
+ }
+
+ public void OnPlayerLoginOk()
+ {
+ UpdateDecomposeModels();
+ UpdateSelectModels();
+ }
+
+ public override void UnInit()
+ {
+
+ }
+
+ private int GetSelectEquipLvByLocalSave()
+ {
+ selectEquipLv = LocalSave.GetInt(LocalSaveSelectEquipLv);
+ return selectEquipLv;
+ }
+
+ private bool IsAutoDecomposeByLocalSave()
+ {
+ isAutoDecompose = LocalSave.GetBool(LocalSaveAutoDecompose);
+ return isAutoDecompose;
+ }
+
+ public void UpdateSelectEquipLv(int equipLv)
+ {
+ selectEquipLv = equipLv;
+ UpdateSelectModels();
+ LocalSave.SetInt(LocalSaveSelectEquipLv,equipLv);
+ }
+
+ public void UpdateIsAutoDecompose(bool isAuto)
+ {
+ isAutoDecompose = isAuto;
+ LocalSave.SetBool(LocalSaveAutoDecompose,isAutoDecompose);
+ }
+
+ public void UpdateDecomposeModels()
+ {
+ allGuids.Clear();
+ var singlePack = playerPack.GetSinglePackModel(PackType.rptJadeDynastyItem);
+ if (singlePack == null) return;
+
+ var itemDict = singlePack.GetPackModelIndexDict();
+ foreach(var index in itemDict.Keys)
+ {
+ var model = itemDict[index];
+ if(model.chinItemModel.EquipPlace > 0)
+ {
+ allGuids.Add(model.itemInfo.ItemGUID);
+ }
+ }
+ }
+
+ public void UpdateSelectModels()
+ {
+ selectGuids.Clear();
+ foreach(var guid in allGuids)
+ {
+ var model = playerPack.GetItemModelByGUID(guid);
+ if(model != null)
+ {
+ if (selectEquipLv != 0
+ && model.chinItemModel.LV <= selectEquipLv)
+ {
+ selectGuids.Add(model.itemInfo.ItemGUID);
+ }
+ }
+ }
+ if(UpdateSelectItemEvent != null)
+ {
+ UpdateSelectItemEvent();
+ }
+ }
+
+ public void AddSelectModel(string guid)
+ {
+ if (guid == null) return;
+
+ if(!selectGuids.Contains(guid))
+ {
+ selectGuids.Add(guid);
+ if(UpdateSelectItemEvent != null)
+ {
+ UpdateSelectItemEvent();
+ }
+ }
+ }
+
+ public void RemoveSelectModel(string guid)
+ {
+ if (guid == null) return;
+
+ if(selectGuids.Contains(guid))
+ {
+ selectGuids.Remove(guid);
+ if (UpdateSelectItemEvent != null)
+ {
+ UpdateSelectItemEvent();
+ }
+ }
+ }
+
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs.meta b/System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs.meta
new file mode 100644
index 0000000..ff20769
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyDecomposeModel.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: d16f0dd3ef5fc9d48a0bbb2dae96ecf4
+timeCreated: 1548069008
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs b/System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs
new file mode 100644
index 0000000..e507e96
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs
@@ -0,0 +1,115 @@
+锘縰sing System;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastyDecomposeWin : Window
+ {
+ [SerializeField] ScrollerController decomposeCtrl;
+ [SerializeField] SortTable sortTable;
+ [SerializeField] Button closeBtn;
+ [SerializeField] Button autoDecomposeBtn;
+ [SerializeField] Button decomposeBtn;
+ [SerializeField] Button selectBtn;
+ [SerializeField] Image autoDecomposeImg;
+ [SerializeField] Transform sortArrow;
+
+ JadeDynastyDecomposeModel decomposeModel { get { return ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>(); } }
+ #region Built-in
+ protected override void BindController()
+ {
+
+ }
+ protected override void AddListeners()
+ {
+ closeBtn.AddListener(CloseClick);
+ autoDecomposeBtn.AddListener(ClickAutoDecompose);
+ decomposeBtn.AddListener(ClickDecompose);
+ selectBtn.AddListener(ClickSelect);
+ }
+
+ protected override void OnPreOpen()
+ {
+ decomposeModel.UpdateSelectItemEvent += UpdateSelectItem;
+ sortTable.onSortCloseEvent += CloseSortTable;
+ sortTable.onSelectSortEvent += UpdateSelectEquipLv;
+ sortTable.SetDefault();
+ SetDisplay();
+ }
+
+ protected override void OnAfterOpen()
+ {
+
+ }
+
+ protected override void OnPreClose()
+ {
+ decomposeModel.UpdateSelectItemEvent -= UpdateSelectItem;
+ sortTable.onSortCloseEvent -= CloseSortTable;
+ sortTable.onSelectSortEvent -= UpdateSelectEquipLv;
+ }
+ protected override void OnAfterClose()
+ {
+
+ }
+ #endregion
+
+ private void SetDisplay()
+ {
+ CreateItemLine();
+ sortArrow.localRotation = Quaternion.Euler(0, 0, 180);
+ sortTable.gameObject.SetActive(false);
+ autoDecomposeImg.gameObject.SetActive(decomposeModel.isAutoDecompose);
+ }
+
+ private void CreateItemLine()
+ {
+ decomposeModel.UpdateDecomposeModels();
+ decomposeModel.UpdateSelectModels();
+ decomposeCtrl.Refresh();
+ for(int i = 0; i < decomposeModel.allGuids.Count; i++)
+ {
+ decomposeCtrl.AddCell(ScrollerDataType.Header,i);
+ }
+ decomposeCtrl.Restart();
+ }
+
+ private void UpdateSelectEquipLv(SortType type, int lv)
+ {
+ if (type != SortType.EquipLv) return;
+
+ decomposeModel.UpdateSelectEquipLv(lv);
+ }
+
+ private void UpdateSelectItem()
+ {
+ decomposeCtrl.m_Scorller.RefreshActiveCellViews();
+ }
+
+ private void CloseSortTable()
+ {
+ sortArrow.localRotation = Quaternion.Euler(0, 0, 180);
+ }
+
+ private void ClickSelect()
+ {
+ sortArrow.localRotation = Quaternion.Euler(0, 0, 0);
+ if (!sortTable.gameObject.activeInHierarchy)
+ {
+ sortTable.gameObject.SetActive(true);
+ }
+ }
+
+ private void ClickDecompose()
+ {
+
+ }
+
+ private void ClickAutoDecompose()
+ {
+ autoDecomposeImg.gameObject.SetActive(!decomposeModel.isAutoDecompose);
+ decomposeModel.UpdateIsAutoDecompose(!decomposeModel.isAutoDecompose);
+ }
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs.meta b/System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs.meta
new file mode 100644
index 0000000..31f581b
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyDecomposeWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 4058e063e60ae424592cd7af03ad4fc9
+timeCreated: 1548064681
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs b/System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs
new file mode 100644
index 0000000..65aa7af
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs
@@ -0,0 +1,81 @@
+锘縰sing System;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastyEquipBeh : MonoBehaviour
+ {
+ [SerializeField] RoleEquipType equipType = RoleEquipType.retMax;
+ [SerializeField] GameObject lockObj;
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] Text lockText;
+ [SerializeField] Text nameText;
+ [SerializeField] Button equipBtn;
+
+ ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
+ PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
+
+ private void OnEnable()
+ {
+ playerPack.ItemCntAddAct += PutOnEquip;
+ playerPack.ItemCntReduceAct += PutOffEquip;
+ SetDisplay();
+ }
+
+ private void OnDisable()
+ {
+ playerPack.ItemCntAddAct -= PutOnEquip;
+ playerPack.ItemCntReduceAct -= PutOffEquip;
+ }
+
+ public void SetDisplay()
+ {
+ bool islock = false;
+ int towerLayer = 1;
+ lockObj.SetActive(islock);
+ lockText.gameObject.SetActive(islock);
+ nameText.text = string.Empty;
+ nameText.gameObject.SetActive(false);
+ equipBtn.RemoveAllListeners();
+ itemCell.cellBtn.RemoveAllListeners();
+ if(islock)
+ {
+ itemCell.gameObject.SetActive(false);
+ lockText.text = StringUtility.Contact("璇涗粰濉�/n",towerLayer,"灞傝В閿�");
+ }
+ else
+ {
+ ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptJadeDynastyEquip,(int)equipType);
+ itemCell.gameObject.SetActive(itemModel != null);
+ if(itemModel != null)
+ {
+ itemCell.Init(itemModel);
+ itemCell.cellBtn.AddListener(() => { ClickItemCell(itemModel); });
+ }
+ }
+ }
+
+ private void PutOffEquip(PackType type, int index, int id)
+ {
+ if (type != PackType.rptJadeDynastyEquip || index != (int)equipType) return;
+
+ SetDisplay();
+ }
+
+ private void PutOnEquip(PackType type, int index, int id)
+ {
+ if (type != PackType.rptJadeDynastyEquip || index != (int)equipType) return;
+
+ SetDisplay();
+ }
+
+
+ private void ClickItemCell(ItemModel item)
+ {
+ if (item == null) return;
+
+ tipsModel.SetItemTipsModel(item.packType,item.itemInfo.ItemGUID);
+ }
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs.meta b/System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs.meta
new file mode 100644
index 0000000..6565307
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyEquipBeh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 932f7caddd34f5848a1b609234d55caa
+timeCreated: 1548035370
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs b/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs
new file mode 100644
index 0000000..fa02f1b
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs
@@ -0,0 +1,97 @@
+锘縰sing System;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastyEquipWin : Window
+ {
+ [SerializeField] Button decomposeBtn;
+ [Header("璇涗粰瑁呭浣�")]
+ [SerializeField] Button stoneAttrBtn;
+ [SerializeField] Button suitAttrBtn;
+ [Header("璇涗粰鑳屽寘")]
+ [SerializeField] ScrollerController itemCtrl;
+ [SerializeField] int initCount = 100;
+
+ PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
+ #region Built-in
+ protected override void BindController()
+ {
+
+ }
+ protected override void AddListeners()
+ {
+ decomposeBtn.AddListener(ClickDecompose);
+ stoneAttrBtn.AddListener(ClickStoneAttr);
+ suitAttrBtn.AddListener(ClickSuitAttr);
+ }
+
+ protected override void OnPreOpen()
+ {
+ playerPack.RefreshItemCountAct += UpdateJadeDynastyItem;
+ SetDisplay();
+ }
+
+ protected override void OnAfterOpen()
+ {
+
+ }
+
+ protected override void OnPreClose()
+ {
+ playerPack.RefreshItemCountAct -= UpdateJadeDynastyItem;
+ }
+
+ protected override void OnAfterClose()
+ {
+
+ }
+ #endregion
+
+ private void SetDisplay()
+ {
+ CreateItemLine();
+ }
+
+ private void CreateItemLine()
+ {
+ itemCtrl.Refresh();
+ int line = initCount / 5;
+ for(int i = 0; i < line; i++)
+ {
+ itemCtrl.AddCell(ScrollerDataType.Header,i);
+ }
+ itemCtrl.Restart();
+ }
+
+ private void UpdateJadeDynastyItem(PackType type, int index, int id)
+ {
+ if (type != PackType.rptJadeDynastyItem) return;
+
+ UpdateItemLine();
+ }
+
+ private void UpdateItemLine()
+ {
+ itemCtrl.m_Scorller.RefreshActiveCellViews();
+ }
+
+ private void ClickSuitAttr()
+ {
+ WindowCenter.Instance.Open<JadeDynastySuitAttrWin>();
+ }
+
+ private void ClickStoneAttr()
+ {
+
+ }
+
+ private void ClickDecompose()
+ {
+ WindowCenter.Instance.Open<JadeDynastyDecomposeWin>();
+ }
+
+
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs.meta b/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs.meta
new file mode 100644
index 0000000..64c200c
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyEquipWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: aece173e3072f4a45ac2c3d45709d527
+timeCreated: 1547867941
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs b/System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs
new file mode 100644
index 0000000..64e9357
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs
@@ -0,0 +1,39 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastyItemBeh : MonoBehaviour
+ {
+ [SerializeField] ItemCell itemCell;
+ [SerializeField] Button lockBtn;
+
+ ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
+ PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
+
+ public void SetDisplay(int index)
+ {
+ var singlePack = playerPack.GetSinglePackModel(PackType.rptJadeDynastyItem);
+ if (singlePack == null) return;
+
+ var itemModel = playerPack.GetItemModelByIndex(PackType.rptJadeDynastyItem, index);
+ itemCell.gameObject.SetActive(itemModel != null);
+ if(itemModel != null)
+ {
+ lockBtn.gameObject.SetActive(false);
+ itemCell.Init(itemModel,true);
+ itemCell.cellBtn.RemoveAllListeners();
+ itemCell.cellBtn.AddListener(()=>
+ {
+ tipsModel.SetItemTipsModel(itemModel.packType,itemModel.itemInfo.ItemGUID);
+ });
+
+ }
+ else
+ {
+ bool isLock = index > (singlePack.openGridCount - 1);
+ lockBtn.gameObject.SetActive(isLock);
+ }
+ }
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs.meta b/System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs.meta
new file mode 100644
index 0000000..23bc70a
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyItemBeh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: e6b6e570c6125ef46842e12a39509708
+timeCreated: 1548038720
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs b/System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs
new file mode 100644
index 0000000..1c38d76
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs
@@ -0,0 +1,25 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+using EnhancedUI.EnhancedScroller;
+using System.Collections.Generic;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastyItemLineBeh : ScrollerUI
+ {
+ [SerializeField] List<JadeDynastyItemBeh> itemBehs = new List<JadeDynastyItemBeh>();
+
+ PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
+
+ public override void Refresh(CellView cell)
+ {
+ int length = itemBehs.Count;
+ for(int i = 0; i < length; i++)
+ {
+ int index = cell.index * length + i;
+ var itemBeh = itemBehs[i];
+ itemBeh.SetDisplay(index);
+ }
+ }
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs.meta b/System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs.meta
new file mode 100644
index 0000000..3d7983e
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyItemLineBeh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 90b8c7969d616ae458ab3efef2d4880d
+timeCreated: 1548038657
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs b/System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs
new file mode 100644
index 0000000..b1ad24f
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs
@@ -0,0 +1,84 @@
+锘縰sing System;
+using UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastyKnapSackWin : Window
+ {
+ [SerializeField] FunctionButton funcEquip;
+ [SerializeField] FunctionButtonGroup funcGroup;
+ [SerializeField] Button closeBtn;
+ [SerializeField] Button leftBtn;
+ [SerializeField] Button rightBtn;
+
+ #region Built-in
+ protected override void BindController()
+ {
+
+ }
+ protected override void AddListeners()
+ {
+ closeBtn.AddListener(CloseClick);
+ leftBtn.AddListener(ClickLeft);
+ rightBtn.AddListener(ClickRight);
+ funcEquip.AddListener(ClickFuncEquip);
+ }
+ protected override void OnPreOpen()
+ {
+
+ }
+
+ protected override void OnActived()
+ {
+ base.OnActived();
+ funcGroup.TriggerByOrder(functionOrder);
+ }
+
+ protected override void OnAfterOpen()
+ {
+
+ }
+
+ protected override void OnPreClose()
+ {
+
+ }
+
+ protected override void OnAfterClose()
+ {
+
+ }
+ #endregion
+
+ private void ClickRight()
+ {
+ funcGroup.TriggerNext();
+ }
+ private void ClickLeft()
+ {
+ funcGroup.TriggerLast();
+ }
+ private void ClickFuncEquip()
+ {
+ CloseSubWindows();
+ if (windowState == WindowState.Opened)
+ {
+ WindowCenter.Instance.OpenWithoutAnimation<JadeDynastyKnapSackWin>();
+ }
+ else
+ {
+ WindowCenter.Instance.Open<JadeDynastyKnapSackWin>();
+ }
+ functionOrder = funcEquip.order;
+ }
+ private void CloseSubWindows()
+ {
+ var children = WindowConfig.Get().FindChildWindows(this.GetType().Name);
+ foreach (var window in children)
+ {
+ WindowCenter.Instance.Close(window);
+ }
+ }
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs.meta b/System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs.meta
new file mode 100644
index 0000000..7977bf2
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastyKnapSackWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 5336f00e3c02082409234c4d9281b34a
+timeCreated: 1547867941
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs b/System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs
new file mode 100644
index 0000000..8f9360b
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs
@@ -0,0 +1,108 @@
+锘縰sing System;
+using UnityEngine;
+using UnityEngine.UI;
+using System.Collections.Generic;
+using TableConfig;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastySuitAttrBeh : MonoBehaviour
+ {
+ [SerializeField] Text titleText;
+ [SerializeField] List<SuitAttr> suitAttrs = new List<SuitAttr>();
+ [SerializeField] GameObject noneActive;
+
+ public void SetDisplay(int suitLv,bool isNext = false)
+ {
+ bool isShowNoneActive = false;
+ if (!isNext)
+ {
+ bool isActive = true;
+ isShowNoneActive = !isActive;
+ titleText.text = StringUtility.Contact("濂楄鎬诲睘鎬�");
+ }
+ else
+ {
+ bool isMaxSuitLv = false;
+ isShowNoneActive = isMaxSuitLv;
+ titleText.text = StringUtility.Contact("杩涢樁灞炴��");
+ }
+
+ if(noneActive != null)
+ {
+ noneActive.SetActive(isShowNoneActive);
+ }
+
+ for(int i = 0; i < suitAttrs.Count; i++)
+ {
+ var suitAttr = suitAttrs[i];
+ suitAttr.SetDisplay(i,1,null,null);
+ }
+ }
+
+ [Serializable]
+ public class SuitAttr
+ {
+ [SerializeField] Text suitTypeText;
+ [SerializeField] List<GameObject> attrObjlist = new List<GameObject>();
+ [SerializeField] List<Text> attrTextlist = new List<Text>();
+ [SerializeField] Text activeText;
+ [SerializeField] GameObject activeObj;
+ ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
+ public void SetDisplay(int suitType,int suitLv,List<int> ids,List<int> values)
+ {
+ if (ids == null || values == null) return;
+
+ bool isActive = true;
+ switch(suitType)
+ {
+ case 0:
+ suitTypeText.text = StringUtility.Contact("璇涗粰瀹堟姢LV." + suitLv);
+ break;
+ case 1:
+ suitTypeText.text = StringUtility.Contact("璇涗粰涔嬪姏LV." + suitLv);
+ break;
+ case 2:
+ suitTypeText.text = StringUtility.Contact("璇涗粰鍓戦樀LV." + suitLv);
+ break;
+ }
+ activeObj.SetActive(!isActive);
+ if(!isActive)
+ {
+ string conditionSB = StringUtility.Contact("杈惧埌8闃舵縺娲�");
+ }
+ for (int i = 0; i < attrObjlist.Count; i++)
+ {
+ var attrObj = attrObjlist[i];
+ attrObj.SetActive(i < ids.Count);
+ if(i < ids.Count)
+ {
+ var attrId = ids[i];
+ var attrValue = values[i];
+ var attrText = attrTextlist[i];
+ var attrConfig = Config.Instance.Get<PlayerPropertyConfig>(attrId);
+ string attrSB = string.Empty;
+ string attrValueSB = string.Empty;
+ if (isActive)
+ {
+ attrValueSB = UIHelper.AppendStringColor(TextColType.Green, tipsModel.GetProValueTypeStr(attrConfig, attrValue));
+ }
+ else
+ {
+ attrValueSB = UIHelper.AppendStringColor(TextColType.Gray, tipsModel.GetProValueTypeStr(attrConfig, attrValue));
+ }
+ if (attrConfig.Name.Contains("%s"))
+ {
+ attrSB = attrConfig.Name.Replace("%s", attrValueSB);
+ }
+ else
+ {
+ attrSB = StringUtility.Contact(attrConfig.Name, "+", attrValueSB);
+ }
+ attrText.text = attrSB;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs.meta b/System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs.meta
new file mode 100644
index 0000000..bba1d1d
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastySuitAttrBeh.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: fd03e25d39702af45834d010b9ce3c1f
+timeCreated: 1548051833
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs b/System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs
new file mode 100644
index 0000000..209c5b4
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs
@@ -0,0 +1,58 @@
+锘縰sing UnityEngine;
+using UnityEngine.UI;
+
+namespace Snxxz.UI
+{
+ public class JadeDynastySuitAttrWin : Window
+ {
+ [SerializeField] JadeDynastySuitAttrBeh curSuitAttrBeh;
+ [SerializeField] JadeDynastySuitAttrBeh nextSuitAttrBeh;
+
+ #region Built-in
+ protected override void BindController()
+ {
+
+ }
+ protected override void AddListeners()
+ {
+
+ }
+
+ protected override void OnPreOpen()
+ {
+ SetDisplay();
+ }
+ protected override void OnAfterOpen()
+ {
+
+ }
+
+ protected override void OnPreClose()
+ {
+
+ }
+
+ protected override void OnAfterClose()
+ {
+
+ }
+ #endregion
+
+ private void SetDisplay()
+ {
+ int curSuitLv = 0;
+ int nextSuitLv = 1;
+ bool isMaxSuitLv = false;
+ nextSuitAttrBeh.gameObject.SetActive(!isMaxSuitLv);
+ if(isMaxSuitLv)
+ {
+ curSuitAttrBeh.SetDisplay(curSuitLv);
+ }
+ else
+ {
+ curSuitAttrBeh.SetDisplay(curSuitLv);
+ nextSuitAttrBeh.SetDisplay(nextSuitLv,true);
+ }
+ }
+ }
+}
diff --git a/System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs.meta b/System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs.meta
new file mode 100644
index 0000000..a3adb38
--- /dev/null
+++ b/System/JadeDynastyKnapSack/JadeDynastySuitAttrWin.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 57eff5f7971a1f74da451b3bde6e9606
+timeCreated: 1548051551
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/System/KnapSack/Logic/EquipTip.cs b/System/KnapSack/Logic/EquipTip.cs
index f970bdf..d574063 100644
--- a/System/KnapSack/Logic/EquipTip.cs
+++ b/System/KnapSack/Logic/EquipTip.cs
@@ -94,6 +94,11 @@
[SerializeField]
ScrollerController suirAttrCtrl;
+ [Header("璇涗粰濂楄")]
+ [SerializeField] GameObject jadeDynastySuitObj;
+ [SerializeField] JadeDynastySuitAttrBeh curJadeDynastySuitAttr;
+ [SerializeField] JadeDynastySuitAttrBeh nextJadeDynastySuitAttr;
+
[SerializeField] List<GameObject> attrCutLinelist = new List<GameObject>();
#endregion
@@ -235,6 +240,7 @@
SetWashAttrUI();
SetGemAttrUI();
SetSuitAttrUI();
+ SetJadeDynastySuitAttr();
for (int i = 0; i < attrCutLinelist.Count; i++)
{
if (i == curAttrTypeNum - 1)
@@ -843,6 +849,37 @@
}
}
+ private void SetJadeDynastySuitAttr()
+ {
+ if (jadeDynastySuitObj == null) return;
+
+ if(itemAttrData.itemConfig.EquipPlace >= (int)RoleEquipType.JadeDynasty_Cloak
+ && itemAttrData.itemConfig.EquipPlace <= (int)RoleEquipType.JadeDynasty_Sword4)
+ {
+ jadeDynastySuitObj.SetActive(true);
+ }
+ else
+ {
+ jadeDynastySuitObj.SetActive(false);
+ return;
+ }
+
+ bool isMaxSuitLv = false;
+ int maxSuitLv = 1;
+ int curSuitLv = itemAttrData.packType == PackType.rptJadeDynastyItem ? maxSuitLv : 0;
+ bool isShowNext = !isMaxSuitLv && itemAttrData.packType == PackType.rptJadeDynastyItem;
+ nextJadeDynastySuitAttr.gameObject.SetActive(isShowNext);
+ if(isShowNext)
+ {
+ curJadeDynastySuitAttr.SetDisplay(curSuitLv);
+ nextJadeDynastySuitAttr.SetDisplay(curSuitLv + 1);
+ }
+ else
+ {
+ curJadeDynastySuitAttr.SetDisplay(curSuitLv);
+ }
+ }
+
private void SetMidUIHeight(float midHeight)
{
scrollRect.enabled = false;
diff --git a/UI/Common/SortTable.cs b/UI/Common/SortTable.cs
index 9e1d0cb..d3dd56f 100644
--- a/UI/Common/SortTable.cs
+++ b/UI/Common/SortTable.cs
@@ -93,6 +93,7 @@
{
EquipQuality,
EquipStar,
+ EquipLv,
}
[Serializable]
public struct SortElement
--
Gitblit v1.8.0