// Token: 0x06001439 RID: 5177 RVA: 0x00074A84 File Offset: 0x00072C84
 public void SetLoadoutItem(global::LoadoutSlotType loadoutSlotType, IUnityItem item)
 {
     if (item == null)
     {
         this.ResetSlot(loadoutSlotType);
     }
     else
     {
         InventoryItem inventoryItem;
         if (Singleton <InventoryManager> .Instance.TryGetInventoryItem(item.View.ID, out inventoryItem) && inventoryItem.IsValid)
         {
             if (item.View.ItemType == UberstrikeItemType.Weapon)
             {
                 this.RemoveDuplicateWeaponClass(inventoryItem);
             }
             this.Loadout.SetSlot(loadoutSlotType, item);
         }
         else if (item.View != null)
         {
             BuyPanelGUI buyPanelGUI = PanelManager.Instance.OpenPanel(PanelType.BuyItem) as BuyPanelGUI;
             if (buyPanelGUI)
             {
                 buyPanelGUI.SetItem(item, BuyingLocationType.Shop, BuyingRecommendationType.None, false);
             }
         }
         UnityRuntime.StartRoutine(Singleton <PlayerDataManager> .Instance.StartSetLoadout());
         this.UpdateArmor();
     }
 }
예제 #2
0
 // Token: 0x06000C95 RID: 3221 RVA: 0x00054E1C File Offset: 0x0005301C
 public static void BuyItem(IUnityItem item, ItemPrice price, BuyingLocationType buyingLocation = BuyingLocationType.Shop, BuyingRecommendationType recommendation = BuyingRecommendationType.Manual, bool autoEquip = false)
 {
     if (item.View.IsConsumable)
     {
         int id = item.View.ID;
         ShopWebServiceClient.BuyPack(id, PlayerDataManager.AuthToken, price.PackType, price.Currency, item.View.ItemType, buyingLocation, recommendation, delegate(int result)
         {
             BuyPanelGUI.HandleBuyItem(item, (BuyItemResult)result, autoEquip);
         }, delegate(Exception ex)
         {
             BuyPanelGUI._isBuyingItem = false;
             PanelManager.Instance.ClosePanel(PanelType.BuyItem);
         });
     }
     else
     {
         int id2 = item.View.ID;
         ShopWebServiceClient.BuyItem(id2, PlayerDataManager.AuthToken, price.Currency, price.Duration, item.View.ItemType, buyingLocation, recommendation, delegate(int result)
         {
             BuyPanelGUI.HandleBuyItem(item, (BuyItemResult)result, autoEquip);
         }, delegate(Exception ex)
         {
             BuyPanelGUI._isBuyingItem = false;
             PanelManager.Instance.ClosePanel(PanelType.BuyItem);
         });
     }
 }
예제 #3
0
    // Token: 0x06000AD4 RID: 2772 RVA: 0x00045CB8 File Offset: 0x00043EB8
    private void DrawNoClanMessage(Rect rect)
    {
        Rect position = new Rect((rect.width - 480f) / 2f, (rect.height - 240f) / 2f, 480f, 240f);

        GUI.BeginGroup(position, BlueStonez.window_standard_grey38);
        GUI.Label(new Rect(0f, 0f, position.width, 56f), LocalizedStrings.ClansCaps, BlueStonez.tab_strip);
        GUI.Box(new Rect(position.width / 2f - 82f, 60f, 48f, 48f), new GUIContent(this._level4Icon), BlueStonez.item_slot_large);
        if (Singleton <ClanDataManager> .Instance.HaveLevel)
        {
            GUI.Box(new Rect(position.width / 2f - 82f, 60f, 48f, 48f), new GUIContent(UberstrikeIcons.LevelMastered));
        }
        GUI.Box(new Rect(position.width / 2f - 24f, 60f, 48f, 48f), new GUIContent(this._licenseIcon), BlueStonez.item_slot_large);
        if (Singleton <ClanDataManager> .Instance.HaveLicense)
        {
            GUI.Box(new Rect(position.width / 2f - 24f, 60f, 48f, 48f), new GUIContent(UberstrikeIcons.LevelMastered));
        }
        GUI.Box(new Rect(position.width / 2f + 34f, 60f, 48f, 48f), new GUIContent(this._friendsIcon), BlueStonez.item_slot_large);
        if (Singleton <ClanDataManager> .Instance.HaveFriends)
        {
            GUI.Box(new Rect(position.width / 2f + 34f, 60f, 48f, 48f), new GUIContent(UberstrikeIcons.LevelMastered));
        }
        if (!Singleton <ClanDataManager> .Instance.HaveLevel || !Singleton <ClanDataManager> .Instance.HaveLicense || !Singleton <ClanDataManager> .Instance.HaveFriends)
        {
            bool enabled = GUI.enabled;
            GUI.Label(new Rect(position.width / 2f - 90f, 110f, 210f, 14f), LocalizedStrings.ToCreateAClanYouStillNeedTo, BlueStonez.label_interparkbold_11pt_left);
            GUI.enabled = (enabled && !Singleton <ClanDataManager> .Instance.HaveLevel);
            GUI.Label(new Rect(position.width / 2f - 90f, 124f, 200f, 14f), LocalizedStrings.ReachLevelFour + ((!Singleton <ClanDataManager> .Instance.HaveLevel) ? string.Empty : string.Format(" ({0})", LocalizedStrings.Done)), BlueStonez.label_interparkbold_11pt_left);
            GUI.enabled = (enabled && !Singleton <ClanDataManager> .Instance.HaveFriends);
            GUI.Label(new Rect(position.width / 2f - 90f, 138f, 200f, 14f), LocalizedStrings.HaveAtLeastOneFriend + ((!Singleton <ClanDataManager> .Instance.HaveFriends) ? string.Empty : string.Format(" ({0})", LocalizedStrings.Done)), BlueStonez.label_interparkbold_11pt_left);
            GUI.enabled = (enabled && !Singleton <ClanDataManager> .Instance.HaveLicense);
            GUI.Label(new Rect(position.width / 2f - 90f, 152f, 240f, 14f), LocalizedStrings.BuyAClanLicense + ((!Singleton <ClanDataManager> .Instance.HaveLicense) ? string.Empty : string.Format(" ({0})", LocalizedStrings.Done)), BlueStonez.label_interparkbold_11pt_left);
            GUI.enabled = enabled;
            if (!Singleton <ClanDataManager> .Instance.HaveLicense && GUITools.Button(new Rect((position.width - 200f) / 2f, 170f, 200f, 22f), new GUIContent(LocalizedStrings.BuyAClanLicense), BlueStonez.buttondark_medium))
            {
                IUnityItem itemInShop = Singleton <ItemManager> .Instance.GetItemInShop(1234);

                if (itemInShop != null && itemInShop.View != null)
                {
                    BuyPanelGUI buyPanelGUI = PanelManager.Instance.OpenPanel(PanelType.BuyItem) as BuyPanelGUI;
                    if (buyPanelGUI)
                    {
                        buyPanelGUI.SetItem(itemInShop, BuyingLocationType.Shop, BuyingRecommendationType.None, false);
                    }
                }
            }
        }
        else
        {
            GUI.Label(new Rect(0f, 140f, position.width, 14f), LocalizedStrings.CreateAClanAndInviteYourFriends, BlueStonez.label_interparkbold_11pt);
        }
        GUITools.PushGUIState();
        GUI.enabled &= (Singleton <ClanDataManager> .Instance.HaveLevel && Singleton <ClanDataManager> .Instance.HaveLicense && Singleton <ClanDataManager> .Instance.HaveFriends);
        if (GUITools.Button(new Rect((position.width - 200f) / 2f, 200f, 200f, 30f), new GUIContent(LocalizedStrings.CreateAClanCaps), BlueStonez.button_green))
        {
            this.createAClan = true;
        }
        GUITools.PopGUIState();
        GUI.EndGroup();
    }
예제 #4
0
 // Token: 0x06000E05 RID: 3589 RVA: 0x00060A34 File Offset: 0x0005EC34
 protected void DrawBuyButton(Rect position, string text, ShopArea area = ShopArea.Shop)
 {
     GUI.contentColor = ColorScheme.UberStrikeYellow;
     if (GUITools.Button(position, new GUIContent(text), BlueStonez.buttondark_medium))
     {
         BuyPanelGUI buyPanelGUI = PanelManager.Instance.OpenPanel(PanelType.BuyItem) as BuyPanelGUI;
         if (buyPanelGUI)
         {
             buyPanelGUI.SetItem(this.Item, this._location, this._recommendation, false);
         }
     }
     GUI.contentColor = Color.white;
 }
예제 #5
0
    // Token: 0x06000C93 RID: 3219 RVA: 0x00054CA0 File Offset: 0x00052EA0
    private void DrawBuyButton(Rect rect)
    {
        GUI.BeginGroup(rect);
        Rect position = new Rect((rect.width - 120f) / 2f, (rect.height - 30f) / 2f, 120f, 30f);

        GUITools.PushGUIState();
        GUI.enabled = (!BuyPanelGUI._isBuyingItem && this._price.SelectedPriceOption != null);
        if (GUI.Button(position, GUIContent.none, BlueStonez.buttongold_large) && !BuyPanelGUI._isBuyingItem)
        {
            BuyPanelGUI._isBuyingItem = true;
            BuyPanelGUI.BuyItem(this._item, this._price.SelectedPriceOption, this._buyingLocation, this._buyingRecommendation, this._autoEquip);
        }
        GUITools.PopGUIState();
        Rect position2 = new Rect((rect.width - 120f) / 2f, (rect.height - 20f) / 2f, 120f, 20f);

        GUI.Label(position2, new GUIContent(this._priceTag, this._priceIcon), BlueStonez.label_interparkbold_13pt_black);
        GUI.EndGroup();
    }
예제 #6
0
    // Token: 0x06000E02 RID: 3586 RVA: 0x000608F4 File Offset: 0x0005EAF4
    protected void DrawEquipButton(Rect rect, string content)
    {
        if ((this.Item.View.ItemType == UberstrikeItemType.Weapon || this.Item.View.ItemType == UberstrikeItemType.Gear || this.Item.View.ItemType == UberstrikeItemType.QuickUse) && GUI.Button(rect, new GUIContent(content), BlueStonez.buttondark_medium) && this.Item != null)
        {
            switch (this.Item.View.ItemType)
            {
            case UberstrikeItemType.Weapon:
                global::EventHandler.Global.Fire(new ShopEvents.SelectLoadoutArea
                {
                    Area = LoadoutArea.Weapons
                });
                break;

            case UberstrikeItemType.Gear:
                global::EventHandler.Global.Fire(new ShopEvents.SelectLoadoutArea
                {
                    Area = LoadoutArea.Gear
                });
                break;

            case UberstrikeItemType.QuickUse:
                global::EventHandler.Global.Fire(new ShopEvents.SelectLoadoutArea
                {
                    Area = LoadoutArea.QuickItems
                });
                break;
            }
            if (!Singleton <InventoryManager> .Instance.EquipItem(this.Item))
            {
                BuyPanelGUI buyPanelGUI = PanelManager.Instance.OpenPanel(PanelType.BuyItem) as BuyPanelGUI;
                if (buyPanelGUI)
                {
                    buyPanelGUI.SetItem(this.Item, this._location, this._recommendation, false);
                }
            }
        }
    }