PersonalSkillView.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using UI.RoleInfo;
  2. using System.Text.RegularExpressions;
  3. using cfg.GfgCfg;
  4. using FairyGUI;
  5. namespace GFGGame
  6. {
  7. public class PersonalSkillView : BaseWindow
  8. {
  9. private UI_PersonalSkillUI _ui;
  10. public override void Dispose()
  11. {
  12. if (_ui != null)
  13. {
  14. _ui.Dispose();
  15. _ui = null;
  16. }
  17. base.Dispose();
  18. }
  19. protected override void OnInit()
  20. {
  21. base.OnInit();
  22. packageName = UI_PersonalSkillUI.PACKAGE_NAME;
  23. _ui = UI_PersonalSkillUI.Create();
  24. this.viewCom = _ui.target;
  25. this.viewCom.Center();
  26. this.modal = true;
  27. _ui.m_list.itemRenderer = RenderListItem;
  28. }
  29. protected override void OnShown()
  30. {
  31. base.OnShown();
  32. ViewManager.SetMaskAlpha(0.8f);
  33. _ui.m_list.numItems = CommonDataManager.Tables.TblRoleSkillCfg.DataList.Count;
  34. }
  35. protected override void OnHide()
  36. {
  37. base.OnHide();
  38. ViewManager.SetMaskAlpha(0.6f);
  39. }
  40. private void RenderListItem(int index, GObject obj)
  41. {
  42. RoleSkillCfg cfg = CommonDataManager.Tables.TblRoleSkillCfg.DataList[index];
  43. UI_ListSkillItem item = UI_ListSkillItem.Proxy(obj);
  44. item.m_loaIcon.url = string.Format("ui://RoleInfo/{0}", cfg.Res);
  45. item.m_txtname.text = cfg.Name;
  46. item.m_txtDesc.text = cfg.Desc;
  47. UI_ListSkillItem.ProxyEnd();
  48. }
  49. }
  50. }