Browse Source

BasePopupWindowContent now has None as optional

master
desktop-maesty/steve 7 years ago
parent
commit
bee577d945
  1. 7
      Assets/Fungus/Scripts/Editor/BasePopupWindowContent.cs
  2. 2
      Assets/Fungus/Scripts/Editor/PopupContent/EventSelectorPopupWindowContent.cs
  3. 3
      Assets/Fungus/Scripts/Editor/PopupContent/VariableSelectPopupWindowContent.cs

7
Assets/Fungus/Scripts/Editor/BasePopupWindowContent.cs

@ -53,13 +53,15 @@ namespace Fungus.EditorUtils
protected float scrollOffset;
protected int currentIndex;
protected Vector2 size;
protected bool hasNoneOption = false;
static readonly char[] SEARCH_SPLITS = new char[]{ CATEGORY_CHAR, ' ' };
protected static readonly char CATEGORY_CHAR = '/';
public BasePopupWindowContent(string currentHandlerName, int width, int height)
public BasePopupWindowContent(string currentHandlerName, int width, int height, bool showNoneOption = false)
{
this.size = new Vector2(width, height);
hasNoneOption = showNoneOption;
PrepareAllItems();
@ -140,7 +142,8 @@ namespace Fungus.EditorUtils
hoverIndex = 0;
scroll = Vector2.zero;
visibleItems.Insert(0, new FilteredListItem(-1, "None"));
if(hasNoneOption)
visibleItems.Insert(0, new FilteredListItem(-1, "None"));
}
private void DrawSelectionArea(Rect scrollRect)

2
Assets/Fungus/Scripts/Editor/PopupContent/EventSelectorPopupWindowContent.cs

@ -32,7 +32,7 @@ namespace Fungus.EditorUtils
protected Block block;
public EventSelectorPopupWindowContent(string currentHandlerName, Block block, int width, int height)
:base(currentHandlerName, width, height)
:base(currentHandlerName, width, height, true)
{
this.block = block;
}

3
Assets/Fungus/Scripts/Editor/PopupContent/VariableSelectPopupWindowContent.cs

@ -6,6 +6,9 @@ using System.Linq;
namespace Fungus.EditorUtils
{
/// <summary>
/// Show the variable selection window as a searchable popup
/// </summary>
public class VariableSelectPopupWindowContent : BasePopupWindowContent
{
static readonly int POPUP_WIDTH = 200, POPUP_HEIGHT = 200;

Loading…
Cancel
Save