Esempio n. 1
0
 public AbstractUXList(UXFactory uxFactory, UXCamera uxCamera, AbstractUXListComponent component) : base(uxCamera, component.gameObject, null)
 {
     this.uxFactory       = uxFactory;
     this.component       = component;
     this.addedItems      = new List <UXElement>();
     this.addedItemOrders = new List <int>();
     this.templateItem    = null;
     this.OnDrag          = null;
     component.Init();
     this.RepositionItems();
 }
Esempio n. 2
0
 public SliderControl(UXFactory factory, string num, bool forStorage, bool forTurret, bool forUpgrade)
 {
     this.CurrentSlider = factory.GetElement <UXSlider>(this.GetFormattedName("pBarCurrent{0}", num, forStorage, forTurret));
     this.NextSlider    = factory.GetElement <UXSlider>(this.GetFormattedName("pBarNext{0}", num, forStorage, forTurret));
     this.Background    = factory.GetElement <UXSprite>(this.GetFormattedName("SpritepBarBkg{0}", num, forStorage, forTurret));
     this.DescLabel     = factory.GetElement <UXLabel>(this.GetFormattedName("LabelpBar{0}", num, forStorage, forTurret));
     this.CurrentLabel  = factory.GetElement <UXLabel>(this.GetFormattedName("LabelpBar{0}Current", num, forStorage, forTurret));
     this.NextLabel     = factory.GetElement <UXLabel>(this.GetFormattedName("LabelpBar{0}Next", num, forStorage, forTurret));
     if (!forUpgrade)
     {
         this.NextSlider.Visible = false;
         this.NextLabel.Visible  = false;
     }
 }
Esempio n. 3
0
        public static JewelControl Create(UXFactory uxFactory, string name)
        {
            bool      flag             = name == "Clans";
            UXElement optionalElement  = uxFactory.GetOptionalElement <UXElement>("ContainerJewel" + name);
            UXLabel   optionalElement2 = uxFactory.GetOptionalElement <UXLabel>("LabelMessageCount" + name);

            if (optionalElement2 == null)
            {
                optionalElement2 = uxFactory.GetOptionalElement <UXLabel>("LabelMesageCount" + name);
            }
            if (optionalElement != null && optionalElement2 != null)
            {
                return(new JewelControl(optionalElement, optionalElement2, flag));
            }
            return(null);
        }
Esempio n. 4
0
 public T FindElement <T>(string elementName) where T : UXElement
 {
     if (this.screens.Count == 0)
     {
         return(default(T));
     }
     for (int i = this.screens.Count - 1; i >= 0; i--)
     {
         if (this.screens[i].Screen is UXFactory)
         {
             UXFactory uXFactory = this.screens[i].Screen as UXFactory;
             if (uXFactory.HasElement <T>(elementName))
             {
                 return(uXFactory.GetElement <T>(elementName));
             }
         }
     }
     return(default(T));
 }
 public void InitScrollSprites(UXFactory source, UIScrollView scrollView, float scrollPosition, bool isScrollable)
 {
 }
Esempio n. 6
0
 public EventTickerView(UXFactory factory)
 {
     this.factory = factory;
     this.InitializeEventTickerElements();
 }
Esempio n. 7
0
 public BackButtonHelper(UXFactory uxFactory)
 {
     this.uxFactory = uxFactory;
     this.navigationVisibilityStack = new Stack <List <UXElement> >();
 }
Esempio n. 8
0
 public static void SetDeployableDecalVisibiliy(UXFactory uxFactory, bool visible)
 {
     uxFactory.GetElement <UXSprite>("SpriteHeroDecal").Visible = visible;
 }
 public PlanetSelectionDropDown(UXFactory uxFactory)
 {
     this.uxFactory = uxFactory;
     this.lang      = Service.Get <Lang>();
 }
Esempio n. 10
0
 public UXTable(UXFactory uxFactory, UXCamera uxCamera, UXTableComponent component) : base(uxFactory, uxCamera, component)
 {
     this.tableComponent = component;
 }
Esempio n. 11
0
 public UXGrid(UXFactory uxFactory, UXCamera uxCamera, UXGridComponent component) : base(uxFactory, uxCamera, component)
 {
     this.gridComponent = component;
 }
Esempio n. 12
0
 public static JewelControl CreateSticker(UXFactory uxFactory, string name, string parentName)
 {
     return(JewelControl.Create(uxFactory, name, parentName, true, false));
 }
Esempio n. 13
0
 public static JewelControl Create(UXFactory uxFactory, string name)
 {
     return(JewelControl.Create(uxFactory, name, null, true, true));
 }
 public void InitScrollArrows(UXFactory source)
 {
     this.scrollSpriteHandler.InitScrollSprites(source, this.NGUIScrollView, this.GetCurrentScrollPosition(false), this.IsScrollable());
     Service.Get <EventManager>().UnregisterObserver(this, EventId.AllUXElementsCreated);
 }
Esempio n. 15
0
        public EatResponse OnEvent(EventId id, object cookie)
        {
            switch (id)
            {
            case EventId.ContractAdded:
            {
                ContractEventData contractEventData = (ContractEventData)cookie;
                if (contractEventData.Contract.ProductUid.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                {
                    this.CountEvent();
                }
                return(EatResponse.NotEaten);
            }

            case EventId.ContractBacklogUpdated:
IL_18:
                switch (id)
                {
                case EventId.ScreenClosing:
                {
                    UXFactory uXFactory = cookie as UXFactory;
                    string    text      = (uXFactory != null && !(uXFactory.Root == null)) ? uXFactory.Root.name : string.Empty;
                    if (text.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                    {
                        this.CountEvent();
                    }
                    return(EatResponse.NotEaten);
                }

                case EventId.ScreenClosed:
                case EventId.ScreenOverlayClosing:
IL_34:
                    if (id != EventId.BuildingPurchaseSuccess)
                    {
                        if (id != EventId.BuildingSelected)
                        {
                            if (id != EventId.DroidPurchaseAnimationComplete)
                            {
                                if (id != EventId.EntityKilled)
                                {
                                    if (id != EventId.TroopDeployed)
                                    {
                                        if (id == EventId.TroopDonationTrackRewardReceived)
                                        {
                                            goto IL_3C0;
                                        }
                                        if (id == EventId.SpecialAttackDeployed)
                                        {
                                            SpecialAttack specialAttack = (SpecialAttack)cookie;
                                            if (specialAttack.VO.Uid.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                                            {
                                                this.CountEvent();
                                            }
                                            return(EatResponse.NotEaten);
                                        }
                                        if (id == EventId.ButtonClicked)
                                        {
                                            string text2 = (string)cookie;
                                            if (text2.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                                            {
                                                this.CountEvent();
                                            }
                                            return(EatResponse.NotEaten);
                                        }
                                        if (id == EventId.ContractCompletedForStoryAction)
                                        {
                                            ContractTO contractTO = (ContractTO)cookie;
                                            if (contractTO.Uid.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                                            {
                                                this.CountEvent();
                                            }
                                            return(EatResponse.NotEaten);
                                        }
                                        if (id == EventId.InventoryResourceUpdated)
                                        {
                                            string text3 = (string)cookie;
                                            if (text3.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                                            {
                                                this.CountEvent();
                                            }
                                            return(EatResponse.NotEaten);
                                        }
                                        if (id != EventId.HeroDeployed && id != EventId.ChampionDeployed)
                                        {
                                            if (id != EventId.EquipmentUnlocked)
                                            {
                                                return(EatResponse.NotEaten);
                                            }
                                            goto IL_3C0;
                                        }
                                    }
                                    Entity             entity         = (Entity)cookie;
                                    TroopComponent     troopComponent = entity.Get <TroopComponent>();
                                    ITroopDeployableVO troopType      = troopComponent.TroopType;
                                    if (troopType.Uid.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                                    {
                                        this.CountEvent();
                                    }
                                    return(EatResponse.NotEaten);
                                }
                                Entity entity2 = (Entity)cookie;
                                string text4   = string.Empty;
                                string a       = this.prepareArgs[1];
                                if (a == "troopKilled")
                                {
                                    TroopComponent troopComponent2 = entity2.Get <TroopComponent>();
                                    if (troopComponent2 == null)
                                    {
                                        return(EatResponse.NotEaten);
                                    }
                                    text4 = troopComponent2.TroopType.Uid;
                                }
                                else if (a == "buildingKilled")
                                {
                                    BuildingComponent buildingComponent = entity2.Get <BuildingComponent>();
                                    if (buildingComponent == null)
                                    {
                                        return(EatResponse.NotEaten);
                                    }
                                    BuildingTypeVO buildingType = buildingComponent.BuildingType;
                                    text4 = buildingType.Uid;
                                }
                                if (text4.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                                {
                                    this.CountEvent();
                                }
                                return(EatResponse.NotEaten);
                            }
IL_3C0:
                            this.CountEvent();
                            return(EatResponse.NotEaten);
                        }
                        Entity            entity3            = (Entity)cookie;
                        BuildingComponent buildingComponent2 = entity3.Get <BuildingComponent>();
                        if (buildingComponent2 == null)
                        {
                            return(EatResponse.NotEaten);
                        }
                        BuildingTypeVO buildingType2 = buildingComponent2.BuildingType;
                        if (buildingType2.Uid.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                        {
                            this.CountEvent();
                        }
                        return(EatResponse.NotEaten);
                    }
                    else
                    {
                        Entity            entity4            = (Entity)cookie;
                        BuildingComponent buildingComponent3 = entity4.Get <BuildingComponent>();
                        if (buildingComponent3 == null)
                        {
                            return(EatResponse.NotEaten);
                        }
                        BuildingTypeVO buildingType3 = buildingComponent3.BuildingType;
                        if (buildingType3.Uid.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                        {
                            this.CountEvent();
                        }
                        return(EatResponse.NotEaten);
                    }
                    break;

                case EventId.ScreenLoaded:
                {
                    UXFactory uXFactory2 = cookie as UXFactory;
                    string    name       = uXFactory2.Root.name;
                    if (name.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                    {
                        this.CountEvent();
                    }
                    return(EatResponse.NotEaten);
                }
                }
                goto IL_34;

            case EventId.ContractStarted:
            {
                ContractEventData contractEventData2 = (ContractEventData)cookie;
                if (contractEventData2.Contract.ProductUid.Equals(this.eventData[0], StringComparison.InvariantCultureIgnoreCase))
                {
                    this.CountEvent();
                }
                return(EatResponse.NotEaten);
            }
            }
            goto IL_18;
        }
 public FactionSelectorDropDown(UXFactory uxFactory)
 {
     this.uxFactory = uxFactory;
 }
        public EatResponse OnEvent(EventId id, object cookie)
        {
            if (id <= EventId.ButtonClicked)
            {
                if (id <= EventId.EntityKilled)
                {
                    if (id <= EventId.BuildingSelected)
                    {
                        if (id != EventId.BuildingPurchaseSuccess)
                        {
                            if (id != EventId.BuildingSelected)
                            {
                                return(EatResponse.NotEaten);
                            }
                            Entity            entity            = (Entity)cookie;
                            BuildingComponent buildingComponent = entity.Get <BuildingComponent>();
                            if (buildingComponent == null)
                            {
                                return(EatResponse.NotEaten);
                            }
                            BuildingTypeVO buildingType = buildingComponent.BuildingType;
                            if (buildingType.Uid.Equals(this.eventData[0], 5))
                            {
                                this.CountEvent();
                                return(EatResponse.NotEaten);
                            }
                            return(EatResponse.NotEaten);
                        }
                        else
                        {
                            Entity            entity2            = (Entity)cookie;
                            BuildingComponent buildingComponent2 = entity2.Get <BuildingComponent>();
                            if (buildingComponent2 == null)
                            {
                                return(EatResponse.NotEaten);
                            }
                            BuildingTypeVO buildingType2 = buildingComponent2.BuildingType;
                            if (buildingType2.Uid.Equals(this.eventData[0], 5))
                            {
                                this.CountEvent();
                                return(EatResponse.NotEaten);
                            }
                            return(EatResponse.NotEaten);
                        }
                    }
                    else
                    {
                        if (id == EventId.DroidPurchaseAnimationComplete)
                        {
                            goto IL_3D4;
                        }
                        if (id != EventId.EntityKilled)
                        {
                            return(EatResponse.NotEaten);
                        }
                        Entity entity3 = (Entity)cookie;
                        string text    = "";
                        string text2   = this.prepareArgs[1];
                        if (text2 == "troopKilled")
                        {
                            TroopComponent troopComponent = entity3.Get <TroopComponent>();
                            if (troopComponent == null)
                            {
                                return(EatResponse.NotEaten);
                            }
                            text = troopComponent.TroopType.Uid;
                        }
                        else if (text2 == "buildingKilled")
                        {
                            BuildingComponent buildingComponent3 = entity3.Get <BuildingComponent>();
                            if (buildingComponent3 == null)
                            {
                                return(EatResponse.NotEaten);
                            }
                            BuildingTypeVO buildingType3 = buildingComponent3.BuildingType;
                            text = buildingType3.Uid;
                        }
                        if (text.Equals(this.eventData[0], 5))
                        {
                            this.CountEvent();
                            return(EatResponse.NotEaten);
                        }
                        return(EatResponse.NotEaten);
                    }
                }
                else if (id <= EventId.TroopDonationTrackRewardReceived)
                {
                    if (id != EventId.TroopDeployed)
                    {
                        if (id != EventId.TroopDonationTrackRewardReceived)
                        {
                            return(EatResponse.NotEaten);
                        }
                        goto IL_3D4;
                    }
                }
                else if (id != EventId.SpecialAttackDeployed)
                {
                    if (id != EventId.ButtonClicked)
                    {
                        return(EatResponse.NotEaten);
                    }
                    string text3 = (string)cookie;
                    if (text3.Equals(this.eventData[0], 5))
                    {
                        this.CountEvent();
                        return(EatResponse.NotEaten);
                    }
                    return(EatResponse.NotEaten);
                }
                else
                {
                    SpecialAttack specialAttack = (SpecialAttack)cookie;
                    if (specialAttack.VO.Uid.Equals(this.eventData[0], 5))
                    {
                        this.CountEvent();
                        return(EatResponse.NotEaten);
                    }
                    return(EatResponse.NotEaten);
                }
            }
            else if (id <= EventId.InventoryResourceUpdated)
            {
                if (id <= EventId.ContractStarted)
                {
                    if (id != EventId.ContractAdded)
                    {
                        if (id != EventId.ContractStarted)
                        {
                            return(EatResponse.NotEaten);
                        }
                        ContractEventData contractEventData = (ContractEventData)cookie;
                        if (contractEventData.Contract.ProductUid.Equals(this.eventData[0], 5))
                        {
                            this.CountEvent();
                            return(EatResponse.NotEaten);
                        }
                        return(EatResponse.NotEaten);
                    }
                    else
                    {
                        ContractEventData contractEventData2 = (ContractEventData)cookie;
                        if (contractEventData2.Contract.ProductUid.Equals(this.eventData[0], 5))
                        {
                            this.CountEvent();
                            return(EatResponse.NotEaten);
                        }
                        return(EatResponse.NotEaten);
                    }
                }
                else if (id != EventId.ContractCompletedForStoryAction)
                {
                    if (id != EventId.InventoryResourceUpdated)
                    {
                        return(EatResponse.NotEaten);
                    }
                    string text4 = (string)cookie;
                    if (text4.Equals(this.eventData[0], 5))
                    {
                        this.CountEvent();
                        return(EatResponse.NotEaten);
                    }
                    return(EatResponse.NotEaten);
                }
                else
                {
                    ContractTO contractTO = (ContractTO)cookie;
                    if (contractTO.Uid.Equals(this.eventData[0], 5))
                    {
                        this.CountEvent();
                        return(EatResponse.NotEaten);
                    }
                    return(EatResponse.NotEaten);
                }
            }
            else if (id <= EventId.ScreenLoaded)
            {
                if (id != EventId.ScreenClosing)
                {
                    if (id != EventId.ScreenLoaded)
                    {
                        return(EatResponse.NotEaten);
                    }
                    UXFactory uXFactory = cookie as UXFactory;
                    string    name      = uXFactory.Root.name;
                    if (name.Equals(this.eventData[0], 5))
                    {
                        this.CountEvent();
                        return(EatResponse.NotEaten);
                    }
                    return(EatResponse.NotEaten);
                }
                else
                {
                    UXFactory uXFactory2 = cookie as UXFactory;
                    string    text5      = (uXFactory2 == null || uXFactory2.Root == null) ? string.Empty : uXFactory2.Root.name;
                    if (text5.Equals(this.eventData[0], 5))
                    {
                        this.CountEvent();
                        return(EatResponse.NotEaten);
                    }
                    return(EatResponse.NotEaten);
                }
            }
            else if (id != EventId.HeroDeployed && id != EventId.ChampionDeployed)
            {
                if (id != EventId.EquipmentUnlocked)
                {
                    return(EatResponse.NotEaten);
                }
                goto IL_3D4;
            }
            Entity             entity4         = (Entity)cookie;
            TroopComponent     troopComponent2 = entity4.Get <TroopComponent>();
            ITroopDeployableVO troopType       = troopComponent2.TroopType;

            if (troopType.Uid.Equals(this.eventData[0], 5))
            {
                this.CountEvent();
                return(EatResponse.NotEaten);
            }
            return(EatResponse.NotEaten);

IL_3D4:
            this.CountEvent();
            return(EatResponse.NotEaten);
        }