using Snxxz.UI;
|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace EnhancedUI.EnhancedScroller
|
{
|
public class ChatChannelCell : ScrollerUI
|
{
|
[SerializeField] Image m_Select;
|
[SerializeField] Text m_ChannelName;
|
|
private static Color unselectedColor = new Color32(237, 161, 13, 255);
|
private static Color selectedColor = new Color32(255, 244, 205, 255);
|
|
ChatCenter m_ChatCenter;
|
ChatCenter chatCenter
|
{
|
get
|
{
|
return m_ChatCenter ?? (m_ChatCenter = ModelCenter.Instance.GetModel<ChatCenter>());
|
}
|
}
|
|
public override void Refresh(CellView cell)
|
{
|
var _type = (ChatInfoType)cell.index;
|
if (_type == ChatInfoType.Friend)
|
{
|
m_ChannelName.text = Language.Get("PlayerDetail_PrivateChat");
|
}
|
else
|
{
|
m_ChannelName.text = Language.Get(StringUtility.Contact("ChatType_", _type.ToString()));
|
}
|
m_Select.gameObject.SetActive(_type == ChatCtrl.Inst.presentChatType);
|
m_ChannelName.color = _type == ChatCtrl.Inst.presentChatType ? selectedColor : unselectedColor;
|
}
|
}
|
}
|