public void InitScrollSprites(UXFactory source, UIScrollView scrollView, float scrollPosition, bool isScrollable) { if (scrollView != null && source != null) { string text = "Sprite" + scrollView.name; string text2 = text; string text3 = text; UIScrollView.Movement movement = scrollView.movement; if (movement != UIScrollView.Movement.Horizontal) { if (movement == UIScrollView.Movement.Vertical) { text2 += "ScrollUp"; text3 += "ScrollDown"; } } else { text2 += "ScrollLeft"; text3 += "ScrollRight"; } this.scrollBackSprite = source.GetOptionalElement <UXSprite>(text2); this.scrollForwardSprite = source.GetOptionalElement <UXSprite>(text3); this.UpdateScrollSprites(scrollView, scrollPosition, isScrollable); } }
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); }
public static JewelControl Create(UXFactory uxFactory, string jewelName, string parentNameSuffix, bool showCount, bool shouldHide) { bool flag = jewelName == "Clans"; string text = "ContainerJewel" + jewelName; UXElement optionalElement = uxFactory.GetOptionalElement <UXElement>(text); UXLabel optionalElement2 = uxFactory.GetOptionalElement <UXLabel>("LabelMessageCount" + jewelName); Animator a = null; if (optionalElement != null) { a = optionalElement.Root.GetComponent <Animator>(); } else { Service.Logger.WarnFormat("No UI element found: " + text, new object[0]); } UXSprite optionalElement3 = uxFactory.GetOptionalElement <UXSprite>("SpriteJewel" + jewelName); UXTexture optionalElement4 = uxFactory.GetOptionalElement <UXTexture>("TextureJewel" + jewelName); if (string.IsNullOrEmpty(parentNameSuffix)) { parentNameSuffix = jewelName; } UXLabel optionalElement5 = uxFactory.GetOptionalElement <UXLabel>("LabelTimer" + parentNameSuffix); UXSprite optionalElement6 = uxFactory.GetOptionalElement <UXSprite>("SpriteJewelGradient" + parentNameSuffix); if (optionalElement2 == null) { optionalElement2 = uxFactory.GetOptionalElement <UXLabel>("LabelMesageCount" + jewelName); } return((optionalElement != null && optionalElement2 != null) ? new JewelControl(optionalElement, optionalElement2, a, optionalElement3, optionalElement6, optionalElement4, optionalElement5, flag, showCount, shouldHide) : null); }
public BuildingTooltip(UXFactory factory, UXElement tooltipElement, string subElementPrefix, string parentName, BuildingTooltipKind kind) { this.TooltipElement = tooltipElement; this.Kind = kind; this.lastTimeLeft = 0f; this.lastTimeTotal = 0f; string name = UXUtils.FormatAppendedName(subElementPrefix + "LabelName", parentName); this.titleLabel = factory.GetElement <UXLabel>(name); string name2 = UXUtils.FormatAppendedName(subElementPrefix + "LabelLevel", parentName); this.levelLabel = factory.GetElement <UXLabel>(name2); string name3 = UXUtils.FormatAppendedName(subElementPrefix + "Label", parentName); this.bubbleLabel = factory.GetOptionalElement <UXLabel>(name3); string name4 = UXUtils.FormatAppendedName(subElementPrefix + "SpriteBkg", parentName); this.bubbleSprite = factory.GetOptionalElement <UXSprite>(name4); string name5 = UXUtils.FormatAppendedName(subElementPrefix + "PbarLabelTime", parentName); this.timeLabel = factory.GetOptionalElement <UXLabel>(name5); string name6 = UXUtils.FormatAppendedName(subElementPrefix + "Pbar", parentName); this.progressSlider = factory.GetOptionalElement <UXSlider>(name6); string name7 = UXUtils.FormatAppendedName(subElementPrefix + "SpriteImage", parentName); this.iconSprite = factory.GetOptionalElement <UXSprite>(name7); string name8 = UXUtils.FormatAppendedName(subElementPrefix + "Selected", parentName); this.selectedGroup = factory.GetOptionalElement <UXElement>(name8); this.SetupBGBasedOnKind(); }