- Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.

- Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.
- Fixed an issue with death display where the text wasn't updating their width correctly.
- Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.
- Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.
This commit is contained in:
Tercio
2015-08-05 15:44:12 -03:00
parent 668d509e29
commit 115e80a3e4
9 changed files with 82 additions and 22 deletions
+3
View File
@@ -29,6 +29,9 @@ refresh_group = boolean, if true it apply the scale to all windows in the group
instance:MicroDisplaysSide (side)
side = number, 1 = top side of the window, 2 = bottom.
instance:MicroDisplaysLock (is_locked)
is_locked = boolean, true is the micro displays are locked and cannot interact with the mouse.
instance:SetAutoHideMenu (enabled)
enabled = boolean, if true, the buttons on window's title bar auto hide when the player isn't interacting with the window.
+10 -3
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -618,7 +618,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex
end
if (use_animations) then
instancia:fazer_animacoes()
instancia:fazer_animacoes (qual_barra-1)
end
if (forcar) then
+1
View File
@@ -119,6 +119,7 @@ _detalhes.instance_defaults = {
toolbar_side = 1,
--micro displays side
micro_displays_side = 2,
micro_displays_locked = true,
--stretch button anchor side (1 = top 2 = bottom)
stretch_button_side = 1,
--where plugins icon will be placed on main window toolbar (1 = left 2 = right)
+6 -13
View File
@@ -556,10 +556,12 @@ function atributo_misc:DeadAtualizarBarra (morte, qual_barra, colocacao, instanc
esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [morte[4]]))
end
esta_barra.icone_classe:SetVertexColor (1, 1, 1)
if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip
gump:UpdateTooltip (qual_barra, esta_barra, instancia)
end
esta_barra.texto_esquerdo:SetSize (esta_barra:GetWidth() - esta_barra.texto_direita:GetStringWidth() - 20, 15)
end
@@ -654,20 +656,11 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
local barras_container = instancia.barras
local percentage_type = instancia.row_info.percent_type
if (instancia.bars_sort_direction == 1) then
for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado
if (mortes[i]) then --> correção para um raro e desconhecido problema onde mortes[i] é nil
atributo_misc:DeadAtualizarBarra (mortes[i], qual_barra, i, instancia)
qual_barra = qual_barra+1
end
end
elseif (instancia.bars_sort_direction == 2) then
for i = instancia.barraS[2], instancia.barraS[1], 1 do --> vai atualizar só o range que esta sendo mostrado
for i = instancia.barraS[1], instancia.barraS[2], 1 do --> vai atualizar só o range que esta sendo mostrado
if (mortes[i]) then --> correção para um raro e desconhecido problema onde mortes[i] é nil
atributo_misc:DeadAtualizarBarra (mortes[i], qual_barra, i, instancia)
qual_barra = qual_barra+1
end
end
return _detalhes:EndRefresh (instancia, total, tabela_do_combate, showing) --> retorna a tabela que precisa ganhar o refresh
@@ -784,7 +777,7 @@ function atributo_misc:RefreshWindow (instancia, tabela_do_combate, forcar, expo
end
if (use_animations) then
instancia:fazer_animacoes()
instancia:fazer_animacoes (qual_barra-1)
end
if (instancia.atributo == 5) then --> custom
+17 -1
View File
@@ -43,6 +43,20 @@
end
end
function _detalhes.StatusBar:LockDisplays (instance, locked)
if (instance.StatusBar.center and instance.StatusBar.left and instance.StatusBar.right) then
if (locked) then
instance.StatusBar.center.frame:EnableMouse (false)
instance.StatusBar.left.frame:EnableMouse (false)
instance.StatusBar.right.frame:EnableMouse (false)
else
instance.StatusBar.center.frame:EnableMouse (true)
instance.StatusBar.left.frame:EnableMouse (true)
instance.StatusBar.right.frame:EnableMouse (true)
end
end
end
--> create a plugin child for an instance
function _detalhes.StatusBar:CreateStatusBarChildForInstance (instance, pluginName)
local PluginObject = _detalhes.StatusBar.NameTable [pluginName]
@@ -291,7 +305,9 @@
--|TTexturePath: size X: size Y: point offset Y X : texture size : coordx1 L : coordx2 R : coordy1 T : coordy2 B |t
-- left click: 0.0019531:0.1484375:0.4257813:0.6210938 right click: 0.0019531:0.1484375:0.6269531:0.8222656
_detalhes.OnEnterMainWindow (frame.child.instance)
local instance = frame.child.instance
_detalhes.OnEnterMainWindow (instance)
frame:SetBackdrop (on_enter_backdrop)
frame:SetBackdropColor (0.7, 0.7, 0.7, 0.6)
+3
View File
@@ -360,6 +360,9 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
end
end
--> apply default values if some key is missing
instance:LoadInstanceConfig()
--> reset basic config
instance.snap = {}
instance.horizontalSnap = nil
+26 -3
View File
@@ -7068,6 +7068,27 @@ function window:CreateFrame6()
ConfigLeftMicroFrameButton:SetNormalTexture ([[Interface\Buttons\UI-OptionsButton]])
ConfigLeftMicroFrameButton:SetHighlightTexture ([[Interface\Buttons\UI-OptionsButton]])
ConfigLeftMicroFrameButton.tooltip = Loc ["STRING_OPTIONS_MICRODISPLAYS_OPTION_TOOLTIP"]
--> lock mini displays
g:NewSwitch (frame6, _, "$parentLockMiniDisplaysSlider", "LockMiniDisplaysSlider", 60, 20, _, _, instance.micro_displays_locked)
g:NewLabel (frame6, _, "$parentLockMiniDisplaysLabel", "LockMiniDisplaysLabel", Loc ["STRING_OPTIONS_MICRODISPLAY_LOCK"], "GameFontHighlightLeft")
frame6.LockMiniDisplaysSlider:SetPoint ("left", frame6.LockMiniDisplaysLabel, "right", 2)
frame6.LockMiniDisplaysSlider.OnSwitch = function (self, instance, value)
instance:MicroDisplaysLock (value)
if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then
for _, this_instance in ipairs (instance:GetInstanceGroup()) do
if (this_instance ~= instance) then
this_instance:MicroDisplaysLock (value)
end
end
end
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
window:CreateLineBackground2 (frame6, "LockMiniDisplaysSlider", "LockMiniDisplaysLabel", Loc ["STRING_OPTIONS_MICRODISPLAY_LOCK_DESC"])
--> sidebars
g:NewSwitch (frame6, _, "$parentSideBarsSlider", "sideBarsSlider", 60, 20, _, _, instance.show_sidebars)
@@ -7202,8 +7223,6 @@ function window:CreateFrame6()
frame6.strataDropdown:SetPoint ("left", frame6.strataLabel, "right", 2)
window:CreateLineBackground2 (frame6, "strataDropdown", "strataLabel", Loc ["STRING_OPTIONS_INSTANCE_STRATA_DESC"])
--> statusbar color overwrite
g:NewLabel (frame6, _, "$parentStatusbarLabelAnchor", "statusbarAnchorLabel", Loc ["STRING_OPTIONS_INSTANCE_STATUSBAR_ANCHOR"], "GameFontNormal")
@@ -7308,7 +7327,8 @@ function window:CreateFrame6()
{"MicroDisplayCenterLabel", 6},
{"MicroDisplayRightLabel", 7},
{"instanceMicroDisplaysSideLabel", 8, true},
{"MicroDisplayWarningLabel", 9, true},
{"LockMiniDisplaysLabel", 9},
{"MicroDisplayWarningLabel", 10, true},
}
window:arrange_menu (frame6, right_side, window.right_start_at, window.top_start_at)
@@ -10324,6 +10344,9 @@ end --> if not window
_G.DetailsOptionsWindow6WindowScaleSlider.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow6WindowScaleSlider.MyObject:SetValue (editing_instance.window_scale)
_G.DetailsOptionsWindow6LockMiniDisplaysSlider.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow6LockMiniDisplaysSlider.MyObject:SetValue (editing_instance.micro_displays_locked)
----
+15 -1
View File
@@ -6061,8 +6061,9 @@ function _detalhes:ChangeSkin (skin_name)
self:HideSideBars()
end
--> refresh the side of the micro displays
--> refresh the side of the micro displays and its lock state
self:MicroDisplaysSide()
self:MicroDisplaysLock()
--> update statusbar
if (self.show_statusbar) then
@@ -6660,6 +6661,19 @@ function _detalhes:GetInstanceIconsCurrentAlpha()
end
end
function _detalhes:MicroDisplaysLock (lockstate)
if (lockstate == nil) then
lockstate = self.micro_displays_locked
end
self.micro_displays_locked = lockstate
if (lockstate) then --> is locked
_detalhes.StatusBar:LockDisplays (self, true)
else
_detalhes.StatusBar:LockDisplays (self, false)
end
end
function _detalhes:MicroDisplaysSide (side, fromuser)
if (not side) then
side = self.micro_displays_side