ShopViewManager.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using ET;
  4. using FairyGUI;
  5. using UI.Store;
  6. namespace GFGGame
  7. {
  8. public class ShopViewManager : SingletonBase<ShopViewManager>
  9. {
  10. public void BuyItem(int itemId, int itemCount, int shopType, ShopCfg shopCfg)
  11. {
  12. BuyItemConteoller.Show(itemId, itemCount, ConstBuyType.TYPE_SHOP, shopType, () =>
  13. {
  14. LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.FU_ZHUANG_DIAN, 2);
  15. GetSuitItemController.TryShow(0);
  16. }, true, false, GameConst.MAX_COUNT_TO_BUY_ITEMS);
  17. }
  18. public void UpdateVipProgressCom(GObject obj)
  19. {
  20. UI_ComVipLv com = UI_ComVipLv.Proxy(obj);
  21. com.m_txtLv.text = RoleDataManager.vipLv.ToString();
  22. VipCfg vipCfg = VipCfgArray.Instance.GetCfg(RoleDataManager.vipLv);
  23. VipCfg nextVipCfg = VipCfgArray.Instance.GetCfg(RoleDataManager.vipLv + 1);
  24. com.m_txtTipsFull.visible = nextVipCfg == null;
  25. if (com.m_btnRule.data == null)
  26. {
  27. com.m_btnRule.onClick.Add(RuleController.ShowRuleView);
  28. com.m_btnRule.data = 300009;
  29. }
  30. if (nextVipCfg != null)
  31. {
  32. com.m_proExp.target.max = vipCfg.num;
  33. com.m_proExp.target.value = RoleDataManager.vipExp;
  34. com.m_proExp.m_txttitle.SetVar("value", com.m_proExp.target.value.ToString()).FlushVars();
  35. com.m_proExp.m_txttitle.SetVar("max", com.m_proExp.target.max.ToString()).FlushVars();
  36. com.m_txtTips.SetVar("exp", (vipCfg.num - RoleDataManager.vipExp).ToString()).FlushVars();
  37. com.m_txtTips.SetVar("vipLv", (nextVipCfg.id).ToString()).FlushVars();
  38. }
  39. UI_ComVipLv.ProxyEnd();
  40. }
  41. }
  42. }