From 1e0e6713b9b8104bf5313b0d6ad3f174fed19ab9 Mon Sep 17 00:00:00 2001 From: Sigmastorm7 Date: Fri, 29 Oct 2021 14:04:42 -0400 Subject: [PATCH 1/4] added lua/xml snippets to atlas info --- .vscode/settings.json | 23 +++++++++++++ TextureAtlasViewer.lua | 17 ++++++++++ TextureAtlasViewer.xml | 77 ++++++++++++++++++++++++++++++------------ 3 files changed, 96 insertions(+), 21 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c3f4d99 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,23 @@ +{ + "Lua.diagnostics.globals": [ + "TAV_InfoPanel", + "TAV_ControlsPanel", + "PERCENTAGE_STRING", + "OpenColorPicker", + "TAV_DisplayContainer", + "TAV_ScrollFrame", + "TAV_CoreFrame", + "CreateFramePool", + "ColorPickerFrame", + "OpacitySliderFrame", + "HybridScrollFrame_GetOffset", + "HybridScrollFrame_GetButtons", + "HybridScrollFrame_SetDoNotHideScrollBar", + "HybridScrollFrame_CreateButtons", + "HybridScrollFrame_Update", + "GetAtlasInfo", + "TAV_ScrollFrameScrollChild", + "LibStub", + "GameTooltip_SetTitle" + ] +} \ No newline at end of file diff --git a/TextureAtlasViewer.lua b/TextureAtlasViewer.lua index 2809720..636381f 100644 --- a/TextureAtlasViewer.lua +++ b/TextureAtlasViewer.lua @@ -591,6 +591,23 @@ function TAV_DisplayContainerMixin:ShowAtlasInfo(name, atlasInfo) TAV_InfoPanel.IconHorizontalTile:SetAtlas(atlasInfo.tilesHorizontally and "ParagonReputation_Checkmark" or "communities-icon-redx"); TAV_InfoPanel.IconVerticalTile:SetAtlas(atlasInfo.tilesVertically and "ParagonReputation_Checkmark" or "communities-icon-redx"); TAV_InfoPanel.AlertIndicator:SetShown(atlasInfo.missing); + + TAV_InfoPanel.Lua:SetText(string.format( + 'tex:SetTexCoord(%s, %s, %s, %s)', + atlasInfo.leftTexCoord, + atlasInfo.rightTexCoord, + atlasInfo.topTexCoord, + atlasInfo.bottomTexCoord + )) + + TAV_InfoPanel.XML:SetText(string.format( + '', + atlasInfo.leftTexCoord, + atlasInfo.rightTexCoord, + atlasInfo.topTexCoord, + atlasInfo.bottomTexCoord + )) + TAV_InfoPanel:Show(); end diff --git a/TextureAtlasViewer.xml b/TextureAtlasViewer.xml index 54abac8..0532a55 100644 --- a/TextureAtlasViewer.xml +++ b/TextureAtlasViewer.xml @@ -21,7 +21,7 @@ - -