PartnerEpiSetBaseCtrl.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using XGame;
  7. using XGame.Database;
  8. using XGame.Framework.UI;
  9. namespace FL.FGUI
  10. {
  11. /// <summary>
  12. /// UI逻辑处理类
  13. /// </summary>
  14. /// <typeparam name=""></typeparam>
  15. public partial class PartnerEpiSetBaseCtrl : UIController<PartnerEpiSetBaseVM>
  16. {
  17. protected override void OnEnable(object intent)
  18. {
  19. AddUIListenres();
  20. }
  21. protected override void OnDisable()
  22. {
  23. RemoveUIListenres();
  24. }
  25. #region UI事件
  26. private void AddUIListenres() { }
  27. private void RemoveUIListenres() { }
  28. #endregion
  29. public void SetData(int mwId, int sbId, bool showStar)
  30. {
  31. if (sbId <= 0)
  32. return;
  33. var sbTable = PartnerTableRepo.Get(sbId);
  34. if (sbTable == null)
  35. {
  36. Log.Debug($"圣兵不存在id:{sbId}");
  37. return;
  38. }
  39. VM.EmptyDiLoader.url = AddressableDefine.EpigraphEmptyPz((int)sbTable.Quality);
  40. if (mwId > 0)
  41. {
  42. var table = EpigraphTableRepo.Get(mwId);
  43. if (table == null)
  44. {
  45. Log.Debug($"铭文不存在id:{mwId}");
  46. return;
  47. }
  48. VM.InSet.selectedIndex = 0;
  49. VM.EpiIcon.Enable(null);
  50. VM.EpiIcon.Ctrl.SetEpiIcon(mwId, showStar);
  51. }
  52. else
  53. {
  54. VM.InSet.selectedIndex = 1;
  55. VM.EpiIcon.Disable();
  56. }
  57. }
  58. }
  59. }