示例#1
0
 // Token: 0x06000D96 RID: 3478 RVA: 0x0005EADC File Offset: 0x0005CCDC
 public ItemBundlePopup(BundleUnityView bundleUnityView)
 {
     this._bundleUnityView = bundleUnityView;
     this.Title            = bundleUnityView.BundleView.Name;
     this.Text             = bundleUnityView.BundleView.Description;
     this.Width            = 388;
     this.Height           = 560 - GlobalUIRibbon.Instance.Height() - 10;
     this._lotteryItemGrid = new ShopItemGrid(bundleUnityView.BundleView.BundleItemViews, 0, 0);
 }
示例#2
0
    // Token: 0x06000D97 RID: 3479 RVA: 0x0005EB54 File Offset: 0x0005CD54
    protected override void DrawPlayGUI(Rect rect)
    {
        GUI.color = ColorScheme.HudTeamBlue;
        float num = BlueStonez.label_interparkbold_18pt.CalcSize(new GUIContent(this.Title)).x * 2.5f;

        GUI.DrawTexture(new Rect((rect.width - num) * 0.5f, -29f, num, 100f), HudTextures.WhiteBlur128);
        GUI.color = Color.white;
        GUITools.OutlineLabel(new Rect(0f, 10f, rect.width, 30f), this.Title, BlueStonez.label_interparkbold_18pt, 1, Color.white, ColorScheme.GuiTeamBlue.SetAlpha(0.5f));
        GUI.Label(new Rect(30f, 35f, rect.width - 60f, 40f), this.Text, BlueStonez.label_interparkbold_13pt);
        int num2 = 288;
        int num3 = (this.Width - num2 - 6) / 2;
        int num4 = 323;

        GUI.BeginGroup(new Rect((float)num3, 75f, (float)num2, (float)num4), BlueStonez.item_slot_large);
        Rect rect2 = new Rect((float)((num2 - 282) / 2), (float)((num4 - 317) / 2), 282f, 317f);

        this._bundleUnityView.Image.Draw(rect2, false);
        this._lotteryItemGrid.Show = (rect2.Contains(Event.current.mousePosition) || ApplicationDataManager.IsMobile);
        this._lotteryItemGrid.Draw(new Rect(0f, 0f, (float)num2, (float)num4));
        GUI.EndGroup();
        if (GUI.Button(new Rect(rect.width * 0.5f - 95f, rect.height - 42f, 20f, 20f), GUIContent.none, BlueStonez.button_left))
        {
            AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.ButtonClick, 0UL, 1f, 1f);

            PopupSystem.HideMessage(this);
            BundleUnityView previousItem = Singleton <BundleManager> .Instance.GetPreviousItem(this._bundleUnityView);

            if (previousItem != null)
            {
                PopupSystem.Show(new ItemBundlePopup(previousItem));
            }
        }
        if (GUI.Button(new Rect(rect.width * 0.5f + 75f, rect.height - 42f, 20f, 20f), GUIContent.none, BlueStonez.button_right))
        {
            AutoMonoBehaviour <SfxManager> .Instance.Play2dAudioClip(GameAudio.ButtonClick, 0UL, 1f, 1f);

            PopupSystem.HideMessage(this);
            BundleUnityView nextItem = Singleton <BundleManager> .Instance.GetNextItem(this._bundleUnityView);

            if (nextItem != null)
            {
                PopupSystem.Show(new ItemBundlePopup(nextItem));
            }
        }
        GUI.enabled = (!this._bundleUnityView.IsOwned && this._bundleUnityView.IsValid && GUITools.SaveClickIn(1f));
        this.BuyButton(rect, this._bundleUnityView);
        GUI.enabled = true;
    }
 // Token: 0x06000BC5 RID: 3013 RVA: 0x0004D328 File Offset: 0x0004B528
 private void BuyButton(Rect position, BundleUnityView bundleUnityView)
 {
     if (GUI.Button(new Rect(81f, 51f, position.width - 110f, 20f), new GUIContent(bundleUnityView.CurrencySymbol + bundleUnityView.Price, "Buy the " + bundleUnityView.BundleView.Name + " pack."), BlueStonez.buttongold_medium))
     {
         GUITools.Clicked();
         if (ApplicationDataManager.Channel == ChannelType.Steam)
         {
             Singleton <BundleManager> .Instance.BuyBundle(bundleUnityView);
         }
         else
         {
             PopupSystem.ClearAll();
             PopupSystem.ShowMessage("Purchase Failed", "Sorry, only Steam players can purchase credit bundles.", PopupSystem.AlertType.OK);
         }
     }
 }
    // Token: 0x06001298 RID: 4760 RVA: 0x0006EB94 File Offset: 0x0006CD94
    public BundleUnityView GetPreviousItem(BundleUnityView currentItem)
    {
        List <BundleUnityView> list = new List <BundleUnityView>(this.AllItemBundles);

        if (list.Count <= 0)
        {
            return(currentItem);
        }
        int num = list.FindIndex((BundleUnityView i) => i == currentItem);

        if (num < 0)
        {
            return(list[UnityEngine.Random.Range(0, list.Count)]);
        }
        int index = (num - 1 + list.Count) % list.Count;

        return(list[index]);
    }
    // Token: 0x06000BC4 RID: 3012 RVA: 0x0004D1E8 File Offset: 0x0004B3E8
    private void DrawPackSlot(Rect position, BundleUnityView bundleUnityView)
    {
        int  id   = bundleUnityView.BundleView.Id;
        bool flag = position.Contains(Event.current.mousePosition);

        if (!this._alpha.ContainsKey(id))
        {
            this._alpha[id] = 0f;
        }
        this._alpha[id] = Mathf.Lerp(this._alpha[id], (float)((!flag) ? 0 : 1), Time.deltaTime * (float)((!flag) ? 10 : 3));
        GUI.BeginGroup(position);
        GUI.Label(new Rect(2f, 2f, position.width - 4f, 79f), GUIContent.none, BlueStonez.gray_background);
        bundleUnityView.Icon.Draw(new Rect(4f, 4f, 75f, 75f), false);
        GUI.Label(new Rect(81f, 0f, position.width - 80f, 44f), bundleUnityView.BundleView.Name, BlueStonez.label_interparkbold_13pt_left);
        GUI.enabled = GUITools.SaveClickIn(1f);
        this.BuyButton(position, bundleUnityView);
        GUI.enabled = true;
        GUI.EndGroup();
    }
    // Token: 0x06001295 RID: 4757 RVA: 0x0006E9EC File Offset: 0x0006CBEC
    public void BuyBundle(BundleUnityView bundle)
    {
        Debug.Log("Trying to buy bundle with id id: " + bundle.BundleView.Id.ToString());
        int    id        = bundle.BundleView.Id;
        string steamId   = PlayerDataManager.SteamId;
        string authToken = PlayerDataManager.AuthToken;

        ShopWebServiceClient.BuyBundleSteam(id, steamId, authToken, delegate(bool success)
        {
            if (!success)
            {
                Debug.Log("Starting steam payment failed! (Handled WS Error)");
                PopupSystem.ClearAll();
                PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
            }
        }, delegate(Exception ex)
        {
            Debug.Log(ex.Message);
            PopupSystem.ClearAll();
            PopupSystem.ShowMessage("Purchase Failed", "Sorry, there was a problem processing your payment. Please visit support.uberstrike.com for help.", PopupSystem.AlertType.OK);
        });
        this._appStorePopup = (PopupSystem.ShowMessage("In App Purchase", "Purchasing, please wait...", PopupSystem.AlertType.None) as BasePopupDialog);
        UnityRuntime.StartRoutine(this.StartCancelDialogTimer());
    }
示例#7
0
 // Token: 0x06000D98 RID: 3480 RVA: 0x00003C87 File Offset: 0x00001E87
 private void BuyButton(Rect position, BundleUnityView bundleUnityView)
 {
 }