2021-04-23 21:50:58 +10:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
2021-04-27 21:22:48 +10:00
|
|
|
|
using UnityExplorer.UI.Panels;
|
2022-04-14 01:25:59 +10:00
|
|
|
|
using UnityExplorer.UI.Widgets.AutoComplete;
|
2021-12-02 18:35:46 +11:00
|
|
|
|
using UniverseLib;
|
2022-04-12 05:20:35 +10:00
|
|
|
|
using UniverseLib.Input;
|
2021-12-02 18:35:46 +11:00
|
|
|
|
using UniverseLib.UI;
|
2022-04-12 05:20:35 +10:00
|
|
|
|
using UniverseLib.UI.Models;
|
2022-01-31 21:24:01 +11:00
|
|
|
|
using UniverseLib.UI.Widgets.ButtonList;
|
|
|
|
|
using UniverseLib.UI.Widgets.ScrollView;
|
|
|
|
|
using UniverseLib.Utility;
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
namespace UnityExplorer.UI.Panels
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2021-05-12 20:48:56 +10:00
|
|
|
|
// Shared modal panel for "AutoComplete" suggestions.
|
|
|
|
|
// A data source implements ISuggestionProvider and uses TakeOwnership and ReleaseOwnership
|
|
|
|
|
// for control, and SetSuggestions to set the actual suggestion data.
|
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
public class AutoCompleteModal : UEPanel
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2021-05-13 23:03:30 +10:00
|
|
|
|
public static AutoCompleteModal Instance => UIManager.GetPanel<AutoCompleteModal>(UIManager.Panels.AutoCompleter);
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2021-04-28 23:58:13 +10:00
|
|
|
|
public override string Name => "AutoCompleter";
|
|
|
|
|
public override UIManager.Panels PanelType => UIManager.Panels.AutoCompleter;
|
2022-04-14 01:25:59 +10:00
|
|
|
|
|
|
|
|
|
public override int MinWidth => 100;
|
|
|
|
|
public override int MinHeight => 25;
|
|
|
|
|
public override Vector2 DefaultAnchorMin => new(MIN_X, 0.4f);
|
|
|
|
|
public override Vector2 DefaultAnchorMax => new(0.68f, MAX_Y);
|
|
|
|
|
const float MIN_X = 0.42f;
|
|
|
|
|
const float MAX_Y = 0.6f;
|
2021-04-28 23:58:13 +10:00
|
|
|
|
|
2022-03-15 01:17:35 +11:00
|
|
|
|
public override bool CanDragAndResize => true;
|
2021-04-28 23:58:13 +10:00
|
|
|
|
public override bool ShouldSaveActiveState => false;
|
|
|
|
|
public override bool NavButtonWanted => false;
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
public static ISuggestionProvider CurrentHandler { get; private set; }
|
2021-04-28 23:58:13 +10:00
|
|
|
|
|
2022-03-15 01:17:35 +11:00
|
|
|
|
public static ButtonListHandler<Suggestion, ButtonCell> buttonListDataHandler;
|
2021-05-15 01:21:07 +10:00
|
|
|
|
public static ScrollPool<ButtonCell> scrollPool;
|
2021-05-15 01:41:03 +10:00
|
|
|
|
private static GameObject navigationTipRow;
|
2021-04-28 23:58:13 +10:00
|
|
|
|
|
2022-01-31 21:24:01 +11:00
|
|
|
|
private static List<Suggestion> Suggestions = new();
|
2021-05-15 01:21:07 +10:00
|
|
|
|
private static int SelectedIndex = 0;
|
|
|
|
|
|
|
|
|
|
public static Suggestion SelectedSuggestion => Suggestions[SelectedIndex];
|
|
|
|
|
|
|
|
|
|
public static bool Suggesting(ISuggestionProvider handler) => CurrentHandler == handler && Instance.UIRoot.activeSelf;
|
2021-04-28 23:58:13 +10:00
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
public AutoCompleteModal(UIBase owner) : base(owner)
|
2021-04-24 04:03:33 +10:00
|
|
|
|
{
|
2022-04-14 01:25:59 +10:00
|
|
|
|
UIManager.UiBase.Panels.OnPanelsReordered += UIPanel_OnPanelsReordered;
|
|
|
|
|
UIManager.UiBase.Panels.OnClickedOutsidePanels += AutoCompleter_OnClickedOutsidePanels;
|
2021-04-24 04:03:33 +10:00
|
|
|
|
}
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2022-04-12 00:17:06 +10:00
|
|
|
|
public static void TakeOwnership(ISuggestionProvider provider)
|
2021-04-24 04:03:33 +10:00
|
|
|
|
{
|
2021-05-15 01:21:07 +10:00
|
|
|
|
CurrentHandler = provider;
|
2021-05-15 01:41:03 +10:00
|
|
|
|
navigationTipRow.SetActive(provider.AllowNavigation);
|
2021-05-15 01:21:07 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ReleaseOwnership(ISuggestionProvider provider)
|
|
|
|
|
{
|
|
|
|
|
if (CurrentHandler == null)
|
2021-04-24 04:03:33 +10:00
|
|
|
|
return;
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
if (CurrentHandler == provider)
|
|
|
|
|
{
|
2022-04-24 02:02:34 +10:00
|
|
|
|
Suggestions.Clear();
|
2021-05-15 01:21:07 +10:00
|
|
|
|
CurrentHandler = null;
|
2021-04-24 04:03:33 +10:00
|
|
|
|
UIRoot.SetActive(false);
|
2021-05-15 01:21:07 +10:00
|
|
|
|
}
|
2021-04-24 04:03:33 +10:00
|
|
|
|
}
|
|
|
|
|
|
2022-04-25 05:47:57 +10:00
|
|
|
|
public void SetSuggestions(List<Suggestion> suggestions, bool jumpToTop = true)
|
2021-04-24 04:03:33 +10:00
|
|
|
|
{
|
2022-04-24 02:02:34 +10:00
|
|
|
|
Suggestions = suggestions;
|
|
|
|
|
|
|
|
|
|
if (jumpToTop)
|
|
|
|
|
{
|
|
|
|
|
SelectedIndex = 0;
|
|
|
|
|
if (scrollPool.DataSource.ItemCount > 0)
|
|
|
|
|
scrollPool.JumpToIndex(0, null);
|
|
|
|
|
}
|
2021-04-24 04:03:33 +10:00
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
if (!Suggestions.Any())
|
|
|
|
|
base.UIRoot.SetActive(false);
|
|
|
|
|
else
|
2021-04-24 04:03:33 +10:00
|
|
|
|
{
|
2021-05-15 01:21:07 +10:00
|
|
|
|
base.UIRoot.SetActive(true);
|
|
|
|
|
base.UIRoot.transform.SetAsLastSibling();
|
2022-03-15 01:17:35 +11:00
|
|
|
|
buttonListDataHandler.RefreshData();
|
2022-04-25 05:47:57 +10:00
|
|
|
|
scrollPool.Refresh(true, jumpToTop);
|
2021-04-24 04:03:33 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
private static float timeOfLastNavHold = -1f;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns true if the AutoCompleteModal used the navigation input, false if not.
|
|
|
|
|
/// The navigation inputs are Control+Up/Down, and Control+Enter.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static bool CheckNavigation(ISuggestionProvider handler)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2021-05-15 01:21:07 +10:00
|
|
|
|
if (!Suggesting(handler))
|
|
|
|
|
return false;
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2021-05-15 06:23:32 +10:00
|
|
|
|
bool up = InputManager.GetKey(KeyCode.UpArrow);
|
|
|
|
|
bool down = InputManager.GetKey(KeyCode.DownArrow);
|
2021-05-15 01:21:07 +10:00
|
|
|
|
|
2021-05-15 06:23:32 +10:00
|
|
|
|
if (up || down)
|
|
|
|
|
{
|
|
|
|
|
if (up)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2021-05-15 06:23:32 +10:00
|
|
|
|
if (InputManager.GetKeyDown(KeyCode.UpArrow))
|
2021-05-15 01:21:07 +10:00
|
|
|
|
{
|
2021-05-15 06:23:32 +10:00
|
|
|
|
SetSelectedSuggestion(SelectedIndex - 1);
|
|
|
|
|
timeOfLastNavHold = Time.realtimeSinceStartup + 0.3f;
|
2021-05-15 01:21:07 +10:00
|
|
|
|
}
|
2021-05-15 06:23:32 +10:00
|
|
|
|
else if (timeOfLastNavHold.OccuredEarlierThan(0.05f))
|
2021-05-15 01:21:07 +10:00
|
|
|
|
{
|
2021-05-15 06:23:32 +10:00
|
|
|
|
SetSelectedSuggestion(SelectedIndex - 1);
|
|
|
|
|
timeOfLastNavHold = Time.realtimeSinceStartup;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (InputManager.GetKeyDown(KeyCode.DownArrow))
|
|
|
|
|
{
|
|
|
|
|
SetSelectedSuggestion(SelectedIndex + 1);
|
|
|
|
|
timeOfLastNavHold = Time.realtimeSinceStartup + 0.3f;
|
|
|
|
|
}
|
|
|
|
|
else if (timeOfLastNavHold.OccuredEarlierThan(0.05f))
|
|
|
|
|
{
|
|
|
|
|
SetSelectedSuggestion(SelectedIndex + 1);
|
|
|
|
|
timeOfLastNavHold = Time.realtimeSinceStartup;
|
2021-05-15 01:21:07 +10:00
|
|
|
|
}
|
2021-04-23 21:50:58 +10:00
|
|
|
|
}
|
2021-05-15 01:21:07 +10:00
|
|
|
|
|
2021-05-15 06:23:32 +10:00
|
|
|
|
return true;
|
2021-04-23 21:50:58 +10:00
|
|
|
|
}
|
2021-05-15 01:21:07 +10:00
|
|
|
|
|
|
|
|
|
return !timeOfLastNavHold.OccuredEarlierThan(0.2f);
|
2021-04-23 21:50:58 +10:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
public static bool CheckEnter(ISuggestionProvider handler)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2021-05-15 01:21:07 +10:00
|
|
|
|
return Suggesting(handler) && InputManager.GetKeyDown(KeyCode.Return);
|
2021-04-23 21:50:58 +10:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
public static bool CheckEscape(ISuggestionProvider handler)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2021-05-15 01:21:07 +10:00
|
|
|
|
return Suggesting(handler) && InputManager.GetKeyDown(KeyCode.Escape);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void SetSelectedSuggestion(int index)
|
|
|
|
|
{
|
|
|
|
|
if (index < 0 || index >= Suggestions.Count)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
return;
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
SelectedIndex = index;
|
2022-04-12 00:17:06 +10:00
|
|
|
|
|
|
|
|
|
scrollPool.JumpToIndex(index, null);
|
2021-04-23 21:50:58 +10:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
// Internal update
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
public override void Update()
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2021-05-15 01:21:07 +10:00
|
|
|
|
if (!UIRoot || !UIRoot.activeSelf)
|
|
|
|
|
return;
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
if (Suggestions.Any() && CurrentHandler != null)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2021-05-15 01:21:07 +10:00
|
|
|
|
if (!CurrentHandler.InputField.UIRoot.activeInHierarchy)
|
|
|
|
|
ReleaseOwnership(CurrentHandler);
|
|
|
|
|
else
|
|
|
|
|
UpdatePosition();
|
2021-04-23 21:50:58 +10:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
// Setting autocomplete cell buttons
|
|
|
|
|
|
2022-04-12 00:17:06 +10:00
|
|
|
|
private readonly Color selectedSuggestionColor = new(45 / 255f, 75 / 255f, 80 / 255f);
|
|
|
|
|
private readonly Color inactiveSuggestionColor = new(0.11f, 0.11f, 0.11f);
|
2021-05-15 01:21:07 +10:00
|
|
|
|
|
|
|
|
|
private List<Suggestion> GetEntries() => Suggestions;
|
|
|
|
|
|
|
|
|
|
private bool ShouldDisplay(Suggestion data, string filter) => true;
|
|
|
|
|
|
2021-04-24 04:03:33 +10:00
|
|
|
|
private void OnCellClicked(int dataIndex)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2022-04-12 05:20:35 +10:00
|
|
|
|
Suggestion suggestion = Suggestions[dataIndex];
|
2021-04-23 21:50:58 +10:00
|
|
|
|
CurrentHandler.OnSuggestionClicked(suggestion);
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
private bool setFirstCell;
|
|
|
|
|
|
2021-04-26 19:56:21 +10:00
|
|
|
|
private void SetCell(ButtonCell cell, int index)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2022-04-24 02:02:34 +10:00
|
|
|
|
if (CurrentHandler == null)
|
|
|
|
|
{
|
|
|
|
|
UIRoot.SetActive(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
if (index < 0 || index >= Suggestions.Count)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
|
|
|
|
cell.Disable();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-12 05:20:35 +10:00
|
|
|
|
Suggestion suggestion = Suggestions[index];
|
2021-04-26 19:56:21 +10:00
|
|
|
|
cell.Button.ButtonText.text = suggestion.DisplayText;
|
2021-05-15 01:21:07 +10:00
|
|
|
|
|
2021-05-15 01:41:03 +10:00
|
|
|
|
if (CurrentHandler.AllowNavigation && index == SelectedIndex && setFirstCell)
|
2021-05-15 01:21:07 +10:00
|
|
|
|
{
|
2022-01-31 21:24:01 +11:00
|
|
|
|
RuntimeHelper.SetColorBlock(cell.Button.Component, selectedSuggestionColor);
|
2021-05-15 01:21:07 +10:00
|
|
|
|
}
|
|
|
|
|
else
|
2022-01-31 21:24:01 +11:00
|
|
|
|
RuntimeHelper.SetColorBlock(cell.Button.Component, inactiveSuggestionColor);
|
2021-05-15 01:21:07 +10:00
|
|
|
|
|
|
|
|
|
setFirstCell = true;
|
2021-04-23 21:50:58 +10:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
// Updating panel position
|
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
private int lastCaretPosition;
|
|
|
|
|
private Vector3 lastInputPosition;
|
|
|
|
|
|
2022-01-02 19:43:55 +11:00
|
|
|
|
internal void UpdatePosition()
|
2021-04-23 21:50:58 +10:00
|
|
|
|
{
|
2022-01-02 19:43:55 +11:00
|
|
|
|
if (CurrentHandler == null)
|
2021-04-23 21:50:58 +10:00
|
|
|
|
return;
|
|
|
|
|
|
2022-04-12 00:17:06 +10:00
|
|
|
|
InputFieldRef input = CurrentHandler.InputField;
|
2021-04-24 04:03:33 +10:00
|
|
|
|
|
2022-04-25 05:47:57 +10:00
|
|
|
|
//if (!input.Component.isFocused
|
|
|
|
|
// || (input.Component.caretPosition == lastCaretPosition && input.UIRoot.transform.position == lastInputPosition))
|
|
|
|
|
// return;
|
2021-05-11 19:15:46 +10:00
|
|
|
|
|
2022-04-25 05:47:57 +10:00
|
|
|
|
if (input.Component.caretPosition == lastCaretPosition && input.UIRoot.transform.position == lastInputPosition)
|
|
|
|
|
return;
|
|
|
|
|
|
2021-04-24 04:03:33 +10:00
|
|
|
|
if (CurrentHandler.AnchorToCaretPosition)
|
|
|
|
|
{
|
2022-04-25 05:47:57 +10:00
|
|
|
|
if (!input.Component.isFocused)
|
|
|
|
|
return;
|
|
|
|
|
|
2022-04-12 05:20:35 +10:00
|
|
|
|
TextGenerator textGen = input.Component.cachedInputTextGenerator;
|
2021-05-11 19:15:46 +10:00
|
|
|
|
int caretIdx = Math.Max(0, Math.Min(textGen.characterCount - 1, input.Component.caretPosition));
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
// normalize the caret horizontal position
|
|
|
|
|
Vector3 caretPos = textGen.characters[caretIdx].cursorPos;
|
|
|
|
|
// transform to world point
|
|
|
|
|
caretPos = input.UIRoot.transform.TransformPoint(caretPos);
|
2022-01-31 21:24:01 +11:00
|
|
|
|
caretPos += new Vector3(input.Transform.rect.width * 0.5f, -(input.Transform.rect.height * 0.5f), 0);
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2021-05-11 19:15:46 +10:00
|
|
|
|
uiRoot.transform.position = new Vector3(caretPos.x + 10, caretPos.y - 30, 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2022-01-31 21:24:01 +11:00
|
|
|
|
uiRoot.transform.position = input.Transform.position + new Vector3(-(input.Transform.rect.width / 2) + 10, -20, 0);
|
2021-05-11 19:15:46 +10:00
|
|
|
|
}
|
2021-04-24 04:03:33 +10:00
|
|
|
|
|
2022-04-25 05:47:57 +10:00
|
|
|
|
lastInputPosition = input.UIRoot.transform.position;
|
|
|
|
|
lastCaretPosition = input.Component.caretPosition;
|
|
|
|
|
|
2021-04-24 04:03:33 +10:00
|
|
|
|
this.Dragger.OnEndResize();
|
2021-04-23 21:50:58 +10:00
|
|
|
|
}
|
|
|
|
|
|
2021-05-15 01:21:07 +10:00
|
|
|
|
// Event listeners for panel
|
|
|
|
|
|
|
|
|
|
private void AutoCompleter_OnClickedOutsidePanels()
|
|
|
|
|
{
|
|
|
|
|
if (!this.UIRoot || !this.UIRoot.activeInHierarchy)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (CurrentHandler != null)
|
|
|
|
|
ReleaseOwnership(CurrentHandler);
|
|
|
|
|
else
|
|
|
|
|
UIRoot.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UIPanel_OnPanelsReordered()
|
|
|
|
|
{
|
|
|
|
|
if (!this.UIRoot || !this.UIRoot.activeInHierarchy)
|
|
|
|
|
return;
|
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
if (this.UIRoot.transform.GetSiblingIndex() != UIManager.UiBase.Panels.PanelHolder.transform.childCount - 1)
|
2021-05-15 01:21:07 +10:00
|
|
|
|
{
|
|
|
|
|
if (CurrentHandler != null)
|
|
|
|
|
ReleaseOwnership(CurrentHandler);
|
|
|
|
|
else
|
|
|
|
|
UIRoot.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
public override void OnFinishResize()
|
2022-03-15 01:50:50 +11:00
|
|
|
|
{
|
2022-04-14 01:25:59 +10:00
|
|
|
|
float xDiff = Rect.anchorMin.x - MIN_X;
|
|
|
|
|
float yDiff = Rect.anchorMax.y - MAX_Y;
|
2022-03-15 01:50:50 +11:00
|
|
|
|
|
|
|
|
|
if (xDiff != 0 || yDiff != 0)
|
|
|
|
|
{
|
2022-04-14 01:25:59 +10:00
|
|
|
|
Rect.anchorMin = new(MIN_X, Rect.anchorMin.y - yDiff);
|
|
|
|
|
Rect.anchorMax = new(Rect.anchorMax.x - xDiff, MAX_Y);
|
2022-03-15 01:50:50 +11:00
|
|
|
|
}
|
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
base.OnFinishResize();
|
2021-04-24 04:03:33 +10:00
|
|
|
|
}
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
// UI Construction
|
|
|
|
|
|
|
|
|
|
protected override void ConstructPanelContent()
|
2021-04-24 04:03:33 +10:00
|
|
|
|
{
|
2022-03-15 01:17:35 +11:00
|
|
|
|
// hide the titlebar
|
|
|
|
|
this.TitleBar.gameObject.SetActive(false);
|
|
|
|
|
|
|
|
|
|
buttonListDataHandler = new ButtonListHandler<Suggestion, ButtonCell>(scrollPool, GetEntries, SetCell, ShouldDisplay, OnCellClicked);
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
scrollPool = UIFactory.CreateScrollPool<ButtonCell>(this.ContentRoot, "AutoCompleter", out GameObject scrollObj,
|
2021-05-16 21:46:38 +10:00
|
|
|
|
out GameObject scrollContent);
|
2022-03-15 01:17:35 +11:00
|
|
|
|
scrollPool.Initialize(buttonListDataHandler);
|
2021-04-24 04:03:33 +10:00
|
|
|
|
UIFactory.SetLayoutElement(scrollObj, flexibleHeight: 9999);
|
|
|
|
|
UIFactory.SetLayoutGroup<VerticalLayoutGroup>(scrollContent, true, false, true, false);
|
2021-04-23 21:50:58 +10:00
|
|
|
|
|
2022-04-14 01:25:59 +10:00
|
|
|
|
navigationTipRow = UIFactory.CreateHorizontalGroup(this.ContentRoot, "BottomRow", true, true, true, true, 0, new Vector4(2, 2, 2, 2));
|
2021-05-15 01:41:03 +10:00
|
|
|
|
UIFactory.SetLayoutElement(navigationTipRow, minHeight: 20, flexibleWidth: 9999);
|
2021-06-05 19:36:09 +10:00
|
|
|
|
UIFactory.CreateLabel(navigationTipRow, "HelpText", "Up/Down to select, Enter to use, Esc to close",
|
2021-05-15 01:21:07 +10:00
|
|
|
|
TextAnchor.MiddleLeft, Color.grey, false, 13);
|
|
|
|
|
|
2021-04-23 21:50:58 +10:00
|
|
|
|
UIRoot.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|