mirror of
https://github.com/maxartz15/MA_TextureAtlasser.git
synced 2026-02-02 17:15:53 +01:00
Duplicate Quad, Settings, Hotkeys.
Added the option to duplicate the selected quad. Added settings for focus, duplication, hotkeys. Added hotkeys, can be enabled in the settings file.
This commit is contained in:
@@ -52,12 +52,17 @@ namespace MA_TextureAtlasserPro
|
||||
GUILayout.Space(MA_TextureAtlasserProUtils.VIEWOFFSET);
|
||||
if(GUILayout.Button(MA_TextureAtlasserProIcons.createQuadIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||
{
|
||||
MA_TextureAtlasserProUtils.CreateTextureQuad(curWindow.textureAtlas, "new Quad", new Rect(0, 0, 128, 128));
|
||||
MA_TextureAtlasserProUtils.CreateTextureQuad(curWindow.textureAtlas, "new Quad", new Rect(0, 0, 128, 128), curWindow.settings.autoFocus);
|
||||
}
|
||||
if(curWindow.textureAtlas.selectedTextureQuad != null && GUILayout.Button(MA_TextureAtlasserProIcons.removeQuadIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||
{
|
||||
if(curWindow.textureAtlas.selectedTextureQuad != null)
|
||||
MA_TextureAtlasserProUtils.RemoveTextureQuad(curWindow.textureAtlas);
|
||||
MA_TextureAtlasserProUtils.RemoveTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus);
|
||||
}
|
||||
if (curWindow.textureAtlas.selectedTextureQuad != null && GUILayout.Button(MA_TextureAtlasserProIcons.duplicateQuadIcon, GUILayout.ExpandWidth(false), GUILayout.ExpandHeight(true)))
|
||||
{
|
||||
if (curWindow.textureAtlas.selectedTextureQuad != null)
|
||||
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus, curWindow.settings.copySelectedQuadData, curWindow.settings.duplicatedQuadNamePrefix);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,31 @@ namespace MA_TextureAtlasserPro
|
||||
|
||||
e.Use();
|
||||
}
|
||||
|
||||
//Hotkeys.
|
||||
if (curWindow.settings.useHotkeys)
|
||||
{
|
||||
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.addQuadHotKey)
|
||||
{
|
||||
MA_TextureAtlasserProUtils.CreateTextureQuad(curWindow.textureAtlas, "new Quad", new Rect(0, 0, 128, 128), curWindow.settings.autoFocus);
|
||||
e.Use();
|
||||
}
|
||||
|
||||
if (curWindow.textureAtlas.selectedTextureQuad != null)
|
||||
{
|
||||
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.removeQuadHotKey)
|
||||
{
|
||||
MA_TextureAtlasserProUtils.RemoveTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus);
|
||||
e.Use();
|
||||
}
|
||||
|
||||
if (e.type == EventType.KeyDown && e.keyCode == curWindow.settings.duplicateHotKey)
|
||||
{
|
||||
MA_TextureAtlasserProUtils.DuplicateTextureQuad(curWindow.textureAtlas, curWindow.settings.autoFocus);
|
||||
e.Use();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Vector2 ConvertScreenCoordsToZoomCoords(Vector2 screenCoords)
|
||||
|
||||
Reference in New Issue
Block a user