Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Oct 17, 2020
1 parent c42a356 commit 6e7414f
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion frames/window_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion frames/window_options2_sections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion functions/loaddata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 4 additions & 14 deletions functions/profiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down
14 changes: 8 additions & 6 deletions functions/savedata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,25 @@ 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
}

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()]
Expand Down
3 changes: 3 additions & 0 deletions startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e7414f

Please sign in to comment.