85 lines
2.2 KiB
C#
85 lines
2.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using GCGame.Table;
|
|
|
|
public class SortRoomPanel : MonoBehaviour {
|
|
|
|
public static SortRoomPanel Instance;
|
|
private void Awake()
|
|
{
|
|
Instance = this;
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
Instance = null;
|
|
}
|
|
|
|
public UIContainerBase _ItemContainer;
|
|
|
|
private void OnEnable()
|
|
{
|
|
InitItemContainer();
|
|
}
|
|
|
|
private List<int> _SelectedSegmentGradeList;
|
|
private List<int> _AllSelectgGradeItemList;
|
|
public void InitItemContainer()
|
|
{
|
|
if(_SelectedSegmentGradeList == null)
|
|
{
|
|
_SelectedSegmentGradeList = new List<int>();
|
|
for(int index = 1; index <= GameManager.gameManager.PlayerDataPool.pvpIfo.MaxSegmentGrade; index++)
|
|
{
|
|
_SelectedSegmentGradeList.Add(index);
|
|
}
|
|
_AllSelectgGradeItemList = new List<int>();
|
|
_AllSelectgGradeItemList.AddRange(_SelectedSegmentGradeList);
|
|
}
|
|
|
|
_ItemContainer.InitContentItem(_SelectedSegmentGradeList);
|
|
_ItemContainer.ForeachActiveItem<SegmentSortItem>((item) => {
|
|
item.ShowMarkIcon(_AllSelectgGradeItemList.Contains(item._SegmentGrade));
|
|
});
|
|
}
|
|
|
|
public void OnItemClick(int SegmentGrade)
|
|
{
|
|
if(_AllSelectgGradeItemList.Contains(SegmentGrade))
|
|
{
|
|
if(_AllSelectgGradeItemList.Count == 1)
|
|
{
|
|
GUIData.AddNotifyData(StrDictionary.GetClientDictionaryString("#{82037}"));
|
|
return;
|
|
}
|
|
|
|
_AllSelectgGradeItemList.Remove(SegmentGrade);
|
|
}else
|
|
{
|
|
_AllSelectgGradeItemList.Add(SegmentGrade);
|
|
}
|
|
|
|
_ItemContainer.ForeachActiveItem<SegmentSortItem>((item) =>
|
|
{
|
|
item.ShowMarkIcon(_AllSelectgGradeItemList.Contains(item._SegmentGrade));
|
|
});
|
|
}
|
|
|
|
public void OnConfirmBtn()
|
|
{
|
|
ReqHonorBattlefieldMatchGetRoomList req = new ReqHonorBattlefieldMatchGetRoomList();
|
|
req.SegmentList = _AllSelectgGradeItemList;
|
|
req.LeaderName = "";
|
|
req.SendMsg();
|
|
|
|
OnCloseBtn();
|
|
}
|
|
|
|
public void OnCloseBtn()
|
|
{
|
|
this.gameObject.SetActive(false);
|
|
}
|
|
}
|