diff --git a/Assets/Fungus/Scripts/Editor/BlockEditor.cs b/Assets/Fungus/Scripts/Editor/BlockEditor.cs index 8a1cc31a..5850dfd6 100644 --- a/Assets/Fungus/Scripts/Editor/BlockEditor.cs +++ b/Assets/Fungus/Scripts/Editor/BlockEditor.cs @@ -288,7 +288,8 @@ namespace Fungus.EditorUtils GUILayout.FlexibleSpace(); - var pos = EditorGUILayout.GetControlRect(true, 0, EditorStyles.objectField); + //using false to prevent forcing a longer row than will fit on smallest inspector + var pos = EditorGUILayout.GetControlRect(false, 0, EditorStyles.objectField); if (pos.x != 0) { lastCMDpopupPos = pos; diff --git a/Assets/Fungus/Scripts/Editor/PopupContent/CommandSelectorPopupWindowContent.cs b/Assets/Fungus/Scripts/Editor/PopupContent/CommandSelectorPopupWindowContent.cs index 6e8fe765..ea3361ec 100644 --- a/Assets/Fungus/Scripts/Editor/PopupContent/CommandSelectorPopupWindowContent.cs +++ b/Assets/Fungus/Scripts/Editor/PopupContent/CommandSelectorPopupWindowContent.cs @@ -48,12 +48,11 @@ namespace Fungus.EditorUtils filteredAttributes = GetFilteredSupportedCommands(curBlock.GetFlowchart()); - int i = 0; foreach (var item in filteredAttributes) { - allItems.Add(new FilteredListItem(i, (item.Value.Category.Length > 0 ? item.Value.Category + CATEGORY_CHAR : "") + item.Value.CommandName, item.Value.HelpText)); - - i++; + //force lookup to orig index here to account for commmand lists being filtered by users + var newFilteredItem = new FilteredListItem(commandTypes.IndexOf(item.Key), (item.Value.Category.Length > 0 ? item.Value.Category + CATEGORY_CHAR : "") + item.Value.CommandName, item.Value.HelpText); + allItems.Add(newFilteredItem); } }