Ejemplo n.º 1
0
    protected void SetUpText(PointShopItem item, bool isChangable)
    {
        //IL_0141: Unknown result type (might be due to invalid IL or missing references)
        //IL_014b: Unknown result type (might be due to invalid IL or missing references)
        itemName.text = item.name;
        if (item.hasLimit)
        {
            switch (item.limitPeriodType)
            {
            case POINT_SHOP_ITEM_LIMIT_TYPE.DAILY:
                tradeNum.text = string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 3u), item.limit - item.buyCount);
                break;

            case POINT_SHOP_ITEM_LIMIT_TYPE.WEEKLY:
                tradeNum.text = string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 4u), item.limit - item.buyCount);
                break;

            case POINT_SHOP_ITEM_LIMIT_TYPE.MONTHLY:
                tradeNum.text = string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 5u), item.limit - item.buyCount);
                break;

            default:
                tradeNum.text = string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 1u), item.limit - item.buyCount);
                break;
            }
        }
        else
        {
            tradeNum.text = StringTable.Get(STRING_CATEGORY.POINT_SHOP, 0u);
        }
        pointNum.text      = string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 2u), item.needPoint);
        pointNum.color     = ((!isChangable) ? Color.get_red() : Color.get_white());
        remainingTime.text = item.expire;
    }
Ejemplo n.º 2
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);
 }
            protected override bool IsCondition(PointShopItem item)
            {
                if (item.type == 3)
                {
                    ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)item.itemId);

                    return(itemData.type == ITEM_TYPE.TICKET);
                }
                return(false);
            }
Ejemplo n.º 4
0
    public static string GetBoughtMessage(PointShopItem item, int num)
    {
        string empty = string.Empty;

        if (item.itemId != 1200000)
        {
            return(string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 7u), item.name, num));
        }
        return(string.Format(StringTable.Get(STRING_CATEGORY.POINT_SHOP, 8u), item.name, num));
    }
Ejemplo n.º 5
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);
        }
    }
Ejemplo n.º 6
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);
        });
    }
Ejemplo n.º 7
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);
 }
            protected override bool IsCondition(PointShopItem item)
            {
                if (item.type == 3)
                {
                    ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)item.itemId);

                    switch (itemData.type)
                    {
                    case ITEM_TYPE.MATERIAL_METAL:
                    case ITEM_TYPE.LITHOGRAPH:
                    case ITEM_TYPE.USE_ITEM:
                    case ITEM_TYPE.TICKET:
                        return(false);

                    default:
                        return(true);
                    }
                }
                return(false);
            }
            protected override bool IsCondition(PointShopItem item)
            {
                switch (item.type)
                {
                case 3:
                case 10:
                {
                    ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)item.itemId);

                    if (itemData.type == ITEM_TYPE.USE_ITEM)
                    {
                        return(false);
                    }
                    return(itemData.rarity == rarity);
                }

                case 4:
                {
                    EquipItemTable.EquipItemData equipItemData = Singleton <EquipItemTable> .I.GetEquipItemData((uint)item.itemId);

                    return(equipItemData.rarity == rarity);
                }

                case 6:
                {
                    QuestTable.QuestTableData questData = Singleton <QuestTable> .I.GetQuestData((uint)item.itemId);

                    return(questData.rarity == rarity);
                }

                case 5:
                {
                    SkillItemTable.SkillItemData skillItemData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)item.itemId);

                    return(skillItemData.rarity == rarity);
                }

                default:
                    return(false);
                }
            }
Ejemplo n.º 10
0
 private void OnBuy(PointShopItem item, int num)
 {
     GameSection.SetEventData(new object[2]
     {
         item.name,
         num
     });
     GameSection.StayEvent();
     PointShopBuyModel.SendForm sendForm = new PointShopBuyModel.SendForm();
     sendForm.uid = item.pointShopItemId;
     sendForm.num = num;
     Protocol.Send(PointShopBuyModel.URL, sendForm, delegate(PointShopBuyModel result)
     {
         if (result != null && result.Error == Error.None)
         {
             item.buyCount  += num;
             data.userPoint -= item.needPoint * num;
             RefreshUI();
         }
         GameSection.ResumeEvent(result != null && result.Error == Error.None, null);
     }, string.Empty);
 }
Ejemplo n.º 11
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();
 }
 protected virtual bool IsCondition(PointShopItem item)
 {
     return(false);
 }
 protected override bool IsCondition(PointShopItem item)
 {
     return(item.type == 10);
 }
Ejemplo n.º 14
0
    protected void SetUpItemIcon(PointShopItem item)
    {
        ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon((REWARD_TYPE)item.type, (uint)item.itemId, itemIconRoot, -1, null, 0, false, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);

        itemIcon.SetEnableCollider(false);
    }
Ejemplo n.º 15
0
 public void SetUp(PointShopItem item, uint pointId, bool isChangable)
 {
     SetUpText(item, isChangable);
     SetUpPointIcon(pointIcon, pointId);
     SetUpItemIcon(item);
 }