128 lines
4.7 KiB
C#
128 lines
4.7 KiB
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
|
|||
|
public struct NewRankInfoItemStruct
|
|||
|
{
|
|||
|
public RankElemStruct _Info;
|
|||
|
public int _Rank;
|
|||
|
public NewRankInfoItemStruct(RankElemStruct info, int rank)
|
|||
|
{
|
|||
|
_Info = info;
|
|||
|
_Rank = rank;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public class NewRanlnfoItem : UIItemBase {
|
|||
|
|
|||
|
public List<Sprite> _RankSpriteIconList;
|
|||
|
public Image _RankIcon;
|
|||
|
public Text _Rank;
|
|||
|
public Text _RoleName;
|
|||
|
public Text _Prof;
|
|||
|
public Text _Prop;
|
|||
|
public GameObject _MarkIcon;
|
|||
|
|
|||
|
public RankElemStruct info;
|
|||
|
public int _RankNum;
|
|||
|
private int _Profession = -1;
|
|||
|
private int _Level = -1;
|
|||
|
public override void Show(Hashtable hash)
|
|||
|
{
|
|||
|
base.Show(hash);
|
|||
|
var StructInfo = (NewRankInfoItemStruct)hash["InitObj"];
|
|||
|
info = StructInfo._Info;
|
|||
|
_RankNum = StructInfo._Rank;
|
|||
|
if (StructInfo._Rank <= 3)
|
|||
|
{
|
|||
|
_RankIcon.gameObject.SetActive(true);
|
|||
|
_RankIcon.overrideSprite = _RankSpriteIconList[StructInfo._Rank - 1];
|
|||
|
_Rank.gameObject.SetActive(false);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_RankIcon.gameObject.SetActive(false);
|
|||
|
_Rank.gameObject.SetActive(true);
|
|||
|
_Rank.text = StructInfo._Rank + "";
|
|||
|
}
|
|||
|
|
|||
|
_RoleName.text = RankWindowNew.Instance.GetProValueStr((int)RankWindowNew.RankPropID.UserName, info);
|
|||
|
_Profession = (int)RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserProf, info);
|
|||
|
_Prof.text = GCGame.Utils.GetProfession((int)RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserProf, info));
|
|||
|
|
|||
|
//用于查看信息使用的等级
|
|||
|
_Level = (int)RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserLevel, info);
|
|||
|
|
|||
|
var specialPropId = TableManager.GetRankInfoByID(NewRankRoot.Instance._CurSelectTabId, 0).SpecialPropID;
|
|||
|
|
|||
|
//switch (NewRankRoot.Instance._CurSelectTabId)
|
|||
|
//{
|
|||
|
// case (int)RankWindowNew.RankType_T.Advance_0:
|
|||
|
// {
|
|||
|
// var _AdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, info);
|
|||
|
// var _AdvanceStar = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceStar, info);
|
|||
|
// _Prop.text = StrDictionary.GetClientDictionaryString("#{43045}", _AdvanceGrade, _AdvanceStar);
|
|||
|
// }
|
|||
|
// break;
|
|||
|
// case (int)RankWindowNew.RankType_T.Advance_1:
|
|||
|
// case (int)RankWindowNew.RankType_T.Advance_2:
|
|||
|
// case (int)RankWindowNew.RankType_T.Advance_3:
|
|||
|
// case (int)RankWindowNew.RankType_T.Advance_4:
|
|||
|
// case (int)RankWindowNew.RankType_T.Advance_5:
|
|||
|
// case (int)RankWindowNew.RankType_T.Advance_6:
|
|||
|
// {
|
|||
|
// var _AdvanceGrade = RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserAdvanceGrade, info);
|
|||
|
// _Prop.text = StrDictionary.GetClientDictionaryString("#{46518}", _AdvanceGrade);
|
|||
|
// }
|
|||
|
// break;
|
|||
|
// default:
|
|||
|
// {
|
|||
|
// if (!RankWindowNew.Instance.GetProValueStr(specialPropId, info).Equals(""))
|
|||
|
// {
|
|||
|
// _Prop.text = RankWindowNew.Instance.GetProValueStr(specialPropId, info);
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// _Prop.text = NewRankRoot.Instance.GetModifiedStr(RankWindowNew.Instance.GetProValueInt(specialPropId, info)) + "";
|
|||
|
// }
|
|||
|
// }
|
|||
|
// break;
|
|||
|
|
|||
|
|
|||
|
//}
|
|||
|
|
|||
|
if (!RankWindowNew.Instance.GetProValueStr(specialPropId, info).Equals(""))
|
|||
|
{
|
|||
|
_Prop.text = RankWindowNew.Instance.GetProValueStr(specialPropId, info);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_Prop.text = NewRankRoot.Instance.GetModifiedStr(RankWindowNew.Instance.GetProValueInt(specialPropId, info)) + "";
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public override void OnItemClick()
|
|||
|
{
|
|||
|
base.OnItemClick();
|
|||
|
if (NewRankRoot.Instance)
|
|||
|
NewRankRoot.Instance.OnItemClick(info);
|
|||
|
}
|
|||
|
|
|||
|
public void ShowMarkIcon(bool isShow)
|
|||
|
{
|
|||
|
_MarkIcon.SetActive(isShow);
|
|||
|
}
|
|||
|
|
|||
|
public void OnNameBtn()
|
|||
|
{
|
|||
|
var guid = (ulong)RankWindowNew.Instance.GetProValueInt((int)RankWindowNew.RankPropID.UserGuid, info);
|
|||
|
var userName = RankWindowNew.Instance.GetProValueStr((int)RankWindowNew.RankPropID.UserName, info);
|
|||
|
PlayerTooltipsLogic.ShowPlayerTooltip(guid, userName, Vector3.zero, "", _Profession, _Level);
|
|||
|
|
|||
|
OnItemClick();
|
|||
|
}
|
|||
|
}
|