PartnerEpiDetailListItemCtrl.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using FL.Data;
  7. using XGame;
  8. using XGame.Database;
  9. using XGame.Framework.UI;
  10. namespace FL.FGUI
  11. {
  12. /// <summary>
  13. /// UI逻辑处理类
  14. /// </summary>
  15. /// <typeparam name=""></typeparam>
  16. public partial class PartnerEpiDetailListItemCtrl : UIController<PartnerEpiDetailListItemVM>
  17. {
  18. protected override void OnEnable(object intent)
  19. {
  20. AddUIListenres();
  21. }
  22. protected override void OnDisable()
  23. {
  24. RemoveUIListenres();
  25. }
  26. #region UI事件
  27. private void AddUIListenres() { }
  28. private void RemoveUIListenres() { }
  29. #endregion
  30. public void OnRefresh(int index, EpigraphSkillLimit data)
  31. {
  32. var info = EpigraphData.Instance.GetEpigraphAttrByTableId(data.epiId);
  33. var starLv = info != null ? info.StarLv : 1;
  34. var skillTable = SkillTableRepo.Get(data.skillId);
  35. if (skillTable == null)
  36. {
  37. Log.Error($"技能表不能存在,技能ID:{data.skillId}");
  38. return;
  39. }
  40. VM.Effect.selectedIndex = starLv >= data.limitLv ? 1 : 0;
  41. VM.Stars.Ctrl.ShowStarUI(data.limitLv);
  42. VM.Title.text = skillTable.Desc;
  43. }
  44. }
  45. }