PlayerLvListItemCtrl.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using XGame.Framework.UI;
  7. namespace FL.FGUI
  8. {
  9. public struct JobLvParam
  10. {
  11. public int lv;
  12. public int curJobLv; // 自身当前职业等级
  13. }
  14. /// <summary>
  15. /// UI逻辑处理类
  16. /// </summary>
  17. /// <typeparam name=""></typeparam>
  18. public partial class PlayerLvListItemCtrl : UIController<PlayerLvListItemVM>
  19. {
  20. protected override void OnEnable(object intent)
  21. {
  22. AddUIListenres();
  23. }
  24. protected override void OnDisable()
  25. {
  26. RemoveUIListenres();
  27. }
  28. #region UI事件
  29. private void AddUIListenres()
  30. {
  31. }
  32. private void RemoveUIListenres()
  33. {
  34. }
  35. #endregion
  36. public void OnRefresh(int index, JobLvParam data)
  37. {
  38. VM.LvLabel.text = string.Format(StringDefine.commonLv, data.lv);
  39. VM.CurLvCtrl.selectedIndex = data.curJobLv == data.lv ? 1 : (data.curJobLv < data.lv ? 0 : 2);
  40. }
  41. }
  42. }