From 33c41156e0c339f6b0354f90dec3aaac1eb8fce8 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Thu, 17 Mar 2022 17:47:44 -0300 Subject: [PATCH] updates --- frames/window_forge.lua | 2 +- functions/loaddata.lua | 91 ++++++++++++++++++----------------------- 2 files changed, 40 insertions(+), 53 deletions(-) diff --git a/frames/window_forge.lua b/frames/window_forge.lua index bf3fae32c..1f10479a0 100644 --- a/frames/window_forge.lua +++ b/frames/window_forge.lua @@ -70,7 +70,7 @@ function Details:OpenForge() nopluginLabel:SetText (L["STRING_FORGE_ENABLEPLUGINS"]) end - if (not Details:GetTutorialCVar ("FORGE_TUTORIAL")) then + if (not Details:GetTutorialCVar ("FORGE_TUTORIAL") and false) then local tutorialFrame = CreateFrame ("frame", "$parentTutorialFrame", f,"BackdropTemplate") tutorialFrame:SetPoint ("center", f, "center") tutorialFrame:SetFrameStrata ("DIALOG") diff --git a/functions/loaddata.lua b/functions/loaddata.lua index a176fcb9b..aa1d753c3 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -335,13 +335,11 @@ function _detalhes:LoadConfig() if (not _detalhes_database.last_version or _detalhes_database.last_version ~= _detalhes.userversion) then _detalhes.is_version_first_run = true end - --_detalhes.is_version_first_run = true - --_detalhes_database.last_realversion = 126 --> profile - + local unitname = UnitName ("player") - + --> fix for old versions if (type (_detalhes.always_use_profile) == "string") then _detalhes.always_use_profile = false @@ -352,7 +350,7 @@ function _detalhes:LoadConfig() _detalhes.always_use_profile = false _detalhes.always_use_profile_name = "" end - + --> check for "always use this profile" if (_detalhes.always_use_profile and not _detalhes.always_use_profile_exception [unitname]) then local profile_name = _detalhes.always_use_profile_name @@ -360,11 +358,6 @@ function _detalhes:LoadConfig() _detalhes_database.active_profile = profile_name end end - - --> old version - -- if (_detalhes.always_use_profile and type (_detalhes.always_use_profile) == "string") then - -- _detalhes_database.active_profile = _detalhes.always_use_profile - -- end --> character first run if (_detalhes_database.active_profile == "") then @@ -382,60 +375,54 @@ function _detalhes:LoadConfig() --> instances _detalhes.tabela_instancias = _detalhes_database.tabela_instancias or {} - --so if the instances are loaded, the taint happen - --if I break the tabela_instancias the addon won't taint - --if true then return end --if I return here, the addon taints --> fix for version 1.21.0 if (#_detalhes.tabela_instancias > 0) then --> only happens once after the character logon - --if (current_profile_name:find (UnitName ("player"))) then - for index, saved_skin in ipairs (profile.instances) do - local instance = _detalhes.tabela_instancias [index] - if (instance) then - saved_skin.__was_opened = instance.ativa - saved_skin.__pos = Details.CopyTable (instance.posicao) - saved_skin.__locked = instance.isLocked - saved_skin.__snap = Details.CopyTable (instance.snap) - saved_skin.__snapH = instance.horizontalSnap - saved_skin.__snapV = instance.verticalSnap - - for key, value in pairs (instance) do - if (_detalhes.instance_defaults [key] ~= nil) then - if (type (value) == "table") then - saved_skin [key] = Details.CopyTable (value) - else - saved_skin [key] = value - end + for index, saved_skin in ipairs (profile.instances) do + local instance = _detalhes.tabela_instancias [index] + if (instance) then + saved_skin.__was_opened = instance.ativa + saved_skin.__pos = Details.CopyTable (instance.posicao) + saved_skin.__locked = instance.isLocked + saved_skin.__snap = Details.CopyTable (instance.snap) + saved_skin.__snapH = instance.horizontalSnap + saved_skin.__snapV = instance.verticalSnap + + for key, value in pairs (instance) do + if (_detalhes.instance_defaults [key] ~= nil) then + if (type (value) == "table") then + saved_skin [key] = Details.CopyTable (value) + else + saved_skin [key] = value end end end end + end - for index, instance in _detalhes:ListInstances() do - _detalhes.local_instances_config [index] = { - pos = Details.CopyTable (instance.posicao), - is_open = instance.ativa, - attribute = instance.atributo, - sub_attribute = instance.sub_atributo, - mode = instance.modo or 2, - modo = instance.modo or 2, - segment = instance.segmento, - snap = Details.CopyTable (instance.snap), - horizontalSnap = instance.horizontalSnap, - verticalSnap = instance.verticalSnap, - sub_atributo_last = instance.sub_atributo_last, - isLocked = instance.isLocked - } - - if (_detalhes.local_instances_config [index].isLocked == nil) then - _detalhes.local_instances_config [index].isLocked = false - end + for index, instance in _detalhes:ListInstances() do + _detalhes.local_instances_config [index] = { + pos = Details.CopyTable (instance.posicao), + is_open = instance.ativa, + attribute = instance.atributo, + sub_attribute = instance.sub_atributo, + mode = instance.modo or 2, + modo = instance.modo or 2, + segment = instance.segmento, + snap = Details.CopyTable (instance.snap), + horizontalSnap = instance.horizontalSnap, + verticalSnap = instance.verticalSnap, + sub_atributo_last = instance.sub_atributo_last, + isLocked = instance.isLocked + } + + if (_detalhes.local_instances_config [index].isLocked == nil) then + _detalhes.local_instances_config [index].isLocked = false end - --end + end _detalhes.tabela_instancias = {} end - --_detalhes:ReativarInstancias() --> apply the profile _detalhes:ApplyProfile (current_profile_name, true)