Exemplo n.º 1
0
 public void PriceChanged(PriceChangedEvent e, BuyableMarketItemNode item)
 {
     item.priceItem.OldPrice  = (int)e.OldPrice;
     item.priceItem.Price     = (int)e.Price;
     item.xPriceItem.OldPrice = (int)e.OldXPrice;
     item.xPriceItem.Price    = (int)e.XPrice;
 }
Exemplo n.º 2
0
        public void PriceChanged(PriceChangedEvent e, BuyableMarketItemNode item, [JoinAll] ScreenNode screen, [JoinByScreen] SingleNode <SelectedItemComponent> selectedItem)
        {
            bool flag = item.Entity.Equals(selectedItem.component.SelectedItem);

            base.Log.InfoFormat("PriceChanged {0} item={1} itemIsSelected={2}", e, item, flag);
            GameObject buyButton  = screen.garageItemsScreen.BuyButton;
            GameObject xBuyButton = screen.garageItemsScreen.XBuyButton;

            buyButton.GetComponent <PriceButtonComponent>().Price  = e.Price;
            xBuyButton.GetComponent <PriceButtonComponent>().Price = e.XPrice;
            if (flag)
            {
                SetPriceEvent event2;
                if (buyButton.activeSelf)
                {
                    event2 = new SetPriceEvent {
                        Price     = e.Price,
                        OldPrice  = e.OldPrice,
                        XPrice    = e.XPrice,
                        OldXPrice = e.OldXPrice
                    };
                    base.ScheduleEvent(event2, buyButton.GetComponent <EntityBehaviour>().Entity);
                }
                if (xBuyButton.activeSelf)
                {
                    event2 = new SetPriceEvent {
                        Price     = e.Price,
                        OldPrice  = e.OldPrice,
                        XPrice    = e.XPrice,
                        OldXPrice = e.OldXPrice
                    };
                    base.ScheduleEvent(event2, xBuyButton.GetComponent <EntityBehaviour>().Entity);
                }
            }
        }
Exemplo n.º 3
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 HideMountButton(ListItemSelectedEvent e, BuyableMarketItemNode item, [JoinAll] ScreenNode screenNode)
 {
     this.HideMountButton(screenNode);
 }