//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Tuesday, September 12, 2017
|
//--------------------------------------------------------
|
|
using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
using Snxxz.UI;
|
|
|
//仙盟宝库
|
namespace Snxxz.UI
|
{
|
|
public class WarehouseTipsWin : TempKnapSackBasic
|
{
|
[SerializeField]
|
TreasureTheLog w_TreasureTheLog;//宝库日志
|
|
PackModel _playerPack;
|
PackModel playerPack { get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); } }
|
ItemTipsModel _itemTipsModel;
|
ItemTipsModel itemTipsModel { get { return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>()); } }
|
FairyAuTreasureModel m_PlayerFairyAuTreasureData;
|
FairyAuTreasureModel playerFairyAuTreasureData { get { return m_PlayerFairyAuTreasureData ?? (m_PlayerFairyAuTreasureData = ModelCenter.Instance.GetModel<FairyAuTreasureModel>()); } }
|
|
#region 属性
|
[SerializeField] ScrollerController _GridlineCtrl;
|
[SerializeField] Button _CloseBtn;//关闭按钮
|
[SerializeField] Button _DonateBtn;//装备捐献按钮
|
[SerializeField] Button _CleanBtn;//批量清理按钮
|
[SerializeField] Button _ExitBtn;//退出管理按钮
|
[SerializeField] Button _DeleteBtn;//销毁装备按钮
|
|
[SerializeField] GameObject ScrollViewFirst;//选择面板1
|
[SerializeField] GameObject ScrollViewSecond;//选择面板2
|
[SerializeField] GameObject ScrollViewThree;//选择面板3
|
|
[SerializeField] Button _Arrow1;//按钮1
|
[SerializeField] Button _Arrow2;//按钮2
|
[SerializeField] Button _Arrow3;//按钮3
|
|
[SerializeField] Text Label_A;//文本1
|
[SerializeField] Text Label_B;//文本2
|
[SerializeField] Text Label_C;//文本3
|
|
[SerializeField] Transform _ContentTwo;//选择面板2的父节点
|
[SerializeField] Transform _ContentOne;//选择面板1的父节点
|
[SerializeField] Transform _ContentThree;//选择面板3的父节点
|
|
[SerializeField] Toggle _ToggleRed;//红色
|
[SerializeField] Toggle _Toggleorange;//橙色
|
[SerializeField] Toggle _Togglepurple;//紫色装备
|
[SerializeField] Toggle _ToggleeMpty;//清空选择
|
|
[SerializeField] Toggle _ToggleEmpty;//清空选择
|
[SerializeField] Toggle _ToggleAny;//任意阶数
|
[SerializeField] Toggle _Togle_1;//一阶
|
[SerializeField] Toggle _Togle_2;//二阶
|
[SerializeField] Toggle _Togle_3;//三阶
|
[SerializeField] Toggle _Togle_4;//四阶
|
[SerializeField] Toggle _Togle_5;//五阶
|
[SerializeField] Toggle _Togle_6;//六阶
|
[SerializeField] Toggle _Togle_7;//七阶
|
[SerializeField] Toggle _Togle_8;//八阶
|
[SerializeField] Toggle _Togle_9;//九阶
|
[SerializeField] Toggle _Togle_10;//十阶
|
[SerializeField] Toggle _Togle_11;//十一阶
|
[SerializeField] Toggle _Togle_12;//十二阶
|
[SerializeField] Toggle _Togle_13;//十三阶
|
[SerializeField] Toggle _Togle_14;//十四阶
|
[SerializeField] Toggle _Togle_15;//十五阶
|
|
[SerializeField] Toggle _ToggleStar1;//一星
|
[SerializeField] Toggle _ToggleStar2;//二星
|
[SerializeField] Toggle _ToggleStarMp;//清空选择
|
|
[SerializeField] Text _CountText;//获取当前的积分值
|
[SerializeField] GameObject _Dropdown3;//星级
|
[SerializeField] GameObject _Dropdown2;//阶数界面
|
[SerializeField] GameObject _Dropdown;//装备颜色
|
[SerializeField] GameObject _WarehouseCountBG;//仓库积分面板
|
[SerializeField] int _FamilyPosition = 0;//家族职位
|
|
[SerializeField] Button m_BtnAdd;//获取途径按钮
|
private AchievementGuideEffect AchievementGuideEffect1;
|
int Item_lv = 0;//标记物品阶数
|
int Item_Color = 0;//标记物品颜色
|
int Item_Star = 0;//标记星级
|
private Dictionary<int, bool> _EquipmentArray = new Dictionary<int, bool>();//用来存储需要销毁的装备下标
|
private Dictionary<int, int> DicHighlight = new Dictionary<int, int>();//需要高亮的物品
|
int _indexList = 0;//标记需要兑换的数组下标
|
int _WPID = 0;//用来标记需要兑换的物品ID
|
private int SpiritPetDan = 0;
|
public static event Action RedPointUpdate;
|
GetItemPathModel _GetItemPath;
|
GetItemPathModel GetItemPath { get { return _GetItemPath ?? (_GetItemPath = ModelCenter.Instance.GetModel<GetItemPathModel>()); } }
|
#endregion
|
|
|
|
private bool _bool = false;
|
#region Built-in
|
protected override void BindController()
|
{
|
FuncConfigConfig _PetFoodExchange = FuncConfigConfig.Get("PetFoodExchange");
|
SpiritPetDan = int.Parse(_PetFoodExchange.Numerical1);
|
}
|
|
protected override void AddListeners()
|
{
|
AddListen();
|
m_BtnAdd.AddListener(() =>
|
{
|
GetItemPath.SetChinItemModel(2150);
|
});
|
}
|
|
protected override void OnPreOpen()
|
{
|
_listArray.Clear();
|
foreach (int key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
|
{
|
_listArray.Add(key);
|
}
|
_FamilyPosition = (int)PlayerDatas.Instance.fairyData.mine.FamilyLV;
|
FairyAuTreasureModel.Event_FairyAuIntegral += FairyAuIntegral;//仙盟积分刷新
|
FairyAuTreasureModel.Event_FamilyStoreItemInfo += FamilyStoreItemInfo;//仓库信息刷新
|
FairyAuTreasureModel.Del_FamilyStoreItemInfo += Del_FamilyStoreItemInfo;//仓库物品删除
|
FairyAuTreasureModel.Event_FamilyActionInfo += FamilyActionInfo;//家族行为信息刷新
|
_GridlineCtrl.OnRefreshCell += OnRefreshGridCell;
|
_bool = false;
|
w_TreasureTheLog.Init();
|
QueryFamilyAction();//家族行为信息查询
|
_Dropdown.SetActive(false);
|
_Dropdown2.SetActive(false);
|
_Dropdown3.SetActive(false);
|
_ExitBtn.gameObject.SetActive(false);
|
_DeleteBtn.gameObject.SetActive(false);
|
_DonateBtn.gameObject.SetActive(true);
|
_CleanBtn.gameObject.SetActive(true);
|
_WarehouseCountBG.SetActive(true);
|
_CountText.text = playerFairyAuTreasureData._FairyAuIntegral.ToString();
|
SetItemID();//获取高亮特效物品ID
|
base.OnCreateGridLineCell(_GridlineCtrl);
|
|
}
|
|
protected override void OnAfterOpen()
|
{
|
if (RedPointUpdate != null && playerFairyAuTreasureData.IsShowPoint)
|
{
|
playerFairyAuTreasureData.IsShowPoint = false;
|
RedPointUpdate();
|
}
|
_GridlineCtrl.mScrollRect.verticalNormalizedPosition = 1;
|
HandleAchievement();
|
}
|
|
protected override void OnPreClose()
|
{
|
if (playerFairyAuTreasureData.JumpItemID != null && playerFairyAuTreasureData.JumpItemID.Count > 0)
|
{
|
playerFairyAuTreasureData.JumpItemID.Clear();
|
}
|
}
|
|
protected override void OnAfterClose()
|
{
|
w_TreasureTheLog.UnInit();
|
FairyAuTreasureModel.Event_FairyAuIntegral -= FairyAuIntegral;//仙盟积分刷新
|
FairyAuTreasureModel.Event_FamilyStoreItemInfo -= FamilyStoreItemInfo;//仓库信息刷新
|
FairyAuTreasureModel.Event_FamilyActionInfo -= FamilyActionInfo;//家族行为信息刷新
|
FairyAuTreasureModel.Del_FamilyStoreItemInfo -= Del_FamilyStoreItemInfo;//仓库物品删除
|
_GridlineCtrl.OnRefreshCell -= OnRefreshGridCell;
|
}
|
|
List<int> _listArray = new List<int>();
|
|
public void OnRefreshGridCell(ScrollerDataType type, CellView cell)
|
{
|
|
int gridlineIndex = cell.index;
|
int childCode = 0;
|
|
for (childCode = 0; childCode < cell.transform.childCount; childCode++)
|
{
|
WarehouseGrid warehouseGrid = cell.transform.GetChild(childCode).GetComponent<WarehouseGrid>();
|
int cellCount = (cell.transform.childCount) * gridlineIndex + (childCode + 1);
|
warehouseGrid.ItemCell.gameObject.SetActive(false);
|
warehouseGrid.Uieffect.gameObject.SetActive(false);
|
if (cellCount - 1 < playerFairyAuTreasureData._DicfamilyStoreItem.Count)
|
{
|
warehouseGrid.ItemCell.gameObject.SetActive(true);
|
int _IndexKey = _listArray[cellCount - 1];
|
FamilyStoreItem itemModel = playerFairyAuTreasureData._DicfamilyStoreItem[_IndexKey];
|
if (DicHighlight.ContainsKey(_IndexKey))//需要选中的特效
|
{
|
warehouseGrid.Uieffect.gameObject.SetActive(true);
|
warehouseGrid.Uieffect.Play();
|
}
|
ItemCellModel cellModel = new ItemCellModel(itemModel.ItemID, false, 0, 0, "", PackType.Deleted, true, itemModel._UserData);
|
warehouseGrid.ItemCell.Init(cellModel);
|
if (AchievementGoto.achievementType == AchievementGoto.SpiritPetDan)//兑换灵宠丹(221)
|
{
|
if (AchievementGuideEffect1 != null)
|
{
|
AchievementGuideEffectPool.Recycle(AchievementGuideEffect1);
|
}
|
if (SpiritPetDan == itemModel.ItemID)
|
{
|
AchievementGuideEffect1 = AchievementGuideEffectPool.Require(2);
|
if (AchievementGuideEffect1.effect != null)
|
{
|
AchievementGuideEffect1.effect.ResetOrder(3100);
|
}
|
AchievementGuideEffect1.transform.SetParentEx(warehouseGrid.ItemCell.transform, Vector3.zero, Vector3.zero, Vector3.one);
|
}
|
}
|
|
LightUpJudgment(warehouseGrid.Lllume, _bool, playerFairyAuTreasureData._DicfamilyStoreItem[_IndexKey].Index);
|
warehouseGrid.ItemCell.cellBtn.RemoveAllListeners();
|
warehouseGrid.ItemCell.cellBtn.AddListener(() =>
|
{
|
TypeJudgment(warehouseGrid.Lllume, _bool, (int)itemModel.ItemID, playerFairyAuTreasureData._DicfamilyStoreItem[_IndexKey].Index);
|
});
|
}
|
else
|
{
|
warehouseGrid.Lllume.SetActive(false);
|
}
|
}
|
}
|
|
|
void TypeJudgment(GameObject _obj, bool _bol, int Item_ID, int _Index)//类型判断
|
{
|
if (_bol)
|
{
|
if (_Index == 0)
|
return;
|
if (_obj.activeSelf)
|
{
|
_obj.SetActive(false);
|
_EquipmentArray.Remove(_Index);
|
}
|
else
|
{
|
_obj.SetActive(true);
|
_EquipmentArray.Add(_Index, true);
|
}
|
}
|
else
|
{
|
if (_Index == 0 && Item_ID == 1130)
|
{
|
WindowCenter.Instance.Open<ConvertItemTipsWin>();
|
}
|
else
|
{
|
_indexList = _Index;
|
_WPID = playerFairyAuTreasureData._DicfamilyStoreItem[_Index].ItemID;
|
ItemConfig Item = ItemConfig.Get(playerFairyAuTreasureData._DicfamilyStoreItem[_Index].ItemID);
|
PetEatEquipConfig tagPet = PetEatEquipConfig.GetEquipColorAndEquipClass(Item.ItemColor, Item.LV);//装备积分兑换表
|
ntegralGain = tagPet.integrate;
|
ItemAttrData attrData = new ItemAttrData(playerFairyAuTreasureData._DicfamilyStoreItem[_Index].ItemID, false, 1, -1, 0, true, PackType.Deleted
|
, "", playerFairyAuTreasureData._DicfamilyStoreItem[_Index]._UserData, ItemTipChildType.UnionWarehouseExchange);
|
attrData.SetTipsFuncBtn(ItemOperateType.exchange, Exchange);
|
itemTipsModel.SetItemTipsModel(attrData);
|
}
|
}
|
}
|
|
int ntegralGain = 0;//装备积分获取
|
void Exchange(ItemOperateType type, string s)
|
{
|
SinglePack singlePack = playerPack.GetSinglePack(PackType.Item);
|
if (singlePack == null) return;
|
|
if (singlePack.GetEmptyGridCount() < 1)
|
{
|
ScrollTip.ShowTip(Language.Get("Z1803"));
|
return;
|
}
|
if (playerFairyAuTreasureData._FairyAuIntegral >= ntegralGain)
|
{
|
CA610_tagCMFamilyStoreExchange _CA610 = new CA610_tagCMFamilyStoreExchange();
|
_CA610.StoreItemIndex = (byte)(_indexList);
|
_CA610.ItemID = (uint)_WPID;
|
_CA610.ExcangeCount = 1;
|
ClearItemID(_indexList);
|
GameNetSystem.Instance.SendInfo(_CA610);
|
KnapSackEventMgr.Instance.HideItemPopWin();
|
}
|
else
|
{
|
ScrollTip.ShowTip(Language.Get("Z1804"));
|
|
}
|
}
|
|
void LightUpJudgment(GameObject _obj, bool _bol, int _index)//点亮判断
|
{
|
if (_bol)
|
{
|
if (_EquipmentArray.ContainsKey(_index))
|
{
|
_obj.SetActive(true);
|
}
|
else
|
{
|
_obj.SetActive(false);
|
}
|
}
|
else
|
{
|
_obj.SetActive(false);
|
}
|
}
|
|
void AddListen()//按钮事件监听添加
|
{
|
_CloseBtn.onClick.AddListener(CloseButton);
|
_DonateBtn.onClick.AddListener(DonateButton);
|
_CleanBtn.onClick.AddListener(CleanButton);
|
_ExitBtn.onClick.AddListener(ExitButton);
|
_DeleteBtn.onClick.AddListener(DeleteButton);
|
_Arrow1.onClick.AddListener(Arrow1);
|
_Arrow2.onClick.AddListener(Arrow2);
|
_Arrow3.AddListener(Arrow3);
|
|
_ToggleRed.onValueChanged.AddListener(delegate (bool _bool) { ToggleRed(_bool); });
|
_Toggleorange.onValueChanged.AddListener(delegate (bool _bool) { Toggleorange(_bool); });
|
_Togglepurple.onValueChanged.AddListener(delegate (bool _bool) { Togglepurple(_bool); });
|
_ToggleeMpty.onValueChanged.AddListener(delegate (bool _bool) { ToggleeMpty(_bool); });
|
|
|
_ToggleEmpty.onValueChanged.AddListener(delegate (bool _bool) { ToggleEmpty(_bool); });
|
_ToggleAny.onValueChanged.AddListener(delegate (bool _bool) { ToggleAny(_bool); });
|
_Togle_1.onValueChanged.AddListener(delegate (bool _bool) { Togle_1(_bool); });
|
_Togle_2.onValueChanged.AddListener(delegate (bool _bool) { Togle_2(_bool); });
|
_Togle_3.onValueChanged.AddListener(delegate (bool _bool) { Togle_3(_bool); });
|
_Togle_4.onValueChanged.AddListener(delegate (bool _bool) { Togle_4(_bool); });
|
_Togle_5.onValueChanged.AddListener(delegate (bool _bool) { Togle_5(_bool); });
|
_Togle_6.onValueChanged.AddListener(delegate (bool _bool) { Togle_6(_bool); });
|
_Togle_7.onValueChanged.AddListener(delegate (bool _bool) { Togle_7(_bool); });
|
_Togle_8.onValueChanged.AddListener(delegate (bool _bool) { Togle_8(_bool); });
|
_Togle_9.onValueChanged.AddListener(delegate (bool _bool) { Togle_9(_bool); });
|
_Togle_10.onValueChanged.AddListener(delegate (bool _bool) { Togle_10(_bool); });
|
_Togle_11.onValueChanged.AddListener(delegate (bool _bool) { Togle_11(_bool); });
|
_Togle_12.onValueChanged.AddListener(delegate (bool _bool) { Togle_12(_bool); });
|
_Togle_13.onValueChanged.AddListener(delegate (bool _bool) { Togle_13(_bool); });
|
_Togle_14.onValueChanged.AddListener(delegate (bool _bool) { Togle_14(_bool); });
|
_Togle_15.onValueChanged.AddListener(delegate (bool _bool) { Togle_15(_bool); });
|
_ToggleStar1.onValueChanged.AddListener(delegate (bool _bool) { Toggle_Star1(_bool); });
|
_ToggleStar2.onValueChanged.AddListener(delegate (bool _bool) { Toggle_Star2(_bool); });
|
_ToggleStarMp.onValueChanged.AddListener(delegate (bool _bool) { Toggle_StarMP(_bool); });
|
}
|
|
void CloseButton()//关闭按钮
|
{
|
Close();
|
}
|
|
void DonateButton()//装备捐献按钮
|
{
|
if (IsDonateEquipment())
|
{
|
WindowCenter.Instance.Open<DonateEquipTipsWin>();
|
}
|
else
|
{
|
ScrollTip.ShowTip(Language.Get("NoDonationEquipment_Z"));
|
}
|
|
}
|
#endregion
|
|
void FairyAuIntegral()//仙盟积分刷新
|
{
|
_CountText.text = playerFairyAuTreasureData._FairyAuIntegral.ToString();
|
}
|
|
void CleanButton()//批量清理按钮
|
{
|
if (PlayerDatas.Instance.fairyData.IsCanFunc(PlayerFairyData.LimitFunc.CanClearTreasury))
|
{
|
ScrollViewFirst.SetActive(false);
|
ScrollViewSecond.SetActive(false);
|
ScrollViewThree.SetActive(false);
|
_ExitBtn.gameObject.SetActive(false);
|
_CleanBtn.gameObject.SetActive(false);
|
_Dropdown.SetActive(true);
|
_WarehouseCountBG.SetActive(false);
|
_Dropdown2.SetActive(true);
|
_Dropdown3.SetActive(true);
|
_ExitBtn.gameObject.SetActive(true);
|
_DeleteBtn.gameObject.SetActive(true);
|
_bool = true;
|
SelectiveCleaningEquipment();//选择清理装备
|
}
|
else
|
{
|
ScrollTip.ShowTip(Language.Get("Z1079"));
|
|
}
|
}
|
|
void ExitButton()//退出管理按钮
|
{
|
_ExitBtn.gameObject.SetActive(true);
|
_CleanBtn.gameObject.SetActive(true);
|
_WarehouseCountBG.SetActive(true);
|
_Dropdown.SetActive(false);
|
_Dropdown2.SetActive(false);
|
_Dropdown3.SetActive(false);
|
_ExitBtn.gameObject.SetActive(false);
|
_DeleteBtn.gameObject.SetActive(false);
|
_bool = false;
|
_GridlineCtrl.m_Scorller.RefreshActiveCellViews();//刷新当前可见
|
_EquipmentArray.Clear();
|
}
|
|
void DeleteButton()//装备销毁按钮
|
{
|
if (_EquipmentArray.Count == 0)
|
{
|
ScrollTip.ShowTip(Language.Get("SelectEquipDestroy"));
|
return;
|
}
|
|
ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("Z1078"), (bool isOk) =>
|
{
|
if (isOk)
|
{
|
CA409_tagCGFamilyStoreDel _CA409 = new CA409_tagCGFamilyStoreDel();
|
byte[] List = new byte[_EquipmentArray.Count];
|
int type = 0;
|
foreach (int index in _EquipmentArray.Keys)
|
{
|
List[type] = (byte)(index - 1);
|
type += 1;
|
}
|
_CA409.IndexCount = (byte)List.Length;
|
_CA409.StoreItemIndex = List;
|
GameNetSystem.Instance.SendInfo(_CA409);
|
_EquipmentArray.Clear();
|
}
|
});
|
}
|
|
void Arrow1()//仓库星级按钮1
|
|
{
|
ScrollViewFirst.gameObject.SetActive(!ScrollViewFirst.activeSelf);
|
}
|
|
void Arrow2()//装备吸收按钮切换按钮2
|
|
{
|
ScrollViewSecond.gameObject.SetActive(!ScrollViewSecond.activeSelf);
|
}
|
void Arrow3()//星级切换按钮
|
{
|
ScrollViewThree.gameObject.SetActive(!ScrollViewThree.activeSelf);
|
}
|
#region//一推的Toggle
|
void IsNoConentA(Toggle toogleA, Toggle toogleC)
|
{
|
for (int i = 0; i < _ContentOne.childCount; i++)
|
{
|
|
if (_ContentOne.GetChild(i).GetComponent<Toggle>().name == toogleA.name)
|
{
|
_ContentOne.GetChild(i).GetComponent<Toggle>().isOn = true;
|
}
|
else
|
{
|
_ContentOne.GetChild(i).GetComponent<Toggle>().isOn = false;
|
}
|
}
|
for (int i = 0; i < _ContentThree.childCount; i++)
|
{
|
|
if (_ContentThree.GetChild(i).GetComponent<Toggle>().name == toogleC.name)
|
{
|
_ContentThree.GetChild(i).GetComponent<Toggle>().isOn = true;
|
}
|
else
|
{
|
_ContentThree.GetChild(i).GetComponent<Toggle>().isOn = false;
|
}
|
}
|
}
|
void IsNoConentB(Toggle ToogleB, Toggle ToogleC)
|
{
|
for (int i = 0; i < _ContentTwo.childCount; i++)
|
{
|
|
if (_ContentTwo.GetChild(i).GetComponent<Toggle>().name == ToogleB.name)
|
{
|
_ContentTwo.GetChild(i).GetComponent<Toggle>().isOn = true;
|
}
|
else
|
{
|
_ContentTwo.GetChild(i).GetComponent<Toggle>().isOn = false;
|
}
|
}
|
for (int i = 0; i < _ContentThree.childCount; i++)
|
{
|
|
if (_ContentThree.GetChild(i).GetComponent<Toggle>().name == ToogleC.name)
|
{
|
_ContentThree.GetChild(i).GetComponent<Toggle>().isOn = true;
|
}
|
else
|
{
|
_ContentThree.GetChild(i).GetComponent<Toggle>().isOn = false;
|
}
|
}
|
}
|
void IsNoConentC(Toggle ToogleA, Toggle ToogleB)
|
{
|
for (int i = 0; i < _ContentOne.childCount; i++)
|
{
|
|
if (_ContentOne.GetChild(i).GetComponent<Toggle>().name == ToogleA.name)
|
{
|
_ContentOne.GetChild(i).GetComponent<Toggle>().isOn = true;
|
}
|
else
|
{
|
_ContentOne.GetChild(i).GetComponent<Toggle>().isOn = false;
|
}
|
}
|
for (int i = 0; i < _ContentTwo.childCount; i++)
|
{
|
|
if (_ContentTwo.GetChild(i).GetComponent<Toggle>().name == ToogleB.name)
|
{
|
_ContentTwo.GetChild(i).GetComponent<Toggle>().isOn = true;
|
}
|
else
|
{
|
_ContentTwo.GetChild(i).GetComponent<Toggle>().isOn = false;
|
}
|
}
|
|
}
|
void ToggleRed(bool _bool)//红色
|
{
|
if (_bool)
|
{
|
Label_A.text = _ToggleRed.transform.Find("Label").GetComponent<Text>().text;
|
Label_A.color = _ToggleRed.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewFirst.gameObject.SetActive(false);
|
if (_ToggleEmpty.isOn)
|
{
|
IsNoConentB(_ToggleAny, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Toggleorange(bool _bool)//橙色
|
{
|
if (_bool)
|
{
|
Label_A.text = _Toggleorange.transform.Find("Label").GetComponent<Text>().text;
|
Label_A.color = _Toggleorange.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewFirst.gameObject.SetActive(false);
|
if (_ToggleEmpty.isOn)
|
{
|
IsNoConentB(_ToggleAny, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
|
void Togglepurple(bool _bool)//紫色
|
{
|
if (_bool)
|
{
|
Label_A.text = _Togglepurple.transform.Find("Label").GetComponent<Text>().text;
|
Label_A.color = _Togglepurple.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewFirst.gameObject.SetActive(false);
|
if (_ToggleEmpty.isOn)
|
{
|
IsNoConentB(_ToggleAny, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
|
}
|
|
}
|
|
void ToggleeMpty(bool _bool)//清空选择
|
{
|
if (_bool)
|
{
|
Label_A.text = _ToggleeMpty.transform.Find("Label").GetComponent<Text>().text;
|
Label_A.color = _ToggleeMpty.transform.Find("Label").GetComponent<Text>().color;
|
IsNoConentB(_ToggleEmpty, _ToggleStarMp);
|
ScrollViewFirst.gameObject.SetActive(false);
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
|
|
|
|
void ToggleEmpty(bool _bool)//清空选择
|
{
|
if (_bool)
|
{
|
|
Label_B.text = _ToggleEmpty.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _ToggleEmpty.transform.Find("Label").GetComponent<Text>().color;
|
IsNoConentA(_ToggleeMpty, _ToggleStarMp);
|
ScrollViewSecond.gameObject.SetActive(false);
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
|
void ToggleAny(bool _bool)//任意阶数
|
{
|
if (_bool)
|
{
|
|
Label_B.text = _ToggleAny.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _ToggleAny.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_1(bool _bool)//一阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_1.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_1.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_2(bool _bool)//二阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_2.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_2.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_3(bool _bool)//三阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_3.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_3.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_4(bool _bool)//四阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_4.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_4.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_5(bool _bool)//五阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_5.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_5.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_6(bool _bool)//六阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_6.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_6.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_7(bool _bool)//七阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_7.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_7.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_8(bool _bool)//八阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_8.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_8.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_9(bool _bool)//九阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_9.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_9.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_10(bool _bool)//十阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_10.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_10.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_11(bool _bool)//十一阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_11.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_11.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_12(bool _bool)//十二阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_12.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_12.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_13(bool _bool)//十三阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_13.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_13.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_14(bool _bool)//十四阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_14.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_14.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Togle_15(bool _bool)//十五阶
|
{
|
if (_bool)
|
{
|
Label_B.text = _Togle_15.transform.Find("Label").GetComponent<Text>().text;
|
Label_B.color = _Togle_15.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewSecond.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn)
|
{
|
IsNoConentA(_Togglepurple, _ToggleStar1);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
void Toggle_Star1(bool _bool)//一星
|
{
|
if (_bool)
|
{
|
Label_C.text = _ToggleStar1.transform.Find("Label").GetComponent<Text>().text;
|
Label_C.color = _ToggleStar1.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewThree.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn && _ToggleEmpty.isOn)
|
{
|
IsNoConentC(_Togglepurple, _ToggleAny);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
}
|
|
void Toggle_Star2(bool _bool)//二星
|
{
|
if (_bool)
|
{
|
Label_C.text = _ToggleStar2.transform.Find("Label").GetComponent<Text>().text;
|
Label_C.color = _ToggleStar2.transform.Find("Label").GetComponent<Text>().color;
|
ScrollViewThree.gameObject.SetActive(false);
|
if (_ToggleeMpty.isOn && _ToggleEmpty.isOn)
|
{
|
IsNoConentC(_Togglepurple, _ToggleAny);
|
}
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
}
|
|
void Toggle_StarMP(bool _bool)//清空选择
|
{
|
if (_bool)
|
{
|
|
Label_C.text = _ToggleStarMp.transform.Find("Label").GetComponent<Text>().text;
|
Label_C.color = _ToggleStarMp.transform.Find("Label").GetComponent<Text>().color;
|
IsNoConentC(_ToggleeMpty, _ToggleEmpty);
|
ScrollViewThree.gameObject.SetActive(false);
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
}
|
|
|
private void ToggleStar(bool isBool)
|
{
|
SelectiveCleaningEquipment();//选择销毁
|
}
|
|
#endregion
|
|
void SelectiveCleaningEquipment()//选择清理装备
|
{
|
int type_A = Color_T();//类型1装备品质
|
int type_B = Class_T();//类型2装备阶级
|
int Type_C = Start_T();//类型3星级
|
Item_lv = type_B;
|
Item_Color = type_A;
|
Item_Star = Type_C;
|
_EquipmentArray.Clear();
|
foreach (int key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
|
{
|
var itemConfig = ItemConfig.Get(playerFairyAuTreasureData._DicfamilyStoreItem[key].ItemID);
|
if ((Item_lv >= itemConfig.LV && Item_Color >= itemConfig.ItemColor && playerFairyAuTreasureData._DicfamilyStoreItem[key].Index != 0 && Item_Star >= itemConfig.StarLevel))
|
{
|
_EquipmentArray.Add(playerFairyAuTreasureData._DicfamilyStoreItem[key].Index, true);
|
}
|
}
|
|
_GridlineCtrl.m_Scorller.RefreshActiveCellViews();//刷新当前可见
|
}
|
int Color_T()//返回值1
|
{
|
for (int i = 0; i < _ContentOne.childCount; i++)
|
{
|
if (_ContentOne.GetChild(i).GetComponent<Toggle>().isOn)
|
{
|
switch (_ContentOne.GetChild(i).name)
|
{
|
case "ToggleRed":
|
return 5;
|
|
case "Toggleorange":
|
return 4;
|
case "Togglepurple":
|
return 3;
|
case "ToggleeMpty":
|
return 0;
|
}
|
}
|
}
|
return 0;
|
}
|
|
int Class_T()//返回值2
|
{
|
for (int i = 0; i < _ContentTwo.childCount; i++)
|
{
|
if (_ContentTwo.GetChild(i).GetComponent<Toggle>().isOn)
|
{
|
switch (_ContentTwo.GetChild(i).name)
|
{
|
case "Togle_1":
|
return 1;
|
case "Togle_2":
|
return 2;
|
case "Togle_3":
|
return 3;
|
case "Togle_4":
|
return 4;
|
case "Togle_5":
|
return 5;
|
case "Togle_6":
|
return 6;
|
case "Togle_7":
|
return 7;
|
case "Togle_8":
|
return 8;
|
case "Togle_9":
|
return 9;
|
case "Togle_10":
|
return 10;
|
case "Togle_11":
|
return 11;
|
case "Togle_12":
|
return 12;
|
case "Togle_13":
|
return 13;
|
case "Togle_14":
|
return 14;
|
case "Togle_15":
|
return 15;
|
case "ToggleAny":
|
return 30;
|
case "ToggleEmpty":
|
return 0;
|
}
|
}
|
}
|
return 0;
|
}
|
|
int Start_T()
|
{
|
for (int i = 0; i < _ContentThree.childCount; i++)
|
{
|
if (_ContentThree.GetChild(i).GetComponent<Toggle>().isOn)
|
{
|
switch (_ContentThree.GetChild(i).name)
|
{
|
case "Togle_Star2":
|
return 2;
|
case "Togle_Star1":
|
return 1;
|
case "Toggle_StarMP":
|
return 0;
|
}
|
}
|
}
|
return 0;
|
|
}
|
void QueryFamilyAction()//家族行为信息查询
|
{
|
CA408_tagCGQueryFamilyAction _CA408 = new CA408_tagCGQueryFamilyAction();
|
_CA408.ActionType = 7;
|
_CA408.FamilyID = PlayerDatas.Instance.fairyData.fairy.FamilyID;
|
|
GameNetSystem.Instance.SendInfo(_CA408);
|
}
|
|
void FamilyStoreItemInfo()//仓库信息刷新
|
{
|
QueryFamilyAction();//家族行为信息查询
|
_listArray.Clear();
|
foreach (int key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
|
{
|
_listArray.Add(key);
|
}
|
SetItemID();//获取高亮特效物品ID
|
_GridlineCtrl.m_Scorller.RefreshActiveCellViews();//刷新当前可见
|
}
|
|
void Del_FamilyStoreItemInfo(List<int> List)//物品删除
|
{
|
QueryFamilyAction();//家族行为信息查询
|
_listArray.Clear();
|
foreach (int key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
|
{
|
_listArray.Add(key);
|
}
|
SetItemID();//获取高亮特效物品ID
|
_GridlineCtrl.m_Scorller.RefreshActiveCellViews();//刷新当前可见
|
|
}
|
|
void FamilyActionInfo()
|
{
|
_listArray.Clear();
|
foreach (int key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
|
{
|
_listArray.Add(key);
|
}
|
_GridlineCtrl.m_Scorller.RefreshActiveCellViews();//刷新当前可见
|
}
|
|
private void HandleAchievement()
|
{
|
if (AchievementGoto.achievementType == AchievementGoto.EquipmentDonated)//仓库装备捐献(220)
|
{
|
var effcet = AchievementGuideEffectPool.Require(1);
|
if (effcet.effect != null)
|
{
|
effcet.effect.ResetOrder(3500);
|
}
|
effcet.transform.SetParentEx(_DonateBtn.transform, Vector3.zero, Vector3.zero, Vector3.one);
|
}
|
}
|
|
private bool IsDonateEquipment()//判断是否有可捐献装备
|
{
|
Dictionary<int, ItemModel> backpack_dic = playerPack.GetSinglePack(PackType.Item).GetAllItems();
|
Dictionary<int, ProductOrderJudgment> _ProductOrderJudgment = AttributeJudgment();
|
foreach (int item_id in backpack_dic.Keys)
|
{
|
ItemConfig _ChinItem = ItemConfig.Get((int)backpack_dic[item_id].itemId);
|
if (backpack_dic[item_id].isBind == 1)
|
continue;
|
foreach (int key in _ProductOrderJudgment.Keys)
|
{
|
if (_ChinItem.EquipPlace == key && _ChinItem.LV >= _ProductOrderJudgment[key].Class && _ChinItem.StarLevel >= _ProductOrderJudgment[key].TheStar && _ChinItem.ItemColor >= _ProductOrderJudgment[key].Color)
|
{
|
return true;
|
}
|
}
|
}
|
return false;
|
}
|
class ProductOrderJudgment
|
{
|
public int Class;//阶级
|
public int TheStar;//星级
|
public int Color;//颜色
|
|
|
}
|
Dictionary<int, ProductOrderJudgment> AttributeJudgment()//属性判断
|
{
|
Dictionary<int, ProductOrderJudgment> _DicConditions = new Dictionary<int, ProductOrderJudgment>();//条件字典
|
FuncConfigConfig Number1 = FuncConfigConfig.Get("FamilyStoreItemRule1");
|
FuncConfigConfig Number2 = FuncConfigConfig.Get("FamilyStoreItemRule2");
|
string[] strA = Number1.Numerical1.Split('|');
|
string[] strA1 = Number1.Numerical2.Split('|');
|
for (int i = 0; i < strA.Length; i++)
|
{
|
if (!_DicConditions.ContainsKey(int.Parse(strA[i])))
|
{
|
ProductOrderJudgment _ProductOrder = new ProductOrderJudgment();
|
_ProductOrder.Class = int.Parse(strA1[0]);
|
_ProductOrder.TheStar = int.Parse(strA1[1]);
|
_ProductOrder.Color = int.Parse(strA1[2]);
|
_DicConditions.Add(int.Parse(strA[i]), _ProductOrder);
|
}
|
}
|
|
string[] strB = Number2.Numerical1.Split('|');
|
string[] strB1 = Number2.Numerical2.Split('|');
|
for (int j = 0; j < strB.Length; j++)
|
{
|
if (!_DicConditions.ContainsKey(int.Parse(strB[j])))
|
{
|
ProductOrderJudgment _ProductOrder = new ProductOrderJudgment();
|
_ProductOrder.Class = int.Parse(strB1[0]);
|
_ProductOrder.TheStar = int.Parse(strB1[1]);
|
_ProductOrder.Color = int.Parse(strB1[2]);
|
_DicConditions.Add(int.Parse(strB[j]), _ProductOrder);
|
}
|
|
}
|
return _DicConditions;
|
}
|
|
private void SetItemID()//获取物品ID
|
{
|
DicHighlight.Clear();//需要亮的仓库物品下标
|
int Order = 0;//阶数
|
int Color = 0;//颜色
|
int Star = 0;//颜色
|
int EquipPlace = 0;//装备位置
|
if (playerFairyAuTreasureData.JumpItemID == null || playerFairyAuTreasureData.JumpItemID.Count <= 0)
|
{
|
return;
|
}
|
for (int i = 0; i < playerFairyAuTreasureData.JumpItemID.Count; i++)
|
{
|
int ItemId = playerFairyAuTreasureData.JumpItemID[i];
|
var itemconfig = ItemConfig.Get(ItemId);
|
if (itemconfig.EquipPlace == 0 && itemconfig.EquipPlace > 10)
|
{
|
return;
|
}
|
Order = itemconfig.LV;
|
Color = itemconfig.ItemColor;
|
Star = itemconfig.StarLevel;
|
EquipPlace = itemconfig.EquipPlace;
|
foreach (var key in playerFairyAuTreasureData._DicfamilyStoreItem.Keys)
|
{
|
var Item_ID = playerFairyAuTreasureData._DicfamilyStoreItem[key].ItemID;
|
var item_config = ItemConfig.Get(Item_ID);
|
if (item_config == null && item_config.EquipPlace == 0 && item_config.EquipPlace > 10)
|
{
|
continue;
|
}
|
if (item_config.LV >= Order && item_config.ItemColor >= Color
|
&& item_config.StarLevel >= Star && EquipPlace == item_config.EquipPlace
|
&& PlayerDatas.Instance.baseData.Job == item_config.JobLimit / 100)
|
{
|
if (!DicHighlight.ContainsKey(key))
|
{
|
DicHighlight.Add(key, 1);
|
}
|
}
|
}
|
}
|
}
|
|
private void ClearItemID(int Index)
|
{
|
if (DicHighlight.ContainsKey(Index))
|
{
|
DicHighlight.Clear();
|
}
|
}
|
}
|
}
|
|
|
|
|