GetBonusView.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using FairyGUI;
  2. using UI.CommonGame;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. namespace GFGGame
  6. {
  7. public class GetBonusView : BaseWindow
  8. {
  9. // private UI_GetBonusUI _ui;
  10. // private List<ItemData> _bonusList;
  11. // protected override void OnInit()
  12. // {
  13. // base.OnInit();
  14. // _ui = UI_GetBonusUI.Create();
  15. // this.viewCom = _ui.target;
  16. // this.viewCom.Center();
  17. // this.modal = true;
  18. // _ui.m_listBonus.itemRenderer = UpdateBonusItem;
  19. // _ui.m_listBonus.onClickItem.Add(OnClickListBonusItem);
  20. // }
  21. // protected override void OnShown()
  22. // {
  23. // base.OnShown();
  24. // _bonusList = this.viewData as List<ItemData>;
  25. // if (_bonusList != null)
  26. // {
  27. // _ui.m_listBonus.numItems = _bonusList.Count;
  28. // }
  29. // else
  30. // {
  31. // _ui.m_listBonus.numItems = 0;
  32. // }
  33. // if (_ui.m_listBonus.numItems > 4)
  34. // {
  35. // _ui.m_listBonus.columnGap = 40;
  36. // }
  37. // else
  38. // {
  39. // _ui.m_listBonus.columnGap = 60;
  40. // }
  41. // int targetY = (int)(this.viewCom.y + _ui.target.y + _ui.target.height);
  42. // }
  43. // protected override void OnHide()
  44. // {
  45. // base.OnHide();
  46. // GetSuitItemController.TryShow(0);
  47. // }
  48. // private void OnClickListBonusItem(EventContext context)
  49. // {
  50. // GComponent item = context.data as GComponent;
  51. // int itemId = (int)item.data;
  52. // GoodsItemTipsController.ShowItemTips(itemId);
  53. // }
  54. // private void UpdateBonusItem(int index, GObject item)
  55. // {
  56. // ItemData itemData = _bonusList[index] as ItemData;
  57. // ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
  58. // UI_BonusItem listItem = UI_BonusItem.Proxy(item);
  59. // listItem.m_goodsItem.m_txtNumber.text = "x" + itemData.num;
  60. // listItem.m_txtOwned.SetVar("count", "" + ItemDataManager.GetItemNum(itemData.id)).FlushVars();
  61. // listItem.m_goodsItem.m_txtName.text = itemCfg.name;
  62. // listItem.m_goodsItem.m_iconItem.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
  63. // listItem.m_iconBonusOnce.visible = itemData.isOnceBonus;
  64. // RarityIconController.UpdateRarityIcon(listItem.m_goodsItem.m_iconItem.m_rarity, itemData.id, true);
  65. // listItem.target.data = itemData.id;
  66. // }
  67. // protected override void UpdateToCheckGuide(object param)
  68. // {
  69. // if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  70. // GuideController.TryGuide(null, ConstGuideId.GET_BONUS_FIRST, 1, "恭喜你,获得了第一份奖励,点击图标可以查看物品信息,点击半透明区域继续", -1, true, (int)(this.viewCom.y + _ui.target.y + _ui.target.height));
  71. // }
  72. // protected override void TryCompleteGuide()
  73. // {
  74. // GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.GET_BONUS_FIRST);
  75. // GuideController.TryCompleteGuideIndex(cfg.id, 1);
  76. // GuideController.TryCompleteGuide(ConstGuideId.GET_BONUS_FIRST, 1);
  77. // }
  78. }
  79. }