Add in place grid sorting try1
His Dad [12-21-14 - 21:20]
Add in place grid sorting try1
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 ff84e69..b37f6f2 100644
--- a/lua/GRID.lua
+++ b/lua/GRID.lua
@@ -33,7 +33,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
@@ -234,5 +234,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
\ No newline at end of file