diff --git a/lua/CORE.lua b/lua/CORE.lua index 4c4ef21..ec901f5 100644 --- a/lua/CORE.lua +++ b/lua/CORE.lua @@ -16,7 +16,7 @@ function CRT.Info_Research(craft_type,id_craft) local nbtype = GetNumSmithingResearchLines(craft_type) --Nombre de item craftable pour un craft(ex couture: jambe/robe/ect) CRT.SV.data.Craft[CRT.playername][id_craft] = {} - + CRT.SV.data.Craft[CRT.playername][id_craft].doing = {} for ResearchLines = 1, nbtype, 1 do local item_name, item_icon, numTraits, timeRequiredForNextResearchSecs = GetSmithingResearchLineInfo(craft_type, ResearchLines) for ResearchTrait = 1, numTraits, 1 do @@ -31,20 +31,20 @@ function CRT.Info_Research(craft_type,id_craft) - 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 + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft] = {} + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft]["PlayerName"] = CRT.playername + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft]["Alert"] = true + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft]["EndTimeStamp"] = GetTimeStamp() + timeRemaining + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft]["Item_name"] = string.sub(item_name, 1, 18) + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft]["Item_icon"] = item_icon + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft]["Trait_name"] = trait_name + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft]["Trait_icon"] = trait_icon + CRT.SV.data.Craft[CRT.playername][id_craft].doing[Simu_craft]["Trait_description"] = trait_description end end end - CRT.SV.data.Craft[CRT.playername][id_craft]["MaxResearch"] = MaxResearch - CRT.SV.data.Craft[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.Char_sort() -- Produce a sorted list for display @@ -62,16 +62,17 @@ function CRT.Set_Shortest() local char,craft,shortest, remaining,v for char,_ in pairs (CRT.SV.data.Craft) do - shortest = 9999999999 - for craft =0,2, 1 do - for _,v in pairs (CRT.SV.data.Craft[char][craft]["Simu_craft"]) - remaining = v["EndTimeStamp"] - GetTimeStamp() - if shortest > remaining - then shortest = remaining + shortest = 9999999999 + for craft =0,2, 1 do + for _,v in pairs (CRT.SV.data.Craft[char][craft].doing) do + remaining = v["EndTimeStamp"] - GetTimeStamp() + if shortest > remaining + then shortest = remaining + end end end + CRT.SV.data.Craft[char].shortest = shortest end - CRT.SV.data.Craft[char].shortest = shortest end function CRT.Research_started() diff --git a/lua/CraftResearchTimer.lua b/lua/CraftResearchTimer.lua index 0fe2336..9401f1d 100644 --- a/lua/CraftResearchTimer.lua +++ b/lua/CraftResearchTimer.lua @@ -21,7 +21,7 @@ function CRT.Init(eventCode, addOnName) -- SavedVariables CRT.SV.Settings = ZO_SavedVars:New(CRT.svName, CRT.svVersion*100, nil, CRT.svDefaults, nil) - CRT.SV.data = ZO_SavedVars:NewAccountWide(CRT.svName, 1, nil, CRT.data_defaults,nil ) + CRT.SV.data = ZO_SavedVars:NewAccountWide(CRT.svName, 2, nil, CRT.data_defaults,nil ) CRT.InitialiseLanguage() --get rid of bad "version" key from CRT releases prior to this one -- CRT.SV.data.Craft.versionx = nil diff --git a/lua/GRID.lua b/lua/GRID.lua index 38edc85..9ab61ce 100644 --- a/lua/GRID.lua +++ b/lua/GRID.lua @@ -47,7 +47,7 @@ function CRT.GRID_Create_Character(k) 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 + 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 CRT.UI.GRID_WD[k] = {} -- Containing window for character data. We can then move it as a group @@ -143,9 +143,11 @@ function CRT.GRID_Create_Character(k) CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetAlpha(1) CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetAnchor(TOPLEFT,prevcontrol,BOTTOMLEFT,0,0) --below 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.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHandler("OnMouseEnter", function (self) + -- ZO_Tooltips_ShowTextTooltip(self, TOP, CRT.SV.data.Craft[k].doing[simcraft]["Item_name"]) + -- end) + CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetHandler("OnMouseExit", function (self) ZO_Tooltips_HideTextTooltip() end) @@ -159,9 +161,11 @@ function CRT.GRID_Create_Character(k) CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetAlpha(1) CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetAnchor(TOPLEFT,prevcontrol,TOPRIGHT,0,0) --to right 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.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].doing[simcraft]["Trait_description"]) + -- end) + CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetHandler("OnMouseExit", function (self) ZO_Tooltips_HideTextTooltip() end) @@ -177,9 +181,6 @@ function CRT.GRID_Create_Character(k) CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetAnchor(TOPLEFT,prevcontrol,TOPRIGHT,0,0) --to right prevcontrol=CRT.UI.GRID_WD[k][id_craft][simcraft]["item_icon"] -- set back to beginning of line - - - end end num_char = num_char+1 @@ -190,11 +191,11 @@ end function CRT.GRID_Update(timestamp) local emp_start, em_finish 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 + 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.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 (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 Simu_craft == MaxResearch then emp_start = "" --no highlighting em_finish = "" @@ -217,16 +218,16 @@ function CRT.GRID_Update(timestamp) for simcraft = 1, 3,1 do - if (CRT.SV.data.Craft[k][id_craft][simcraft] ~= nil)then + if (CRT.SV.data.Craft[k][id_craft].doing[simcraft] ~= nil)then 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.UI.GRID_WD[k][id_craft][simcraft]["item_icon"]:SetTexture(CRT.SV.data.Craft[k][id_craft].doing[simcraft]["Item_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"]) + CRT.UI.GRID_WD[k][id_craft][simcraft]["trait_icon"]:SetTexture(CRT.SV.data.Craft[k][id_craft].doing[simcraft]["Trait_icon"]) - local currenttimer = CRT.SV.data.Craft[k][id_craft][simcraft]["EndTimeStamp"] - timestamp - 1 + local currenttimer = CRT.SV.data.Craft[k][id_craft].doing[simcraft]["EndTimeStamp"] - timestamp - 1 if (currenttimer > 0) then CRT.UI.GRID_WD[k][id_craft][simcraft]["text"]:SetHidden(false) diff --git a/lua/header.lua b/lua/header.lua index 554e157..ddbf795 100644 --- a/lua/header.lua +++ b/lua/header.lua @@ -36,7 +36,7 @@ CRT = { craft = true, Hide_0 = false, Hide_Type = "Menus only", - BackdropAlpha = 0.5, + BackdropAlpha = 0.8, Scale = 1, Color = { r = 1, @@ -52,7 +52,7 @@ CRT = { craft = true, Hide_0 = false, Hide_Type = "Menus only", - BackdropAlpha = 0.5, + BackdropAlpha = 0.8, Scale = 1, Color = { r = 1, @@ -68,7 +68,7 @@ CRT = { craft = true, Hide_0 = false, Hide_Type = "Menus only", - BackdropAlpha = 0.5, + BackdropAlpha = 0.8, Scale = 1, Color = { r = 1, @@ -83,7 +83,7 @@ CRT = { Y = 400, }, Hide_Type = "Menus only", - BackdropAlpha = 0.5, + BackdropAlpha = 0.8, Scale = 1, Color = { r = 1,