PlayerJobCareerScrollNestedCtrl.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using FL.Data;
  7. using System.Collections.Generic;
  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 PlayerJobCareerScrollNestedCtrl : UIController<PlayerJobCareerScrollNestedVM>
  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. {
  29. }
  30. private void RemoveUIListenres()
  31. {
  32. }
  33. #endregion
  34. public void ShowUI(careerTable curJobInfo, List<careerTable> preDataList, Dictionary<eAdvanceType, List<careerTable>> soldierDataMap,
  35. Dictionary<eAdvanceType, List<careerTable>> shooterDataMap, Dictionary<eAdvanceType, List<careerTable>> magicianDataMap)
  36. {
  37. VM.JobCtrl.selectedIndex = curJobInfo.Careertype;
  38. eCareerType careertype = (eCareerType)curJobInfo.Careertype;
  39. VM.JobLv1.Ctrl.ShowUI(preDataList[0], curJobInfo.Change_times == 0);
  40. VM.Soldier.Ctrl.ShowUI(GetPreviewParam(careertype == eCareerType.Soldier, curJobInfo,
  41. new eAdvanceType[2] { eAdvanceType.ShieldWarrior, eAdvanceType.Berserker }, preDataList, soldierDataMap));
  42. VM.Shooter.Ctrl.ShowUI(GetPreviewParam(careertype == eCareerType.Shooter, curJobInfo,
  43. new eAdvanceType[2] { eAdvanceType.CriticalShooter, eAdvanceType.ComboShooter }, preDataList, shooterDataMap));
  44. VM.Magician.Ctrl.ShowUI(GetPreviewParam(careertype == eCareerType.Magician, curJobInfo,
  45. new eAdvanceType[2] { eAdvanceType.SpellMage, eAdvanceType.ViolentMage }, preDataList, magicianDataMap));
  46. }
  47. private PreviewParam GetPreviewParam(bool bSelectJob, careerTable jobInfo, eAdvanceType[] advancedTypeArray,
  48. List<careerTable> preDataList, Dictionary<eAdvanceType, List<careerTable>> careerDataMap)
  49. {
  50. return new PreviewParam()
  51. {
  52. bSelectJob = bSelectJob,
  53. curJobInfo = jobInfo,
  54. advancedTypeArray = advancedTypeArray,
  55. preDataList = preDataList,
  56. careerDataMap = careerDataMap
  57. };
  58. }
  59. }
  60. }