コード例 #1
0
        public override GameObject GetView(int position)
        {
            XsollaStatusText.StatusTextElement element = elements[position];
            //create a new item, name it, and set the parent
            GameObject newItem = Instantiate(statusPrefab) as GameObject;

            Text[] texts = newItem.GetComponentsInChildren <Text> ();
            texts [0].text = element.GetPref();
            texts [1].text = element.GetValue();
            return(newItem);
        }
コード例 #2
0
        public override void InitScreen(XsollaTranslations translations, XsollaStatus xsollaStatus)
        {
            ResizeToParent();
            string           input      = translations.Get(XsollaTranslations.STATUS_PURCHASED_DESCRIPTION);
            XsollaStatusText statusText = xsollaStatus.GetStatusText();

            XsollaStatus.Group currentStatus = xsollaStatus.GetGroup();
            if (input != null)
            {
                string pattern = "{{.*?}}";
                Regex  regex   = new Regex(pattern);
                input = regex.Replace(input, statusText.GetPurchsaeValue(), 1);
                input = regex.Replace(input, statusText.Get("sum").GetValue(), 1);
            }
            else
            {
                input = "";
            }
            PrepareStatus(currentStatus, xsollaStatus.GetStatusText().GetState(), input, xsollaStatus.GetInvoice());
            AddTitle(statusText.GetProjectString());
            if (currentStatus == XsollaStatus.Group.DONE)
            {
                AddStatus(translations.Get(XsollaTranslations.VIRTUALSTATUS_DONE_DESCRIPTIONS));
            }

            AddElement(statusText.GetPurchsaeValue(), statusText.Get("sum").GetValue());

            XsollaStatusText.StatusTextElement element = statusText.Get("out");
            if (element != null)
            {
                AddElement(statusText.Get("out").GetPref(), statusText.Get("out").GetValue());
            }
            element = statusText.Get("invoice");
            if (element != null)
            {
                AddElement(statusText.Get("invoice").GetPref(), statusText.Get("invoice").GetValue());
            }
            element = statusText.Get("details");
            if (element != null)
            {
                AddElement(statusText.Get("details").GetPref(), statusText.Get("details").GetValue());
            }
            element = statusText.Get("time");
            if (element != null)
            {
                AddElement(statusText.Get("time").GetPref(), statusText.Get("time").GetValue());
            }
            element = statusText.Get("merchant");
            if (element != null)
            {
                AddElement(statusText.Get("merchant").GetPref(), statusText.Get("merchant").GetValue());
            }
            element = statusText.Get("userWallet");
            if (element != null)
            {
                AddElement(statusText.Get("userWallet").GetPref(), statusText.Get("userWallet").GetValue());
            }
            AddLine();
            AddBigElement(statusText.Get("sum").GetPref(), statusText.Get("sum").GetValue());
//			Debug.Log ("statusText.backUrlCaption " + statusText.backUrlCaption);

            if (statusText.backUrlCaption != null && !"".Equals(statusText.backUrlCaption))
            {
                statusViewExitButton.gameObject.GetComponent <Text> ().text = statusText.backUrlCaption;
            }
            else
            {
                statusViewExitButton.gameObject.GetComponent <Text> ().text = translations.Get(XsollaTranslations.BACK_TO_STORE);
            }
            statusViewExitButton.onClick.AddListener(delegate { OnClickExit(currentStatus, xsollaStatus.GetStatusData().GetInvoice(), xsollaStatus.GetStatusData().GetStatus(), null); });
        }
コード例 #3
0
        public override void InitScreen(XsollaTranslations translations, XsollaStatus xsollaStatus)
        {
            ResizeToParent();

            GameObject.FindObjectOfType <MainHeaderController>().setStateUserMenu(false);

            string           input      = translations.Get(XsollaTranslations.STATUS_PURCHASED_DESCRIPTION);
            XsollaStatusText statusText = xsollaStatus.GetStatusText();

            XsollaStatus.Group currentStatus = xsollaStatus.GetGroup();
            if (input != null)
            {
                string pattern = "{{.*?}}";
                Regex  regex   = new Regex(pattern);

                if ((statusText.GetPurchsaeValue() != "") && (statusText.Get("sum").GetValue() != ""))
                {
                    input = regex.Replace(input, statusText.GetPurchsaeValue(), 1);
                    input = regex.Replace(input, statusText.Get("sum").GetValue(), 1);
                }
                else
                {
                    input = "";
                }
            }
            else
            {
                input = "";
            }
            PrepareStatus(currentStatus, xsollaStatus.GetStatusText().GetState(), input, xsollaStatus.GetInvoice(), xsollaStatus);
            AddTitle(statusText.GetProjectString());
            if (currentStatus == XsollaStatus.Group.DONE)
            {
                AddStatus(translations.Get(XsollaTranslations.VIRTUALSTATUS_DONE_DESCRIPTIONS));
            }

            if (statusText.GetPurchsaeValue() != "")
            {
                AddElement(statusText.GetPurchsaeValue(), statusText.Get("sum").GetValue());
            }

            XsollaStatusText.StatusTextElement element = statusText.Get("out");
            if (element != null)
            {
                AddElement(statusText.Get("out").GetPref(), statusText.Get("out").GetValue());
            }
            element = statusText.Get("invoice");
            if (element != null)
            {
                AddElement(statusText.Get("invoice").GetPref(), statusText.Get("invoice").GetValue());
            }
            element = statusText.Get("details");
            if (element != null)
            {
                AddElement(statusText.Get("details").GetPref(), statusText.Get("details").GetValue());
            }
            element = statusText.Get("time");
            if (element != null)
            {
                AddElement(statusText.Get("time").GetPref(), statusText.Get("time").GetValue());
            }
            element = statusText.Get("merchant");
            if (element != null)
            {
                AddElement(statusText.Get("merchant").GetPref(), statusText.Get("merchant").GetValue());
            }
            element = statusText.Get("userWallet");
            if (element != null)
            {
                AddElement(statusText.Get("userWallet").GetPref(), statusText.Get("userWallet").GetValue());
            }
            AddLine();
            AddBigElement(statusText.Get("sum").GetPref(), statusText.Get("sum").GetValue());

            statusViewExitButton.gameObject.GetComponent <Text> ().text = translations.Get(XsollaTranslations.BACK_TO_STORE);
            statusViewExitButton.onClick.AddListener(delegate
            {
                //OnClickExit(currentStatus, xsollaStatus.GetStatusData().GetInvoice(), xsollaStatus.GetStatusData().GetStatus(), null);
                OnClickBack(currentStatus, xsollaStatus.GetStatusData().GetInvoice(), xsollaStatus.GetStatusData().GetStatus(), null);
            });
        }