Button labels, tooltips, icons.

First iteration, buttons now have optional tooltips and labels. By default the editor will load with them on, this can be changed in the settings.
This commit is contained in:
max
2020-04-18 22:55:52 +02:00
parent 6c2daebb56
commit 3532465e69
12 changed files with 200 additions and 56 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 34f8bb860cb13ac49ab6602f84a27dfd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
namespace MA_TextureAtlasserPro
{
[CustomEditor(typeof(MA_TextureAtlasserProSettings))]
[CanEditMultipleObjects]
public class MA_TextureAtlasserProSettingsEditor : Editor
{
GUIContent reloadButton = new GUIContent("Reload", "Update the editor with the changes made.");
public override void OnInspectorGUI()
{
GUILayout.BeginVertical();
DrawDefaultInspector();
GUILayout.Space(15);
if(GUILayout.Button(reloadButton, GUILayout.Height(40), GUILayout.ExpandWidth(true)))
{
//Update necessary systems.
MA_TextureAtlasserProGuiLoader.LoadEditorGui((MA_TextureAtlasserProSettings)this.target);
}
GUILayout.EndVertical();
}
}
}
#endif

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9850f2b069cfb36498e9601e4884071a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10,7 +10,10 @@ namespace MA_TextureAtlasserPro
[System.Serializable]
public class MA_TextureAtlasserProSettings : ScriptableObject
{
[Header("Hotkeys:")]
[Header("GUI (requires reload):")]
public MA_TextureAtlasserProGuiSettings editorGuiSettings = new MA_TextureAtlasserProGuiSettings();
[Header("HotKeys:")]
public bool useHotkeys = false;
public EventModifiers modifierKey = EventModifiers.Alt;
public KeyCode addQuadHotKey = KeyCode.Q;
@ -36,5 +39,19 @@ namespace MA_TextureAtlasserPro
return false;
}
}
[System.Serializable]
public class MA_TextureAtlasserProGuiSettings
{
public MA_EditorGuiMode editorGuiMode = MA_EditorGuiMode.IconAndText;
public bool enableToolTips = true;
}
public enum MA_EditorGuiMode
{
IconAndText = 0,
Icon = 1,
Text = 2
}
}
#endif