Snap to Grid Multiselect is Broken and Larger Textareas.
Posted: Thu May 14, 2020 10:17 am
Hey Tony! Hope life's good.
On to the requests!
Firstly, I'd really appreciate if the Dialogue Text, Sequence, Notes, Conditions, and Script Textareas were EditorGUIUtility.singleLineHeight*2 or *3 tall. Maybe Dialogue Text can still be a single line, but I think it helps readability and UX quite a lot for the rest to be multiline as is. It helps break up the inspector window, I think.
I can obviously do this edit easily myself, and have done, but I'd figured I'd float the idea here. I'll include code to save you some time in case you want to add it to mainline
Just add
to the Textarea declarations.
Changed Lines:
DialogueEditorWindowDialogueTreeSection.cs | Line: 594, 645
SequenceEditorTools.cs | Line: 104
LuaScriptWizard.cs | Line: 114
LuaConditionWizard.cs | Line: 105
That's how it looks. I was also hoping to get the Conditions and Script boxes into a EditorGUILayout.BeginHorizontal() (if the inspector is over 400px wide). That just requires a little bit of code I'll slap below, but it looks like this:
The code is just:
NOTE: This also requires editing the two script field .Draw commands and changing the EditorGUILayout.LabelField to a GUILayout.Label for them to fill the area properly. The Script Wizard could probably also use a touch since it makes one field quite wide when they're side-by-side there.
Secondly, and more importantly, I think, dragging multi-selected nodes doesn't respect my snap settings. Only the clicked node respects the snap setting and the rest drift around awkwardly. Looking at the code for this, it SEEMS like they're supposed to snap (since it loops through a list of nodes) but it's not happening.
Pre drag:
Post drag:
Snap is set to 24 here but the same thing happens at all snap levels.
On to the requests!
Firstly, I'd really appreciate if the Dialogue Text, Sequence, Notes, Conditions, and Script Textareas were EditorGUIUtility.singleLineHeight*2 or *3 tall. Maybe Dialogue Text can still be a single line, but I think it helps readability and UX quite a lot for the rest to be multiline as is. It helps break up the inspector window, I think.
I can obviously do this edit easily myself, and have done, but I'd figured I'd float the idea here. I'll include code to save you some time in case you want to add it to mainline
Just add
Code: Select all
, GUILayout.Height(EditorGUIUtility.singleLineHeight * 3)
Changed Lines:
DialogueEditorWindowDialogueTreeSection.cs | Line: 594, 645
SequenceEditorTools.cs | Line: 104
LuaScriptWizard.cs | Line: 114
LuaConditionWizard.cs | Line: 105
That's how it looks. I was also hoping to get the Conditions and Script boxes into a EditorGUILayout.BeginHorizontal() (if the inspector is over 400px wide). That just requires a little bit of code I'll slap below, but it looks like this:
The code is just:
Code: Select all
// If statement is for optional Web2.0 RESPONSIVE UI!!!
if (EditorGUIUtility.currentViewWidth > 400)
{
EditorGUILayout.BeginHorizontal();
}
EditorGUILayout.BeginVertical();
// Conditions:
luaConditionWizard.database = database;
entry.conditionsString = luaConditionWizard.Draw(new GUIContent("Conditions", "Optional Lua statement that must be true to use this entry."), entry.conditionsString);
EditorGUILayout.EndVertical();
EditorGUILayout.BeginVertical();
// Script:
luaScriptWizard.database = database;
entry.userScript = luaScriptWizard.Draw(new GUIContent("Script", "Optional Lua code to run when entry is spoken."), entry.userScript);
EditorGUILayout.EndVertical();
// If statement is for optional Web2.0 RESPONSIVE UI!!!
if (EditorGUIUtility.currentViewWidth > 400)
{
EditorGUILayout.EndHorizontal();
}
Secondly, and more importantly, I think, dragging multi-selected nodes doesn't respect my snap settings. Only the clicked node respects the snap setting and the rest drift around awkwardly. Looking at the code for this, it SEEMS like they're supposed to snap (since it loops through a list of nodes) but it's not happening.
Pre drag:
Post drag:
Snap is set to 24 here but the same thing happens at all snap levels.