Skip to content

Commit

Permalink
Fixed title bar text reseting position and code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Oct 28, 2020
1 parent a50a49b commit fd09d77
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 80 deletions.
6 changes: 3 additions & 3 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 213
local dversion = 214

local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
Expand Down Expand Up @@ -612,8 +612,8 @@ function DF:TruncateText (fontString, maxWidth)
end
end

function DF:Msg (msg)
print ("|cFFFFFFAA" .. (self.__name or "FW Msg:") .. "|r ", msg)
function DF:Msg (msg, ...)
print ("|cFFFFFFAA" .. (self.__name or "FW Msg:") .. "|r ", msg, ...)
end

function DF:GetNpcIdFromGuid (guid)
Expand Down
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 = 7933
_detalhes.alpha_build_counter = 7933 --if this is higher than the regular counter, use it instead
_detalhes.build_counter = 7935
_detalhes.alpha_build_counter = 7935 --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
30 changes: 5 additions & 25 deletions classes/class_instance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ end
end

function _detalhes:AtivarInstancia (temp)

self.ativa = true
self.cached_bar_width = self.cached_bar_width or 0

Expand All @@ -608,11 +607,14 @@ end
end

if (not self.iniciada) then
self:RestauraJanela (self.meu_id) --parece que esta chamando o ativar instance denovo...
self:RestauraJanela (self.meu_id, nil, true) --parece que esta chamando o ativar instance denovo... passei true no load_only vamos ver o resultado
self.iniciada = true
else
_detalhes.opened_windows = _detalhes.opened_windows+1
end

self:ChangeSkin() --carrega a skin aqui que era antes feito dentro do restaura janela

_detalhes:TrocaTabela (self, nil, nil, nil, true)

if (self.hide_icon) then
Expand All @@ -627,9 +629,7 @@ end
gump:Fade (self.windowSwitchButton, 0)

self:SetMenuAlpha()

self.baseframe.cabecalho.fechar:Enable()

self:ChangeIcon()

if (not temp) then
Expand All @@ -645,36 +645,17 @@ end
self:ToolbarMenuButtons()
self:ToolbarSide()
self:AttributeMenu()

--[=[ --this block was showing back the window after using /details hide, It's probably a leftover from the new Auto Hide and the old one.
_detalhes.WindowAutoHideTick = _detalhes.WindowAutoHideTick or {}
if (_detalhes.WindowAutoHideTick [self.meu_id]) then
_detalhes.WindowAutoHideTick [self.meu_id]:Cancel()
end
_detalhes.WindowAutoHideTick [self.meu_id] = C_Timer.NewTicker (10, function()
if (self.last_interaction) then
if (self.last_interaction + 10 < _detalhes._tempo) then
self:AdjustAlphaByContext(true)
_detalhes.WindowAutoHideTick [self.meu_id]:Cancel()
end
else
self:AdjustAlphaByContext(true)
_detalhes.WindowAutoHideTick [self.meu_id]:Cancel()
end
end)
--]=]
else
self:AdjustAlphaByContext(true)
end

self:DesaturateMenu()

self:CheckFor_EnabledTrashSuppression()

if (not temp and not _detalhes.initializing) then
_detalhes:SendEvent ("DETAILS_INSTANCE_OPEN", nil, self)
end

end
------------------------------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -735,7 +716,6 @@ end
end

table.remove (_detalhes.tabela_instancias, id)

end


Expand Down
58 changes: 10 additions & 48 deletions frames/window_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,6 @@ local function move_janela (baseframe, iniciando, instancia, just_updating)
if (need_start) then --> se a inst�ncia n�o tiver sido aberta ainda

local lower_instance = _detalhes:GetLowerInstanceNumber()
--print (lower_instance, instancia_alvo.meu_id, DEATHGRAPHICS_BUTTON:GetParent():GetName())

instancia_alvo:RestauraJanela (instancia_alvo.meu_id, true)
if (instancia_alvo:IsSoloMode()) then
Expand Down Expand Up @@ -2054,9 +2053,7 @@ local barra_scripts_onmouseup = function (self, button)

return _detalhes:ReportSingleLine (self._instance, self)
end

--print (self.minha_tabela)
-- /dump DetailsBarra_1_1.minha_tabela

if (not self.minha_tabela) then
return _detalhes:Msg ("this bar is waiting update.")
end
Expand Down Expand Up @@ -4001,7 +3998,6 @@ function _detalhes:SetBarGrowDirection (direction)
else
for index = 1, #bars do
bars [index]:SetWidth (baseframe:GetWidth() + self.row_info.space.right)
--print (bars [index]:GetWidth(), baseframe:GetWidth())
end
end
end
Expand Down Expand Up @@ -5042,9 +5038,6 @@ end

-- ~autohide �utohide
function _detalhes:SetWindowAlphaForCombat (entering_in_combat, true_hide, alphaAmount)

--print(entering_in_combat, "|", true_hide, "|", alphaAmount)

local amount, rowsamount, menuamount

--get the values
Expand Down Expand Up @@ -5084,8 +5077,6 @@ function _detalhes:SetWindowAlphaForCombat (entering_in_combat, true_hide, alpha
end
self.combat_changes_alpha = nil
end

--print ("baseframe:",amount,"rowframe:",rowsamount,"menu:",menuamount)

--apply
if (true_hide and amount == 0) then
Expand Down Expand Up @@ -5221,7 +5212,6 @@ function _detalhes:InstanceColor (red, green, blue, alpha, no_save, change_statu
self:StatusBarColor (nil, nil, nil, alpha, true)
end

-- print (self.skin, self.meu_id)
local skin = _detalhes.skins [self.skin]
if (not skin) then --the skin isn't available any more
Details:Msg ("Skin " .. (self.skin or "?") .. " not found, changing to 'Dark Theme'.")
Expand All @@ -5230,15 +5220,6 @@ function _detalhes:InstanceColor (red, green, blue, alpha, no_save, change_statu
self.skin = "Minimalistic"
end

--[[
self.baseframe.rodape.esquerdo:SetVertexColor (red, green, blue)
self.baseframe.rodape.esquerdo:SetAlpha (alpha)
self.baseframe.rodape.direita:SetVertexColor (red, green, blue)
self.baseframe.rodape.direita:SetAlpha (alpha)
self.baseframe.rodape.top_bg:SetVertexColor (red, green, blue)
self.baseframe.rodape.top_bg:SetAlpha (alpha)
--]]

self.baseframe.cabecalho.ball_r:SetVertexColor (red, green, blue)
self.baseframe.cabecalho.ball_r:SetAlpha (alpha)

Expand Down Expand Up @@ -6246,8 +6227,6 @@ local build_segment_list = function (self, elapsed)

segments_used = segments_used + 1

--print (thisCombat.is_boss.name, thisCombat.instance_type, _detalhes:GetRaidIcon (thisCombat.is_boss.mapid), thisCombat.is_boss.ej_instance_id)

if (thisCombat.is_mythic_dungeon_segment) then

if (not isMythicDungeon) then
Expand Down Expand Up @@ -6929,7 +6908,6 @@ function _detalhes:ChangeSkin (skin_name)
if (not just_updating) then

--> skin updater
--print ("debug", self.meu_id, self.iniciada, self.baseframe, self.bgframe)
if (self.bgframe.skin_script) then
self.bgframe:SetScript ("OnUpdate", nil)
self.bgframe.skin_script = false
Expand Down Expand Up @@ -7092,7 +7070,7 @@ function _detalhes:ChangeSkin (skin_name)
self.baseframe.cabecalho.atributo_icon:SetPoint ("topright", self.baseframe.cabecalho.ball_point, "topright", icon_anchor[1], icon_anchor[2])
self:ChangeIcon()
end

----------> lock alpha head

if (not this_skin.can_change_alpha_head) then
Expand All @@ -7114,10 +7092,10 @@ function _detalhes:ChangeSkin (skin_name)
self:SetBarBackdropSettings()
self:SetBarSpecIconSettings()
self:SetBarRightTextSettings()

--> update toolbar
self:ToolbarSide()

--> update stretch button
self:StretchButtonAnchor()

Expand Down Expand Up @@ -7146,7 +7124,7 @@ function _detalhes:ChangeSkin (skin_name)
else
self:InstanceWallpaper (false)
end

--> update instance color
self:InstanceColor()
self:SetBackgroundColor()
Expand Down Expand Up @@ -7727,7 +7705,7 @@ function _detalhes:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side
if (type (enabled) ~= "boolean") then
enabled = self.attribute_text.enabled
end

if (not pos_x) then
pos_x = self.attribute_text.anchor [1]
end
Expand Down Expand Up @@ -8283,18 +8261,18 @@ function _detalhes:ToolbarSide (side, only_update_anchors)
self.baseframe.UPFrameLeftPart:SetPoint ("topleft", self.baseframe, "bottomleft", 0, 0)

end

if (only_update_anchors) then
--> ShowSideBars depends on this and creates a infinite loop
return
end

--> update top menus
self:LeftMenuAnchorSide()

self:StretchButtonAnchor()
self:HideMainIcon()

self:HideMainIcon() --attribute menu reseting value

if (self.show_sidebars) then
self:ShowSideBars()
Expand Down Expand Up @@ -8367,7 +8345,6 @@ function _detalhes:StretchButtonAnchor (side)
end

function _detalhes:MenuAnchor (x, y)

if (self.toolbar_side == 1) then --top
if (not x) then
x = self.menu_anchor [1]
Expand Down Expand Up @@ -8417,7 +8394,6 @@ function _detalhes:MenuAnchor (x, y)
end

self:ToolbarMenuButtons()

end

function _detalhes:HideMainIcon (value)
Expand All @@ -8440,7 +8416,6 @@ function _detalhes:HideMainIcon (value)
self.baseframe.cabecalho.ball:SetTexCoord (l, r, b, t)
local l, r, t, b = unpack (COORDS_LEFT_CONNECTOR_NO_ICON)
self.baseframe.cabecalho.emenda:SetTexCoord (l, r, b, t)

end

local skin = _detalhes.skins [self.skin]
Expand Down Expand Up @@ -8468,19 +8443,6 @@ function _detalhes:HideMainIcon (value)
self.baseframe.cabecalho.emenda:SetTexCoord (l, r, b, t)
end
end

if (_detalhes.skins [self.skin].icon_titletext_position) then
if (not value and self.attribute_text.enabled and self.attribute_text.side == self.toolbar_side) then
self.attribute_text.anchor [1] = _detalhes.skins [self.skin].icon_titletext_position [1]
self.attribute_text.anchor [2] = _detalhes.skins [self.skin].icon_titletext_position [2]
self:AttributeMenu()
elseif (value and self.attribute_text.enabled and self.attribute_text.side == self.toolbar_side) then
self.attribute_text.anchor [1] = _detalhes.skins [self.skin].instance_cprops.attribute_text.anchor [1]
self.attribute_text.anchor [2] = _detalhes.skins [self.skin].instance_cprops.attribute_text.anchor [2]
self:AttributeMenu()
end
end

end

--> search key: ~desaturate
Expand Down
34 changes: 32 additions & 2 deletions frames/window_options2_sections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@ if (true) then
--return
end

--[[
search '~10' to go directly to tooltips settings
~01 - display
~02 - skins
~03 - bars general
~04 - bars texts
~05 - title bar
~06 - body setings
~07 - status bar
~08 - plugins
~09 - profiles
~10 - tooltips
~11 - datafeed
~12 - wallpaper
~13 - automation
~14 - raid tools
~15 - broadcaster
~16 - custom spells
~17 - charts data
--]]


local Details = _G.Details
local DF = _G.DetailsFramework
Expand Down Expand Up @@ -3947,6 +3969,7 @@ do
end


-- ~11 ~datafeed
do
local buildSection = function(sectionFrame)

Expand Down Expand Up @@ -4092,7 +4115,8 @@ do
end


do --~wallpaper
-- ~12 ~wallpaper
do
local buildSection = function(sectionFrame)

--> callback from the image editor
Expand Down Expand Up @@ -4497,7 +4521,9 @@ do --~wallpaper
tinsert(Details.optionsSection, buildSection)
end

do -- ~automation ~auto hide

-- ~13 ~automation ~auto hide
do
local buildSection = function(sectionFrame)

--> auto switch options
Expand Down Expand Up @@ -4920,6 +4946,7 @@ do -- ~automation ~auto hide
end


-- ~14 ~raidtools ~tools
do --raid tools
local buildSection = function(sectionFrame)

Expand Down Expand Up @@ -5374,6 +5401,7 @@ do --raid tools
end


-- ~15 ~broadcaster
do
local buildSection = function(sectionFrame)

Expand Down Expand Up @@ -5611,6 +5639,7 @@ do
end


-- ~16 ~customspells ~spells
do
local buildSection = function(sectionFrame)

Expand Down Expand Up @@ -5770,6 +5799,7 @@ do
end


-- ~17 ~charts data
do
local buildSection = function(sectionFrame)

Expand Down

0 comments on commit fd09d77

Please sign in to comment.