v3.3.3 Ancient orc By Scinutz

His Dad [10-10-15 - 00:16]
v3.3.3 Ancient orc By Scinutz
Filename
AIResearchGrid.lua
AIResearchGrid.txt
AIResearchGrid.xml
diff --git a/AIResearchGrid.lua b/AIResearchGrid.lua
index a3b22e6..47b2bd8 100644
--- a/AIResearchGrid.lua
+++ b/AIResearchGrid.lua
@@ -6,13 +6,13 @@
 -- French Translation by Motsah
 -- Fixes by mpavlinsky
 -- Close on Esc code by Wandamey
--- Glass and Xivkyn added in by Scinutz
+-- Glass, Xivkyn, and Ancient Orc added in by Scinutz

 local _
 AIRG = {}

 AIRG.name = "AIResearchGrid"
-AIRG.version = "3.3.1"
+AIRG.version = "3.3.3"
 AIRG.initialised = false
 AIRG.processing = false
 AIRG.all = " #ALL"  -- Default displayname for Virtual character, overrwritten by Localised version
@@ -71,7 +71,7 @@ end -- AIRG.StyleLearned
 -- Invoked from AIRG.Initialise but lengthy so in it's own function to not clutter Initialise
 function AIRG.initUI()
     -- Some local variable declaration
-    local i, j      -- used in for loops
+    local i, j, zz, yy      -- used in for loops
     local thisTrait, tType, tDesc, rowNum, charName
     -- Initialise a table to hold all the lua generated components
     AIRG.UI = {}
@@ -91,13 +91,13 @@ 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(770, 5)
-    AIRG.UI.TopDivider:SetAnchor(TOPLEFT, AIResearchGrid, TOPLEFT, 0, 32)
+    AIRG.UI.TopDivider:SetDimensions(790, 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(770, 5)
-    AIRG.UI.BottomDivider:SetAnchor(TOPLEFT, AIResearchGrid, TOPLEFT, 0, 636)
+    AIRG.UI.BottomDivider:SetDimensions(790, 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)
     -- CREATE BUTTON FOR CLOSE ADDON AT TOP_RIGHT
@@ -314,15 +314,16 @@ function AIRG.initUI()
     -- 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(770, 50)
+    AIRG.UI.motifSection:SetDimensions(790, 50)
     AIRG.UI.motifSection:SetAnchor(BOTTOMLEFT, AIResearchGrid, BOTTOMLEFT, -110, 0)
     AIRG.UI.motifSection:SetHidden(not AIRG.vars.showMotifs)
     AIResearchGrid:SetHeight(AIRG.vars.showMotifs and 706 or 636)
     AIRG.UI.motifButtons = {}
-    for i = 1, 17 do
+    for i = 1, 18 do
+
         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, 42*i +124, 0)
+        AIRG.UI.motifButtons[i]:SetAnchor(TOPLEFT, AIRG.UI.motifSection, TOPLEFT, 41*i + 124, 0)
         AIRG.UI.motifButtons[i]:SetTexture(AIRG.styleLookupIcons[i] .. "up.dds")
         AIRG.UI.motifButtons[i]:SetMouseEnabled(true)
         j = AIRG.styleLookupValue[i]
@@ -561,6 +562,13 @@ function AIRG.PopulateStyleData()
         local _, numCompleted = GetAchievementCriterion(1181, i)
         AIRG.vars.styles[thisname][17][AIRG.styleChaptersLookup[i]] = numCompleted == 1
       end
+      --Ancient Orc Style chapters
+      AIRG.vars.styles[thisname][18] = {}
+      local itemStyle = AIRG.styleLookupItem[18]
+      for i = 1, 14 do
+        local _, numCompleted = GetAchievementCriterion(1341, i)
+        AIRG.vars.styles[thisname][18][AIRG.styleChaptersLookup[i]] = numCompleted == 1
+      end
     end
   end
 end -- AIRG.PopulateStyleData
@@ -608,8 +616,14 @@ function AIRG.PopulateAll()
 				AIRG.vars.styles[AIRG.all][17][i] = true
 			end
 		end
+		--Update Ancient Orc styles
+		for i = 1, 14 do	--iterate over all Xiv items
+			if  AIRG.vars.styles[thisname][18][i] then
+				AIRG.vars.styles[AIRG.all][18][i] = true
+			end
+		end

-
+
       end
     end
 end  -- AIRG.PopulateAll
@@ -619,12 +633,12 @@ end  -- AIRG.PopulateAll
 function AIRG.DisplayStyles()
     local i
     if (AIRG.vars.styles[AIRG.curCharacter] == nil) then
-        for i = 1, 17 do
+        for i = 1, 18 do
             AIRG.UI.motifButtons[i]:SetTexture(AIRG.styleLookupIcons[i] .. "up.dds")
             AIRG.UI.motifButtons[i]:SetColor(1, 1, 1, 0.7)   -- grey
         end
     else
-        for i = 1, 17 do
+        for i = 1, 18 do
             if (AIRG.vars.styles[AIRG.curCharacter][i]) then
                 AIRG.UI.motifButtons[i]:SetTexture(AIRG.styleLookupIcons[i] .. "down.dds")
                 AIRG.UI.motifButtons[i]:SetColor(0.7, 1, 0.7, 1)   -- Green
@@ -699,7 +713,7 @@ function AIRG.DisplayStyles()
 	local tDesc = GetSmithingStyleItemLink(AIRG.styleLookupItem[styleIndex])
 	AIRG.UI.motifButtons[styleIndex].tooltipText = zo_strjoin(nil, zo_strformat("<<t:1>> (<<2>>/14)\n<<t:3>>\n", GetString("SI_ITEMSTYLE", itemStyle), knownCount, tDesc), tooltipText)

-	--Xiv Motif, special case
+	--Xivkyn Motif, special case

 	local styleIndex = 17
 	--
@@ -729,6 +743,36 @@ function AIRG.DisplayStyles()
 	local tDesc = GetSmithingStyleItemLink(AIRG.styleLookupItem[styleIndex])
 	AIRG.UI.motifButtons[styleIndex].tooltipText = zo_strjoin(nil, zo_strformat("<<t:1>> (<<2>>/14)\n<<t:3>>\n", GetString("SI_ITEMSTYLE", itemStyle), knownCount, tDesc), tooltipText)

+	--Ancient Orc Motif, special case
+
+	local styleIndex = 18
+	--
+	local tooltipText = ""
+	local knownCount = 0
+	for i = 1, 14 do
+		-- check how many chapters are known and build tooltip
+		if (AIRG.vars.styles[AIRG.curCharacter][styleIndex][i]) then
+		   tooltipText = zo_strjoin(nil, tooltipText, "\n|cFFFFFF", GetString("SI_ITEMSTYLECHAPTER", i), "|r")
+		   knownCount = knownCount + 1
+		else
+		   tooltipText = zo_strjoin(nil, tooltipText, "\n|c808080", GetString("SI_ITEMSTYLECHAPTER", i), "|r")
+		end
+	end
+	if knownCount == 0 then
+		AIRG.UI.motifButtons[styleIndex]:SetTexture(AIRG.styleLookupIcons[styleIndex] .. "up.dds")
+		AIRG.UI.motifButtons[styleIndex]:SetColor(1, 1, 1, 0.7)   -- grey
+	else
+		AIRG.UI.motifButtons[styleIndex]:SetTexture(AIRG.styleLookupIcons[styleIndex] .. "down.dds")
+		if knownCount == 14 then
+			AIRG.UI.motifButtons[styleIndex]:SetColor(0.7, 1, 0.7, 1)  -- Green
+		else
+			AIRG.UI.motifButtons[styleIndex]:SetColor(1, 1, 0.7, 1)    -- yellow
+		end
+	end
+	local itemStyle = AIRG.styleLookupValue[styleIndex]
+	local tDesc = GetSmithingStyleItemLink(AIRG.styleLookupItem[styleIndex])
+	AIRG.UI.motifButtons[styleIndex].tooltipText = zo_strjoin(nil, zo_strformat("<<t:1>> (<<2>>/14)\n<<t:3>>\n", GetString("SI_ITEMSTYLE", itemStyle), knownCount, tDesc), tooltipText)
+



@@ -842,6 +886,8 @@ function AIRG.AssignStyleLookups()
     AIRG.styleLookupIcons[15] = "ESOUI/art/progression/progression_indexicon_weapons_"
     AIRG.styleLookupIcons[16] = "ESOUI/art/progression/progression_indexicon_weapons_"
     AIRG.styleLookupIcons[17] = "ESOUI/art/progression/progression_indexicon_weapons_"
+    AIRG.styleLookupIcons[18] = "ESOUI/art/progression/progression_indexicon_weapons_"
+

     -- Translate the icon position to the in-game type. Used for text look-up
     AIRG.styleLookupValue = {}
@@ -862,6 +908,7 @@ function AIRG.AssignStyleLookups()
     AIRG.styleLookupValue[15] = ITEMSTYLE_AREA_DWEMER
     AIRG.styleLookupValue[16] = ITEMSTYLE_GLASS
     AIRG.styleLookupValue[17] = ITEMSTYLE_AREA_XIVKYN
+    AIRG.styleLookupValue[18] = ITEMSTYLE_AREA_ANCIENT_ORC

     -- This is a bit of a hack, but only because of the way ESO uses Style Items with different index to styles.
     AIRG.styleLookupItem = {}
@@ -882,6 +929,7 @@ function AIRG.AssignStyleLookups()
     AIRG.styleLookupItem[15] = 15   -- Dwemer       = Dwemer Frame
     AIRG.styleLookupItem[16] = 29   -- Glass        = Malachite Shard
     AIRG.styleLookupItem[17] = 30   -- Xivkyn       = ??
+    AIRG.styleLookupItem[18] = 23   -- Ancient Orc  = ??

     AIRG.styleChaptersLookup = {}
     AIRG.styleChaptersLookup[1] = 10   --Axe
@@ -899,23 +947,6 @@ function AIRG.AssignStyleLookups()
     AIRG.styleChaptersLookup[13] = 12  --Staves
     AIRG.styleChaptersLookup[14] = 8   --Swords

-    AIRG.styleChaptersLookupGlass = {}
-    AIRG.styleChaptersLookupGlass[1] = 10   --Axe
-    AIRG.styleChaptersLookupGlass[2] = 6    --Belt
-    AIRG.styleChaptersLookupGlass[3] = 3    --Boots
-    AIRG.styleChaptersLookupGlass[4] = 14   --Bows
-    AIRG.styleChaptersLookupGlass[5] = 5    --Chests
-    AIRG.styleChaptersLookupGlass[6] = 11   --Daggers
-    AIRG.styleChaptersLookupGlass[7] = 2    --Gloves
-    AIRG.styleChaptersLookupGlass[8] = 1    --Helmets
-    AIRG.styleChaptersLookupGlass[9] = 4    --Legs
-    AIRG.styleChaptersLookupGlass[10] = 9   --Maces
-    AIRG.styleChaptersLookupGlass[11] = 13  --Shields
-    AIRG.styleChaptersLookupGlass[12] = 7   --Shoulders
-    AIRG.styleChaptersLookupGlass[13] = 12  --Staves
-    AIRG.styleChaptersLookupGlass[14] = 8   --Swords
-
-
 end -- AIRG.AssignStyleLookups


diff --git a/AIResearchGrid.txt b/AIResearchGrid.txt
index 4fe51bc..06e87a7 100644
--- a/AIResearchGrid.txt
+++ b/AIResearchGrid.txt
@@ -1,6 +1,6 @@
-## Title: |cFFFFB0Research Grid|r v3.3.1
+## Title: |cFFFFB0Research Grid|r v3.3.3
 ## APIVersion: 100012
-## Version: 3.3.1
+## Version: 3.3.3
 ## Author: Stormknight and Team
 ## OptionalDependsOn: LibAddonMenu-2.0
 ## SavedVariables: AIRG_SavedVariables
diff --git a/AIResearchGrid.xml b/AIResearchGrid.xml
index e7835b1..0c981da 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="770" y="706" />
+            <Dimensions x="790" y="706" />
             <Anchor point="CENTER" />
             <Controls>