Merge git.esoui.com:eso-CraftResearchTimer-Dad-88
His Dad [12-22-14 - 03:32]
Merge git.esoui.com:eso-CraftResearchTimer-Dad-88
diff --git a/lua/CraftResearchTimer.lua b/lua/CraftResearchTimer.lua
index c49ffa7..59cd27d 100644
--- a/lua/CraftResearchTimer.lua
+++ b/lua/CraftResearchTimer.lua
@@ -503,6 +503,8 @@ function CRT.CommandText_setup(lparam)
d("Shortest: " .. CRT.Converthms(CRT.SV.data.Craft[CRT.playername].shortest))
elseif (lparam == "grid") then
CRT.toggleGRID()
+ elseif (lparam == "sort") then
+ CRT.GRID_Sort()
else
CRT.ToggleUI()
end
diff --git a/lua/GRID.lua b/lua/GRID.lua
index 2acd65a..34448fd 100644
--- a/lua/GRID.lua
+++ b/lua/GRID.lua
@@ -23,6 +23,7 @@ function CRT.GRID_Create()
CRT.UI.GRID_BD = WINDOW_MANAGER:CreateControlFromVirtual("CRT_GRID_BD",CRT.UI.GRID_TLW, "ZO_DefaultBackdrop")
CRT.UI.GRID_BD:SetAlpha(CRT.SV.Settings.GRID.BackdropAlpha)
+ -- Close Button
CRT.UI.GRID_BTN = WINDOW_MANAGER:CreateControl("CRT_GRID_BTN" , CRT.UI.GRID_TLW, CT_BUTTON)
CRT.UI.GRID_BTN:SetDimensions( 30 , 30 )
CRT.UI.GRID_BTN:SetAnchor(TOPRIGHT,CRT.UI.GRID_TLW,TOPRIGHT,5,-10)
@@ -33,7 +34,7 @@ function CRT.GRID_Create()
CRT.UI.GRID_BTN:SetHandler( "OnClicked" , function(self) CRT.UI.GRID_TLW:SetHidden(true); CRT.SV.Settings.GRID.hidden = true end )
CRT.Char_sort()
-
+ -- this loads up the grid in sorted order, but it doesn't stay sorted as research is completed and started.
for _, v in ipairs(CRT.CharsInOrder) do
CRT.GRID_Create_Character(v)
end
@@ -51,7 +52,7 @@ function CRT.GRID_Create_Character(k)
--- Why? CRT.UI.GRID_TLW:SetHidden(CRT.SV.Settings.GRID.hidden)
- -- label for chracter name
+ -- label for character name
CRT.UI.GRID_WD[k] = {}
CRT.UI.GRID_WD[k].label = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_label",CRT.UI.GRID_TLW,CT_LABEL)
--CRT.UI.GRID_WD[k][k]:SetHidden(false)
@@ -239,5 +240,12 @@ function CRT.GRID_Update(timestamp)
end
end
+-- move characters in grid
+function CRT.GRID_Sort()
+
+ CRT.Char_sort()
-
\ No newline at end of file
+ for k, v in ipairs(CRT.CharsInOrder) do
+ CRT.UI.GRID_WD[v][v]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,0,120*k)
+ end
+ end