From 6e7414fb6b58a5b05ca86c3114b5d75938a59cc8 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sat, 17 Oct 2020 17:15:29 -0300 Subject: [PATCH] fix --- boot.lua | 4 ++-- frames/window_main.lua | 6 +++++- frames/window_options2_sections.lua | 2 +- functions/loaddata.lua | 3 ++- functions/profiles.lua | 18 ++++-------------- functions/savedata.lua | 14 ++++++++------ startup.lua | 3 +++ 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/boot.lua b/boot.lua index 06022a6b3..54f2ce189 100644 --- a/boot.lua +++ b/boot.lua @@ -4,8 +4,8 @@ _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") - _detalhes.build_counter = 7919 - _detalhes.alpha_build_counter = 7919 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 7927 + _detalhes.alpha_build_counter = 7927 --if this is higher than the regular counter, use it instead _detalhes.game_version = "v9.0.1" _detalhes.userversion = "v9.0.1." .. _detalhes.build_counter _detalhes.realversion = 143 --core version, this is used to check API version for scripts and plugins (see alias below) diff --git a/frames/window_main.lua b/frames/window_main.lua index 44e377dbc..948a396a1 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -6916,6 +6916,7 @@ function _detalhes:ChangeSkin (skin_name) local this_skin = _detalhes.skins [skin_name] if (not this_skin) then + Details:Msg("error 0x4546", skin_name) skin_name = _detalhes.default_skin_to_use this_skin = _detalhes.skins [skin_name] end @@ -7754,7 +7755,10 @@ function _detalhes:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side shadow = self.attribute_text.shadow end - if (type (timer_encounter) ~= "boolean") then + if (type(self.attribute_text.show_timer) ~= "boolean") then + self.attribute_text.show_timer = true + end + if (type(timer_encounter) ~= "boolean") then timer_encounter = self.attribute_text.show_timer end diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index 7514bc6c5..a9ab30009 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -2176,7 +2176,7 @@ do {--encounter time type = "toggle", - get = function() return currentInstance.attribute_text.show_timer and true end, + get = function() return currentInstance.attribute_text.show_timer and true or false end, set = function (self, fixedparam, value) editInstanceSetting(currentInstance, "AttributeMenu", nil, nil, nil, nil, nil, nil, nil, nil, value) afterUpdate() diff --git a/functions/loaddata.lua b/functions/loaddata.lua index 604815bba..a54a55eb9 100644 --- a/functions/loaddata.lua +++ b/functions/loaddata.lua @@ -412,7 +412,8 @@ function _detalhes:LoadConfig() is_open = instance.ativa, attribute = instance.atributo, sub_attribute = instance.sub_atributo, - mode = instance.modo, + mode = instance.modo or 2, + modo = instance.modo or 2, segment = instance.segmento, snap = table_deepcopy (instance.snap), horizontalSnap = instance.horizontalSnap, diff --git a/functions/profiles.lua b/functions/profiles.lua index 164b69a09..041be5131 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -246,18 +246,6 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) elseif (type (value) == "table") then --> deploy only copy non existing data _detalhes.table.deploy (profile [key], value) - - --[=[ - for key2, value2 in pairs (value) do - if (profile [key] [key2] == nil) then - if (type (value2) == "table") then - profile [key] [key2] = table_deepcopy (_detalhes.default_profile [key] [key2]) - else - profile [key] [key2] = value2 - end - end - end - --]=] end end @@ -306,13 +294,13 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --> check if there is a skin saved or this is a empty profile if (#saved_skins == 0) then - --> is empty profile, let's set "WoW Interface" on #1 window local instance1 = _detalhes:GetInstance (1) if (not instance1) then instance1 = _detalhes:CreateInstance (1) end --> apply default config on this instance (flat skin texture was 'ResetInstanceConfig' running). + instance1.modo = 2 instance1:ResetInstanceConfig() instance1.skin = "no skin" instance1:ChangeSkin (_detalhes.default_skin_to_use) @@ -326,11 +314,11 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) if (#_detalhes.tabela_instancias > 1) then for i = #_detalhes.tabela_instancias, 2, -1 do + _detalhes.tabela_instancias [i].modo = 2 _detalhes.unused_instances [i] = _detalhes.tabela_instancias [i] _detalhes.tabela_instancias [i] = nil end end - else --> load skins @@ -375,6 +363,8 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) else instance.ativa = false end + + instance.modo = instance.modo or 2 --> load data saved again instance:LoadLocalInstanceConfig() diff --git a/functions/savedata.lua b/functions/savedata.lua index 70700efa1..d441c6e9c 100644 --- a/functions/savedata.lua +++ b/functions/savedata.lua @@ -31,16 +31,17 @@ function _detalhes:SaveLocalInstanceConfig() local a1, a2 = instance:GetDisplay() local t = { - pos = table_deepcopy (instance:GetPosition()), + pos = table_deepcopy (instance:GetPosition()), is_open = instance:IsEnabled(), - attribute = a1, - sub_attribute = a2, - mode = instance:GetMode(), - segment = instance:GetSegment(), + attribute = a1 or 1, + sub_attribute = a2 or 1, + modo = instance:GetMode() or 2, + mode = instance:GetMode() or 2, + segment = instance:GetSegment() or 0, snap = table_deepcopy (instance.snap), horizontalSnap = instance.horizontalSnap, verticalSnap = instance.verticalSnap, - sub_atributo_last = instance.sub_atributo_last, + sub_atributo_last = instance.sub_atributo_last or {1, 1, 1, 1, 1}, isLocked = instance.isLocked, last_raid_plugin = instance.last_raid_plugin } @@ -48,6 +49,7 @@ function _detalhes:SaveLocalInstanceConfig() if (t.isLocked == nil) then t.isLocked = false end + if (_detalhes.profile_save_pos) then local cprofile = _detalhes:GetProfile() local skin = cprofile.instances [instance:GetId()] diff --git a/startup.lua b/startup.lua index a36b645d3..1ff10cc6f 100644 --- a/startup.lua +++ b/startup.lua @@ -463,6 +463,9 @@ function Details:StartMeUp() --I'll never stop! --force the group edit be always enabled when Details! starts _detalhes.options_group_edit = true + + --remove standard skin on 9.0.1 + _detalhes.standard_skin = false --enforce to use the new animation code if (_detalhes.streamer_config) then