Exemple #1
0
        public void InitScreen(XsollaUtils pUtils)
        {
            // set title
            _titleProj.text = pUtils.GetProject().name;

            // user name
            _userName.text = pUtils.GetUser().GetName();

            if (pUtils.GetUser().virtualCurrencyBalance != null)
            {
                AddUserMenuBtn(pUtils.GetTranslations().Get("user_menu_balance"), ShowHistory);
                _pMenuBtnComponent.enabled = true;
            }

            if (!pUtils.IsServerLess())
            {
                AddUserMenuBtn(pUtils.GetTranslations().Get("user_menu_payment_accounts"), ShowPaymentManager);
            }

            if (pUtils.GetProject().components.ContainsKey("subscriptions"))
            {
                AddUserMenuBtn(pUtils.GetTranslations().Get("user_menu_user_subscription"), ShowSubscriptionManager);
            }

            if (pUtils.IsServerLess())
            {
                _userName.color            = StyleManager.Instance.GetColor(StyleManager.BaseColor.disable_user_menu);
                _pMenuBtnComponent.enabled = false;
                mDropIcon.gameObject.SetActive(false);
            }
        }
Exemple #2
0
        private void InitMenu(XsollaUtils pUtils)
        {
            mRadioGroupController = mNavMenuPanel.gameObject.AddComponent <RadioGroupController> ();
            GameObject menuItemEmptyPrefab             = Resources.Load(PREFAB_VIEW_MENU_ITEM_EMPTY) as GameObject;
            Dictionary <string, XComponent> components = pUtils.GetProject().components;

            if (components.ContainsKey("items") && components ["items"].IsEnabled)
            {
                string lName = (components ["items"].Name != "") ? components ["items"].Name : pUtils.GetTranslations().Get(XsollaTranslations.VIRTUALITEM_PAGE_TITLE);
                addMenuBtn("", lName, RadioButton.RadioType.SCREEN_GOODS);
            }

            if (components.ContainsKey("virtual_currency") && components ["virtual_currency"].IsEnabled)
            {
                string lName = (components ["virtual_currency"].Name != "") ? components["virtual_currency"].Name : pUtils.GetTranslations().Get(XsollaTranslations.PRICEPOINT_PAGE_TITLE);
                addMenuBtn("", lName, RadioButton.RadioType.SCREEN_PRICEPOINT);
            }

            if (components.ContainsKey("subscriptions") && components["subscriptions"].IsEnabled)
            {
                string lName = (components["subscriptions"].Name != "") ? components["subscriptions"].Name : pUtils.GetTranslations().Get("state_name_subscription");
                addMenuBtn("", lName, RadioButton.RadioType.SCREEN_SUBSCRIPTION);
            }

            if (components.ContainsKey("coupons") && components["coupons"].IsEnabled)
            {
                string lName = (components["coupons"].Name != "") ? components["coupons"].Name : pUtils.GetTranslations().Get(XsollaTranslations.COUPON_PAGE_TITLE);
                addMenuBtn("", lName, RadioButton.RadioType.SCREEN_REDEEMCOUPON);
            }

            GameObject menuItemEmpty = Instantiate(menuItemEmptyPrefab);

            menuItemEmpty.transform.SetParent(mNavMenuPanel.transform);

            if (!pUtils.IsServerLess())
            {
                addMenuBtn("", "", RadioButton.RadioType.SCREEN_FAVOURITE, true);
            }
        }
Exemple #3
0
        private void GoodsRecived(JSONNode pNode)
        {
            // Зачищаем панель с товарами
            ClearItemsContent();
            // Позиция для скролла
            mScrollRectItemsContainer.verticalNormalizedPosition = 1;

            XsollaGoodsManager lGoods = new XsollaGoodsManager().Parse(pNode) as XsollaGoodsManager;

            lGoods.GetItemsList().ForEach((item) =>
            {
                // Если бессерверная то товары за вирт валюту не проходят
                if (mUtils.IsServerLess() && item.IsVirtualPayment())
                {
                    Logger.Log("Item " + item.GetId() + " can't be buy");
                }
                else
                {
                    AddShopItem(item);
                }
            });

            // Если группа пустая
            mEmptyLabel.gameObject.SetActive(mListItems.Count == 0);
            if (mListItems.Count == 0)
            {
                mItemsContentGrid.SetActive(false);
                mItemsContentList.SetActive(false);
            }
            else
            {
                SetLanding();
            }

            mProgressBar.SetLoading(false);
        }