diff --git a/CraftResearchTimer.txt b/CraftResearchTimer.txt
index 0ce3591..477d4f8 100644
--- a/CraftResearchTimer.txt
+++ b/CraftResearchTimer.txt
@@ -6,7 +6,6 @@
lib\LibStub.lua
-
lua\CORE.lua
lua\ALERT.lua
lua\GRID.lua
diff --git a/lua/ALERT.lua b/lua/ALERT.lua
index f5412cc..fb961d9 100644
--- a/lua/ALERT.lua
+++ b/lua/ALERT.lua
@@ -5,18 +5,18 @@
function CRT_Research_Alert(k, id_craft, simcraft, start)
if (start == true) then
for i = 0, 2, 1 do
- local MaxResearch = CRT.SV.Craft_data[k][i]["MaxResearch"]
- local Simu_craft = CRT.SV.Craft_data[k][i]["Simu_craft"]
+ local MaxResearch = CRT.SV.data.Craft[k][i]["MaxResearch"]
+ local Simu_craft = CRT.SV.data.Craft[k][i]["Simu_craft"]
if(Simu_craft < MaxResearch) then
if (i == 0 and CRT.SV.Settings.ALERT.BS == true) then
local msg = "Warning only "..Simu_craft.." / "..MaxResearch.." on Blacksmithing ( "..k.." )"
- CRT_ALERT_WD:AddMessage(msg, CRT.SV.Settings.ALERT.Color.r, CRT.SV.Settings.ALERT.Color.g, CRT.SV.Settings.ALERT.Color.b)
+ CRT.UI.ALERT_WD:AddMessage(msg, CRT.SV.Settings.ALERT.Color.r, CRT.SV.Settings.ALERT.Color.g, CRT.SV.Settings.ALERT.Color.b)
elseif (i == 1 and CRT.SV.Settings.ALERT.CL == true) then
local msg = "Warning only "..Simu_craft.." / "..MaxResearch.." on Clothing ( "..k.." )"
- CRT_ALERT_WD:AddMessage(msg, CRT.SV.Settings.ALERT.Color.r, CRT.SV.Settings.ALERT.Color.g, CRT.SV.Settings.ALERT.Color.b)
+ CRT.UI.ALERT_WD:AddMessage(msg, CRT.SV.Settings.ALERT.Color.r, CRT.SV.Settings.ALERT.Color.g, CRT.SV.Settings.ALERT.Color.b)
elseif (i == 2 and CRT.SV.Settings.ALERT.WO == true) then
local msg = "Warning only "..Simu_craft.." / "..MaxResearch.." on Woodworking ( "..k.." )"
- CRT_ALERT_WD:AddMessage(msg, CRT.SV.Settings.ALERT.Color.r, CRT.SV.Settings.ALERT.Color.g, CRT.SV.Settings.ALERT.Color.b)
+ CRT.UI.ALERT_WD:AddMessage(msg, CRT.SV.Settings.ALERT.Color.r, CRT.SV.Settings.ALERT.Color.g, CRT.SV.Settings.ALERT.Color.b)
end
end
end
@@ -24,9 +24,9 @@ function CRT_Research_Alert(k, id_craft, simcraft, start)
-- UPDATE SIMU_CRAFT
- local MaxResearch = CRT.SV.Craft_data[k][id_craft]["MaxResearch"]
- local Simu_craft = CRT.SV.Craft_data[k][id_craft]["Simu_craft"] - 1 -- set new simucraft
- CRT.SV.Craft_data[k][id_craft]["Simu_craft"] = Simu_craft -- save new simucraft
+ local MaxResearch = CRT.SV.data.Craft[k][id_craft]["MaxResearch"]
+ local Simu_craft = CRT.SV.data.Craft[k][id_craft]["Simu_craft"] - 1 -- set new simucraft
+ CRT.SV.data.Craft[k][id_craft]["Simu_craft"] = Simu_craft -- save new simucraft
if (id_craft == 0) then
id_text = "BS_Text"
elseif(id_craft == 1) then
@@ -35,79 +35,77 @@ function CRT_Research_Alert(k, id_craft, simcraft, start)
id_text = "WO_Text"
end
- CRT_GRID_WD[k][id_craft][0][id_text]:SetText(" "..Simu_craft.." / "..MaxResearch)
+ CRT.UI.GRID_WD[k][id_craft][0][id_text]:SetText(" "..Simu_craft.." / "..MaxResearch)
- local Item_name = CRT.SV.Craft_data[k][id_craft][simcraft]["Item_name"]
- local Trait_name = CRT.SV.Craft_data[k][id_craft][simcraft]["Trait_name"]
+ local Item_name = CRT.SV.data.Craft[k][id_craft][simcraft]["Item_name"]
+ local Trait_name = CRT.SV.data.Craft[k][id_craft][simcraft]["Trait_name"]
local msg = "Reseach completed on "..k.." ( "..Item_name.." - "..Trait_name.." )"
- CRT_ALERT_WD:AddMessage(msg,1,0,0)
+ CRT.UI.ALERT_WD:AddMessage(msg,1,0,0)
end
end
function CRT_Alert_Create()
- CRT_ALERT_TLW = WINDOW_MANAGER:CreateTopLevelWindow("CRT_ALERT_TLW")
- CRT_ALERT_TLW:SetDimensions(800,300)
- CRT_ALERT_TLW:SetHidden(not CRT.SV.Settings.ALERT.hidden)
- CRT_ALERT_TLW:SetClampedToScreen(false)
- CRT_ALERT_TLW:SetMovable(CRT.SV.Settings.lock)
- CRT_ALERT_TLW:SetMouseEnabled(true)
- CRT_ALERT_TLW:SetDrawLayer(0)
- CRT_ALERT_TLW:SetScale(1)
- CRT_ALERT_TLW:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.ALERT.offset.X, CRT.SV.Settings.ALERT.offset.Y)
- CRT_ALERT_TLW:SetHandler("OnMouseUp", function(self) CRT_Save_position("ALERT")end)
+ CRT.UI.ALERT_TLW = WINDOW_MANAGER:CreateTopLevelWindow("CRT_ALERT_TLW")
+ CRT.UI.ALERT_TLW:SetDimensions(800,300)
+ CRT.UI.ALERT_TLW:SetHidden(not CRT.SV.Settings.ALERT.hidden)
+ CRT.UI.ALERT_TLW:SetClampedToScreen(false)
+ CRT.UI.ALERT_TLW:SetMovable(CRT.SV.Settings.lock)
+ CRT.UI.ALERT_TLW:SetMouseEnabled(true)
+ CRT.UI.ALERT_TLW:SetDrawLayer(0)
+ CRT.UI.ALERT_TLW:SetScale(1)
+ CRT.UI.ALERT_TLW:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.ALERT.offset.X, CRT.SV.Settings.ALERT.offset.Y)
+ CRT.UI.ALERT_TLW:SetHandler("OnMouseUp", function(self) CRT_Save_position("ALERT")end)
--Text Buffer
- CRT_ALERT_WD = WINDOW_MANAGER:CreateControl("CRT_ALERT_WB",CRT_ALERT_TLW,CT_TEXTBUFFER)
- CRT_ALERT_WD:SetDimensions( 800, 300 )
- CRT_ALERT_WD:SetFont( "ZoFontGame" )
- CRT_ALERT_WD:SetAnchor(TOPLEFT,lsSum,TOPLEFT,0,0)
- CRT_ALERT_WD:SetLineFade(10,2)
- CRT_ALERT_WD:SetHorizontalAlignment(1)
- CRT_ALERT_WD:SetClearBufferAfterFadeout(true)
+ CRT.UI.ALERT_WD = WINDOW_MANAGER:CreateControl("CRT_ALERT_WB",CRT.UI.ALERT_TLW,CT_TEXTBUFFER)
+ CRT.UI.ALERT_WD:SetDimensions( 800, 300 )
+ CRT.UI.ALERT_WD:SetFont( "ZoFontGame" )
+ CRT.UI.ALERT_WD:SetAnchor(TOPLEFT,lsSum,TOPLEFT,0,0)
+ CRT.UI.ALERT_WD:SetLineFade(10,2)
+ CRT.UI.ALERT_WD:SetHorizontalAlignment(1)
+ CRT.UI.ALERT_WD:SetClearBufferAfterFadeout(true)
-- CRT_ALERT_WB:SetLinkEnabled( true )
- CRT_ALERT_BD = WINDOW_MANAGER:CreateControl("CRT_ALERT_BD",CRT_ALERT_TLW,CT_BACKDROP)
- CRT_ALERT_BD:SetHidden(not CRT.SV.Settings.ALERT.preview)
- CRT_ALERT_BD:SetDimensions( 800 , 300 )
- CRT_ALERT_BD:SetCenterColor(0.1,0.1,0.1,1)
- CRT_ALERT_BD:SetEdgeColor(0,0,0,1)
- CRT_ALERT_BD:SetEdgeTexture("", 8, 1, 1)
- CRT_ALERT_BD:SetAlpha(0.6)
- CRT_ALERT_BD:SetAnchor(TOPLEFT,lsSum,TOPLEFT,0,0)
+ CRT.UI.ALERT_BD = WINDOW_MANAGER:CreateControl("CRT_ALERT_BD",CRT.UI.ALERT_TLW,CT_BACKDROP)
+ CRT.UI.ALERT_BD:SetHidden(not CRT.SV.Settings.ALERT.preview)
+ CRT.UI.ALERT_BD:SetDimensions( 800 , 300 )
+ CRT.UI.ALERT_BD:SetCenterColor(0.1,0.1,0.1,1)
+ CRT.UI.ALERT_BD:SetEdgeColor(0,0,0,1)
+ CRT.UI.ALERT_BD:SetEdgeTexture("", 8, 1, 1)
+ CRT.UI.ALERT_BD:SetAlpha(0.6)
+ CRT.UI.ALERT_BD:SetAnchor(TOPLEFT,lsSum,TOPLEFT,0,0)
end
function CRT_ALERT_Update(timestamp)
- local meta = getmetatable(CRT.SV.Craft_data)
-
- for k, _ in pairs(meta.__index) do
- if (k ~= "version" and CRT.SV.Craft_data[CRT.playername]["Start"] == true) then
+ local k,j
+ for k, _ in pairs(CRT.SV.data.Craft) do
+ if (CRT.SV.data.Craft[CRT.playername]["Start"] == true) then
local CRT_Current_PlayerPosition = GetMapPlayerPosition("player")
if (CRT_Current_PlayerPosition ~= CRT_Start_PlayerPosition) then
- CRT.SV.Craft_data[CRT.playername]["Start"] = false
+ CRT.SV.data.Craft[CRT.playername]["Start"] = false
CRT_Research_Alert(CRT.playername, nil, nil, true)
- for k, _ in pairs(meta.__index) do
- if ((k ~= "version" and k ~= CRT.playername) and (CRT.SV.Craft_data[k][0]["Simu_craft"] ~= 0 or CRT.SV.Craft_data[k][1]["Simu_craft"] ~= 0 or CRT.SV.Craft_data[k][2]["Simu_craft"] ~= 0)) then
+ for j, _ in pairs(CRT.SV.data.Craft) do
+ if ((k ~= CRT.playername) and (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
CRT_Research_Alert(k, nil, nil, true)
end
end
end
end
- if (k ~= "version") then
+
for id_craft = 0, 2,1 do
for simcraft = 1, 3,1 do
- if (CRT.SV.Craft_data[k][id_craft][simcraft] ~= nil)then
- local currenttimer = CRT.SV.Craft_data[k][id_craft][simcraft]["EndTimeStamp"] - timestamp - 1
+ if (CRT.SV.data.Craft[k][id_craft][simcraft] ~= nil)then
+ local currenttimer = CRT.SV.data.Craft[k][id_craft][simcraft]["EndTimeStamp"] - timestamp - 1
if (currenttimer <= 0) then
- if (CRT.SV.Craft_data[k][id_craft][simcraft]["Alert"] == true) then
- CRT.SV.Craft_data[k][id_craft][simcraft]["Alert"] = false
+ if (CRT.SV.data.Craft[k][id_craft][simcraft]["Alert"] == true) then
+ CRT.SV.data.Craft[k][id_craft][simcraft]["Alert"] = false
CRT_Research_Alert(k, id_craft, simcraft, false)
end
end
end
end
end
- end
end
end
\ No newline at end of file
diff --git a/lua/CORE.lua b/lua/CORE.lua
index c1311f9..06dad56 100644
--- a/lua/CORE.lua
+++ b/lua/CORE.lua
@@ -3,7 +3,7 @@
function CRT_Collect_Data()
- CRT.SV.Craft_data[CRT.playername].shortest = 99999999 -- for this player find next due.
+ CRT.SV.data.Craft[CRT.playername].shortest = 99999999 -- for this player find next due.
CRT_Info_Research(CRAFTING_TYPE_BLACKSMITHING, 0)
CRT_Info_Research(CRAFTING_TYPE_CLOTHIER, 1)
CRT_Info_Research(CRAFTING_TYPE_WOODWORKING, 2)
@@ -15,7 +15,7 @@ function CRT_Info_Research(craft_type,id_craft)
local MaxResearch = GetMaxSimultaneousSmithingResearch(craft_type)
local nbtype = GetNumSmithingResearchLines(craft_type) --Nombre de item craftable pour un craft(ex couture: jambe/robe/ect)
- CRT.SV.Craft_data[CRT.playername][id_craft] = {}
+ CRT.SV.data.Craft[CRT.playername][id_craft] = {}
for ResearchLines = 1, nbtype, 1 do
@@ -33,38 +33,35 @@ function CRT_Info_Research(craft_type,id_craft)
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft] = {}
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft]["PlayerName"] = CRT.playername
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft]["Alert"] = true
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft]["EndTimeStamp"] = GetTimeStamp() + timeRemaining
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft]["Item_name"] = string.sub(item_name, 1, 18)
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft]["Item_icon"] = item_icon
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft]["Trait_name"] = trait_name
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft]["Trait_icon"] = trait_icon
- CRT.SV.Craft_data[CRT.playername][id_craft][Simu_craft]["Trait_description"] = trait_description
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft] = {}
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft]["PlayerName"] = CRT.playername
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft]["Alert"] = true
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft]["EndTimeStamp"] = GetTimeStamp() + timeRemaining
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft]["Item_name"] = string.sub(item_name, 1, 18)
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft]["Item_icon"] = item_icon
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft]["Trait_name"] = trait_name
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft]["Trait_icon"] = trait_icon
+ CRT.SV.data.Craft[CRT.playername][id_craft][Simu_craft]["Trait_description"] = trait_description
- if CRT.SV.Craft_data[CRT.playername].shortest > timeRemaining
- then CRT.SV.Craft_data[CRT.playername].shortest = timeRemaining
+ if CRT.SV.data.Craft[CRT.playername].shortest > timeRemaining
+ then CRT.SV.data.Craft[CRT.playername].shortest = timeRemaining
end
-- d("Type de craft :"..id_craft.." nom de l'item :"..name.." temps restant :"..temp_timer[Simu_craft])
end
end
end
- CRT.SV.Craft_data[CRT.playername][id_craft]["MaxResearch"] = MaxResearch
- CRT.SV.Craft_data[CRT.playername][id_craft]["Simu_craft"] = Simu_craft
+ CRT.SV.data.Craft[CRT.playername][id_craft]["MaxResearch"] = MaxResearch
+ CRT.SV.data.Craft[CRT.playername][id_craft]["Simu_craft"] = Simu_craft
end
function CRT_Research_started()
-- erase all data for this character
- CRT.SV.Craft_data[CRT.playername] = {}
+ CRT.SV.data.Craft[CRT.playername] = {}
-- Collect new data
CRT_Collect_Data()
- if (CRT_GRID_TLW == nil) then
- CRT_GRID_Create()
- end
- if (CRT_GRID_WD[CRT.playername] == nil) then
+ if (CRT.UI.GRID_WD[CRT.playername] == nil) then
CRT_GRID_Create_Character(CRT.playername)
end
end
\ No newline at end of file
diff --git a/lua/CRAFT.lua b/lua/CRAFT.lua
index 28feb6b..53432b7 100644
--- a/lua/CRAFT.lua
+++ b/lua/CRAFT.lua
@@ -25,31 +25,31 @@ function CRT_CRAFT_Create()
for id_craft = 0, 2, 1 do
- CRT_CRAFT_TLW[id_craft] = WINDOW_MANAGER:CreateTopLevelWindow("CRT_CRAFT_TLW_"..id_craft)
- CRT_CRAFT_TLW[id_craft]:SetDimensions(CRT_mode_width,CRT_mode_height)
- CRT_CRAFT_TLW[id_craft]:SetHidden(false)
- CRT_CRAFT_TLW[id_craft]:SetClampedToScreen(false)
- CRT_CRAFT_TLW[id_craft]:SetMovable(CRT.SV.Settings.lock)
- CRT_CRAFT_TLW[id_craft]:SetMouseEnabled(true)
- CRT_CRAFT_TLW[id_craft]:SetDrawLayer(1)
- CRT_CRAFT_TLW[id_craft]:SetScale(scale[id_craft])
+ CRT.UI.CRAFT_TLW[id_craft] = WINDOW_MANAGER:CreateTopLevelWindow("CRT_CRAFT_TLW_"..id_craft)
+ CRT.UI.CRAFT_TLW[id_craft]:SetDimensions(CRT_mode_width,CRT_mode_height)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(false)
+ CRT.UI.CRAFT_TLW[id_craft]:SetClampedToScreen(false)
+ CRT.UI.CRAFT_TLW[id_craft]:SetMovable(CRT.SV.Settings.lock)
+ CRT.UI.CRAFT_TLW[id_craft]:SetMouseEnabled(true)
+ CRT.UI.CRAFT_TLW[id_craft]:SetDrawLayer(1)
+ CRT.UI.CRAFT_TLW[id_craft]:SetScale(scale[id_craft])
if (id_craft == 0) then
- CRT_CRAFT_TLW[id_craft]:SetHidden(not CRT.SV.Settings.BS.craft)
- CRT_CRAFT_TLW[id_craft]:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.BS.offset.X, CRT.SV.Settings.BS.offset.Y)
- CRT_CRAFT_TLW[id_craft]:SetHandler("OnMouseUp", function(self) CRT_Save_position(id_craft)end)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(not CRT.SV.Settings.BS.craft)
+ CRT.UI.CRAFT_TLW[id_craft]:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.BS.offset.X, CRT.SV.Settings.BS.offset.Y)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHandler("OnMouseUp", function(self) CRT_Save_position(id_craft)end)
elseif(id_craft == 1) then
- CRT_CRAFT_TLW[id_craft]:SetHidden(not CRT.SV.Settings.CL.craft)
- CRT_CRAFT_TLW[id_craft]:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.CL.offset.X, CRT.SV.Settings.CL.offset.Y)
- CRT_CRAFT_TLW[id_craft]:SetHandler("OnMouseUp", function(self) CRT_Save_position(id_craft)end)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(not CRT.SV.Settings.CL.craft)
+ CRT.UI.CRAFT_TLW[id_craft]:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.CL.offset.X, CRT.SV.Settings.CL.offset.Y)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHandler("OnMouseUp", function(self) CRT_Save_position(id_craft)end)
elseif(id_craft == 2) then
- CRT_CRAFT_TLW[id_craft]:SetHidden(not CRT.SV.Settings.WO.craft)
- CRT_CRAFT_TLW[id_craft]:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.WO.offset.X, CRT.SV.Settings.WO.offset.Y)
- CRT_CRAFT_TLW[id_craft]:SetHandler("OnMouseUp", function(self) CRT_Save_position(id_craft)end)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(not CRT.SV.Settings.WO.craft)
+ CRT.UI.CRAFT_TLW[id_craft]:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.WO.offset.X, CRT.SV.Settings.WO.offset.Y)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHandler("OnMouseUp", function(self) CRT_Save_position(id_craft)end)
end
- CRT_CRAFT_BD[id_craft] = WINDOW_MANAGER:CreateControlFromVirtual(CRT.name.."_Windows"..id_craft.."_BD",CRT_CRAFT_TLW[id_craft], "ZO_DefaultBackdrop")
- CRT_CRAFT_BD[id_craft]:SetAlpha(alpha[id_craft])
+ CRT.UI.CRAFT_BD[id_craft] = WINDOW_MANAGER:CreateControlFromVirtual(CRT.name.."_Windows"..id_craft.."_BD",CRT.UI.CRAFT_TLW[id_craft], "ZO_DefaultBackdrop")
+ CRT.UI.CRAFT_BD[id_craft]:SetAlpha(alpha[id_craft])
@@ -57,41 +57,41 @@ function CRT_CRAFT_Create()
---- WINDOWS 0 ----
-- icon
- CRT_CRAFT_WD[id_craft] = {}
- CRT_CRAFT_WD[id_craft][0] = {}
+ CRT.UI.CRAFT_WD[id_craft] = {}
+ CRT.UI.CRAFT_WD[id_craft][0] = {}
if (CRT.SV.Settings.mode == "Icon") then
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"] = WINDOW_MANAGER:CreateControl("CRT_CRAFT_WD_"..id_craft.."_0_icon",CRT_CRAFT_TLW[id_craft],CT_TEXTURE)
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetHidden(false)
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetDimensions(22,22)
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetAlpha(1)
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetAnchor(TOPLEFT,CRT_CRAFT_TLW[id_craft],TOPLEFT,0,0)
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetMouseEnabled(true)
- -- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetHandler("OnMouseEnter", function (self) ZO_Tooltips_ShowTextTooltip(self, RIGHT, updatetooltip) end)
- -- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetHandler("OnMouseExit", function (self) ZO_Tooltips_HideTextTooltip() end)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"] = WINDOW_MANAGER:CreateControl("CRT_CRAFT_WD_"..id_craft.."_0_icon",CRT.UI.CRAFT_TLW[id_craft],CT_TEXTURE)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetHidden(false)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetDimensions(22,22)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetAlpha(1)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetAnchor(TOPLEFT,CRT.UI.CRAFT_TLW[id_craft],TOPLEFT,0,0)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetMouseEnabled(true)
+ -- CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetHandler("OnMouseEnter", function (self) ZO_Tooltips_ShowTextTooltip(self, RIGHT, updatetooltip) end)
+ -- CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetHandler("OnMouseExit", function (self) ZO_Tooltips_HideTextTooltip() end)
if (id_craft == 0) then
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetTexture("/esoui/art/icons/ability_smith_007.dds")
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetTexture("/esoui/art/icons/ability_smith_007.dds")
elseif (id_craft == 1) then
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetTexture("/esoui/art/icons/ability_tradecraft_008.dds")
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetTexture("/esoui/art/icons/ability_tradecraft_008.dds")
elseif (id_craft == 2) then
- CRT_CRAFT_WD[id_craft][0]["Craft_icon"]:SetTexture("/esoui/art/icons/ability_tradecraft_009.dds")
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_icon"]:SetTexture("/esoui/art/icons/ability_tradecraft_009.dds")
end
end
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"] = WINDOW_MANAGER:CreateControl("CRT_CRAFT_WD_"..id_craft.."_0_text",CRT_CRAFT_TLW[id_craft],CT_LABEL)
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetHidden(false)
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetFont(CRT.font)
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetDimensions(CRT_mode_width,CRT_mode_height)
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetAlpha(1)
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetAnchor(TOPLEFT,CRT_CRAFT_TLW[id_craft],TOPLEFT,CRT_vertical_move,0)
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetText("Loading")
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"] = WINDOW_MANAGER:CreateControl("CRT_CRAFT_WD_"..id_craft.."_0_text",CRT.UI.CRAFT_TLW[id_craft],CT_LABEL)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetHidden(false)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetFont(CRT.font)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetDimensions(CRT_mode_width,CRT_mode_height)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetAlpha(1)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetAnchor(TOPLEFT,CRT.UI.CRAFT_TLW[id_craft],TOPLEFT,CRT_vertical_move,0)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetText("Loading")
if(id_craft == 0) then
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetColor(CRT.SV.Settings.BS.Color.r, CRT.SV.Settings.BS.Color.g, CRT.SV.Settings.BS.Color.b, CRT.SV.Settings.BS.Color.a)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetColor(CRT.SV.Settings.BS.Color.r, CRT.SV.Settings.BS.Color.g, CRT.SV.Settings.BS.Color.b, CRT.SV.Settings.BS.Color.a)
elseif(id_craft == 1) then
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetColor(CRT.SV.Settings.CL.Color.r, CRT.SV.Settings.CL.Color.g, CRT.SV.Settings.CL.Color.b, CRT.SV.Settings.CL.Color.a)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetColor(CRT.SV.Settings.CL.Color.r, CRT.SV.Settings.CL.Color.g, CRT.SV.Settings.CL.Color.b, CRT.SV.Settings.CL.Color.a)
elseif(id_craft == 2) then
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetColor(CRT.SV.Settings.WO.Color.r, CRT.SV.Settings.WO.Color.g, CRT.SV.Settings.WO.Color.b, CRT.SV.Settings.WO.Color.a)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetColor(CRT.SV.Settings.WO.Color.r, CRT.SV.Settings.WO.Color.g, CRT.SV.Settings.WO.Color.b, CRT.SV.Settings.WO.Color.a)
end
@@ -100,41 +100,41 @@ function CRT_CRAFT_Create()
for simcraft = 1, 3 , 1 do
local x = 5
x = x + simcraft*20
- CRT_CRAFT_WD[id_craft][simcraft] = {}
+ CRT.UI.CRAFT_WD[id_craft][simcraft] = {}
--// icon
if (CRT.SV.Settings.mode == "Icon") then
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"] = WINDOW_MANAGER:CreateControl("CRT_CRAFT_WD_"..id_craft.."_"..simcraft.."_icon",CRT_CRAFT_TLW[id_craft],CT_TEXTURE)
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetHidden(true)
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetDimensions(20,20)
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetAlpha(1)
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetAnchor(TOPLEFT,CRT_CRAFT_TLW[id_craft],TOPLEFT,0,x)
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetMouseEnabled(true)
- if(CRT.SV.Craft_data[CRT.playername][id_craft][simcraft] ~= nil) then
- local tooltip = CRT.SV.Craft_data[CRT.playername][id_craft][simcraft]["Item_name"].." - ".. CRT.SV.Craft_data[CRT.playername][id_craft][simcraft]["Trait_description"]
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetHandler("OnMouseEnter", function (self) ZO_Tooltips_ShowTextTooltip(self, TOP, tooltip) end)
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetHandler("OnMouseExit", function (self) ZO_Tooltips_HideTextTooltip() end)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"] = WINDOW_MANAGER:CreateControl("CRT_CRAFT_WD_"..id_craft.."_"..simcraft.."_icon",CRT.UI.CRAFT_TLW[id_craft],CT_TEXTURE)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetHidden(true)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetDimensions(20,20)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetAlpha(1)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetAnchor(TOPLEFT,CRT.UI.CRAFT_TLW[id_craft],TOPLEFT,0,x)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetMouseEnabled(true)
+ if(CRT.SV.data.Craft[CRT.playername][id_craft][simcraft] ~= nil) then
+ local tooltip = CRT.SV.data.Craft[CRT.playername][id_craft][simcraft]["Item_name"].." - ".. CRT.SV.data.Craft[CRT.playername][id_craft][simcraft]["Trait_description"]
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetHandler("OnMouseEnter", function (self) ZO_Tooltips_ShowTextTooltip(self, TOP, tooltip) end)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetHandler("OnMouseExit", function (self) ZO_Tooltips_HideTextTooltip() end)
end
end
--// text
- CRT_CRAFT_WD[id_craft][simcraft]["text"] = WINDOW_MANAGER:CreateControl("CRT_CRAFT_WD_"..id_craft.."_"..simcraft.."_text",CRT_CRAFT_TLW[id_craft],CT_LABEL)
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetHidden(true)
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetFont(CRT.font)
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetDimensions(CRT_mode_width,CRT_mode_height)
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetAlpha(1)
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetAnchor(LEFT,CRT_CRAFT_TLW[id_craft],LEFT,CRT_vertical_move,x)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"] = WINDOW_MANAGER:CreateControl("CRT_CRAFT_WD_"..id_craft.."_"..simcraft.."_text",CRT.UI.CRAFT_TLW[id_craft],CT_LABEL)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetHidden(true)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetFont(CRT.font)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetDimensions(CRT_mode_width,CRT_mode_height)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetAlpha(1)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetAnchor(LEFT,CRT.UI.CRAFT_TLW[id_craft],LEFT,CRT_vertical_move,x)
if(id_craft == 0) then
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetColor(CRT.SV.Settings.BS.Color.r, CRT.SV.Settings.BS.Color.g, CRT.SV.Settings.BS.Color.b, CRT.SV.Settings.BS.Color.a)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetColor(CRT.SV.Settings.BS.Color.r, CRT.SV.Settings.BS.Color.g, CRT.SV.Settings.BS.Color.b, CRT.SV.Settings.BS.Color.a)
elseif(id_craft == 1) then
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetColor(CRT.SV.Settings.CL.Color.r, CRT.SV.Settings.CL.Color.g, CRT.SV.Settings.CL.Color.b, CRT.SV.Settings.CL.Color.a)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetColor(CRT.SV.Settings.CL.Color.r, CRT.SV.Settings.CL.Color.g, CRT.SV.Settings.CL.Color.b, CRT.SV.Settings.CL.Color.a)
elseif(id_craft == 2) then
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetColor(CRT.SV.Settings.WO.Color.r, CRT.SV.Settings.WO.Color.g, CRT.SV.Settings.WO.Color.b, CRT.SV.Settings.WO.Color.a)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetColor(CRT.SV.Settings.WO.Color.r, CRT.SV.Settings.WO.Color.g, CRT.SV.Settings.WO.Color.b, CRT.SV.Settings.WO.Color.a)
end
if (CRT.SV.Settings.mode == "Text") then
- if(CRT.SV.Craft_data[CRT.playername][id_craft][simcraft] ~= nil) then
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetMouseEnabled(true)
- local tooltip = CRT.SV.Craft_data[CRT.playername][id_craft][simcraft]["Item_name"].." - ".. CRT.SV.Craft_data[CRT.playername][id_craft][simcraft]["Trait_description"]
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetHandler("OnMouseEnter", function (self) ZO_Tooltips_ShowTextTooltip(self, TOP, tooltip) end)
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetHandler("OnMouseExit", function (self) ZO_Tooltips_HideTextTooltip() end)
+ if(CRT.SV.data.Craft[CRT.playername][id_craft][simcraft] ~= nil) then
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetMouseEnabled(true)
+ local tooltip = CRT.SV.data.Craft[CRT.playername][id_craft][simcraft]["Item_name"].." - ".. CRT.SV.data.Craft[CRT.playername][id_craft][simcraft]["Trait_description"]
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetHandler("OnMouseEnter", function (self) ZO_Tooltips_ShowTextTooltip(self, TOP, tooltip) end)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetHandler("OnMouseExit", function (self) ZO_Tooltips_HideTextTooltip() end)
end
end
end
@@ -144,8 +144,8 @@ end
function CRT_CRAFT_Update(timestamp)
for id_craft = 0, 2,1 do
- local MaxResearch = CRT.SV.Craft_data[CRT.playername][id_craft]["MaxResearch"]
- local Simu_craft = CRT.SV.Craft_data[CRT.playername][id_craft]["Simu_craft"]
+ local MaxResearch = CRT.SV.data.Craft[CRT.playername][id_craft]["MaxResearch"]
+ local Simu_craft = CRT.SV.data.Craft[CRT.playername][id_craft]["Simu_craft"]
local title = "error"
if (CRT.SV.Settings.mode == "Text" and id_craft == 0) then
@@ -157,33 +157,33 @@ function CRT_CRAFT_Update(timestamp)
elseif (CRT.SV.Settings.mode == "Icon") then
title = " "..Simu_craft.." / "..MaxResearch
end
- CRT_CRAFT_WD[id_craft][0]["Craft_Text"]:SetText(title)
+ CRT.UI.CRAFT_WD[id_craft][0]["Craft_Text"]:SetText(title)
for simcraft = 1, 3,1 do
- if (CRT.SV.Craft_data[CRT.playername][id_craft][simcraft] ~= nil)then
+ if (CRT.SV.data.Craft[CRT.playername][id_craft][simcraft] ~= nil)then
- local currenttimer = CRT.SV.Craft_data[CRT.playername][id_craft][simcraft]["EndTimeStamp"] - timestamp - 1
+ local currenttimer = CRT.SV.data.Craft[CRT.playername][id_craft][simcraft]["EndTimeStamp"] - timestamp - 1
local human_timer = CRT_Converthms(currenttimer)
local msg = "error"
if (CRT.SV.Settings.mode == "Icon") then
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetHidden(false)
- CRT_CRAFT_WD[id_craft][simcraft]["item_icon"]:SetTexture(CRT.SV.Craft_data[CRT.playername][id_craft][simcraft]["Item_icon"])
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetHidden(false)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["item_icon"]:SetTexture(CRT.SV.data.Craft[CRT.playername][id_craft][simcraft]["Item_icon"])
msg = human_timer
elseif (CRT.SV.Settings.mode == "Text") then
- local Item_name = CRT.SV.Craft_data[CRT.playername][id_craft][simcraft]["Item_name"]
+ local Item_name = CRT.SV.data.Craft[CRT.playername][id_craft][simcraft]["Item_name"]
msg = Item_name.." - "..human_timer
end
if (currenttimer > 0) then
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetHidden(false)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetHidden(false)
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetText(msg)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetText(msg)
elseif (currenttimer <= 0) then
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetHidden(false)
- CRT_CRAFT_WD[id_craft][simcraft]["text"]:SetText("|cFF0000Finished|r")
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetHidden(false)
+ CRT.UI.CRAFT_WD[id_craft][simcraft]["text"]:SetText("|cFF0000Finished|r")
end
end
diff --git a/lua/CraftResearchTimer.lua b/lua/CraftResearchTimer.lua
index 22f47c4..5170d83 100644
--- a/lua/CraftResearchTimer.lua
+++ b/lua/CraftResearchTimer.lua
@@ -14,6 +14,11 @@ CRT = {
interval = 20,
width = 100,
height = 80,
+ UI = {},
+ collect=0,
+ data_defaults = {
+ Craft = {}
+ },
svDefaults = {
icon_width = 100,
icon_height = 80,
@@ -29,7 +34,7 @@ CRT = {
},
craft = true,
Hide_0 = false,
- Hide_Type = "Always",
+ Hide_Type = "Menus only",
BackdropAlpha = 0.5,
Scale = 1,
Color = {
@@ -45,7 +50,7 @@ CRT = {
},
craft = true,
Hide_0 = false,
- Hide_Type = "Always",
+ Hide_Type = "Menus only",
BackdropAlpha = 0.5,
Scale = 1,
Color = {
@@ -61,7 +66,7 @@ CRT = {
},
craft = true,
Hide_0 = false,
- Hide_Type = "Always",
+ Hide_Type = "Menus only",
BackdropAlpha = 0.5,
Scale = 1,
Color = {
@@ -71,12 +76,12 @@ CRT = {
a = 1 },
},
GRID = {
- hidden = false,
+ hidden = true,
offset = {
X = 950,
Y = 400,
},
- Hide_Type = "Always",
+ Hide_Type = "Menus only",
BackdropAlpha = 0.5,
Scale = 1,
Color = {
@@ -106,11 +111,19 @@ CRT = {
}
CRT.SV={}
-CRT_GRID_WD = {}
+CRT.UI.GRID_TLW = {}
+CRT.UI.GRID_BD = {}
+CRT.UI.GRID_WD = {}
+CRT.UI.GRID_BTN = {}
+
+CRT.UI.CRAFT_TLW = {}
+CRT.UI.CRAFT_BD = {}
+CRT.UI.CRAFT_WD = {}
+
+CRT.UI.ALERT_TLW = {}
+CRT.UI.ALERT_BD = {}
+CRT.UI.ALERT_WD = {}
-CRT_CRAFT_TLW = {}
-CRT_CRAFT_BD = {}
-CRT_CRAFT_WD = {}
function CRT_Init(eventCode, addOnName)
@@ -120,9 +133,12 @@ function CRT_Init(eventCode, addOnName)
-- SavedVariables
CRT.SV.Settings = ZO_SavedVars:New(CRT.svName, CRT.svVersion*100, nil, CRT.svDefaults, nil)
- CRT.SV.Craft_data = ZO_SavedVars:NewAccountWide(CRT.svName, 1, "Craft_data", nil , nil )
- CRT.SV.Hireling_data = ZO_SavedVars:NewAccountWide(CRT.svName, 1, "Hireling_data", nil , nil )
+ CRT.SV.data = ZO_SavedVars:NewAccountWide(CRT.svName, 1, nil, CRT.data_defaults,nil )
+ --get rid of bad "version" key from CRT releases prior to this one
+ -- CRT.SV.data.Craft.versionx = nil
+ -- CRT.SV.Hireling_data.versionxx = nil
+
-- Slash commands
SLASH_COMMANDS[CRT.cmdsetup] = CRT_CommandText_setup
@@ -399,16 +415,20 @@ function CRT_Init(eventCode, addOnName)
--CRT_Alert_Check(playername,timestamp)
-- erase data for this character
- CRT.SV.Craft_data[CRT.playername] = {}
- CRT.SV.Craft_data[CRT.playername]["Start"] = true
- -- collect data
- CRT_Collect_Data(CRT.playername)
+ -- if CRT.SV.data.Craft == nil
+ -- then CRT.SV.data.Craft = {}
+ -- end
+ CRT.SV.data.Craft[CRT.playername] = {}
+ CRT.SV.data.Craft[CRT.playername]["Start"] = true
+ CRT_Collect_Data()
-- Create GRID
CRT_GRID_Create()
-- Create SOLO CRAFT
CRT_CRAFT_Create()
CRT.Init_done = true
+ -- Only after initialised do we hook any other events.
+ EVENT_MANAGER:RegisterForEvent(CRT.name, EVENT_SMITHING_TRAIT_RESEARCH_STARTED, CRT_Research_started)
end
end
@@ -447,7 +467,7 @@ end
EVENT_MANAGER:RegisterForEvent(CRT.name, EVENT_ADD_ON_LOADED, CRT_Init)
-EVENT_MANAGER:RegisterForEvent(CRT.name, EVENT_SMITHING_TRAIT_RESEARCH_STARTED, CRT_Research_started)
+
--EVENT_MANAGER:RegisterForEvent(CRT.name, EVENT_MAIL_OPEN_MAILBOX, CRT_Force_read)
--EVENT_MANAGER:RegisterForEvent(CRT.name, EVENT_MAIL_NUM_UNREAD_CHANGED, CRT_mail_check)
@@ -456,34 +476,34 @@ EVENT_MANAGER:RegisterForEvent(CRT.name, EVENT_SMITHING_TRAIT_RESEARCH_STARTED,
function CRT_ToggleUI()
if (CRT.SV.Settings.BS.craft == true and CRT.SV.Settings.BS.Hide_Type == "Toggle keybind") then
- if (CRT_CRAFT_TLW[0]:IsHidden() == true) then
- CRT_CRAFT_TLW[0]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[0]:IsHidden() == true) then
+ CRT.UI.CRAFT_TLW[0]:SetHidden(false)
else
- CRT_CRAFT_TLW[0]:SetHidden(true)
+ CRT.UI.CRAFT_TLW[0]:SetHidden(true)
end
end
if (CRT.SV.Settings.CL.craft == true and CRT.SV.Settings.CL.Hide_Type == "Toggle keybind") then
- if (CRT_CRAFT_TLW[1]:IsHidden() == true) then
- CRT_CRAFT_TLW[1]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[1]:IsHidden() == true) then
+ CRT.UI.CRAFT_TLW[1]:SetHidden(false)
else
- CRT_CRAFT_TLW[1]:SetHidden(true)
+ CRT.UI.CRAFT_TLW[1]:SetHidden(true)
end
end
if (CRT.SV.Settings.WO.craft == true and CRT.SV.Settings.WO.Hide_Type == "Toggle keybind") then
- if (CRT_CRAFT_TLW[2]:IsHidden() == true) then
- CRT_CRAFT_TLW[2]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[2]:IsHidden() == true) then
+ CRT.UI.CRAFT_TLW[2]:SetHidden(false)
else
- CRT_CRAFT_TLW[2]:SetHidden(true)
+ CRT.UI.CRAFT_TLW[2]:SetHidden(true)
end
end
end
function CRT_toggleGRID()
- if (CRT_GRID_TLW:IsHidden() == true) then
- CRT_GRID_TLW:SetHidden(false)
+ if (CRT.UI.GRID_TLW:IsHidden() == true) then
+ CRT.UI.GRID_TLW:SetHidden(false)
CRT.SV.Settings.GRID.hidden = false
else
- CRT_GRID_TLW:SetHidden(true)
+ CRT.UI.GRID_TLW:SetHidden(true)
CRT.SV.Settings.GRID.hidden = true
end
end
@@ -501,15 +521,15 @@ function CRT_toggleGUI()
if ((id_craft == 0 and CRT.SV.Settings.BS.craft == true) or (id_craft == 1 and CRT.SV.Settings.CL.craft == true) or (id_craft == 2 and CRT.SV.Settings.WO.craft == true)) then
if (hidemenu[id_craft] ~= "Toggle keybind") then
if (hidemenu[id_craft] == "Hide in menus" and checkUI == true)then
- CRT_CRAFT_TLW[id_craft]:SetHidden(true)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(true)
elseif (hidemenu[id_craft] == "Hide in menus" and checkUI == false)then
- CRT_CRAFT_TLW[id_craft]:SetHidden(false)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(false)
elseif (hidemenu[id_craft] == "Menus only" and checkUI == true) then
- CRT_CRAFT_TLW[id_craft]:SetHidden(false)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(false)
elseif (hidemenu[id_craft] == "Menus only" and checkUI == false) then
- CRT_CRAFT_TLW[id_craft]:SetHidden(true)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(true)
elseif (hidemenu[id_craft] == "Always") then
- CRT_CRAFT_TLW[id_craft]:SetHidden(false)
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(false)
end
end
end
@@ -520,8 +540,8 @@ function CRT_toggleGUI()
hide0[2] = CRT.SV.Settings.WO.Hide_0
- if (hide0[id_craft] == true and hidemenu[id_craft] ~= "Toggle keybind" and CRT.SV.Craft_data[CRT.playername][id_craft]["Simu_craft"] == 0) then
- CRT_CRAFT_TLW[id_craft]:SetHidden(true)
+ if (hide0[id_craft] == true and hidemenu[id_craft] ~= "Toggle keybind" and CRT.SV.data.Craft[CRT.playername][id_craft]["Simu_craft"] == 0) then
+ CRT.UI.CRAFT_TLW[id_craft]:SetHidden(true)
end
end
end
@@ -586,20 +606,20 @@ end
function CRT_Save_position(id_craft)
if (id_craft == 0) then
- CRT.SV.Settings.BS.offset.X = math.floor(CRT_CRAFT_TLW[id_craft]:GetLeft())
- CRT.SV.Settings.BS.offset.Y = math.floor(CRT_CRAFT_TLW[id_craft]:GetTop())
+ CRT.SV.Settings.BS.offset.X = math.floor(CRT.UI.CRAFT_TLW[id_craft]:GetLeft())
+ CRT.SV.Settings.BS.offset.Y = math.floor(CRT.UI.CRAFT_TLW[id_craft]:GetTop())
elseif (id_craft == 1) then
- CRT.SV.Settings.CL.offset.X = math.floor(CRT_CRAFT_TLW[id_craft]:GetLeft())
- CRT.SV.Settings.CL.offset.Y = math.floor(CRT_CRAFT_TLW[id_craft]:GetTop())
+ CRT.SV.Settings.CL.offset.X = math.floor(CRT.UI.CRAFT_TLW[id_craft]:GetLeft())
+ CRT.SV.Settings.CL.offset.Y = math.floor(CRT.UI.CRAFT_TLW[id_craft]:GetTop())
elseif (id_craft == 2) then
- CRT.SV.Settings.WO.offset.X = math.floor(CRT_CRAFT_TLW[id_craft]:GetLeft())
- CRT.SV.Settings.WO.offset.Y = math.floor(CRT_CRAFT_TLW[id_craft]:GetTop())
+ CRT.SV.Settings.WO.offset.X = math.floor(CRT.UI.CRAFT_TLW[id_craft]:GetLeft())
+ CRT.SV.Settings.WO.offset.Y = math.floor(CRT.UI.CRAFT_TLW[id_craft]:GetTop())
elseif (id_craft == "GRID") then
- CRT.SV.Settings.GRID.offset.X = math.floor(CRT_GRID_TLW:GetLeft())
- CRT.SV.Settings.GRID.offset.Y = math.floor(CRT_GRID_TLW:GetTop())
+ CRT.SV.Settings.GRID.offset.X = math.floor(CRT.UI.GRID_TLW:GetLeft())
+ CRT.SV.Settings.GRID.offset.Y = math.floor(CRT.UI.GRID_TLW:GetTop())
elseif (id_craft == "ALERT") then
- CRT.SV.Settings.ALERT.offset.X = math.floor(CRT_ALERT_TLW:GetLeft())
- CRT.SV.Settings.ALERT.offset.Y = math.floor(CRT_ALERT_TLW:GetTop())
+ CRT.SV.Settings.ALERT.offset.X = math.floor(CRT.UI.ALERT_TLW:GetLeft())
+ CRT.SV.Settings.ALERT.offset.Y = math.floor(CRT.UI.ALERT_TLW:GetTop())
end
end
@@ -611,7 +631,7 @@ function CRT_CommandText_setup(lparam)
d("Version " .. CRT.version)
d("The CRT have moved to the normal game settings")
d("Player: " .. CRT.playername)
- d("Shortest: " .. CRT_Converthms(CRT.SV.Craft_data[CRT.playername].shortest))
+ d("Shortest: " .. CRT_Converthms(CRT.SV.data.Craft[CRT.playername].shortest))
elseif (lparam == "grid") then
CRT_toggleGRID()
else
diff --git a/lua/GRID.lua b/lua/GRID.lua
index ef4cb84..8402e84 100644
--- a/lua/GRID.lua
+++ b/lua/GRID.lua
@@ -1,71 +1,63 @@
-- Craft Research Timer (CRT) by @aTo (EU)
-- v0.4.8
+local num_char --track character number drawing for, for positioning
function CRT_GRID_Create()
- local meta = getmetatable(CRT.SV.Craft_data)
- local snum_char = 0
- for k, _ in pairs(meta.__index) do
- if (k ~= "version") then
- snum_char = snum_char + 1
- end
- end
- if (snum_char > 0) then
+
-- Fenetre de base
- CRT_GRID_TLW = WINDOW_MANAGER:CreateTopLevelWindow("CRT_GRID_TLW")
- CRT_GRID_TLW:SetHidden(CRT.SV.Settings.GRID.hidden)
- CRT_GRID_TLW:SetClampedToScreen(false)
- CRT_GRID_TLW:SetMovable(CRT.SV.Settings.lock)
- CRT_GRID_TLW:SetMouseEnabled(true)
- CRT_GRID_TLW:SetDrawLayer(1)
- CRT_GRID_TLW:SetScale(CRT.SV.Settings.GRID.Scale)
- CRT_GRID_TLW:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.GRID.offset.X, CRT.SV.Settings.GRID.offset.Y)
- CRT_GRID_TLW:SetHandler("OnMouseUp", function(self) CRT_Save_position("GRID")end)
- CRT_GRID_TLW:SetHidden(true)
+ CRT.UI.GRID_TLW= WINDOW_MANAGER:CreateTopLevelWindow("CRT_GRID_TLW")
+ CRT.UI.GRID_TLW:SetHidden(CRT.SV.Settings.GRID.hidden)
+ CRT.UI.GRID_TLW:SetClampedToScreen(false)
+ CRT.UI.GRID_TLW:SetMovable(CRT.SV.Settings.lock)
+ CRT.UI.GRID_TLW:SetMouseEnabled(true)
+ CRT.UI.GRID_TLW:SetDrawLayer(1)
+ CRT.UI.GRID_TLW:SetScale(CRT.SV.Settings.GRID.Scale)
+ CRT.UI.GRID_TLW:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, CRT.SV.Settings.GRID.offset.X, CRT.SV.Settings.GRID.offset.Y)
+ CRT.UI.GRID_TLW:SetHandler("OnMouseUp", function(self) CRT_Save_position("GRID")end)
+ CRT.UI.GRID_TLW:SetHidden(true)
--/background
- CRT_GRID_BD = WINDOW_MANAGER:CreateControlFromVirtual("CRT_GRID_BD",CRT_GRID_TLW, "ZO_DefaultBackdrop")
- CRT_GRID_BD:SetAlpha(CRT.SV.Settings.GRID.BackdropAlpha)
+ 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)
- CRT_GRID_BTN = WINDOW_MANAGER:CreateControl("CRT_GRID_BTN" , CRT_GRID_TLW , CT_BUTTON)
- CRT_GRID_BTN:SetDimensions( 30 , 30 )
- CRT_GRID_BTN:SetAnchor(TOPRIGHT,CRT_GRID_TLW,TOPRIGHT,5,-10)
- CRT_GRID_BTN:SetState( BSTATE_NORMAL )
- CRT_GRID_BTN:SetMouseOverBlendMode(0)
- CRT_GRID_BTN:SetNormalTexture("/esoui/art/buttons/decline_down.dds")
- CRT_GRID_BTN:SetMouseOverTexture("/esoui/art/buttons/decline_up.dds")
- CRT_GRID_BTN:SetHandler( "OnClicked" , function(self) CRT_GRID_TLW:SetHidden(true); CRT.SV.Settings.GRID.hidden = true end )
+ 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)
+ CRT.UI.GRID_BTN:SetState( BSTATE_NORMAL )
+ CRT.UI.GRID_BTN:SetMouseOverBlendMode(0)
+ CRT.UI.GRID_BTN:SetNormalTexture("/esoui/art/buttons/decline_down.dds")
+ CRT.UI.GRID_BTN:SetMouseOverTexture("/esoui/art/buttons/decline_up.dds")
+ CRT.UI.GRID_BTN:SetHandler( "OnClicked" , function(self) CRT.UI.GRID_TLW:SetHidden(true); CRT.SV.Settings.GRID.hidden = true end )
- for k, _ in pairsByKeys(meta.__index) do
+ for k, _ in pairs(CRT.SV.data.Craft) do
CRT_GRID_Create_Character(k)
- end
-
- end
+ end
end
function CRT_GRID_Create_Character(k)
if (num_char == nil) then
num_char = 0
end
- if (k ~= "version" and (CRT.SV.Craft_data[k][0]["Simu_craft"] ~= 0 or CRT.SV.Craft_data[k][1]["Simu_craft"] ~= 0 or CRT.SV.Craft_data[k][2]["Simu_craft"] ~= 0)) then
+ 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
- CRT_GRID_TLW:SetHidden(CRT.SV.Settings.GRID.hidden)
+ CRT.UI.GRID_TLW:SetHidden(CRT.SV.Settings.GRID.hidden)
-- pseudo
- CRT_GRID_WD[k] = {}
- CRT_GRID_WD[k][k] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..k,CRT_GRID_TLW,CT_LABEL)
- --CRT_GRID_WD[k][k]:SetHidden(false)
- CRT_GRID_WD[k][k]:SetFont("ZoFontGame")
- CRT_GRID_WD[k][k]:SetDimensions(360,20)
- CRT_GRID_WD[k][k]: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_GRID_WD[k][k]:SetAlpha(1)
- CRT_GRID_WD[k][k]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,0,120*num_char)
- CRT_GRID_WD[k][k]:SetHorizontalAlignment(1)
- CRT_GRID_WD[k][k]:SetText(string.upper(k))
+ CRT.UI.GRID_WD[k] = {}
+ CRT.UI.GRID_WD[k][k] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..k,CRT.UI.GRID_TLW,CT_LABEL)
+ --CRT.UI.GRID_WD[k][k]:SetHidden(false)
+ CRT.UI.GRID_WD[k][k]:SetFont("ZoFontGame")
+ CRT.UI.GRID_WD[k][k]:SetDimensions(360,20)
+ CRT.UI.GRID_WD[k][k]: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][k]:SetAlpha(1)
+ CRT.UI.GRID_WD[k][k]:SetAnchor(TOPLEFT,CRT.UI.GRID_TLW,TOPLEFT,0,120*num_char)
+ CRT.UI.GRID_WD[k][k]:SetHorizontalAlignment(1)
+ CRT.UI.GRID_WD[k][k]:SetText(string.upper(k))
if (num_char == 0) then
x = 0
@@ -75,61 +67,61 @@ function CRT_GRID_Create_Character(k)
y = 20+num_char*120
end
--blacksmithing
- CRT_GRID_WD[k][0] = {}
- CRT_GRID_WD[k][0][0] = {}
- CRT_GRID_WD[k][0][0]["BS_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_0_icon",CRT_GRID_TLW,CT_TEXTURE)
- CRT_GRID_WD[k][0][0]["BS_Icon"]:SetHidden(false)
- CRT_GRID_WD[k][0][0]["BS_Icon"]:SetDimensions(20,20)
- CRT_GRID_WD[k][0][0]["BS_Icon"]:SetAlpha(1)
- CRT_GRID_WD[k][0][0]["BS_Icon"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,0,y)
- CRT_GRID_WD[k][0][0]["BS_Icon"]:SetTexture("/esoui/art/icons/ability_smith_007.dds")
+ 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"]: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"]:SetTexture("/esoui/art/icons/ability_smith_007.dds")
- CRT_GRID_WD[k][0][0]["BS_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_0_text",CRT_GRID_TLW,CT_LABEL)
- CRT_GRID_WD[k][0][0]["BS_Text"]:SetHidden(false)
- CRT_GRID_WD[k][0][0]["BS_Text"]:SetFont("ZoFontGame")
- CRT_GRID_WD[k][0][0]["BS_Text"]:SetDimensions(360,20)
- CRT_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_GRID_WD[k][0][0]["BS_Text"]:SetAlpha(1)
- CRT_GRID_WD[k][0][0]["BS_Text"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,20,y)
- CRT_GRID_WD[k][0][0]["BS_Text"]:SetText("Loading")
+ 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"]: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"]: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"]:SetText("Loading")
--Clothing
- CRT_GRID_WD[k][1] = {}
- CRT_GRID_WD[k][1][0] = {}
- CRT_GRID_WD[k][1][0]["CL_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_1_icon",CRT_GRID_TLW,CT_TEXTURE)
- CRT_GRID_WD[k][1][0]["CL_Icon"]:SetHidden(false)
- CRT_GRID_WD[k][1][0]["CL_Icon"]:SetDimensions(20,20)
- CRT_GRID_WD[k][1][0]["CL_Icon"]:SetAlpha(1)
- CRT_GRID_WD[k][1][0]["CL_Icon"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,120,y)
- CRT_GRID_WD[k][1][0]["CL_Icon"]:SetTexture("/esoui/art/icons/ability_tradecraft_008.dds")
+ 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"]: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"]:SetTexture("/esoui/art/icons/ability_tradecraft_008.dds")
- CRT_GRID_WD[k][1][0]["CL_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_1_text",CRT_GRID_TLW,CT_LABEL)
- CRT_GRID_WD[k][1][0]["CL_Text"]:SetHidden(false)
- CRT_GRID_WD[k][1][0]["CL_Text"]:SetFont("ZoFontGame")
- CRT_GRID_WD[k][1][0]["CL_Text"]:SetDimensions(360,20)
- CRT_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_GRID_WD[k][1][0]["CL_Text"]:SetAlpha(1)
- CRT_GRID_WD[k][1][0]["CL_Text"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,140,y)
- CRT_GRID_WD[k][1][0]["CL_Text"]:SetText("Loading")
+ 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"]: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"]: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"]:SetText("Loading")
--Woodworking
- CRT_GRID_WD[k][2] = {}
- CRT_GRID_WD[k][2][0] = {}
- CRT_GRID_WD[k][2][0]["WO_Icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_2_icon",CRT_GRID_TLW,CT_TEXTURE)
- CRT_GRID_WD[k][2][0]["WO_Icon"]:SetHidden(false)
- CRT_GRID_WD[k][2][0]["WO_Icon"]:SetDimensions(20,20)
- CRT_GRID_WD[k][2][0]["WO_Icon"]:SetAlpha(1)
- CRT_GRID_WD[k][2][0]["WO_Icon"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,240,y)
- CRT_GRID_WD[k][2][0]["WO_Icon"]:SetTexture("/esoui/art/icons/ability_tradecraft_009.dds")
+ 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"]: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"]:SetTexture("/esoui/art/icons/ability_tradecraft_009.dds")
- CRT_GRID_WD[k][2][0]["WO_Text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_2_text",CRT_GRID_TLW,CT_LABEL)
- CRT_GRID_WD[k][2][0]["WO_Text"]:SetHidden(false)
- CRT_GRID_WD[k][2][0]["WO_Text"]:SetFont("ZoFontGame")
- CRT_GRID_WD[k][2][0]["WO_Text"]:SetDimensions(360,20)
- CRT_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_GRID_WD[k][2][0]["WO_Text"]:SetAlpha(1)
- CRT_GRID_WD[k][2][0]["WO_Text"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,260,y)
- CRT_GRID_WD[k][2][0]["WO_Text"]:SetText("Loading")
+ 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"]: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"]: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"]:SetText("Loading")
for id_craft = 0, 2,1 do
for simcraft = 1, 3,1 do
@@ -142,70 +134,69 @@ function CRT_GRID_Create_Character(k)
y = 20+num_char*120+(20*simcraft)
end
- CRT_GRID_WD[k][id_craft][simcraft] = {}
+ CRT.UI.GRID_WD[k][id_craft][simcraft] = {}
-- item icon
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_icon",CRT_GRID_TLW,CT_TEXTURE)
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHidden(true)
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetDimensions(20,20)
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetAlpha(1)
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,x-20,y)
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetMouseEnabled(true)
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHandler("OnMouseEnter", function (self)
- ZO_Tooltips_ShowTextTooltip(self, TOP, CRT.SV.Craft_data[k][id_craft][simcraft]["Item_name"])
+ 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"]: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"]: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"])
end)
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHandler("OnMouseExit", function (self)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHandler("OnMouseExit", function (self)
ZO_Tooltips_HideTextTooltip()
end)
-- trait icon
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_trait",CRT_GRID_TLW,CT_TEXTURE)
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHidden(true)
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetDimensions(20,20)
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetAlpha(1)
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,x,y)
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetMouseEnabled(true)
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHandler("OnMouseEnter", function (self)
- ZO_Tooltips_ShowTextTooltip(self, TOP, CRT.SV.Craft_data[k][id_craft][simcraft]["Trait_description"])
+ 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"]: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"]: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"])
end)
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHandler("OnMouseExit", function (self)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHandler("OnMouseExit", function (self)
ZO_Tooltips_HideTextTooltip()
end)
-- text
- CRT_GRID_WD[k][id_craft][simcraft]["text"] = WINDOW_MANAGER:CreateControl("CRT_GRID_"..k.."_"..id_craft.."_"..simcraft.."_text",CRT_GRID_TLW,CT_LABEL)
- CRT_GRID_WD[k][id_craft][simcraft]["text"]:SetHidden(true)
- CRT_GRID_WD[k][id_craft][simcraft]["text"]:SetFont("ZoFontGame")
- CRT_GRID_WD[k][id_craft][simcraft]["text"]:SetDimensions(360,20)
- CRT_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_GRID_WD[k][id_craft][simcraft]["text"]:SetAlpha(1)
- CRT_GRID_WD[k][id_craft][simcraft]["text"]:SetAnchor(TOPLEFT,CRT_GRID_TLW,TOPLEFT,x+20,y)
+ 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"]: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)
end
end
num_char = num_char+1
- CRT_GRID_TLW:SetDimensions(360,120*num_char)
+ CRT.UI.GRID_TLW:SetDimensions(360,120*num_char)
end
end
function CRT_GRID_Update(timestamp)
- local meta = getmetatable(CRT.SV.Craft_data)
- for k, _ in pairs(meta.__index) do
- if (k ~= "version" and (CRT.SV.Craft_data[k][0]["Simu_craft"] ~= 0 or CRT.SV.Craft_data[k][1]["Simu_craft"] ~= 0 or CRT.SV.Craft_data[k][2]["Simu_craft"] ~= 0)) then
+ for k, _ in pairs(CRT.SV.data.Craft) do
+ 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
for id_craft = 0, 2,1 do
- if (CRT.SV.Craft_data[k][id_craft]["MaxResearch"] ~= nil ) then
- local MaxResearch = CRT.SV.Craft_data[k][id_craft]["MaxResearch"]
- local Simu_craft = CRT.SV.Craft_data[k][id_craft]["Simu_craft"]
+ if (CRT.SV.data.Craft[k][id_craft]["MaxResearch"] ~= nil ) then
+ local MaxResearch = CRT.SV.data.Craft[k][id_craft]["MaxResearch"]
+ local Simu_craft = CRT.SV.data.Craft[k][id_craft]["Simu_craft"]
if (id_craft == 0) then
- CRT_GRID_WD[k][id_craft][0]["BS_Text"]:SetText(" "..Simu_craft.." / "..MaxResearch)
+ CRT.UI.GRID_WD[k][id_craft][0]["BS_Text"]:SetText(" "..Simu_craft.." / "..MaxResearch)
elseif(id_craft == 1) then
- CRT_GRID_WD[k][id_craft][0]["CL_Text"]:SetText(" "..Simu_craft.." / "..MaxResearch)
+ CRT.UI.GRID_WD[k][id_craft][0]["CL_Text"]:SetText(" "..Simu_craft.." / "..MaxResearch)
elseif(id_craft == 2) then
- CRT_GRID_WD[k][id_craft][0]["WO_Text"]:SetText(" "..Simu_craft.." / "..MaxResearch)
+ CRT.UI.GRID_WD[k][id_craft][0]["WO_Text"]:SetText(" "..Simu_craft.." / "..MaxResearch)
end
end
@@ -213,23 +204,23 @@ function CRT_GRID_Update(timestamp)
for simcraft = 1, 3,1 do
- if (CRT.SV.Craft_data[k][id_craft][simcraft] ~= nil)then
+ if (CRT.SV.data.Craft[k][id_craft][simcraft] ~= nil)then
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHidden(false)
- CRT_GRID_WD[k][id_craft][simcraft]["item_icon"]:SetTexture(CRT.SV.Craft_data[k][id_craft][simcraft]["Item_icon"])
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHidden(false)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetTexture(CRT.SV.data.Craft[k][id_craft][simcraft]["Item_icon"])
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHidden(false)
- CRT_GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetTexture(CRT.SV.Craft_data[k][id_craft][simcraft]["Trait_icon"])
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHidden(false)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetTexture(CRT.SV.data.Craft[k][id_craft][simcraft]["Trait_icon"])
- local currenttimer = CRT.SV.Craft_data[k][id_craft][simcraft]["EndTimeStamp"] - timestamp - 1
+ local currenttimer = CRT.SV.data.Craft[k][id_craft][simcraft]["EndTimeStamp"] - timestamp - 1
if (currenttimer > 0) then
- CRT_GRID_WD[k][id_craft][simcraft]["text"]:SetHidden(false)
- CRT_GRID_WD[k][id_craft][simcraft]["text"]:SetText(CRT_Converthms(currenttimer))
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetHidden(false)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetText(CRT_Converthms(currenttimer))
elseif (currenttimer <= 0) then
- CRT_GRID_WD[k][id_craft][simcraft]["text"]:SetHidden(false)
- CRT_GRID_WD[k][id_craft][simcraft]["text"]:SetText("|cFF0000Finished|r")
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetHidden(false)
+ CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetText("|cFF0000Finished|r")
end
end
end
diff --git a/lua/Menu-function.lua b/lua/Menu-function.lua
index c135ed7..e1fde2e 100644
--- a/lua/Menu-function.lua
+++ b/lua/Menu-function.lua
@@ -3,17 +3,17 @@
function CRT_SetLock(Newlock)
CRT.SV.Settings.lock = Newlock
- if (CRT_GRID_TLW ~= nil) then
- CRT_GRID_TLW:SetMovable(Newlock)
+ if (CRT.UI.GRID_TLW~= nil) then
+ CRT.UI.GRID_TLW:SetMovable(Newlock)
end
- if (CRT_CRAFT_TLW[0] ~= nil) then
- CRT_CRAFT_TLW[0]:SetMovable(Newlock)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil) then
+ CRT.UI.CRAFT_TLW[0]:SetMovable(Newlock)
end
- if (CRT_CRAFT_TLW[1] ~= nil) then
- CRT_CRAFT_TLW[1]:SetMovable(Newlock)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil) then
+ CRT.UI.CRAFT_TLW[1]:SetMovable(Newlock)
end
- if (CRT_CRAFT_TLW[2] ~= nil) then
- CRT_CRAFT_TLW[2]:SetMovable(Newlock)
+ if (CRT.UI.CRAFT_TLW[2] ~= nil) then
+ CRT.UI.CRAFT_TLW[2]:SetMovable(Newlock)
end
end
@@ -39,16 +39,16 @@ end
-------------------------ALERT Components---------------------------------------
function CRT_SetAlert(NewAlert)
CRT.SV.Settings.ALERT.hidden = NewAlert
- if (CRT_ALERT_TLW ~= nil) then
- CRT_ALERT_TLW:SetHidden(not NewAlert)
+ if (CRT.UI.ALERT_TLW ~= nil) then
+ CRT.UI.ALERT_TLW:SetHidden(not NewAlert)
end
end
function CRT_SetPreview(NewPreview)
CRT.SV.Settings.ALERT.preview = NewPreview
- CRT_ALERT_BD:SetHidden(not NewPreview)
- if (CRT_ALERT_TLW ~= nil) then
- CRT_ALERT_TLW:SetMovable(NewPreview)
+ CRT.UI.ALERT_BD:SetHidden(not NewPreview)
+ if (CRT.UI.ALERT_TLW ~= nil) then
+ CRT.UI.ALERT_TLW:SetMovable(NewPreview)
end
end
@@ -57,8 +57,8 @@ function CRT_GetALERTColor()
end
function CRT_SetALERTColor(r, g, b, a)
- if (CRT_ALERT_WD ~= nil) then
- CRT_ALERT_WD:AddMessage("New Alert Color", CRT.SV.Settings.ALERT.Color.r, CRT.SV.Settings.ALERT.Color.g, CRT.SV.Settings.ALERT.Color.b)
+ if (CRT.UI.ALERT_WD ~= nil) then
+ CRT.UI.ALERT_WD:AddMessage("New Alert Color", CRT.SV.Settings.ALERT.Color.r, CRT.SV.Settings.ALERT.Color.g, CRT.SV.Settings.ALERT.Color.b)
end
CRT.SV.Settings.ALERT.Color.r = r
CRT.SV.Settings.ALERT.Color.g = g
@@ -84,8 +84,8 @@ function CRT_GetGRIDBackdropAlpha()
end
function CRT_SetGRIDBackdropAlpha(NewGRIDBackdropAlphaPercent)
local NewGRIDBackdropAlpha = NewGRIDBackdropAlphaPercent / 100
- if (CRT_GRID_BD ~= nil) then
- CRT_GRID_BD:SetAlpha(NewGRIDBackdropAlpha)
+ if (CRT.UI.GRID_BD ~= nil) then
+ CRT.UI.GRID_BD:SetAlpha(NewGRIDBackdropAlpha)
end
CRT.SV.Settings.GRID.BackdropAlpha = NewGRIDBackdropAlpha
end
@@ -96,8 +96,8 @@ function CRT_GetGRIDScale()
end
function CRT_SetGRIDScale(NewGRIDScalePercent)
local NewGRIDScale = NewGRIDScalePercent / 100
- if (CRT_GRID_TLW ~= nil) then
- CRT_GRID_TLW:SetScale(NewGRIDScale)
+ if (CRT.UI.GRID_TLW~= nil) then
+ CRT.UI.GRID_TLW:SetScale(NewGRIDScale)
end
CRT.SV.Settings.GRID.Scale = NewGRIDScale
end
@@ -117,15 +117,15 @@ end
function CRT_SetTrackerBS(state)
CRT.SV.Settings.BS.craft = state
- if (CRT_CRAFT_TLW[0] ~= nil) then
- CRT_CRAFT_TLW[0]:SetHidden(not state)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil) then
+ CRT.UI.CRAFT_TLW[0]:SetHidden(not state)
end
end
function CRT_SetBSHide0(NewBSHide0)
CRT.SV.Settings.BS.Hide_0 = NewBSHide0
- if (CRT_CRAFT_TLW[0] ~= nil and NewBSHide0 == false and CRT.SV.Settings.BS.Hide_Type ~= "Toggle keybind" and CRT.SV.Settings.BS.craft == true) then
- CRT_CRAFT_TLW[0]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil and NewBSHide0 == false and CRT.SV.Settings.BS.Hide_Type ~= "Toggle keybind" and CRT.SV.Settings.BS.craft == true) then
+ CRT.UI.CRAFT_TLW[0]:SetHidden(false)
end
end
@@ -133,14 +133,14 @@ end
function CRT_SetBSHideMenu(NewBSHideMenu)
CRT.SV.Settings.BS.Hide_Type = NewBSHideMenu
if (NewBSHideMenu == "Toggle keybind") then
- if (CRT_CRAFT_TLW[0] ~= nil and CRT.SV.Settings.BS.craft == true) then
- CRT_CRAFT_TLW[0]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil and CRT.SV.Settings.BS.craft == true) then
+ CRT.UI.CRAFT_TLW[0]:SetHidden(false)
end
- if (CRT_CRAFT_TLW[1] ~= nil and CRT.SV.Settings.CL.craft == true) then
- CRT_CRAFT_TLW[1]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil and CRT.SV.Settings.CL.craft == true) then
+ CRT.UI.CRAFT_TLW[1]:SetHidden(false)
end
- if (CRT_CRAFT_TLW[2] ~= nil and CRT.SV.Settings.WO.craft == true) then
- CRT_CRAFT_TLW[2]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[2] ~= nil and CRT.SV.Settings.WO.craft == true) then
+ CRT.UI.CRAFT_TLW[2]:SetHidden(false)
end
end
end
@@ -152,8 +152,8 @@ function CRT_GetBSBackdropAlpha()
end
function CRT_SetBSBackdropAlpha(NewBSBackdropAlphaPercent)
local NewBSBackdropAlpha = NewBSBackdropAlphaPercent / 100
- if (CRT_CRAFT_TLW[0] ~= nil) then
- CRT_CRAFT_BD[0]:SetAlpha(NewBSBackdropAlpha)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil) then
+ CRT.UI.CRAFT_BD[0]:SetAlpha(NewBSBackdropAlpha)
end
CRT.SV.Settings.BS.BackdropAlpha = NewBSBackdropAlpha
end
@@ -164,8 +164,8 @@ function CRT_GetBSScale()
end
function CRT_SetBSScale(NewBSScalePercent)
local NewBSScale = NewBSScalePercent / 100
- if (CRT_CRAFT_TLW[0] ~= nil) then
- CRT_CRAFT_TLW[0]:SetScale(NewBSScale)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil) then
+ CRT.UI.CRAFT_TLW[0]:SetScale(NewBSScale)
end
CRT.SV.Settings.BS.Scale = NewBSScale
end
@@ -175,10 +175,10 @@ return CRT.SV.Settings.BS.Color.r, CRT.SV.Settings.BS.Color.g, CRT.SV.Settings.B
end
function CRT_SetBSColor(r, g, b, a)
- if (CRT_CRAFT_TLW[0] ~= nil) then
- CRT_CRAFT_WD[0][0]["Craft_Text"]:SetColor(r,g,b,a)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil) then
+ CRT.UI.CRAFT_WD[0][0]["Craft_Text"]:SetColor(r,g,b,a)
for simcraft = 1, 3, 1 do
- CRT_CRAFT_WD[0][simcraft]["text"]:SetColor(r,g,b,a)
+ CRT.UI.CRAFT_WD[0][simcraft]["text"]:SetColor(r,g,b,a)
end
end
@@ -192,15 +192,15 @@ end
-------------------------CL Components---------------------------------------
function CRT_SetTrackerCL(state)
CRT.SV.Settings.CL.craft = state
- if (CRT_CRAFT_TLW[1] ~= nil) then
- CRT_CRAFT_TLW[1]:SetHidden(not state)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil) then
+ CRT.UI.CRAFT_TLW[1]:SetHidden(not state)
end
end
function CRT_SetCLHide0(NewCLHide0)
CRT.SV.Settings.CL.Hide_0 = NewCLHide0
- if (CRT_CRAFT_TLW[1] ~= nil and NewCLHide0 == false and CRT.SV.Settings.CL.Hide_Type ~= "Toggle keybind" and CRT.SV.Settings.CL.craft == true) then
- CRT_CRAFT_TLW[1]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil and NewCLHide0 == false and CRT.SV.Settings.CL.Hide_Type ~= "Toggle keybind" and CRT.SV.Settings.CL.craft == true) then
+ CRT.UI.CRAFT_TLW[1]:SetHidden(false)
end
end
@@ -208,14 +208,14 @@ end
function CRT_SetCLHideMenu(NewCLHideMenu)
CRT.SV.Settings.CL.Hide_Type = NewCLHideMenu
if (NewCLHideMenu == "Toggle keybind") then
- if (CRT_CRAFT_TLW[0] ~= nil and CRT.SV.Settings.BS.craft == true) then
- CRT_CRAFT_TLW[0]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil and CRT.SV.Settings.BS.craft == true) then
+ CRT.UI.CRAFT_TLW[0]:SetHidden(false)
end
- if (CRT_CRAFT_TLW[1] ~= nil and CRT.SV.Settings.CL.craft == true) then
- CRT_CRAFT_TLW[1]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil and CRT.SV.Settings.CL.craft == true) then
+ CRT.UI.CRAFT_TLW[1]:SetHidden(false)
end
- if (CRT_CRAFT_TLW[2] ~= nil and CRT.SV.Settings.WO.craft == true) then
- CRT_CRAFT_TLW[2]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[2] ~= nil and CRT.SV.Settings.WO.craft == true) then
+ CRT.UI.CRAFT_TLW[2]:SetHidden(false)
end
end
end
@@ -226,8 +226,8 @@ function CRT_GetCLBackdropAlpha()
end
function CRT_SetCLBackdropAlpha(NewCLBackdropAlphaPercent)
local NewCLBackdropAlpha = NewCLBackdropAlphaPercent / 100
- if (CRT_CRAFT_BD[1] ~= nil) then
- CRT_CRAFT_BD[1]:SetAlpha(NewCLBackdropAlpha)
+ if (CRT.UI.CRAFT_BD[1] ~= nil) then
+ CRT.UI.CRAFT_BD[1]:SetAlpha(NewCLBackdropAlpha)
end
CRT.SV.Settings.CL.BackdropAlpha = NewCLBackdropAlpha
end
@@ -238,8 +238,8 @@ function CRT_GetCLScale()
end
function CRT_SetCLScale(NewCLScalePercent)
local NewCLScale = NewCLScalePercent / 100
- if (CRT_CRAFT_TLW[1] ~= nil) then
- CRT_CRAFT_TLW[1]:SetScale(NewCLScale)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil) then
+ CRT.UI.CRAFT_TLW[1]:SetScale(NewCLScale)
end
CRT.SV.Settings.CL.Scale = NewCLScale
end
@@ -249,10 +249,10 @@ return CRT.SV.Settings.CL.Color.r, CRT.SV.Settings.CL.Color.g, CRT.SV.Settings.C
end
function CRT_SetCLColor(r, g, b, a)
- if (CRT_CRAFT_TLW[1] ~= nil) then
- CRT_CRAFT_WD[1][0]["Craft_Text"]:SetColor(r,g,b,a)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil) then
+ CRT.UI.CRAFT_WD[1][0]["Craft_Text"]:SetColor(r,g,b,a)
for simcraft = 1, 3, 1 do
- CRT_CRAFT_WD[1][simcraft]["text"]:SetColor(r,g,b,a)
+ CRT.UI.CRAFT_WD[1][simcraft]["text"]:SetColor(r,g,b,a)
end
end
@@ -265,29 +265,29 @@ end
-------------------------Woodworking Components---------------------------------------
function CRT_SetTrackerWO(state)
CRT.SV.Settings.WO.craft = state
- if (CRT_CRAFT_TLW[2] ~= nil) then
- CRT_CRAFT_TLW[2]:SetHidden(not state)
+ if (CRT.UI.CRAFT_TLW[2] ~= nil) then
+ CRT.UI.CRAFT_TLW[2]:SetHidden(not state)
end
end
function CRT_SetWOHide0(NewWOHide0)
CRT.SV.Settings.WO.Hide_0 = NewWOHide0
- if (CRT_CRAFT_TLW[2] ~= nil and NewWOHide0 == false and CRT.SV.Settings.WO.Hide_0 ~= "Toggle keybind" and CRT.SV.Settings.WO.craft == true) then
- CRT_CRAFT_TLW[2]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[2] ~= nil and NewWOHide0 == false and CRT.SV.Settings.WO.Hide_0 ~= "Toggle keybind" and CRT.SV.Settings.WO.craft == true) then
+ CRT.UI.CRAFT_TLW[2]:SetHidden(false)
end
end
function CRT_SetWOHideMenu(NewWOHideMenu)
CRT.SV.Settings.WO.Hide_Type = NewWOHideMenu
if (NewWOHideMenu == "Toggle keybind") then
- if (CRT_CRAFT_TLW[0] ~= nil and CRT.SV.Settings.BS.craft == true) then
- CRT_CRAFT_TLW[0]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[0] ~= nil and CRT.SV.Settings.BS.craft == true) then
+ CRT.UI.CRAFT_TLW[0]:SetHidden(false)
end
- if (CRT_CRAFT_TLW[1] ~= nil and CRT.SV.Settings.CL.craft == true) then
- CRT_CRAFT_TLW[1]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil and CRT.SV.Settings.CL.craft == true) then
+ CRT.UI.CRAFT_TLW[1]:SetHidden(false)
end
- if (CRT_CRAFT_TLW[2] ~= nil and CRT.SV.Settings.WO.craft == true) then
- CRT_CRAFT_TLW[2]:SetHidden(false)
+ if (CRT.UI.CRAFT_TLW[2] ~= nil and CRT.SV.Settings.WO.craft == true) then
+ CRT.UI.CRAFT_TLW[2]:SetHidden(false)
end
end
end
@@ -299,8 +299,8 @@ end
function CRT_SetWOBackdropAlpha(NewWOBackdropAlphaPercent)
local NewWOBackdropAlpha = NewWOBackdropAlphaPercent / 100
- if (CRT_CRAFT_BD[2] ~= nil) then
- CRT_CRAFT_BD[2]:SetAlpha(NewWOBackdropAlpha)
+ if (CRT.UI.CRAFT_BD[2] ~= nil) then
+ CRT.UI.CRAFT_BD[2]:SetAlpha(NewWOBackdropAlpha)
end
CRT.SV.Settings.WO.BackdropAlpha = NewWOBackdropAlpha
end
@@ -312,8 +312,8 @@ end
function CRT_SetWOScale(NewWOScalePercent)
local NewWOScale = NewWOScalePercent / 100
- if (CRT_CRAFT_TLW[1] ~= nil) then
- CRT_CRAFT_TLW[2]:SetScale(NewWOScale)
+ if (CRT.UI.CRAFT_TLW[1] ~= nil) then
+ CRT.UI.CRAFT_TLW[2]:SetScale(NewWOScale)
end
CRT.SV.Settings.WO.Scale = NewWOScale
end
@@ -323,10 +323,10 @@ return CRT.SV.Settings.WO.Color.r, CRT.SV.Settings.WO.Color.g, CRT.SV.Settings.W
end
function CRT_SetWOColor(r, g, b, a)
- if (CRT_CRAFT_TLW[2] ~= nil) then
- CRT_CRAFT_WD[2][0]["Craft_Text"]:SetColor(r,g,b,a)
+ if (CRT.UI.CRAFT_TLW[2] ~= nil) then
+ CRT.UI.CRAFT_WD[2][0]["Craft_Text"]:SetColor(r,g,b,a)
for simcraft = 1, 3, 1 do
- CRT_CRAFT_WD[2][simcraft]["text"]:SetColor(r,g,b,a)
+ CRT.UI.CRAFT_WD[2][simcraft]["text"]:SetColor(r,g,b,a)
end
end