コード例 #1
0
    private void ResponseBuyCard(ScChargeBuySuccess msg)
    {
        var product = moduleCharge.GetProduct(msg.productId);

        if (product.info.type == (int)ProductType.MonthCard)
        {
            var title = ConfigText.GetDefalutString(TextForMatType.RechargeUIText, Module_Charge.CalcCardDays(moduleCharge.MonthEndTime) > 0 ? 24 : 23);
            Window_ItemTip.Show(title, monthChargeItem.info.reward);
        }
        else if (product.info.type == (int)ProductType.SeasonCard)
        {
            var title = ConfigText.GetDefalutString(TextForMatType.RechargeUIText, Module_Charge.CalcCardDays(moduleCharge.SeasonEndTime) > 0 ? 24 : 23);
            Window_ItemTip.Show(title, seasonChargeItem.info.reward);
        }
    }
コード例 #2
0
        public void Set(PChargeItem item, bool has, ulong endTime)
        {
            if (item == null)
            {
                return;
            }

            chargeItem = item;
            buyNode.SafeSetActive(!has);
            reorderNode.SafeSetActive(has);


            Util.SetText(price, Util.GetChargeCurrencySymbol(chargeItem.info.currencyType) + chargeItem.info.cost);
            if (has)
            {
                Util.SetText(remainTimeText, Util.Format(ConfigText.time0.text[0], Module_Charge.CalcCardDays(endTime)));
            }
        }
コード例 #3
0
    private void OnBuyClick()
    {
        if (m_chargeItem == null || m_rewards == null)
        {
            return;
        }

        var day = Module_Charge.CalcCardDays(m_chargeItem.info.endTime);

        if (day < m_rewards.oneinfo.Length)
        {
            var t = Util.GetDateTime((long)m_chargeItem.info.endTime);
            Window_Alert.ShowAlertDefalut(Util.Format(ConfigText.GetDefalutString(TextForMatType.RechargeUIText, 28),
                                                      t.Month, t.Day),
                                          () =>
            {
                moduleCharge.RequestBuyProduct(m_chargeItem);
            }, () => {});
            return;
        }

        moduleCharge.RequestBuyProduct(m_chargeItem);
    }