1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using UI.Store;
- using UI.CommonGame;
- using FairyGUI;
- using System.Collections.Generic;
- using ET;
- namespace GFGGame
- {
- public class StoreExchangeView : BaseWindow
- {
- private UI_StoreExchangeUI _ui;
- private List<ShopCfg> _shopCfgs;
- public override void Dispose()
- {
- if (_ui != null)
- {
- _ui.Dispose();
- }
- _ui = null;
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- packageName = UI_StoreExchangeUI.PACKAGE_NAME;
- _ui = UI_StoreExchangeUI.Create();
- this.viewCom = _ui.target;
- isfullScreen = true;
- this.clickBlankToClose = false;
- _ui.m_list.itemRenderer = ListItemRenderer;
- }
- protected override void AddEventListener()
- {
- base.AddEventListener();
- }
- protected override void OnShown()
- {
- base.OnShown();
- int menu2 = (int)this.viewData;
- _shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_EXCHANGE, menu2);
- _shopCfgs = ShopDataManager.Instance.SortGiftBagCfgs(_shopCfgs);
- _ui.m_list.numItems = _shopCfgs.Count;
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- protected override void RemoveEventListener()
- {
- base.RemoveEventListener();
- }
- private void ListItemRenderer(int index, GObject obj)
- {
- ShopCfg shopCfg = _shopCfgs[index];
- ShopViewManager.Instance.UptadeItem(obj, shopCfg);
- }
- }
- }
|