Skip to content

Commit a8614ed

Browse files
committed
visual update
selected configs text removed. text widths updated. small visual bugfix
1 parent c3c5f00 commit a8614ed

File tree

2 files changed

+36
-47
lines changed

2 files changed

+36
-47
lines changed
-2 Bytes
Loading

Assets/Editor/Editor Windows/ScriptableObjectEditorWindow.cs

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -82,50 +82,6 @@ private void OnGUI()
8282
{
8383
EditorGUILayout.BeginHorizontal();
8484

85-
EditorGUILayout.Space();
86-
87-
88-
GUIContent refreshButton;
89-
if (refreshIcon != null)
90-
{
91-
refreshButton = new GUIContent(refreshIcon, "refresh");
92-
}
93-
else
94-
{
95-
refreshButton = new GUIContent("refresh", "refresh");
96-
}
97-
if (GUILayout.Button(refreshButton, GUILayout.Width(80)))
98-
{
99-
RefreshAll();
100-
}
101-
102-
// Display a popup window at the mouse position for type selection
103-
GUIContent filtersButton;
104-
if (filtersIcon != null)
105-
{
106-
filtersButton = new GUIContent(filtersIcon, "filters");
107-
}
108-
else
109-
{
110-
filtersButton = new GUIContent("filters", "filters");
111-
}
112-
if (GUILayout.Button(filtersButton, GUILayout.Width(80)))
113-
{
114-
Vector2 mousePosition = Event.current.mousePosition;
115-
PopupWindow.Show(new Rect(mousePosition.x, mousePosition.y + 20, 0, 0), new ConfigTypeSelectionPopup(selectedTypes, GroupScriptableObjectsByType, availableTypes));
116-
}
117-
EditorGUILayout.EndHorizontal();
118-
119-
EditorGUILayout.Space(5);
120-
121-
EditorGUILayout.BeginHorizontal();
122-
// Show a summary of currently selected types or indicate none are selected
123-
GUILayout.Label("Selected Config Types: " + (selectedTypes.Count > 0 ? string.Join(", ", selectedTypes.Select(t => t.Name)) : "None"), EditorStyles.miniBoldLabel);
124-
if (groupedConfigs == null || groupedConfigs.Count == 0)
125-
{
126-
GUILayout.Label("No Configs Loaded", EditorStyles.boldLabel);
127-
}
128-
12985
GUIContent spaceButton;
13086
if (spaceIcon != null)
13187
{
@@ -165,8 +121,41 @@ private void OnGUI()
165121
}
166122
}
167123

124+
EditorGUILayout.Space();
125+
126+
GUIContent refreshButton;
127+
if (refreshIcon != null)
128+
{
129+
refreshButton = new GUIContent(refreshIcon, "refresh");
130+
}
131+
else
132+
{
133+
refreshButton = new GUIContent("refresh", "refresh");
134+
}
135+
if (GUILayout.Button(refreshButton, GUILayout.Width(80)))
136+
{
137+
RefreshAll();
138+
}
139+
140+
// Display a popup window at the mouse position for type selection
141+
GUIContent filtersButton;
142+
if (filtersIcon != null)
143+
{
144+
filtersButton = new GUIContent(filtersIcon, "filters");
145+
}
146+
else
147+
{
148+
filtersButton = new GUIContent("filters", "filters");
149+
}
150+
if (GUILayout.Button(filtersButton, GUILayout.Width(80)))
151+
{
152+
Vector2 mousePosition = Event.current.mousePosition;
153+
PopupWindow.Show(new Rect(mousePosition.x, mousePosition.y + 20, 0, 0), new ConfigTypeSelectionPopup(selectedTypes, GroupScriptableObjectsByType, availableTypes));
154+
}
168155
EditorGUILayout.EndHorizontal();
169156

157+
EditorGUILayout.Space(5);
158+
170159
// show configs
171160
ScrollPosMain = EditorGUILayout.BeginScrollView(ScrollPosMain);
172161
if (groupedConfigs.Count != 0)
@@ -198,7 +187,7 @@ private void OnGUI()
198187
else
199188
{
200189
AddConfigButton = new GUIContent("Add new", "create new config from " + configGroup[0].GetType().Name);
201-
AddConfigButtonOptions = new GUILayoutOption[] { GUILayout.Width(80) };
190+
AddConfigButtonOptions = new GUILayoutOption[] { GUILayout.Width(65) };
202191
}
203192

204193
// Buton çaðrýsýnda GUIStyle parametresini ekleyin
@@ -463,7 +452,7 @@ private void DeleteButton<T>(T Config) where T : ScriptableObject
463452
GUILayoutOption[] deleteConfigButtonOptions;
464453
GUIStyle buttonStyle = new GUIStyle(GUI.skin.button);
465454

466-
if (addConfigIcon != null)
455+
if (deleteConfigIcon != null)
467456
{
468457
deleteConfigButton = new GUIContent(deleteConfigIcon, "delete config permanently");
469458
deleteConfigButtonOptions = new GUILayoutOption[] { GUILayout.Height(20), GUILayout.Width(20) };
@@ -476,7 +465,7 @@ private void DeleteButton<T>(T Config) where T : ScriptableObject
476465
else
477466
{
478467
deleteConfigButton = new GUIContent("del", "delete config permanently");
479-
deleteConfigButtonOptions = new GUILayoutOption[] { GUILayout.Width(80) };
468+
deleteConfigButtonOptions = new GUILayoutOption[] { GUILayout.Width(30) };
480469
}
481470

482471
if (GUILayout.Button(deleteConfigButton, buttonStyle, deleteConfigButtonOptions))

0 commit comments

Comments
 (0)