示例#1
0
    private void ViewEventTab()
    {
        SetActive((Enum)UI.OBJ_NORMAL, false);
        SetActive((Enum)UI.OBJ_TAB_ROOT, true);
        SetActive((Enum)UI.OBJ_ON_TAB_NORMAL, false);
        SetActive((Enum)UI.OBJ_ON_TAB_EVENT, true);
        SetActive((Enum)UI.OBJ_EVENT_LIST, true);
        List <PointShop> current = (from x in pointShop
                                    where x.isEvent
                                    select x).ToList();

        SetGrid(UI.GRD_EVENT_LIST, "PointShopEventList", current.Count, true, delegate(int i, Transform t, bool b)
        {
            PointShop pointShop  = current[i];
            UITexture component  = FindCtrl(t, UI.TEX_EVENT_LIST_BANNER).GetComponent <UITexture>();
            UITexture component2 = FindCtrl(t, UI.TXT_EVENT_LIST_POINT_ICON).GetComponent <UITexture>();
            SetLabelText(t, UI.LBL_EVENT_LIST_POINT, string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 2u), pointShop.userPoint));
            ResourceLoad.LoadPointIconImageTexture(component2, (uint)pointShop.pointShopId);
            ResourceLoad.LoadPointShopBannerTexture(component, (uint)pointShop.pointShopId);
            SetEvent(FindCtrl(t, UI.TEX_EVENT_LIST_BANNER), "EVENT_SHOP", pointShop);
            int num = (from x in pointShop.items
                       where x.isBuyable
                       where x.type != 8 || !MonoBehaviourSingleton <UserInfoManager> .I.IsUnlockedStamp(x.itemId)
                       where x.type != 9 || !MonoBehaviourSingleton <UserInfoManager> .I.IsUnlockedDegree(x.itemId)
                       where x.type != 7 || !MonoBehaviourSingleton <GlobalSettingsManager> .I.IsUnlockedAvatar(x.itemId)
                       select x).Count();
            bool flag = num == 0;
            SetActive(t, UI.LBL_EVENT_LIST_SOLD_OUT, flag);
            SetButtonEnabled(t, UI.TEX_EVENT_LIST_BANNER, !flag);
            SetLabelText(t, UI.LBL_EVENT_LIST_REMAINING_TIME, pointShop.expire);
        });
    }
示例#2
0
 public override void Initialize()
 {
     //IL_001e: Unknown result type (might be due to invalid IL or missing references)
     data        = (GameSection.GetEventData() as PointShop);
     currentPage = 1;
     this.StartCoroutine(DoInitialize());
 }
示例#3
0
 public void SetUpItemDetailItem(PointShopItem item, PointShop shop, uint pointId, bool isChangable)
 {
     SetUpText(item, isChangable);
     SetUpPointIcon(pointIcon, pointId);
     SetUpPointIcon(havePointIcon, pointId);
     havePointNum.text = string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 2u), shop.userPoint);
 }
示例#4
0
    private void OnQuery_CONFIRM_BUY()
    {
        object[]      array         = GameSection.GetEventData() as object[];
        PointShopItem pointShopItem = array[0] as PointShopItem;
        PointShop     pointShop     = array[1] as PointShop;

        if (pointShop.userPoint < pointShopItem.needPoint)
        {
            GameSection.ChangeEvent("SHORTAGE_POINT", null);
        }
    }
示例#5
0
    private void ViewNormalTab()
    {
        SetActive((Enum)UI.OBJ_NORMAL, true);
        SetActive((Enum)UI.OBJ_TAB_ROOT, true);
        SetActive((Enum)UI.OBJ_ON_TAB_NORMAL, true);
        SetActive((Enum)UI.OBJ_ON_TAB_EVENT, false);
        SetActive((Enum)UI.OBJ_EVENT_LIST, false);
        PointShop shop = pointShop.First((PointShop x) => !x.isEvent);

        currentPointShopItem = GetBuyableItemList();
        if (filter != null)
        {
            filter.DoFiltering(ref currentPointShopItem);
        }
        SetLabelText((Enum)UI.LBL_NORMAL_POINT, string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 2u), shop.userPoint));
        UITexture component = GetCtrl(UI.TEX_NORMAL_POINT_ICON).GetComponent <UITexture>();

        ResourceLoad.LoadPointIconImageTexture(component, (uint)shop.pointShopId);
        maxPage = currentPointShopItem.Count / GameDefine.POINT_SHOP_LIST_COUNT;
        if (currentPointShopItem.Count % GameDefine.POINT_SHOP_LIST_COUNT > 0)
        {
            maxPage++;
        }
        SetLabelText((Enum)UI.LBL_ARROW_NOW, (maxPage <= 0) ? "0" : currentPage.ToString());
        SetLabelText((Enum)UI.LBL_ARROW_MAX, maxPage.ToString());
        int item_num = Mathf.Min(GameDefine.POINT_SHOP_LIST_COUNT, currentPointShopItem.Count - (currentPage - 1) * GameDefine.POINT_SHOP_LIST_COUNT);

        SetGrid(UI.GRD_NORMAL, "PointShopListItem", item_num, true, delegate(int i, Transform t, bool b)
        {
            int index         = i + (currentPage - 1) * GameDefine.POINT_SHOP_LIST_COUNT;
            object event_data = new object[3]
            {
                currentPointShopItem[index],
                shop,
                new Action <PointShopItem, int>(OnBuy)
            };
            SetEvent(t, "CONFIRM_BUY", event_data);
            PointShopItemList component2 = t.GetComponent <PointShopItemList>();
            component2.SetUp(currentPointShopItem[index], (uint)shop.pointShopId, currentPointShopItem[index].needPoint <= shop.userPoint);
            int num          = -1;
            REWARD_TYPE type = (REWARD_TYPE)currentPointShopItem[index].type;
            if (type == REWARD_TYPE.ITEM)
            {
                num = MonoBehaviourSingleton <InventoryManager> .I.GetHaveingItemNum((uint)currentPointShopItem[index].itemId);
            }
            SetLabelText(t, UI.LBL_HAVE, string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 6u), num.ToString()));
            SetActive(t, UI.LBL_HAVE, num >= 0);
        });
        bool flag = pointShop.Any((PointShop x) => x.isEvent);

        SetActive((Enum)UI.OBJ_EVENT_NON_ACTIVE, !flag);
        SetActive((Enum)UI.BTN_EVENT, flag);
    }
示例#6
0
    public override bool PageSwitchEventEnableBefore(bool bBack = false)
    {
        if (!m_bInit)
        {
            if (m_PointShop == null)
            {
                m_PointShop = GetComponentInChildren <PointShop>();
                m_PointShop.SetTopAndBottomAjustStatusBar(new Vector2(1, -266));
            }

            //ページ初期化処理
            m_PointShop.SceneStart();
            m_bInit = true;
        }
        return(!m_PointShop.IsReady);
    }
示例#7
0
    private void OnBuy(PointShopItem item, int num)
    {
        string boughtMessage = PointShopManager.GetBoughtMessage(item, num);

        GameSection.SetEventData(boughtMessage);
        GameSection.StayEvent();
        PointShop pointShop = this.pointShop.First((PointShop x) => x.items.Contains(item));

        MonoBehaviourSingleton <UserInfoManager> .I.PointShopManager.SendPointShopBuy(item, pointShop, num, delegate(bool isSuccess)
        {
            if (isSuccess)
            {
                UpdateTab();
            }
            GameSection.ResumeEvent(isSuccess, null);
        });
    }
示例#8
0
 public void SendPointShopBuy(PointShopItem pointShopItem, PointShop pointShop, int num, Action <bool> call_back)
 {
     PointShopBuyModel.SendForm sendForm = new PointShopBuyModel.SendForm();
     sendForm.uid = pointShopItem.pointShopItemId;
     sendForm.num = num;
     Protocol.Send(PointShopBuyModel.URL, sendForm, delegate(PointShopBuyModel result)
     {
         bool obj = false;
         if (result != null && result.Error == Error.None)
         {
             pointShopItem.buyCount += num;
             pointShop.userPoint    -= pointShopItem.needPoint * num;
             obj = true;
         }
         call_back(obj);
     }, string.Empty);
 }
示例#9
0
 public override void Initialize()
 {
     object[] array = GameSection.GetEventData() as object[];
     if (array.Length == 3)
     {
         currentItem = (array[0] as PointShopItem);
         pointShop   = (array[1] as PointShop);
         onBuy       = (array[2] as Action <PointShopItem, int>);
         int num = (!currentItem.hasLimit) ? 2147483647 : (currentItem.limit - currentItem.buyCount);
         changableNum = Mathf.Min(Mathf.Min(num, pointShop.userPoint / currentItem.needPoint), GameDefine.POINT_SHOP_MAX_BUY_LIMIT);
     }
     if (changableNum == 1)
     {
         SetActive((Enum)UI.BTN_L, false);
         SetActive((Enum)UI.BTN_R, false);
     }
     else
     {
         SetRepeatButton((Enum)UI.BTN_L, "L", (object)null);
         SetRepeatButton((Enum)UI.BTN_R, "R", (object)null);
     }
     base.Initialize();
 }