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