public WarshipOverviewEnablingSystem(Contexts contexts, WarshipsUiStorage warshipsUiStorage, LobbyLayoutSwitcher lobbyLayoutSwitcher, LobbyEcsController lobbyEcsController, TextTooltip textTooltip) : base(contexts.lobbyUi) { lobbyUiContext = contexts.lobbyUi; this.warshipsUiStorage = warshipsUiStorage; this.lobbyEcsController = lobbyEcsController; this.textTooltip = textTooltip; this.lobbyLayoutSwitcher = lobbyLayoutSwitcher; }
/// <summary> /// creates the name label and adds a tooltip if present /// </summary> /// <returns>The name label.</returns> /// <param name="table">Table.</param> /// <param name="skin">Skin.</param> protected Label createNameLabel(Table table, Skin skin) { var label = new Label(_name, skin); label.setTouchable(Touchable.Enabled); var tooltipAttribute = getFieldOrPropertyAttribute <TooltipAttribute>(); if (tooltipAttribute != null) { var tooltip = new TextTooltip(tooltipAttribute.tooltip, label, skin); table.getStage().addElement(tooltip); } return(label); }
private void Awake() { lobbyUiStorage = FindObjectOfType <LobbyUiStorage>() ?? throw new NullReferenceException(nameof(LobbyUiStorage)); uiLayersStorage = FindObjectOfType <UiLayersStorage>() ?? throw new NullReferenceException(nameof(UiLayersStorage)); shopUiStorage = FindObjectOfType <ShopUiStorage>() ?? throw new NullReferenceException(nameof(ShopUiStorage)); movingAwardsUiStorage = FindObjectOfType <MovingAwardsUiElementsStorage>() ?? throw new NullReferenceException(nameof(MovingAwardsUiElementsStorage)); warshipsUiStorage = FindObjectOfType <WarshipsUiStorage>() ?? throw new NullReferenceException(nameof(WarshipsUiStorage)); shopUiSpawner = FindObjectOfType <ShopUiSpawner>() ?? throw new NullReferenceException(nameof(shopUiSpawner)); lobbySceneSwitcher = FindObjectOfType <LobbySceneSwitcher>() ?? throw new NullReferenceException(nameof(lobbySceneSwitcher)); inGameCurrencyPaymaster = FindObjectOfType <InGameCurrencyPaymaster>() ?? throw new NullReferenceException(nameof(inGameCurrencyPaymaster)); textTooltip = FindObjectOfType <TextTooltip>() ?? throw new NullReferenceException(nameof(TextTooltip)); }
/// <summary> /// creates the name label and adds a tooltip if present /// </summary> /// <returns>The name label.</returns> /// <param name="table">Table.</param> /// <param name="skin">Skin.</param> protected Label CreateNameLabel(Table table, Skin skin, float leftCellWidth = -1) { var label = new Label(_name, skin).SetFontScale(2f); label.SetTouchable(Touchable.Enabled); // set a width on the cell so long labels dont cause issues if we have a leftCellWidth set if (leftCellWidth > 0) { label.SetEllipsis("...").SetWidth(leftCellWidth); } var tooltipAttribute = GetFieldOrPropertyAttribute <TooltipAttribute>(); if (tooltipAttribute != null) { var tooltip = new TextTooltip(tooltipAttribute.Tooltip, label, skin); table.GetStage().AddElement(tooltip); } return(label); }
private void Awake() { lobbyEcsController = FindObjectOfType <LobbyEcsController>(); scrollViewSmoothMovementBehaviour = FindObjectOfType <ScrollViewSmoothMovementBehaviour>(); textTooltip = FindObjectOfType <TextTooltip>(); }
public void OnPointerEnter(PointerEventData eventData) { this.instance = Instantiate(this.tooltip, this.canvas.transform); this.instance.SetText(this.text); }