You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

45 lines
1.2 KiB

using TMPro;
using UnityEngine;
using IVDataFormat;
public class EScrNotice : EScrCell
{
private ButtonIV btnView;
private TextMeshProUGUI txtTitle, txtDate;
public override void InitCell()
{
Transform trf = transform;
txtTitle = trf.Find("txtTitle").GetComponent<TextMeshProUGUI>();
txtDate = trf.Find("txtDate").GetComponent<TextMeshProUGUI>();
btnView = trf.Find("btnView").GetComponent<ButtonIV>();
btnView.transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("all_see");
}
public override void Localize()
{
btnView.transform.GetChild(0).GetComponent<TextMeshProUGUI>().text = LocalizationText.GetText("all_see");
}
public override void SetData(int itemid)
{
itemID = itemid;
if (!DataHandler.TryGetNotice(itemid, out dNotice targetNotice)) return;
txtTitle.text = targetNotice.GetTitle();
txtDate.text = FormatString.TextDateTimeUtc9Line1(targetNotice.endAt);
}
public override void RefreshCellView()
{
base.RefreshCellView();
SetData(itemID);
}
public void BtnView()
{
SoundMgr.PlaySfx(SoundName.BtnPress);
NoticeMgr.SOpenDetail(itemID);
}
}