JJBB/Assets/Project/Script/GUI/Master/MasterInfoLogic.cs
2024-08-23 15:49:34 +08:00

112 lines
2.4 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using Games.GlobeDefine;
using GCGame.Table;
using GCGame;
public class MasterInfoLogic : UIControllerBase<MasterInfoLogic>
{
void OnEnable()
{
SetInstance(this);
}
void OnDisable()
{
SetInstance(null);
}
#region static
public static void ShowMasterRelieve()
{
Hashtable hash = new Hashtable();
UIManager.ShowUI(UIInfo.MasterRelieveRoot, OnMasterRelieveShow, hash);
}
static void OnMasterRelieveShow(bool bSuccess, object param)
{
Hashtable hash = param as Hashtable;
if (!bSuccess)
{
return;
}
if (hash == null)
{
return;
}
if (MasterInfoLogic.Instance() != null)
{
MasterInfoLogic.Instance().Show(true);
}
}
public static void ShowMasterMatch(GC_PREACH_ORDER_LIST packet)
{
Hashtable hash = new Hashtable();
hash.Add("Packet", packet);
UIManager.ShowUI(UIInfo.MasterRelieveRoot, OnMasterMatchShow, hash);
}
static void OnMasterMatchShow(bool bSuccess, object param)
{
Hashtable hash = param as Hashtable;
if (!bSuccess)
{
return;
}
if (hash == null)
{
return;
}
if (MasterInfoLogic.Instance() != null)
{
MasterInfoLogic.Instance().Show((GC_PREACH_ORDER_LIST)hash["Packet"]);
}
}
#endregion
#region
public UIContainerSelect _RelationContainer;
public Text _EmptyTips;
public void Show(bool isRelieve)
{
if (isRelieve)
{
_EmptyTips.text = "";
Hashtable hash = new Hashtable();
hash.Add("IsRelieve", isRelieve);
_RelationContainer.InitSelectContent(GameManager.gameManager.PlayerDataPool.m_MasterInfo._MyApprentices, null, null, null, hash);
}
}
public void Show(GC_PREACH_ORDER_LIST packet)
{
_RelationContainer.InitSelectContent(packet.orderDataList, null);
if (packet.orderDataList.Count == 0)
{
_EmptyTips.text = StrDictionary.GetClientDictionaryString("#{7302}");
}
else
{
_EmptyTips.text = "";
}
}
public void CloseWindow()
{
UIManager.CloseUI(UIInfo.MasterRelieveRoot);
}
#endregion
}