Esempio n. 1
0
        public void SwitchBuyButton(ListItemSelectedEvent e, BuyableMarketItemNode item, [JoinByParentGroup] ICollection <UserItemNode> parentUserItem, [JoinAll] ScreenNode screen)
        {
            CheckMarketItemRestrictionsEvent eventInstance = new CheckMarketItemRestrictionsEvent();

            base.ScheduleEvent(eventInstance, item);
            if (eventInstance.RestrictedByRank || eventInstance.RestrictedByUpgradeLevel)
            {
                this.HideBuyButton(screen);
                this.HideXBuyButton(screen);
            }
            else
            {
                if (item.priceItem.IsBuyable)
                {
                    this.ShowBuyButton(item.priceItem, screen);
                }
                else
                {
                    this.HideBuyButton(screen);
                }
                if (item.xPriceItem.IsBuyable)
                {
                    this.ShowXBuyButton(item.xPriceItem, screen);
                }
                else
                {
                    this.HideXBuyButton(screen);
                }
            }
        }
        public void ShowUserRankRestrictionDescription(ListItemSelectedEvent e, UserRankRestrictionNode userRankRestriction, [JoinAll] SelfUserNode user, [JoinAll] ScreenNode screen, [JoinAll] SingleNode <RanksNamesComponent> ranksNames)
        {
            CheckMarketItemRestrictionsEvent eventInstance = new CheckMarketItemRestrictionsEvent();

            base.ScheduleEvent(eventInstance, userRankRestriction);
            if (eventInstance.RestrictedByRank)
            {
                this.ShowUserRankRestrictionDescription(screen, userRankRestriction.purchaseUserRankRestriction, ranksNames.component);
            }
        }
        public void ShowUserRankRestrictionIndicator(UpdateRankEvent e, SelfUserNode selfUser, [JoinAll, Combine] MarketItemWithUserRankRestrictionNode item)
        {
            CheckMarketItemRestrictionsEvent eventInstance = new CheckMarketItemRestrictionsEvent();

            base.ScheduleEvent(eventInstance, item);
            if (!eventInstance.RestrictedByRank)
            {
                item.userRankRestrictionBadgeGUI.SendMessageUpwards("OnItemEnabled", SendMessageOptions.DontRequireReceiver);
                item.userRankRestrictionBadgeGUI.gameObject.SetActive(false);
            }
        }
        public void ShowUserRankRestrictionIndicator(NodeAddedEvent e, [Combine] MarketItemWithUserRankRestrictionNode item, SelfUserNode selfUser)
        {
            CheckMarketItemRestrictionsEvent eventInstance = new CheckMarketItemRestrictionsEvent();

            base.ScheduleEvent(eventInstance, item);
            if (eventInstance.RestrictedByRank)
            {
                item.userRankRestrictionBadgeGUI.SetRank(item.purchaseUserRankRestriction.RestrictionValue);
                item.userRankRestrictionBadgeGUI.gameObject.SetActive(true);
                item.userRankRestrictionBadgeGUI.SendMessageUpwards("OnItemDisabled", SendMessageOptions.RequireReceiver);
            }
        }
        public void ShowUpgradeLevelRestrictionIndicator(NodeAddedEvent e, MarketItemWithUpgradeLevelRestrictionNode marketItem)
        {
            CheckMarketItemRestrictionsEvent eventInstance = new CheckMarketItemRestrictionsEvent();

            base.ScheduleEvent(eventInstance, marketItem);
            if (eventInstance.RestrictedByUpgradeLevel)
            {
                marketItem.upgradeLevelRestrictionBadgeGUI.RestrictionValue = (((marketItem.purchaseUpgradeLevelRestriction.RestrictionValue != 0) || !eventInstance.MountWillBeRestrictedByUpgradeLevel) ? marketItem.purchaseUpgradeLevelRestriction.RestrictionValue : marketItem.mountUpgradeLevelRestriction.RestrictionValue).ToString();
                marketItem.upgradeLevelRestrictionBadgeGUI.gameObject.SetActive(true);
                marketItem.upgradeLevelRestrictionBadgeGUI.SendMessageUpwards("OnItemDisabled", SendMessageOptions.RequireReceiver);
            }
        }
        public void ShowUpgradeLevelRestrictionIndicator(ItemUpgradeUpdatedEvent e, UpgradableItemNode parentItem, [JoinByParentGroup, Combine] MarketItemWithUpgradeLevelRestrictionNode marketItem)
        {
            CheckMarketItemRestrictionsEvent eventInstance = new CheckMarketItemRestrictionsEvent();

            base.ScheduleEvent(eventInstance, marketItem);
            if (!eventInstance.RestrictedByUpgradeLevel && (!eventInstance.RestrictedByRank && marketItem.upgradeLevelRestrictionBadgeGUI.gameObject.activeSelf))
            {
                marketItem.upgradeLevelRestrictionBadgeGUI.SendMessageUpwards("OnItemEnabled", SendMessageOptions.DontRequireReceiver);
                marketItem.upgradeLevelRestrictionBadgeGUI.SendMessageUpwards("Unlock", SendMessageOptions.DontRequireReceiver);
                marketItem.upgradeLevelRestrictionBadgeGUI.gameObject.SetActive(false);
                marketItem.upgradeLevelRestrictionBadgeGUI.SendMessageUpwards("MoveToItem", marketItem.upgradeLevelRestrictionBadgeGUI.gameObject, SendMessageOptions.DontRequireReceiver);
            }
        }
        public void ShowUpgradeLevelRestrictionDescription(ListItemSelectedEvent e, UpgradeLevelRestrictionNode upgradeLevelRestriction, [JoinAll] ScreenNode screen)
        {
            CheckMarketItemRestrictionsEvent eventInstance = new CheckMarketItemRestrictionsEvent();

            base.ScheduleEvent(eventInstance, upgradeLevelRestriction);
            if (eventInstance.RestrictedByUpgradeLevel)
            {
                if ((upgradeLevelRestriction.purchaseUpgradeLevelRestriction.RestrictionValue == 0) && eventInstance.MountWillBeRestrictedByUpgradeLevel)
                {
                    this.ShowUpgradeLevelRestrictionDescription(screen, upgradeLevelRestriction.mountUpgradeLevelRestriction.RestrictionValue);
                }
                else
                {
                    this.ShowUpgradeLevelRestrictionDescription(screen, upgradeLevelRestriction.purchaseUpgradeLevelRestriction.RestrictionValue);
                }
            }
        }
Esempio n. 8
0
 public void RestrictMarketItemByUpgradeLevel(CheckMarketItemRestrictionsEvent e, MarketItemWithUpgradeLevelRestrictionNode marketItem, [JoinByParentGroup] ICollection <UpgradableItemNode> upgradableItems)
 {