Skip to content

Commit 9b61acf

Browse files
RogPodgekeveleigh
andauthored
Updated button config inspector to show icon names (#9972)
* updated button config inspector to show icon names * Update Assets/MRTK/SDK/Features/UX/Scripts/Buttons/ButtonIconSet.cs Co-authored-by: Kurtis <[email protected]> * Update Assets/MRTK/SDK/Features/UX/Scripts/Buttons/ButtonIconSet.cs Co-authored-by: Kurtis <[email protected]> * property update Co-authored-by: Kurtis <[email protected]>
1 parent c436a84 commit 9b61acf

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Assets/MRTK/SDK/Editor/Inspectors/UX/Interactable/ButtonConfigHelperInspector.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ private void DrawIconQuadEditor(bool showComponents, ButtonIconSet iconSet)
387387

388388
EditorGUILayout.Space();
389389
EditorGUILayout.PropertyField(iconSetProp);
390+
391+
EditorGUILayout.Space();
390392
if (iconSet == null)
391393
{
392394
EditorGUILayout.HelpBox("No icon set assigned. You can specify custom icons manually by assigning them to the field below:", MessageType.Info);

Assets/MRTK/SDK/Features/UX/Scripts/Buttons/ButtonIconSet.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ public bool EditorDrawCharIconSelector(uint currentChar, out bool foundChar, out
244244
}
245245
}
246246

247+
if (currentSelection >= 0)
248+
{
249+
EditorGUILayout.BeginHorizontal();
250+
251+
EditorGUILayout.LabelField("Current Icon Name", EditorStyles.boldLabel);
252+
EditorGUILayout.LabelField(charIcons[currentSelection].Name);
253+
254+
EditorGUILayout.EndHorizontal();
255+
}
256+
247257
using (new EditorGUI.IndentLevelScope(indentLevel))
248258
{
249259
int column = 0;
@@ -315,6 +325,16 @@ public bool EditorDrawSpriteIconSelector(Sprite currentSprite, out bool foundSpr
315325
}
316326
}
317327

328+
if (currentSelection >= 0)
329+
{
330+
EditorGUILayout.BeginHorizontal();
331+
332+
EditorGUILayout.LabelField("Current Icon Name", EditorStyles.boldLabel);
333+
EditorGUILayout.LabelField(spriteIcons[currentSelection].name);
334+
335+
EditorGUILayout.EndHorizontal();
336+
}
337+
318338
if (spriteIconTextures == null || spriteIconTextures.Length != spriteIcons.Length)
319339
{
320340
UpdateSpriteIconTextures();
@@ -386,6 +406,16 @@ public bool EditorDrawQuadIconSelector(Texture currentTexture, out bool foundTex
386406
}
387407
}
388408

409+
if(currentSelection >= 0)
410+
{
411+
EditorGUILayout.BeginHorizontal();
412+
413+
EditorGUILayout.LabelField("Current Icon Name", EditorStyles.boldLabel);
414+
EditorGUILayout.LabelField(quadIcons[currentSelection].name);
415+
416+
EditorGUILayout.EndHorizontal();
417+
}
418+
389419
using (new EditorGUI.IndentLevelScope(indentLevel))
390420
{
391421
float height = maxButtonSize * ((float)quadIcons.Length / maxButtonsPerColumn);

0 commit comments

Comments
 (0)