123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /// #pkgName FGUI包名
- /// #panelName UIPanel名字
- /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
- /// 该脚本由模板创建
- /// created by cb 2024
- using FairyGUI;
- using FL.Data;
- using XGame.Database;
- using XGame.Framework.UI;
- namespace FL.FGUI
- {
- /// <summary>
- /// UI逻辑处理类
- /// </summary>
- /// <typeparam name=""></typeparam>
- public partial class PartnerEpiChangeListItemCtrl : UIController<PartnerEpiChangeListItemVM>
- {
- protected override void OnEnable(object intent)
- {
- AddUIListenres();
- }
- protected override void OnDisable()
- {
- RemoveUIListenres();
- }
- #region UI事件
- private void AddUIListenres()
- {
- VM.Panel.onClick.Add(OnClick);
- }
- private void RemoveUIListenres()
- {
- VM.Panel.onClick.Remove(OnClick);
- }
- private void OnClick(EventContext eventContext)
- {
- EventSingle.Instance.Notify(EventDefine.EpigraphChangeListClick, attr.id);
- }
- #endregion
- #region 属性
- private int sbId;
- private EpigraphAttributes attr;
- #endregion
- #region 页面
- public void OnRefresh(int index, EpiChangeListData data)
- {
- sbId = data.sbId;
- attr = data.attrs;
- UpEpiInfo();
- }
- private void UpEpiInfo()
- {
- var table = EpigraphTableRepo.Get(sbId);
- if (table == null)
- return;
- VM.EpiLabel.Ctrl.SetEpiIcon(sbId, true);
- VM.NameLabel.text = table.Name;
- var info = EpigraphData.Instance.GetEpigraphInfo(sbId);
- VM.IsUp.selectedIndex = info?.partnerId > 0 ? 1 : 0;
- }
- #endregion
- }
- }
|