diff --git a/lua/CORE.lua b/lua/CORE.lua
index 0f3ec89..0a3737f 100644
--- a/lua/CORE.lua
+++ b/lua/CORE.lua
@@ -73,5 +73,5 @@ function CRT.Research_started()
if (CRT.UI.GRID_WD[CRT.playername] == nil) then
CRT.GRID_Create_Character(CRT.playername)
end
- CRT.Char_sort()
+ -- CRT.Char_sort()
end
\ No newline at end of file
diff --git a/lua/GRID.lua b/lua/GRID.lua
index 34448fd..89e47e9 100644
--- a/lua/GRID.lua
+++ b/lua/GRID.lua
@@ -22,7 +22,7 @@ function CRT.GRID_Create()
--/background
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 )
@@ -42,33 +42,32 @@ end
function CRT.GRID_Create_Character(k)
local x, y
-
+ local width = 360
+ local panelheight = 120 -- per character
+
if (num_char == nil) then
num_char = 0
end
if ((CRT.SV.data.Craft[k][0]["Simu_craft"] ~= 0 or CRT.SV.data.Craft[k][1]["Simu_craft"] ~= 0 or CRT.SV.data.Craft[k][2]["Simu_craft"] ~= 0)) then
-
- -- display main window
- --- Why? CRT.UI.GRID_TLW:SetHidden(CRT.SV.Settings.GRID.hidden)
-
+
+ CRT.UI.GRID_WD[k] = {}
+ -- Containing window for character data. We can then move it as a group
+ CRT.UI.GRID_WD[k].panel = WINDOW_MANAGER:CreateTopLevelWindow("CRT_GRID_"..k.."_panel")
+ CRT.UI.GRID_WD[k].panel:SetParent(CRT.UI.GRID_TLW)
+ CRT.UI.GRID_WD[k].panel:SetAnchor(TOPRIGHT,CRT.UI.GRID_TLW,TOPRIGHT,0,panelheight*num_char)
+ CRT.UI.GRID_WD[k].panel:SetDimensions(width,panelheight)
-- 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)
+ CRT.UI.GRID_WD[k].label = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_label",CRT.UI.GRID_WD[k].panel,CT_LABEL)
CRT.UI.GRID_WD[k].label:SetFont("ZoFontGame")
- CRT.UI.GRID_WD[k].label:SetDimensions(360,20)
+ CRT.UI.GRID_WD[k].label:SetDimensions(width,20)
CRT.UI.GRID_WD[k].label:SetColor(CRT.SV.Settings.GRID.Color.r, CRT.SV.Settings.GRID.Color.g, CRT.SV.Settings.GRID.Color.b, CRT.SV.Settings.GRID.Color.a)
CRT.UI.GRID_WD[k].label:SetAlpha(1)
- CRT.UI.GRID_WD[k].label:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,0,120*num_char)
+ CRT.UI.GRID_WD[k].label:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,0,0)
CRT.UI.GRID_WD[k].label:SetHorizontalAlignment(1)
CRT.UI.GRID_WD[k].label:SetText(string.upper(k))
- -- Containing window for character data. We can then move it as a group
- CRT.UI.GRID_WD[k].panel = WINDOW_MANAGER:CreateTopLevelWindow("CRT_GRID_"..k.."_panel")
- CRT.UI.GRID_WD[k].panel:SetParent(CRT.UI.GRID_TLW)
- CRT.UI.GRID_WD[k].panel:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,0,120*num_char)
-
+
if (num_char == 0) then
x = 0
y = 20
@@ -80,78 +79,78 @@ function CRT.GRID_Create_Character(k)
--blacksmithing
CRT.UI.GRID_WD[k][0] = {}
CRT.UI.GRID_WD[k][0][0] = {}
- CRT.UI.GRID_WD[k][0][0]["BS_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_0_icon",CRT.UI.GRID_TLW,CT_TEXTURE)
+ CRT.UI.GRID_WD[k][0][0]["BS_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_0_icon",CRT.UI.GRID_WD[k].panel,CT_TEXTURE)
CRT.UI.GRID_WD[k][0][0]["BS_Icon"]:SetHidden(false)
CRT.UI.GRID_WD[k][0][0]["BS_Icon"]:SetDimensions(20,20)
CRT.UI.GRID_WD[k][0][0]["BS_Icon"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][0][0]["BS_Icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,0,y)
+ CRT.UI.GRID_WD[k][0][0]["BS_Icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,0,20)
CRT.UI.GRID_WD[k][0][0]["BS_Icon"]:SetTexture("/esoui/art/icons/ability_smith_007.dds")
- CRT.UI.GRID_WD[k][0][0]["BS_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_0_text",CRT.UI.GRID_TLW,CT_LABEL)
+ CRT.UI.GRID_WD[k][0][0]["BS_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_0_text",CRT.UI.GRID_WD[k].panel,CT_LABEL)
CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetHidden(false)
CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetFont("ZoFontGame")
- CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetDimensions(360,20)
+ CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetDimensions(panelwidth,20)
CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetColor(CRT.SV.Settings.GRID.Color.r, CRT.SV.Settings.GRID.Color.g, CRT.SV.Settings.GRID.Color.b, CRT.SV.Settings.GRID.Color.a)
CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,20,y)
+ CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,20,20)
CRT.UI.GRID_WD[k][0][0]["BS_Text"]:SetText("Loading")
--Clothing
CRT.UI.GRID_WD[k][1] = {}
CRT.UI.GRID_WD[k][1][0] = {}
- CRT.UI.GRID_WD[k][1][0]["CL_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_1_icon",CRT.UI.GRID_TLW,CT_TEXTURE)
+ CRT.UI.GRID_WD[k][1][0]["CL_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_1_icon",CRT.UI.GRID_WD[k].panel,CT_TEXTURE)
CRT.UI.GRID_WD[k][1][0]["CL_Icon"]:SetHidden(false)
CRT.UI.GRID_WD[k][1][0]["CL_Icon"]:SetDimensions(20,20)
CRT.UI.GRID_WD[k][1][0]["CL_Icon"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][1][0]["CL_Icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,120,y)
+ CRT.UI.GRID_WD[k][1][0]["CL_Icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,120,20)
CRT.UI.GRID_WD[k][1][0]["CL_Icon"]:SetTexture("/esoui/art/icons/ability_tradecraft_008.dds")
- CRT.UI.GRID_WD[k][1][0]["CL_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_1_text",CRT.UI.GRID_TLW,CT_LABEL)
+ CRT.UI.GRID_WD[k][1][0]["CL_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_1_text",CRT.UI.GRID_WD[k].panel,CT_LABEL)
CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetHidden(false)
CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetFont("ZoFontGame")
- CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetDimensions(360,20)
+ CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetDimensions(panelwidth,20)
CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetColor(CRT.SV.Settings.GRID.Color.r, CRT.SV.Settings.GRID.Color.g, CRT.SV.Settings.GRID.Color.b, CRT.SV.Settings.GRID.Color.a)
CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,140,y)
+ CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,140,20)
CRT.UI.GRID_WD[k][1][0]["CL_Text"]:SetText("Loading")
--Woodworking
CRT.UI.GRID_WD[k][2] = {}
CRT.UI.GRID_WD[k][2][0] = {}
- CRT.UI.GRID_WD[k][2][0]["WO_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_2_icon",CRT.UI.GRID_TLW,CT_TEXTURE)
+ CRT.UI.GRID_WD[k][2][0]["WO_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_2_icon",CRT.UI.GRID_WD[k].panel,CT_TEXTURE)
CRT.UI.GRID_WD[k][2][0]["WO_Icon"]:SetHidden(false)
CRT.UI.GRID_WD[k][2][0]["WO_Icon"]:SetDimensions(20,20)
CRT.UI.GRID_WD[k][2][0]["WO_Icon"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][2][0]["WO_Icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,240,y)
+ CRT.UI.GRID_WD[k][2][0]["WO_Icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,240,20)
CRT.UI.GRID_WD[k][2][0]["WO_Icon"]:SetTexture("/esoui/art/icons/ability_tradecraft_009.dds")
- CRT.UI.GRID_WD[k][2][0]["WO_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_2_text",CRT.UI.GRID_TLW,CT_LABEL)
+ CRT.UI.GRID_WD[k][2][0]["WO_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_2_text",CRT.UI.GRID_WD[k].panel,CT_LABEL)
CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetHidden(false)
CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetFont("ZoFontGame")
- CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetDimensions(360,20)
+ CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetDimensions(width,20)
CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetColor(CRT.SV.Settings.GRID.Color.r, CRT.SV.Settings.GRID.Color.g, CRT.SV.Settings.GRID.Color.b, CRT.SV.Settings.GRID.Color.a)
CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,260,y)
+ CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,260,20)
CRT.UI.GRID_WD[k][2][0]["WO_Text"]:SetText("Loading")
for id_craft = 0, 2,1 do
for simcraft = 1, 3,1 do
- if (num_char == 0) then
+ -- if (num_char == 0) then
x = (120*id_craft)+20
y = 20+(20*simcraft)
- else
- x = (120*id_craft)+20
- y = 20+num_char*120+(20*simcraft)
- end
+ -- else
+ -- x = (120*id_craft)+20
+ -- y = 20+num_char*panelheight+(20*simcraft)
+ -- end
CRT.UI.GRID_WD[k][id_craft][simcraft] = {}
-- item icon
- CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_icon",CRT.UI.GRID_TLW,CT_TEXTURE)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_icon",CRT.UI.GRID_WD[k].panel,CT_TEXTURE)
CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHidden(true)
CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetDimensions(20,20)
CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,x-20,y)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,x-20,y)
CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetMouseEnabled(true)
CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHandler("OnMouseEnter", function (self)
ZO_Tooltips_ShowTextTooltip(self, TOP, CRT.SV.data.Craft[k][id_craft][simcraft]["Item_name"])
@@ -163,11 +162,11 @@ function CRT.GRID_Create_Character(k)
-- trait icon
- CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_trait",CRT.UI.GRID_TLW,CT_TEXTURE)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_trait",CRT.UI.GRID_WD[k].panel,CT_TEXTURE)
CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHidden(true)
CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetDimensions(20,20)
CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,x,y)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,x,y)
CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetMouseEnabled(true)
CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHandler("OnMouseEnter", function (self)
ZO_Tooltips_ShowTextTooltip(self, TOP, CRT.SV.data.Craft[k][id_craft][simcraft]["Trait_description"])
@@ -176,20 +175,20 @@ function CRT.GRID_Create_Character(k)
ZO_Tooltips_HideTextTooltip()
end)
-- text
- CRT.UI.GRID_WD[k][id_craft][simcraft]["text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_text",CRT.UI.GRID_TLW,CT_LABEL)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_text",CRT.UI.GRID_WD[k].panel,CT_LABEL)
CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetHidden(true)
CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetFont("ZoFontGame")
CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetDimensions(360,20)
CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetColor(CRT.SV.Settings.GRID.Color.r, CRT.SV.Settings.GRID.Color.g, CRT.SV.Settings.GRID.Color.b, CRT.SV.Settings.GRID.Color.a)
CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetAlpha(1)
- CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,x+20,y)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetAnchor(TOPLEFT,CRT.UI.GRID_WD[k].panel,TOPLEFT,x+20,y)
end
end
num_char = num_char+1
- CRT.UI.GRID_TLW:SetDimensions(360,120*num_char)
+ CRT.UI.GRID_TLW:SetDimensions(width,panelheight*num_char)
end
end
@@ -245,7 +244,7 @@ function CRT.GRID_Sort()
CRT.Char_sort()
- 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
+ -- 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