Files
JJBB/Assets/Project/Script/GUI/Equip/EquipChangeAttrMsg.cs

82 lines
2.2 KiB
C#
Raw Normal View History

2024-08-23 15:49:34 +08:00
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using Games.Item;
using GCGame.Table;
public class EquipChangeAttrMsg : UIControllerBase<EquipChangeAttrMsg>
{
void OnEnable()
{
SetInstance(this);
}
void OnDisable()
{
SetInstance(null);
}
#region show
public static void Show(GC_NOTIFY_EQUIP_ATTR_CHANGED packet)
{
Hashtable hash = new Hashtable();
hash.Add("Packet", packet);
UIManager.ShowUI(UIInfo.EquipChangeAttrMsg, EquipChangeAttrMsg.ShowUIOver, hash);
}
static void ShowUIOver(bool bSuccess, object param)
{
if (bSuccess)
{
Hashtable hash = param as Hashtable;
if (EquipChangeAttrMsg.Instance() != null)
{
EquipChangeAttrMsg.Instance().ShowInner((GC_NOTIFY_EQUIP_ATTR_CHANGED)hash["Packet"]);
}
}
}
void ShowInner(GC_NOTIFY_EQUIP_ATTR_CHANGED packet)
{
List<EquipChangeAttrItem.ChangeAttrInfo> changeItems = new List<EquipChangeAttrItem.ChangeAttrInfo>();
EquipChangeAttrItem.ChangeAttrInfo combatValItem = new EquipChangeAttrItem.ChangeAttrInfo();
combatValItem.PropName = StrDictionary.GetClientDictionaryString("#{4245}");
combatValItem.PropOrgValue = packet.Oldscore;
combatValItem.PropNewValue = packet.Newscore;
changeItems.Add(combatValItem);
for (int i = 0; i < packet.newpropvalueCount; ++i)
{
EquipChangeAttrItem.ChangeAttrInfo attritem = new EquipChangeAttrItem.ChangeAttrInfo();
attritem.PropName = PropID.GetAttrName((PropID.PropertyID)packet.GetPropid(i), -1, packet.GetNewpropvalue(i));
attritem.PropOrgValue = packet.GetOldpropvalue(i);
attritem.PropNewValue = packet.GetNewpropvalue(i);
changeItems.Add(attritem);
}
_AttrChanges.InitContentItem(changeItems);
Invoke("CloseWindow", 3);
}
public void CloseWindow()
{
UIManager.CloseUI(UIInfo.EquipChangeAttrMsg);
}
#endregion
#region
public UIContainerBase _AttrChanges;
#endregion
}