Put motifs in two rows

His Dad [01-30-16 - 19:32]
Put motifs in two rows
Filename
AIResearchGrid.lua
AIResearchGrid.xml
Language/en.lua
diff --git a/AIResearchGrid.lua b/AIResearchGrid.lua
index fcb97eb..0c22602 100644
--- a/AIResearchGrid.lua
+++ b/AIResearchGrid.lua
@@ -91,12 +91,12 @@ function AIRG.initUI()
     -- Nice little line under the main title
     -- ## Check is htis showing right?
     AIRG.UI.TopDivider = WINDOW_MANAGER:CreateControl("AIResearchGridTopDivider", AIResearchGrid, CT_TEXTURE)
-    AIRG.UI.TopDivider:SetDimensions(790, 5)
+    AIRG.UI.TopDivider:SetDimensions(750, 5)
     AIRG.UI.TopDivider:SetAnchor(TOPLEFT, AIResearchGrid, TOPLEFT, 25, 32)
     AIRG.UI.TopDivider:SetTexture("/esoui/art/quest/questjournal_divider.dds")
     -- Nice little line under the grid
     AIRG.UI.BottomDivider = WINDOW_MANAGER:CreateControl("AIResearchGridBottomDivider", AIResearchGrid, CT_TEXTURE)
-    AIRG.UI.BottomDivider:SetDimensions(790, 5)
+    AIRG.UI.BottomDivider:SetDimensions(750, 5)
     AIRG.UI.BottomDivider:SetAnchor(TOPLEFT, AIResearchGrid, TOPLEFT, 25, 636)
     AIRG.UI.BottomDivider:SetTexture("/esoui/art/quest/questjournal_divider.dds")
     AIRG.UI.BottomDivider:SetHidden(not AIRG.vars.showMotifs)
@@ -309,21 +309,31 @@ function AIRG.initUI()
 --    AIRG.UI.columnFooterTitle:SetText(GetString(SI_SMITHING_RESEARCH_LINE_HEADER))
     AIRG.UI.columnFooterTitle:SetText(GetString(SI_CRAFTING_COMPONENT_TOOLTIP_TRAITS))   -- "Traits"

+  AIResearchGrid:SetHeight(AIRG.vars.showMotifs and 756 or 636)
+
     -- BUILD THE MOTIF ICONS ACROSS THE BOTTOM
     -- Note that for now, we're just setting up 15 icons and stuff is configured manually
     -- but we can fix it later. It's not like it's going to have an overhead on processing. :)
     -- It's set-up inside a container frame to make hiding or showing the whole lot simpler.
     AIRG.UI.motifSection = WINDOW_MANAGER:CreateControl("AIResearchMotifSection", AIResearchGrid, CT_CONTROL)
-    AIRG.UI.motifSection:SetDimensions(790, 50)
-    AIRG.UI.motifSection:SetAnchor(BOTTOMLEFT, AIResearchGrid, BOTTOMLEFT, -166, 0)
+    AIRG.UI.motifSection:SetDimensions(750, 100)
+    AIRG.UI.motifSection:SetAnchor(BOTTOMLEFT, AIResearchGrid, BOTTOMLEFT, 0, 0)
     AIRG.UI.motifSection:SetHidden(not AIRG.vars.showMotifs)
-    AIResearchGrid:SetHeight(AIRG.vars.showMotifs and 706 or 636)
+
     AIRG.UI.motifButtons = {}
+	local yoffset = 0
+	local xoffset
     for i = 1, 20 do

+		if i > 14 then	--split normal from chapter
+			yoffset = 50
+			xoffset = i -14
+		else
+			xoffset = i
+		end
         AIRG.UI.motifButtons[i] = WINDOW_MANAGER:CreateControl("AIResearchGridMotifButton" .. tostring(i), AIRG.UI.motifSection, CT_TEXTURE)
         AIRG.UI.motifButtons[i]:SetDimensions(40, 40)
-        AIRG.UI.motifButtons[i]:SetAnchor(TOPLEFT, AIRG.UI.motifSection, TOPLEFT, 40*i + 120, 0)
+        AIRG.UI.motifButtons[i]:SetAnchor(TOPLEFT, AIRG.UI.motifSection, TOPLEFT, 40*xoffset + 40, yoffset)
         AIRG.UI.motifButtons[i]:SetTexture(AIRG.styleLookupIcons[i] .. "up.dds")
         AIRG.UI.motifButtons[i]:SetMouseEnabled(true)
         j = AIRG.styleLookupValue[i]
diff --git a/AIResearchGrid.xml b/AIResearchGrid.xml
index 0c981da..2165da7 100644
--- a/AIResearchGrid.xml
+++ b/AIResearchGrid.xml
@@ -1,7 +1,7 @@
 <GuiXml>
     <Controls>
         <TopLevelControl name="AIResearchGrid" mouseEnabled="true" movable="true" clampedToScreen="true" hidden="true">
-            <Dimensions x="790" y="706" />
+            <Dimensions x="750" y="756" />
             <Anchor point="CENTER" />
             <Controls>

diff --git a/Language/en.lua b/Language/en.lua
index 69fe6fd..cbf632a 100644
--- a/Language/en.lua
+++ b/Language/en.lua
@@ -11,7 +11,7 @@ function AIRG.InitialiseLanguage()
     AIRG.L["Show Motifs"]                           = "Show Motifs?"
     AIRG.L["Show Motifs Long"]                      = "Show motifs along the bottom of the Research Grid addon."

-    AIRG.L["Characters"]                            = "|c45D7F7Character Deletion|r"
+    AIRG.L["Characters"]                            = "|c45D7F7Character Data Deletion|r"
     AIRG.L["CharacterSelect"]                       = "Select Character"
     AIRG.L["Delete"]                                = "Delete"
     AIRG.L["DeleteDesc"]                            = "Click this button to delete data for the selected character."