Fixed an issue when using Click to Open Menus + Auto Hide Menu
This commit is contained in:
@@ -308,6 +308,16 @@
|
||||
---@field boss boolean
|
||||
---@field last_event unixtime
|
||||
|
||||
---@class segmentid : number
|
||||
---@class instanceid : number
|
||||
|
||||
---@class instance : table
|
||||
---@field GetCombat fun(instance: instance, segmentId: segmentid) get the combat of the segment
|
||||
---@field GetInstanceGroup fun() : table
|
||||
---@field showing combat
|
||||
---@field meu_id instanceid
|
||||
---@field is_interacting boolean
|
||||
---@field modo number
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -144,7 +144,6 @@ core\meta.lua
|
||||
core\network.lua
|
||||
|
||||
core\parser.lua
|
||||
#core\parser_timewalk.lua
|
||||
|
||||
functions\loaddata.lua
|
||||
|
||||
|
||||
+22
-23
@@ -5,6 +5,28 @@
|
||||
local addonName, Details222 = ...
|
||||
|
||||
--[[global]] DETAILS_TOTALS_ONLYGROUP = true
|
||||
--[[global]] DETAILS_SEGMENTID_OVERALL = -1
|
||||
--[[global]] DETAILS_SEGMENTID_CURRENT = 0
|
||||
|
||||
--enum segments type
|
||||
--[[global]] DETAILS_SEGMENTTYPE_GENERIC = 0
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_OVERALL = 1
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_DUNGEON_TRASH = 5
|
||||
--[[global]] DETAILS_SEGMENTTYPE_DUNGEON_BOSS = 6
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_RAID_TRASH = 7
|
||||
--[[global]] DETAILS_SEGMENTTYPE_RAID_BOSS = 8
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC = 10
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH = 11
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL = 12
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASHOVERALL = 13
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS = 14
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_PVP_ARENA = 20
|
||||
--[[global]] DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND = 21
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--local pointers
|
||||
@@ -183,29 +205,6 @@
|
||||
return Loc ["STRING_UNKNOW"]
|
||||
end
|
||||
|
||||
--[[global]] DETAILS_SEGMENTID_OVERALL = -1
|
||||
--[[global]] DETAILS_SEGMENTID_CURRENT = 0
|
||||
|
||||
--enum segments type
|
||||
--[[global]] DETAILS_SEGMENTTYPE_GENERIC = 0
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_OVERALL = 1
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_DUNGEON_TRASH = 5
|
||||
--[[global]] DETAILS_SEGMENTTYPE_DUNGEON_BOSS = 6
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_RAID_TRASH = 7
|
||||
--[[global]] DETAILS_SEGMENTTYPE_RAID_BOSS = 8
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_GENERIC = 10
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASH = 11
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL = 12
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_TRASHOVERALL = 13
|
||||
--[[global]] DETAILS_SEGMENTTYPE_MYTHICDUNGEON_BOSS = 14
|
||||
|
||||
--[[global]] DETAILS_SEGMENTTYPE_PVP_ARENA = 20
|
||||
--[[global]] DETAILS_SEGMENTTYPE_PVP_BATTLEGROUND = 21
|
||||
|
||||
function combate:GetCombatType()
|
||||
--mythic dungeon
|
||||
local isMythicDungeon = is_mythic_dungeon_segment
|
||||
|
||||
+219
-252
@@ -7,8 +7,6 @@ local ipairs = ipairs --lua local
|
||||
local pairs = pairs --lua local
|
||||
local _math_floor = math.floor --lua local
|
||||
local _table_remove = table.remove --lua local
|
||||
local _getmetatable = getmetatable --lua local
|
||||
local setmetatable = setmetatable --lua local
|
||||
local _string_len = string.len --lua local
|
||||
local _unpack = unpack --lua local
|
||||
local _cstr = string.format --lua local
|
||||
@@ -37,13 +35,12 @@ local sub_atributos = _detalhes.sub_atributos
|
||||
end
|
||||
|
||||
function _detalhes:ReativarInstancias()
|
||||
|
||||
_detalhes.opened_windows = 0
|
||||
|
||||
--set metatables
|
||||
for index = 1, #_detalhes.tabela_instancias do
|
||||
local instancia = _detalhes.tabela_instancias [index]
|
||||
if (not _getmetatable (instancia)) then
|
||||
local instancia = _detalhes.tabela_instancias[index]
|
||||
if (not getmetatable(instancia)) then
|
||||
setmetatable(_detalhes.tabela_instancias[index], _detalhes)
|
||||
end
|
||||
end
|
||||
@@ -53,7 +50,7 @@ local sub_atributos = _detalhes.sub_atributos
|
||||
local instancia = _detalhes.tabela_instancias [index]
|
||||
if (instancia:IsEnabled()) then
|
||||
_detalhes.opened_windows = _detalhes.opened_windows + 1
|
||||
instancia:RestauraJanela (index, nil, true)
|
||||
instancia:RestauraJanela(index, nil, true)
|
||||
else
|
||||
instancia.iniciada = false
|
||||
end
|
||||
@@ -71,7 +68,7 @@ local sub_atributos = _detalhes.sub_atributos
|
||||
|
||||
--send open event
|
||||
for index = 1, #_detalhes.tabela_instancias do
|
||||
local instancia = _detalhes.tabela_instancias [index]
|
||||
local instancia = _detalhes.tabela_instancias[index]
|
||||
if (instancia:IsEnabled()) then
|
||||
if (not _detalhes.initializing) then
|
||||
_detalhes:SendEvent("DETAILS_INSTANCE_OPEN", nil, instancia)
|
||||
@@ -82,46 +79,66 @@ local sub_atributos = _detalhes.sub_atributos
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--API: call a function to all enabled instances
|
||||
function _detalhes:InstanceCall(funcao, ...)
|
||||
if (type(funcao) == "string") then
|
||||
funcao = _detalhes [funcao]
|
||||
---call a function to all enabled instances
|
||||
---@param func function|string
|
||||
---@vararg any
|
||||
function Details:InstanceCall(func, ...)
|
||||
if (type(func) == "string") then
|
||||
func = Details[func]
|
||||
end
|
||||
for index, instance in ipairs(_detalhes.tabela_instancias) do
|
||||
if (instance:IsAtiva()) then --only enabled
|
||||
funcao (instance, ...)
|
||||
for index, instance in ipairs(Details.tabela_instancias) do
|
||||
if (instance:IsAtiva()) then
|
||||
func(instance, ...)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--chama a fun��o para ser executada em todas as inst�ncias (internal)
|
||||
function _detalhes:InstanciaCallFunction(funcao, ...)
|
||||
for index, instancia in ipairs(_detalhes.tabela_instancias) do
|
||||
if (instancia:IsAtiva()) then --s� reabre se ela estiver ativa
|
||||
funcao (_, instancia, ...)
|
||||
---run a function on all enabled instances
|
||||
---@param func function
|
||||
---@vararg any
|
||||
function Details:InstanciaCallFunction(func, ...)
|
||||
for index, instancia in ipairs(Details.tabela_instancias) do
|
||||
if (instancia:IsAtiva()) then
|
||||
func(_, instancia, ...)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--chama a fun��o para ser executada em todas as inst�ncias (internal)
|
||||
function _detalhes:InstanciaCallFunctionOffline (funcao, ...)
|
||||
for index, instancia in ipairs(_detalhes.tabela_instancias) do
|
||||
funcao (_, instancia, ...)
|
||||
---run a function on all instances (enabled or disabled)
|
||||
---@param func function
|
||||
---@vararg any
|
||||
function Details:InstanciaCallFunctionOffline(func, ...)
|
||||
for index, instancia in ipairs(Details.tabela_instancias) do
|
||||
func(_, instancia, ...)
|
||||
end
|
||||
end
|
||||
|
||||
---run a function on all instances in the group
|
||||
---@param instance instance
|
||||
---@param funcName string
|
||||
---@vararg any
|
||||
function Details:InstanceGroupCall(instance, funcName, ...)
|
||||
for _, thisInstance in ipairs(instance:GetInstanceGroup()) do
|
||||
thisInstance[funcName](thisInstance, ...)
|
||||
end
|
||||
end
|
||||
|
||||
---change a settings on all windows in the group
|
||||
---@param instance instance
|
||||
---@param keyName string
|
||||
---@param value any
|
||||
function Details:InstanceGroupEditSetting(instance, keyName, value)
|
||||
for _, thisInstance in ipairs(instance:GetInstanceGroup()) do
|
||||
thisInstance[keyName] = value
|
||||
end
|
||||
end
|
||||
|
||||
---change a settings on all windows in the group
|
||||
---@param instance instance
|
||||
---@param table1Key string|number
|
||||
---@param table2Key string|number
|
||||
---@param table3Key string|number
|
||||
---@param value any
|
||||
function Details:InstanceGroupEditSettingOnTable(instance, table1Key, table2Key, table3Key, value)
|
||||
for _, thisInstance in ipairs(instance:GetInstanceGroup()) do
|
||||
if (value == nil) then
|
||||
@@ -135,9 +152,11 @@ function Details:InstanceGroupEditSettingOnTable(instance, table1Key, table2Key,
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:GetLowerInstanceNumber()
|
||||
---get the instanceId of the opened instance with the lowest id
|
||||
---@return instanceid|nil
|
||||
function Details:GetLowerInstanceNumber()
|
||||
local lower = 999
|
||||
for index, instancia in ipairs(_detalhes.tabela_instancias) do
|
||||
for index, instancia in ipairs(Details.tabela_instancias) do
|
||||
if (instancia.ativa and instancia.baseframe) then
|
||||
if (instancia.meu_id < lower) then
|
||||
lower = instancia.meu_id
|
||||
@@ -145,36 +164,50 @@ function _detalhes:GetLowerInstanceNumber()
|
||||
end
|
||||
end
|
||||
if (lower == 999) then
|
||||
_detalhes.lower_instance = 0
|
||||
Details.lower_instance = 0
|
||||
return nil
|
||||
else
|
||||
_detalhes.lower_instance = lower
|
||||
Details.lower_instance = lower
|
||||
return lower
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:IsLowerInstance()
|
||||
local lower = _detalhes:GetLowerInstanceNumber()
|
||||
if (lower) then
|
||||
return lower == self.meu_id
|
||||
end
|
||||
return false
|
||||
end
|
||||
--instance class prototype/mixin
|
||||
local instanceMixins = {
|
||||
---get the combat object which the instance is showing
|
||||
---@param instance instance
|
||||
---@param segmentId segmentid
|
||||
---@return combat
|
||||
GetCombat = function(instance, segmentId)
|
||||
return instance.showing
|
||||
end,
|
||||
|
||||
function _detalhes:IsInteracting()
|
||||
return self.is_interacting
|
||||
end
|
||||
---check if the instance is the lower instance id
|
||||
---@param self instance
|
||||
---@return boolean
|
||||
IsLowerInstance = function(self)
|
||||
return Details:GetLowerInstanceNumber() == self.meu_id
|
||||
end,
|
||||
|
||||
function _detalhes:GetMode()
|
||||
return self.modo
|
||||
end
|
||||
---@param self instance
|
||||
---@return boolean
|
||||
IsInteracting = function(self)
|
||||
return self.is_interacting
|
||||
end,
|
||||
|
||||
---@param self instance
|
||||
---@return number
|
||||
GetMode = function(self)
|
||||
return self.modo
|
||||
end,
|
||||
}
|
||||
|
||||
function _detalhes:GetInstance(id)
|
||||
return _detalhes.tabela_instancias [id]
|
||||
return _detalhes.tabela_instancias[id]
|
||||
end
|
||||
--user friendly alias
|
||||
function _detalhes:GetWindow (id)
|
||||
return _detalhes.tabela_instancias [id]
|
||||
function _detalhes:GetWindow(id)
|
||||
return _detalhes.tabela_instancias[id]
|
||||
end
|
||||
|
||||
function Details:GetNumInstances()
|
||||
@@ -498,7 +531,7 @@ end
|
||||
function _detalhes:ToggleWindow (index)
|
||||
local window = _detalhes:GetInstance(index)
|
||||
|
||||
if (window and _getmetatable (window)) then
|
||||
if (window and getmetatable (window)) then
|
||||
if (window:IsEnabled()) then
|
||||
window:ShutDown()
|
||||
else
|
||||
@@ -645,6 +678,8 @@ end
|
||||
|
||||
function _detalhes:AtivarInstancia (temp, all)
|
||||
self.ativa = true
|
||||
DetailsFramework:Mixin(self, instanceMixins)
|
||||
|
||||
self.cached_bar_width = self.cached_bar_width or 0
|
||||
|
||||
self.modo = self.modo or 2
|
||||
@@ -810,7 +845,7 @@ end
|
||||
return new_instance
|
||||
end
|
||||
|
||||
local new_instance = _detalhes:NovaInstancia (next_id)
|
||||
local new_instance = _detalhes:CreateNewInstance (next_id)
|
||||
|
||||
if (_detalhes.standard_skin) then
|
||||
for key, value in pairs(_detalhes.standard_skin) do
|
||||
@@ -885,7 +920,7 @@ end
|
||||
end
|
||||
|
||||
--cria uma nova janela
|
||||
local new_instance = _detalhes:NovaInstancia (#_detalhes.tabela_instancias+1)
|
||||
local new_instance = _detalhes:CreateNewInstance (#_detalhes.tabela_instancias+1)
|
||||
|
||||
if (not _detalhes.initializing) then
|
||||
_detalhes:SendEvent("DETAILS_INSTANCE_OPEN", nil, new_instance)
|
||||
@@ -1284,24 +1319,23 @@ end
|
||||
|
||||
--cria uma janela para uma nova inst�ncia
|
||||
--search key: ~new ~nova
|
||||
function _detalhes:CreateDisabledInstance (ID, skin_table)
|
||||
|
||||
function _detalhes:CreateDisabledInstance(ID, skin_table)
|
||||
--first check if we can recycle a old instance
|
||||
if (_detalhes.unused_instances [ID]) then
|
||||
local new_instance = _detalhes.unused_instances [ID]
|
||||
_detalhes.tabela_instancias [ID] = new_instance
|
||||
_detalhes.unused_instances [ID] = nil
|
||||
--replace the values on recycled instance
|
||||
new_instance:ResetInstanceConfig()
|
||||
if (_detalhes.unused_instances [ID]) then
|
||||
local new_instance = _detalhes.unused_instances [ID]
|
||||
_detalhes.tabela_instancias [ID] = new_instance
|
||||
_detalhes.unused_instances [ID] = nil
|
||||
--replace the values on recycled instance
|
||||
new_instance:ResetInstanceConfig()
|
||||
|
||||
--copy values from a previous skin saved
|
||||
if (skin_table) then
|
||||
--copy from skin_table to new_instance
|
||||
_detalhes.table.copy(new_instance, skin_table)
|
||||
end
|
||||
--copy values from a previous skin saved
|
||||
if (skin_table) then
|
||||
--copy from skin_table to new_instance
|
||||
_detalhes.table.copy(new_instance, skin_table)
|
||||
end
|
||||
|
||||
return new_instance
|
||||
end
|
||||
return new_instance
|
||||
end
|
||||
|
||||
--must create a new one
|
||||
local new_instance = {
|
||||
@@ -1349,159 +1383,131 @@ end
|
||||
}
|
||||
|
||||
setmetatable(new_instance, _detalhes)
|
||||
_detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance
|
||||
_detalhes.tabela_instancias[#_detalhes.tabela_instancias+1] = new_instance
|
||||
|
||||
--fill the empty instance with default values
|
||||
new_instance:ResetInstanceConfig()
|
||||
new_instance:ResetInstanceConfig()
|
||||
|
||||
--copy values from a previous skin saved
|
||||
if (skin_table) then
|
||||
--copy from skin_table to new_instance
|
||||
_detalhes.table.copy(new_instance, skin_table)
|
||||
end
|
||||
if (skin_table) then
|
||||
--copy from skin_table to new_instance
|
||||
_detalhes.table.copy(new_instance, skin_table)
|
||||
end
|
||||
|
||||
--setup default wallpaper
|
||||
new_instance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background"
|
||||
new_instance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background"
|
||||
|
||||
--finish
|
||||
return new_instance
|
||||
end
|
||||
|
||||
function _detalhes:NovaInstancia (ID)
|
||||
|
||||
local new_instance = {}
|
||||
setmetatable(new_instance, _detalhes)
|
||||
_detalhes.tabela_instancias [#_detalhes.tabela_instancias+1] = new_instance
|
||||
|
||||
--instance number
|
||||
new_instance.meu_id = ID
|
||||
|
||||
--setup all config
|
||||
new_instance:ResetInstanceConfig()
|
||||
--setup default wallpaper
|
||||
new_instance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background"
|
||||
|
||||
--internal stuff
|
||||
new_instance.barras = {} --container que ir� armazenar todas as barras
|
||||
new_instance.barraS = {nil, nil} --de x at� x s�o as barras que est�o sendo mostradas na tela
|
||||
new_instance.rolagem = false --barra de rolagem n�o esta sendo mostrada
|
||||
new_instance.largura_scroll = 26
|
||||
new_instance.bar_mod = 0
|
||||
new_instance.bgdisplay_loc = 0
|
||||
new_instance.cached_bar_width = 0
|
||||
|
||||
--displaying row info
|
||||
new_instance.rows_created = 0
|
||||
new_instance.rows_showing = 0
|
||||
new_instance.rows_max = 50
|
||||
new_instance.rows_fit_in_window = nil
|
||||
|
||||
--saved pos for normal mode and lone wolf mode
|
||||
new_instance.posicao = {
|
||||
["normal"] = {x = 1, y = 2, w = 300, h = 200},
|
||||
["solo"] = {x = 1, y = 2, w = 300, h = 200}
|
||||
}
|
||||
--save information about window snaps
|
||||
new_instance.snap = {}
|
||||
|
||||
--current state starts as normal
|
||||
new_instance.mostrando = "normal"
|
||||
--menu consolidated
|
||||
new_instance.consolidate = false
|
||||
new_instance.icons = {true, true, true, true}
|
||||
|
||||
--create window frames
|
||||
|
||||
local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal (ID, new_instance, true)
|
||||
new_instance.baseframe = _baseframe
|
||||
new_instance.bgframe = _bgframe
|
||||
new_instance.bgdisplay = _bgframe_display
|
||||
new_instance.scroll = _scrollframe
|
||||
|
||||
--status bar stuff
|
||||
new_instance.StatusBar = {}
|
||||
new_instance.StatusBar.left = nil
|
||||
new_instance.StatusBar.center = nil
|
||||
new_instance.StatusBar.right = nil
|
||||
new_instance.StatusBar.options = {}
|
||||
|
||||
local clock = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_CLOCK")
|
||||
_detalhes.StatusBar:SetCenterPlugin (new_instance, clock)
|
||||
|
||||
local segment = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_PSEGMENT")
|
||||
_detalhes.StatusBar:SetLeftPlugin (new_instance, segment)
|
||||
|
||||
local dps = _detalhes.StatusBar:CreateStatusBarChildForInstance (new_instance, "DETAILS_STATUSBAR_PLUGIN_PDPS")
|
||||
_detalhes.StatusBar:SetRightPlugin (new_instance, dps)
|
||||
|
||||
--internal stuff
|
||||
new_instance.alturaAntiga = _baseframe:GetHeight()
|
||||
new_instance.atributo = 1 --dano
|
||||
new_instance.sub_atributo = 1 --damage done
|
||||
new_instance.sub_atributo_last = {1, 1, 1, 1, 1}
|
||||
new_instance.segmento = -1 --combate atual
|
||||
new_instance.modo = modo_grupo
|
||||
new_instance.last_modo = modo_grupo
|
||||
new_instance.LastModo = modo_grupo
|
||||
|
||||
--change the attribute
|
||||
_detalhes:TrocaTabela(new_instance, 0, 1, 1)
|
||||
|
||||
--internal stuff
|
||||
new_instance.row_height = new_instance.row_info.height + new_instance.row_info.space.between
|
||||
|
||||
new_instance.oldwith = new_instance.baseframe:GetWidth()
|
||||
new_instance.iniciada = true
|
||||
new_instance:SaveMainWindowPosition()
|
||||
new_instance:ReajustaGump()
|
||||
|
||||
new_instance.rows_fit_in_window = _math_floor(new_instance.posicao[new_instance.mostrando].h / new_instance.row_height)
|
||||
|
||||
--all done
|
||||
new_instance:AtivarInstancia()
|
||||
|
||||
new_instance:ShowSideBars()
|
||||
|
||||
new_instance.skin = "no skin"
|
||||
new_instance:ChangeSkin (_detalhes.default_skin_to_use)
|
||||
|
||||
--apply standard skin if have one saved
|
||||
--[[
|
||||
if (_detalhes.standard_skin) then
|
||||
|
||||
local style = _detalhes.standard_skin
|
||||
local instance = new_instance
|
||||
local skin = style.skin
|
||||
|
||||
instance.skin = ""
|
||||
instance:ChangeSkin (skin)
|
||||
|
||||
--overwrite all instance parameters with saved ones
|
||||
for key, value in pairs(style) do
|
||||
if (key ~= "skin") then
|
||||
if (type(value) == "table") then
|
||||
instance [key] = Details.CopyTable(value)
|
||||
else
|
||||
instance [key] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
--]]
|
||||
|
||||
--apply all changed attributes
|
||||
--new_instance:ChangeSkin()
|
||||
|
||||
return new_instance
|
||||
end
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function _detalhes:FixToolbarMenu (instance)
|
||||
--print("fixing...", instance.meu_id)
|
||||
--instance:ToolbarMenuButtons()
|
||||
---create a new instance of a Details! window in the user interface
|
||||
---@param instanceId instanceid
|
||||
---@return instance
|
||||
function Details:CreateNewInstance(instanceId)
|
||||
local newInstance = {}
|
||||
setmetatable(newInstance, Details)
|
||||
Details.tabela_instancias[#Details.tabela_instancias+1] = newInstance
|
||||
|
||||
DetailsFramework:Mixin(newInstance, instanceMixins)
|
||||
|
||||
--instance id
|
||||
newInstance.meu_id = instanceId
|
||||
|
||||
--setup all config
|
||||
newInstance:ResetInstanceConfig()
|
||||
--setup default wallpaper
|
||||
newInstance.wallpaper.texture = "Interface\\AddOns\\Details\\images\\background"
|
||||
|
||||
--internal stuff
|
||||
newInstance.barras = {} --store the bars which shows data to the user
|
||||
newInstance.barraS = {nil, nil} --range of bars showing on the window
|
||||
newInstance.rolagem = false --scroll is shown?
|
||||
newInstance.largura_scroll = 26
|
||||
newInstance.bar_mod = 0
|
||||
newInstance.bgdisplay_loc = 0
|
||||
newInstance.cached_bar_width = 0
|
||||
|
||||
--displaying row info
|
||||
newInstance.rows_created = 0
|
||||
newInstance.rows_showing = 0
|
||||
newInstance.rows_max = 50
|
||||
newInstance.rows_fit_in_window = nil
|
||||
|
||||
--saved pos for normal mode and lone wolf mode
|
||||
newInstance.posicao = {
|
||||
["normal"] = {x = 1, y = 2, w = 300, h = 200},
|
||||
["solo"] = {x = 1, y = 2, w = 300, h = 200}
|
||||
}
|
||||
|
||||
--save information about window snaps
|
||||
newInstance.snap = {}
|
||||
|
||||
--current state starts as normal
|
||||
newInstance.mostrando = "normal"
|
||||
|
||||
--menu consolidated
|
||||
newInstance.consolidate = false
|
||||
newInstance.icons = {true, true, true, true}
|
||||
|
||||
--create window frames
|
||||
local _baseframe, _bgframe, _bgframe_display, _scrollframe = gump:CriaJanelaPrincipal(instanceId, newInstance, true)
|
||||
newInstance.baseframe = _baseframe
|
||||
newInstance.bgframe = _bgframe
|
||||
newInstance.bgdisplay = _bgframe_display
|
||||
newInstance.scroll = _scrollframe
|
||||
|
||||
--status bar stuff
|
||||
newInstance.StatusBar = {}
|
||||
newInstance.StatusBar.left = nil
|
||||
newInstance.StatusBar.center = nil
|
||||
newInstance.StatusBar.right = nil
|
||||
newInstance.StatusBar.options = {}
|
||||
|
||||
--create some plugins in the statusbar
|
||||
local clock = Details.StatusBar:CreateStatusBarChildForInstance(newInstance, "DETAILS_STATUSBAR_PLUGIN_CLOCK")
|
||||
Details.StatusBar:SetCenterPlugin(newInstance, clock)
|
||||
|
||||
local segment = Details.StatusBar:CreateStatusBarChildForInstance(newInstance, "DETAILS_STATUSBAR_PLUGIN_PSEGMENT")
|
||||
Details.StatusBar:SetLeftPlugin(newInstance, segment)
|
||||
|
||||
local dps = Details.StatusBar:CreateStatusBarChildForInstance(newInstance, "DETAILS_STATUSBAR_PLUGIN_PDPS")
|
||||
Details.StatusBar:SetRightPlugin(newInstance, dps)
|
||||
|
||||
--internal stuff
|
||||
newInstance.alturaAntiga = _baseframe:GetHeight()
|
||||
newInstance.atributo = 1 --dano
|
||||
newInstance.sub_atributo = 1 --damage done
|
||||
newInstance.sub_atributo_last = {1, 1, 1, 1, 1}
|
||||
newInstance.segmento = -1 --combate atual
|
||||
newInstance.modo = modo_grupo
|
||||
newInstance.last_modo = modo_grupo
|
||||
newInstance.LastModo = modo_grupo
|
||||
|
||||
--change the attribute
|
||||
Details:TrocaTabela(newInstance, 0, 1, 1)
|
||||
|
||||
--internal stuff
|
||||
newInstance.row_height = newInstance.row_info.height + newInstance.row_info.space.between
|
||||
newInstance.oldwith = newInstance.baseframe:GetWidth()
|
||||
newInstance.iniciada = true
|
||||
|
||||
newInstance:SaveMainWindowPosition()
|
||||
newInstance:ReajustaGump()
|
||||
|
||||
newInstance.rows_fit_in_window = _math_floor(newInstance.posicao[newInstance.mostrando].h / newInstance.row_height)
|
||||
|
||||
--all done
|
||||
newInstance:AtivarInstancia()
|
||||
newInstance:ShowSideBars()
|
||||
|
||||
newInstance.skin = "no skin"
|
||||
newInstance:ChangeSkin(Details.default_skin_to_use)
|
||||
|
||||
return newInstance
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
--ao reiniciar o addon esta fun��o � rodada para recriar a janela da inst�ncia
|
||||
@@ -2357,8 +2363,7 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic
|
||||
if (instance.meu_id ~= instancia.meu_id and instance.ativa and not instance._postponing_switch and not instance._postponing_current) then
|
||||
if (instance:GetSegment() >= 0 and instancia:GetSegment() ~= -1) then
|
||||
if (instance.modo == 2 or instance.modo == 3) then
|
||||
--na troca de segmento, conferir se a instancia esta frozen
|
||||
|
||||
--check if the instance is frozen
|
||||
if (instance.freezed) then
|
||||
if (not iniciando_instancia) then
|
||||
instance:UnFreeze()
|
||||
@@ -2369,14 +2374,14 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic
|
||||
|
||||
instance.segmento = segmento
|
||||
|
||||
if (segmento == -1) then --overall
|
||||
instance.showing = _detalhes.tabela_overall
|
||||
if (segmento == DETAILS_SEGMENTID_OVERALL) then
|
||||
instance.showing = Details:GetOverallCombat()
|
||||
|
||||
elseif (segmento == 0) then --combate atual
|
||||
instance.showing = _detalhes.tabela_vigente; --print("==> Changing the Segment now! - classe_instancia.lua 2148")
|
||||
elseif (segmento == DETAILS_SEGMENTID_CURRENT) then
|
||||
instance.showing = Details:GetCurrentCombat()
|
||||
|
||||
else --alguma tabela do hist�rico
|
||||
instance.showing = _detalhes.tabela_historico.tabelas [segmento]
|
||||
else
|
||||
instance.showing = Details:GetCombat(segmento)
|
||||
end
|
||||
|
||||
if (not instance.showing) then
|
||||
@@ -2402,7 +2407,7 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic
|
||||
end
|
||||
end
|
||||
|
||||
--Muda o atributo caso necess�rio
|
||||
--if the main attibute is 5 (custom), check if there is any custom display, is isn't, change the attribute and sub attribute to 1 (damage done)
|
||||
if (atributo == 5) then
|
||||
if (#_detalhes.custom < 1) then
|
||||
atributo = 1
|
||||
@@ -2422,14 +2427,14 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic
|
||||
return _detalhes.SoloTables.switch (nil, nil, -1)
|
||||
|
||||
elseif ((instancia.modo == modo_raid) and not (_detalhes.initializing or iniciando_instancia)) then --raid
|
||||
return --nao faz nada quando clicar no bot�o
|
||||
return --do nothing when clicking in the button
|
||||
end
|
||||
|
||||
atributo_changed = true
|
||||
instancia.atributo = atributo
|
||||
instancia.sub_atributo = instancia.sub_atributo_last [atributo]
|
||||
instancia.sub_atributo = instancia.sub_atributo_last[atributo]
|
||||
|
||||
--troca icone
|
||||
--change icon
|
||||
instancia:ChangeIcon()
|
||||
|
||||
if (update_coolTip) then
|
||||
@@ -2437,44 +2442,6 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic
|
||||
_detalhes.popup:Select(2, instancia.sub_atributo, atributo)
|
||||
end
|
||||
|
||||
--DEPRECATED
|
||||
if (_detalhes.cloud_process) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg("(debug) instancia #"..instancia.meu_id.." found cloud process.")
|
||||
end
|
||||
|
||||
local atributo = instancia.atributo
|
||||
local time_left = (_detalhes.last_data_requested+7) - _detalhes._tempo
|
||||
|
||||
if (atributo == 1 and _detalhes.in_combat and not _detalhes:CaptureGet("damage") and _detalhes.host_by) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg("(debug) instancia need damage cloud.")
|
||||
end
|
||||
elseif (atributo == 2 and _detalhes.in_combat and (not _detalhes:CaptureGet("heal") or _detalhes:CaptureGet("aura")) and _detalhes.host_by) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg("(debug) instancia need heal cloud.")
|
||||
end
|
||||
elseif (atributo == 3 and _detalhes.in_combat and not _detalhes:CaptureGet("energy") and _detalhes.host_by) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg("(debug) instancia need energy cloud.")
|
||||
end
|
||||
elseif (atributo == 4 and _detalhes.in_combat and not _detalhes:CaptureGet("miscdata") and _detalhes.host_by) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg("(debug) instancia need misc cloud.")
|
||||
end
|
||||
else
|
||||
time_left = nil
|
||||
end
|
||||
|
||||
if (time_left) then
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg("(debug) showing instance alert.")
|
||||
end
|
||||
instancia:InstanceAlert (Loc ["STRING_PLEASE_WAIT"], {[[Interface\COMMON\StreamCircle]], 22, 22, true}, time_left)
|
||||
end
|
||||
end
|
||||
--END OF DEPRECATED
|
||||
|
||||
_detalhes:InstanceCall(_detalhes.CheckPsUpdate)
|
||||
_detalhes:SendEvent("DETAILS_INSTANCE_CHANGEATTRIBUTE", nil, instancia, atributo, sub_atributo)
|
||||
end
|
||||
@@ -2516,7 +2483,7 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic
|
||||
end
|
||||
return
|
||||
else
|
||||
--verificar relogio, precisaria dar refresh no plugin clock
|
||||
--refresh clock plugin
|
||||
end
|
||||
|
||||
instancia.v_barras = true
|
||||
|
||||
@@ -31,6 +31,35 @@ function Details:GetCurrentCombat()
|
||||
return Details.tabela_vigente
|
||||
end
|
||||
|
||||
function Details:GetOverallCombat()
|
||||
return _detalhes.tabela_overall
|
||||
end
|
||||
|
||||
function Details:GetCombat(combat)
|
||||
if (not combat) then
|
||||
return Details.tabela_vigente
|
||||
|
||||
elseif (type(combat) == "number") then
|
||||
if (combat == -1) then --overall
|
||||
return Details.tabela_overall
|
||||
|
||||
elseif (combat == 0) then --current
|
||||
return Details.tabela_vigente
|
||||
else
|
||||
return Details.tabela_historico.tabelas[combat]
|
||||
end
|
||||
|
||||
elseif (type(combat) == "string") then
|
||||
if (combat == "overall") then
|
||||
return Details.tabela_overall
|
||||
elseif (combat == "current") then
|
||||
return Details.tabela_vigente
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
--returns a private table containing all stored segments
|
||||
function Details:GetCombatSegments()
|
||||
return Details.tabela_historico.tabelas
|
||||
|
||||
@@ -6258,31 +6258,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
return Details.encounter_table.id and true or false
|
||||
end
|
||||
|
||||
--get combat
|
||||
function Details:GetCombat(combat)
|
||||
if (not combat) then
|
||||
return _current_combat
|
||||
|
||||
elseif (type(combat) == "number") then
|
||||
if (combat == -1) then --overall
|
||||
return Details.tabela_overall
|
||||
elseif (combat == 0) then --current
|
||||
return _current_combat
|
||||
else
|
||||
return Details.tabela_historico.tabelas [combat]
|
||||
end
|
||||
|
||||
elseif (type(combat) == "string") then
|
||||
if (combat == "overall") then
|
||||
return Details.tabela_overall
|
||||
elseif (combat == "current") then
|
||||
return _current_combat
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
function Details:GetAllActors(_combat, _actorname)
|
||||
return Details:GetActor(_combat, 1, _actorname), Details:GetActor(_combat, 2, _actorname), Details:GetActor(_combat, 3, _actorname), Details:GetActor(_combat, 4, _actorname)
|
||||
end
|
||||
|
||||
+149
-240
@@ -8943,14 +8943,7 @@ function Details:SetTooltipBackdrop(border_texture, border_size, border_color)
|
||||
end
|
||||
|
||||
--reset button functions
|
||||
local reset_button_onenter = function(self, _, forced, from_click)
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
local instancia = self._instance or self.widget._instance
|
||||
local baseframe = instancia.baseframe
|
||||
|
||||
local resetButton_OnEnter = function(self, _, bForceOpen)
|
||||
local gameCooltip = GameCooltip
|
||||
|
||||
OnEnterMainWindow(self.instance, self)
|
||||
@@ -8961,8 +8954,13 @@ end
|
||||
self:GetNormalTexture():SetDesaturated(false)
|
||||
end
|
||||
|
||||
if (Details.instances_menu_click_to_open and not bForceOpen) then
|
||||
return
|
||||
end
|
||||
|
||||
--prepare the reset button menu
|
||||
gameCooltip:Reset()
|
||||
gameCooltip:SetType ("menu")
|
||||
gameCooltip:SetType("menu")
|
||||
|
||||
gameCooltip:SetOption("ButtonsYMod", -6)
|
||||
gameCooltip:SetOption("HeighMod", 6)
|
||||
@@ -8982,13 +8980,13 @@ end
|
||||
gameCooltip:AddIcon([[Interface\Buttons\UI-StopButton]], 1, 1, 14, 14, 0, 1, 0, 1, "red")
|
||||
gameCooltip:AddMenu(1, Details.tabela_historico.resetar)
|
||||
|
||||
show_anti_overlap (self.instance, self, "top")
|
||||
show_anti_overlap(self.instance, self, "top")
|
||||
|
||||
Details:SetMenuOwner (self, self.instance)
|
||||
Details:SetMenuOwner(self, self.instance)
|
||||
gameCooltip:ShowCooltip()
|
||||
end
|
||||
|
||||
local reset_button_onleave = function(self)
|
||||
local resetButton_OnLeave = function(self)
|
||||
OnLeaveMainWindow(self.instance, self)
|
||||
|
||||
if (self.instance.desaturated_menu) then
|
||||
@@ -9010,7 +9008,7 @@ end
|
||||
|
||||
--close button functions
|
||||
|
||||
local close_button_onclick = function(self, button_type, button)
|
||||
local closeButton_OnClick = function(self, button_type, button)
|
||||
if (self and not self.instancia and button and button.instancia) then
|
||||
self = button
|
||||
end
|
||||
@@ -9020,16 +9018,13 @@ end
|
||||
self:Disable()
|
||||
self.instancia:DesativarInstancia()
|
||||
|
||||
--n�o h� mais inst�ncias abertas, ent�o manda msg alertando
|
||||
--check if there's no more windows opened
|
||||
if (Details.opened_windows == 0) then
|
||||
Details:Msg(Loc["STRING_CLOSEALL"])
|
||||
end
|
||||
|
||||
--tutorial, how to fully delete a window
|
||||
--_detalhes:SetTutorialCVar ("FULL_DELETE_WINDOW", false)
|
||||
|
||||
if (not Details:GetTutorialCVar("FULL_DELETE_WINDOW")) then
|
||||
Details:SetTutorialCVar ("FULL_DELETE_WINDOW", true)
|
||||
Details:SetTutorialCVar("FULL_DELETE_WINDOW", true)
|
||||
|
||||
local panel = gump:Create1PxPanel(UIParent, 600, 100, "|cFFFFFFFFDetails!, the window hit the ground, bang bang...|r", nil, nil, nil, nil)
|
||||
panel:SetBackdropColor(0, 0, 0, 0.9)
|
||||
@@ -9044,10 +9039,10 @@ end
|
||||
|
||||
GameCooltip:Hide()
|
||||
end
|
||||
Details.close_instancia_func = close_button_onclick
|
||||
Details.close_instancia_func = closeButton_OnClick
|
||||
|
||||
local close_button_onenter = function(self)
|
||||
OnEnterMainWindow(self.instance, self, 3)
|
||||
local closeButton_OnEnter = function(self)
|
||||
OnEnterMainWindow(self.instance, self)
|
||||
|
||||
if (self.instance.desaturated_menu) then
|
||||
self:GetNormalTexture():SetDesaturated(false)
|
||||
@@ -9059,7 +9054,7 @@ end
|
||||
self.instance.baseframe.cabecalho.button_mouse_over = true
|
||||
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:SetType ("menu")
|
||||
GameCooltip:SetType("menu")
|
||||
GameCooltip:SetOption("ButtonsYMod", -7)
|
||||
GameCooltip:SetOption("ButtonsYModSub", -2)
|
||||
GameCooltip:SetOption("YSpacingMod", 0)
|
||||
@@ -9070,14 +9065,12 @@ end
|
||||
GameCooltip:SetOption("IgnoreButtonAutoHeightSub", false)
|
||||
GameCooltip:SetOption("SubMenuIsTooltip", true)
|
||||
GameCooltip:SetOption("FixedWidthSub", 180)
|
||||
--GameCooltip:SetOption("FixedHeight", 30)
|
||||
|
||||
GameCooltip:SetOption("HeighMod", 9)
|
||||
|
||||
local font = SharedMedia:Fetch("font", "Friz Quadrata TT")
|
||||
GameCooltip:AddLine(Loc["STRING_MENU_CLOSE_INSTANCE"], nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
|
||||
GameCooltip:AddIcon([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], 1, 1, 14, 14, 0.2, 0.8, 0.2, 0.8)
|
||||
GameCooltip:AddMenu(1, close_button_onclick, self)
|
||||
GameCooltip:AddMenu(1, closeButton_OnClick, self)
|
||||
|
||||
GameCooltip:AddLine(Loc["STRING_MENU_CLOSE_INSTANCE_DESC"], nil, 2, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
|
||||
GameCooltip:AddIcon([[Interface\CHATFRAME\UI-ChatIcon-Minimize-Up]], 2, 1, 18, 18)
|
||||
@@ -9085,14 +9078,13 @@ end
|
||||
GameCooltip:AddLine(Loc["STRING_MENU_CLOSE_INSTANCE_DESC2"], nil, 2, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
|
||||
GameCooltip:AddIcon([[Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent]], 2, 1, 18, 18)
|
||||
|
||||
GameCooltip:SetWallpaper (1, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true)
|
||||
GameCooltip:SetWallpaper (2, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true)
|
||||
GameCooltip:SetWallpaper(1, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true)
|
||||
GameCooltip:SetWallpaper(2, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true)
|
||||
GameCooltip:SetBackdrop(1, menus_backdrop, nil, menus_bordercolor)
|
||||
GameCooltip:SetBackdrop(2, menus_backdrop, nil, menus_bordercolor)
|
||||
|
||||
show_anti_overlap (self.instance, self, "top")
|
||||
|
||||
Details:SetMenuOwner (self, self.instance)
|
||||
show_anti_overlap(self.instance, self, "top")
|
||||
Details:SetMenuOwner(self, self.instance)
|
||||
GameCooltip:ShowCooltip()
|
||||
end
|
||||
|
||||
@@ -9119,26 +9111,11 @@ end
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--build upper menu bar
|
||||
|
||||
local menu_can_open = function()
|
||||
if (GameCooltip.active) then
|
||||
local owner = GameCooltip:GetOwner()
|
||||
if (owner and owner:GetScript("OnUpdate") == on_leave_menu) then
|
||||
owner:SetScript("OnUpdate", nil)
|
||||
end
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local report_on_enter = function(self, motion, forced, from_click)
|
||||
local is_cooltip_opened = menu_can_open() -- and not is_cooltip_opened
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
local reportButton_OnEnter = function(self, motion, forced)
|
||||
local instancia = self._instance or self.widget._instance
|
||||
local baseframe = instancia.baseframe
|
||||
|
||||
OnEnterMainWindow(instancia, self, 3)
|
||||
OnEnterMainWindow(instancia, self)
|
||||
if (instancia.desaturated_menu) then
|
||||
self:GetNormalTexture():SetDesaturated(false)
|
||||
end
|
||||
@@ -9146,9 +9123,13 @@ local report_on_enter = function(self, motion, forced, from_click)
|
||||
GameCooltip.buttonOver = true
|
||||
baseframe.cabecalho.button_mouse_over = true
|
||||
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
GameCooltip:Reset()
|
||||
|
||||
GameCooltip:SetType ("menu")
|
||||
GameCooltip:SetType("menu")
|
||||
GameCooltip:SetOption("ButtonsYMod", -6)
|
||||
GameCooltip:SetOption("HeighMod", 6)
|
||||
GameCooltip:SetOption("YSpacingMod", -1)
|
||||
@@ -9159,20 +9140,19 @@ local report_on_enter = function(self, motion, forced, from_click)
|
||||
|
||||
Details:CheckLastReportsIntegrity()
|
||||
|
||||
local last_reports = Details.latest_report_table
|
||||
if (#last_reports > 0) then
|
||||
local amountReports = #last_reports
|
||||
amountReports = math.min (amountReports, 10)
|
||||
local lastPeports = Details.latest_report_table
|
||||
if (#lastPeports > 0) then
|
||||
local amountReports = #lastPeports
|
||||
amountReports = math.min(amountReports, 10)
|
||||
|
||||
for index = amountReports, 1, -1 do
|
||||
local report = last_reports [index]
|
||||
local instance_number, attribute, subattribute, amt, report_where, custom_name = unpack(report)
|
||||
local report = lastPeports[index]
|
||||
local instanceId, attribute, subattribute, amt, report_where, custom_name = unpack(report)
|
||||
|
||||
local name = Details:GetSubAttributeName (attribute, subattribute, custom_name)
|
||||
local subAttributeName = Details:GetSubAttributeName(attribute, subattribute, custom_name)
|
||||
local artwork = Details.GetReportIconAndColor(report_where)
|
||||
|
||||
local artwork = Details.GetReportIconAndColor (report_where)
|
||||
|
||||
GameCooltip:AddLine(name .. " (#" .. amt .. ")", nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
|
||||
GameCooltip:AddLine(subAttributeName .. " (#" .. amt .. ")", nil, 1, "white", nil, Details.font_sizes.menus, Details.font_faces.menus)
|
||||
if (artwork) then
|
||||
GameCooltip:AddIcon(artwork.icon, 1, 1, 14, 14, artwork.coords[1], artwork.coords[2], artwork.coords[3], artwork.coords[4], artwork.color, nil, false)
|
||||
end
|
||||
@@ -9186,17 +9166,17 @@ local report_on_enter = function(self, motion, forced, from_click)
|
||||
GameCooltip:AddIcon([[Interface\Addons\Details\Images\report_button]], 1, 1, 12, 19)
|
||||
GameCooltip:AddMenu(1, Details.Reportar, instancia, nil, "INSTANCE" .. instancia.meu_id)
|
||||
|
||||
show_anti_overlap (instancia, self, "top")
|
||||
Details:SetMenuOwner (self, instancia)
|
||||
show_anti_overlap(instancia, self, "top")
|
||||
Details:SetMenuOwner(self, instancia)
|
||||
|
||||
GameCooltip:ShowCooltip()
|
||||
end
|
||||
|
||||
local report_on_leave = function(self, motion, forced, from_click)
|
||||
local reportButton_OnLeave = function(self, motion, forced, from_click)
|
||||
local instancia = self._instance or self.widget._instance
|
||||
local baseframe = instancia.baseframe
|
||||
|
||||
OnLeaveMainWindow(instancia, self, 3)
|
||||
OnLeaveMainWindow(instancia, self)
|
||||
|
||||
hide_anti_overlap(instancia.baseframe.anti_menu_overlap)
|
||||
|
||||
@@ -9208,23 +9188,18 @@ local report_on_leave = function(self, motion, forced, from_click)
|
||||
end
|
||||
|
||||
if (GameCooltip.active) then
|
||||
parameters_table [2] = from_click and 1 or 0
|
||||
parameters_table[2] = from_click and 1 or 0
|
||||
self:SetScript("OnUpdate", on_leave_menu)
|
||||
else
|
||||
self:SetScript("OnUpdate", nil)
|
||||
end
|
||||
end
|
||||
|
||||
local atributo_on_enter = function(self, motion, forced, from_click)
|
||||
local is_cooltip_opened = menu_can_open() -- and not is_cooltip_opened
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
local attributeButton_OnEnter = function(self, motion, forced, from_click)
|
||||
local instancia = self._instance or self.widget._instance
|
||||
local baseframe = instancia.baseframe
|
||||
|
||||
OnEnterMainWindow(instancia, self, 3)
|
||||
OnEnterMainWindow(instancia, self)
|
||||
|
||||
if (instancia.desaturated_menu) then
|
||||
self:GetNormalTexture():SetDesaturated(false)
|
||||
@@ -9233,19 +9208,22 @@ local atributo_on_enter = function(self, motion, forced, from_click)
|
||||
GameCooltip.buttonOver = true
|
||||
baseframe.cabecalho.button_mouse_over = true
|
||||
|
||||
show_anti_overlap (instancia, self, "top")
|
||||
show_anti_overlap(instancia, self, "top")
|
||||
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:SetType (3)
|
||||
GameCooltip:SetType(3)
|
||||
GameCooltip:SetFixedParameter(instancia)
|
||||
|
||||
if (Details.solo and Details.solo == instancia.meu_id) then
|
||||
Details:MontaSoloOption(instancia)
|
||||
|
||||
elseif (instancia:IsRaidMode()) then
|
||||
|
||||
local have_plugins = Details:MontaRaidOption(instancia)
|
||||
if (not have_plugins) then
|
||||
local hasRaidPlugins = Details:MontaRaidOption(instancia)
|
||||
if (not hasRaidPlugins) then
|
||||
GameCooltip:SetType ("tooltip")
|
||||
GameCooltip:SetOption("ButtonsYMod", 0)
|
||||
|
||||
@@ -9253,31 +9231,25 @@ local atributo_on_enter = function(self, motion, forced, from_click)
|
||||
GameCooltip:SetOption("IgnoreButtonAutoHeight", false)
|
||||
GameCooltip:AddLine("All raid plugins already\nin use or disabled.", nil, 1, "white", nil, 10, SharedMedia:Fetch("font", "Friz Quadrata TT"))
|
||||
GameCooltip:AddIcon([[Interface\GROUPFRAME\UI-GROUP-ASSISTANTICON]], 1, 1)
|
||||
GameCooltip:SetWallpaper (1, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true)
|
||||
|
||||
GameCooltip:SetWallpaper(1, Details.tooltip.menus_bg_texture, Details.tooltip.menus_bg_coords, Details.tooltip.menus_bg_color, true)
|
||||
end
|
||||
|
||||
else
|
||||
Details:MontaAtributosOption (instancia)
|
||||
Details:MontaAtributosOption(instancia)
|
||||
GameCooltip:SetOption("YSpacingMod", -1)
|
||||
GameCooltip:SetOption("YSpacingModSub", -2)
|
||||
end
|
||||
|
||||
GameCooltip:SetOption("TextSize", Details.font_sizes.menus)
|
||||
|
||||
Details:SetMenuOwner (self, instancia)
|
||||
|
||||
|
||||
Details:SetMenuOwner(self, instancia)
|
||||
GameCooltip:ShowCooltip()
|
||||
end
|
||||
|
||||
local atributo_on_leave = function(self, motion, forced, from_click)
|
||||
local attributeButton_OnLeave = function(self, motion, forced, from_click)
|
||||
local instancia = self._instance or self.widget._instance
|
||||
local baseframe = instancia.baseframe
|
||||
|
||||
OnLeaveMainWindow(instancia, self, 3)
|
||||
|
||||
hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
|
||||
OnLeaveMainWindow(instancia, self)
|
||||
hide_anti_overlap(instancia.baseframe.anti_menu_overlap)
|
||||
|
||||
if (instancia.desaturated_menu) then
|
||||
self:GetNormalTexture():SetDesaturated(true)
|
||||
@@ -9287,7 +9259,7 @@ local atributo_on_leave = function(self, motion, forced, from_click)
|
||||
baseframe.cabecalho.button_mouse_over = false
|
||||
|
||||
if (GameCooltip.active) then
|
||||
parameters_table [2] = 0
|
||||
parameters_table[2] = 0
|
||||
self:SetScript("OnUpdate", on_leave_menu)
|
||||
else
|
||||
self:SetScript("OnUpdate", nil)
|
||||
@@ -9295,10 +9267,6 @@ local atributo_on_leave = function(self, motion, forced, from_click)
|
||||
end
|
||||
|
||||
local segmentButton_OnEnter = function(self, motion, forced, fromClick)
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
local instance = self._instance or self.widget._instance
|
||||
local baseframe = instance.baseframe
|
||||
|
||||
@@ -9311,6 +9279,10 @@ local segmentButton_OnEnter = function(self, motion, forced, fromClick)
|
||||
GameCooltip.buttonOver = true
|
||||
baseframe.cabecalho.button_mouse_over = true
|
||||
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
local timeToOpen = 0
|
||||
if (_G.GameCooltip.active) then
|
||||
timeToOpen = 0.15
|
||||
@@ -9343,16 +9315,11 @@ local segmentButton_OnLeave = function(self, motion, forced, fromClick)
|
||||
end
|
||||
end
|
||||
|
||||
local modo_selecao_on_enter = function(self, motion, forced, from_click)
|
||||
local is_cooltip_opened = menu_can_open() -- not is_cooltip_opened
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
local modeSelector_OnEnter = function(self, motion, forced, from_click)
|
||||
local instancia = self._instance or self.widget._instance
|
||||
local baseframe = instancia.baseframe
|
||||
|
||||
OnEnterMainWindow(instancia, self, 3)
|
||||
OnEnterMainWindow(instancia, self)
|
||||
|
||||
if (instancia.desaturated_menu) then
|
||||
self:GetNormalTexture():SetDesaturated(false)
|
||||
@@ -9361,9 +9328,13 @@ local modo_selecao_on_enter = function(self, motion, forced, from_click)
|
||||
GameCooltip.buttonOver = true
|
||||
baseframe.cabecalho.button_mouse_over = true
|
||||
|
||||
local passou = 0
|
||||
if (Details.instances_menu_click_to_open and not forced) then
|
||||
return
|
||||
end
|
||||
|
||||
local elapsedTime = 0
|
||||
if (_G.GameCooltip.active) then
|
||||
passou = 0.15
|
||||
elapsedTime = 0.15
|
||||
end
|
||||
|
||||
local checked
|
||||
@@ -9377,20 +9348,19 @@ local modo_selecao_on_enter = function(self, motion, forced, from_click)
|
||||
checked = 3
|
||||
end
|
||||
|
||||
parameters_table [1] = instancia
|
||||
parameters_table [2] = from_click and 1 or passou
|
||||
parameters_table [3] = checked
|
||||
parameters_table[1] = instancia
|
||||
parameters_table[2] = from_click and 1 or elapsedTime
|
||||
parameters_table[3] = checked
|
||||
|
||||
self:SetScript("OnUpdate", build_mode_list)
|
||||
end
|
||||
|
||||
local modo_selecao_on_leave = function(self)
|
||||
local modeSelector_OnLeave = function(self)
|
||||
local instancia = self._instance or self.widget._instance
|
||||
local baseframe = instancia.baseframe
|
||||
|
||||
OnLeaveMainWindow(instancia, self, 3)
|
||||
|
||||
hide_anti_overlap (instancia.baseframe.anti_menu_overlap)
|
||||
OnLeaveMainWindow(instancia, self)
|
||||
hide_anti_overlap(instancia.baseframe.anti_menu_overlap)
|
||||
|
||||
if (instancia.desaturated_menu) then
|
||||
self:GetNormalTexture():SetDesaturated(true)
|
||||
@@ -9400,107 +9370,50 @@ local modo_selecao_on_leave = function(self)
|
||||
baseframe.cabecalho.button_mouse_over = false
|
||||
|
||||
if (GameCooltip.active) then
|
||||
parameters_table [2] = 0
|
||||
parameters_table[2] = 0
|
||||
self:SetScript("OnUpdate", on_leave_menu)
|
||||
else
|
||||
self:SetScript("OnUpdate", nil)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- these can
|
||||
local title_bar_icons = {
|
||||
{texture = [[Interface\AddOns\Details\images\toolbar_icons]], texcoord = {0/256, 32/256, 0, 1}},
|
||||
{texture = [[Interface\AddOns\Details\images\toolbar_icons]], texcoord = {32/256, 64/256, 0, 1}},
|
||||
{texture = [[Interface\AddOns\Details\images\toolbar_icons]], texcoord = {66/256, 93/256, 0, 1}},
|
||||
{texture = [[Interface\AddOns\Details\images\toolbar_icons]], texcoord = {96/256, 128/256, 0, 1}},
|
||||
{texture = [[Interface\AddOns\Details\images\toolbar_icons]], texcoord = {128/256, 160/256, 0, 1}},
|
||||
}
|
||||
function Details:GetTitleBarIconsTexture(button, instance)
|
||||
if (instance or self.meu_id) then
|
||||
local textureFile = self.toolbar_icon_file or instance.toolbar_icon_file
|
||||
local t = title_bar_icons [button]
|
||||
if (t and textureFile) then
|
||||
t.texture = textureFile
|
||||
end
|
||||
return t or title_bar_icons
|
||||
end
|
||||
return title_bar_icons [button] or title_bar_icons
|
||||
end
|
||||
|
||||
function Details:CreateFakeWindow()
|
||||
local t = CreateFrame("frame")
|
||||
t:SetSize(200, 91)
|
||||
t:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16 })
|
||||
t:SetBackdropColor(0.0941, 0.0941, 0.0941, 0.3)
|
||||
local tb = CreateFrame("frame", nil, t)
|
||||
tb:SetPoint("bottomleft", t, "topleft", 0, 0)
|
||||
tb:SetPoint("bottomright", t, "topright", 0, 0)
|
||||
tb:SetHeight(16)
|
||||
tb:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16 })
|
||||
tb:SetBackdropColor(0.7, 0.7, 0.7, 0.4)
|
||||
local tt = tb:CreateFontString(nil, "overlay", "GameFontNormal")
|
||||
Details:SetFontColor(tt, "white")
|
||||
Details:SetFontSize(tt, 10)
|
||||
Details:SetFontFace(tt, LibStub:GetLibrary("LibSharedMedia-3.0"):Fetch("font", "Accidental Presidency"))
|
||||
tt:SetPoint("bottomleft", tb, 3, 4)
|
||||
tt:SetText("Damage Done")
|
||||
|
||||
t.TitleIcons = {}
|
||||
for i = 1, 5 do
|
||||
local b = tb:CreateTexture(nil, "overlay")
|
||||
b:SetSize(12, 12)
|
||||
b:SetPoint("bottomright", tb, "bottomright", -((abs(i-6)-1)*11) - 1, 2)
|
||||
local button_texture_texcoord = Details:GetTitleBarIconsTexture(i)
|
||||
b:SetTexture(button_texture_texcoord.texture)
|
||||
b:SetTexCoord(unpack(button_texture_texcoord.texcoord))
|
||||
tinsert(t.TitleIcons, b)
|
||||
end
|
||||
|
||||
t.TitleBar = tb
|
||||
t.TitleText = tt
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
local function click_to_change_segment (instancia, buttontype)
|
||||
local changeSegmentOnClick = function(instancia, buttontype)
|
||||
if (buttontype == "LeftButton") then
|
||||
|
||||
local segmento_goal = instancia.segmento + 1
|
||||
if (segmento_goal > segmentsUsed) then
|
||||
segmento_goal = -1
|
||||
elseif (segmento_goal > Details.segments_amount) then
|
||||
segmento_goal = -1
|
||||
--previous segment as the pointer move upwards getting older segments
|
||||
local previousSegment = instancia.segmento + 1
|
||||
if (previousSegment > segmentsUsed) then
|
||||
previousSegment = -1
|
||||
elseif (previousSegment > Details.segments_amount) then
|
||||
previousSegment = -1
|
||||
end
|
||||
|
||||
local total_shown = segmentsFilled+2
|
||||
local goal = segmento_goal+1
|
||||
local maxSegments = segmentsFilled + 2
|
||||
previousSegment = previousSegment + 1
|
||||
|
||||
local select_ = math.abs(goal - total_shown)
|
||||
GameCooltip:Select(1, select_)
|
||||
local segmentId = math.abs(previousSegment - maxSegments)
|
||||
GameCooltip:Select(1, segmentId)
|
||||
|
||||
instancia:TrocaTabela(segmento_goal)
|
||||
instancia:TrocaTabela(previousSegment) --todo: use new api
|
||||
|
||||
segmentButton_OnEnter (instancia.baseframe.cabecalho.segmento.widget, _, true, true)
|
||||
segmentButton_OnEnter(instancia.baseframe.cabecalho.segmento.widget, _, true, true)
|
||||
|
||||
elseif (buttontype == "RightButton") then
|
||||
|
||||
local segmento_goal = instancia.segmento - 1
|
||||
if (segmento_goal < -1) then
|
||||
segmento_goal = segmentsUsed
|
||||
--next segment as the pointer move downwards getting newer segments
|
||||
local nextSegment = instancia.segmento - 1
|
||||
if (nextSegment < -1) then
|
||||
nextSegment = segmentsUsed
|
||||
end
|
||||
|
||||
local total_shown = segmentsFilled+2
|
||||
local goal = segmento_goal+1
|
||||
local maxSegments = segmentsFilled + 2
|
||||
nextSegment = nextSegment + 1
|
||||
|
||||
local select_ = math.abs(goal - total_shown)
|
||||
GameCooltip:Select(1, select_)
|
||||
local segmentId = math.abs(nextSegment - maxSegments)
|
||||
GameCooltip:Select(1, segmentId)
|
||||
|
||||
instancia:TrocaTabela(segmento_goal)
|
||||
segmentButton_OnEnter (instancia.baseframe.cabecalho.segmento.widget, _, true, true)
|
||||
instancia:TrocaTabela(nextSegment)
|
||||
segmentButton_OnEnter(instancia.baseframe.cabecalho.segmento.widget, _, true, true)
|
||||
|
||||
elseif (buttontype == "MiddleButton") then
|
||||
|
||||
local segmento_goal = 0
|
||||
|
||||
local total_shown = segmentsFilled+2
|
||||
@@ -9540,10 +9453,10 @@ function gump:CriaCabecalho (baseframe, instancia)
|
||||
baseframe.cabecalho.fechar.instancia = instancia
|
||||
baseframe.cabecalho.fechar.instance = instancia
|
||||
|
||||
baseframe.cabecalho.fechar:SetScript("OnEnter", close_button_onenter)
|
||||
baseframe.cabecalho.fechar:SetScript("OnEnter", closeButton_OnEnter)
|
||||
baseframe.cabecalho.fechar:SetScript("OnLeave", close_button_onleave)
|
||||
|
||||
baseframe.cabecalho.fechar:SetScript("OnClick", close_button_onclick)
|
||||
baseframe.cabecalho.fechar:SetScript("OnClick", closeButton_OnClick)
|
||||
|
||||
--bola do canto esquedo superior --primeiro criar a arma��o para apoiar as texturas
|
||||
baseframe.cabecalho.ball_point = instancia.floatingframe:CreateTexture(nil, "overlay")
|
||||
@@ -9666,33 +9579,31 @@ function gump:CriaCabecalho (baseframe, instancia)
|
||||
instancia.menu_points = {MenuAnchorLeft, MenuAnchorRight}
|
||||
instancia.menu2_points = {Menu2AnchorRight}
|
||||
|
||||
-- bot�es
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--title bar buttons
|
||||
|
||||
local CoolTip = _G.GameCooltip
|
||||
|
||||
--SELE��O DO MODO ----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
local modo_selecao_button_click = function()
|
||||
--mode selection
|
||||
local modeSelector_OnClick = function()
|
||||
if (Details.instances_menu_click_to_open) then
|
||||
if (instancia.LastMenuOpened == "mode" and GameCooltipFrame1:IsShown()) then
|
||||
GameCooltip:ShowMe(false)
|
||||
instancia.LastMenuOpened = nil
|
||||
else
|
||||
modo_selecao_on_enter (instancia.baseframe.cabecalho.modo_selecao.widget, _, true, true)
|
||||
modeSelector_OnEnter(instancia.baseframe.cabecalho.modo_selecao.widget, _, true, true)
|
||||
instancia.LastMenuOpened = "mode"
|
||||
end
|
||||
else
|
||||
Details:OpenOptionsWindow (instancia)
|
||||
Details:OpenOptionsWindow(instancia)
|
||||
end
|
||||
end
|
||||
|
||||
baseframe.cabecalho.modo_selecao = gump:NewButton(baseframe, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, modo_selecao_button_click, nil, nil, [[Interface\AddOns\Details\images\modo_icone]])
|
||||
baseframe.cabecalho.modo_selecao = gump:NewButton(baseframe, nil, "DetailsModeButton"..instancia.meu_id, nil, 16, 16, modeSelector_OnClick, nil, nil, [[Interface\AddOns\Details\images\modo_icone]])
|
||||
baseframe.cabecalho.modo_selecao:SetPoint("bottomleft", baseframe.cabecalho.ball, "bottomright", instancia.menu_anchor [1], instancia.menu_anchor [2])
|
||||
baseframe.cabecalho.modo_selecao:SetFrameLevel(baseframe:GetFrameLevel()+5)
|
||||
baseframe.cabecalho.modo_selecao.widget._instance = instancia
|
||||
|
||||
baseframe.cabecalho.modo_selecao:SetScript("OnEnter", modo_selecao_on_enter)
|
||||
baseframe.cabecalho.modo_selecao:SetScript("OnLeave", modo_selecao_on_leave)
|
||||
baseframe.cabecalho.modo_selecao:SetScript("OnEnter", modeSelector_OnEnter)
|
||||
baseframe.cabecalho.modo_selecao:SetScript("OnLeave", modeSelector_OnLeave)
|
||||
|
||||
local b = baseframe.cabecalho.modo_selecao.widget
|
||||
b:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
@@ -9703,28 +9614,28 @@ function gump:CriaCabecalho (baseframe, instancia)
|
||||
b:GetPushedTexture():SetTexCoord(0/256, 32/256, 0, 1)
|
||||
|
||||
|
||||
--SELECIONAR O SEGMENTO ----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
local segmento_button_click = function(self, button, param1)
|
||||
--segment selection
|
||||
local segmentSelector_OnClick = function(self, button, param1)
|
||||
if (Details.instances_menu_click_to_open) then
|
||||
if (instancia.LastMenuOpened == "segments" and GameCooltipFrame1:IsShown()) then
|
||||
GameCooltip:ShowMe(false)
|
||||
instancia.LastMenuOpened = nil
|
||||
else
|
||||
segmentButton_OnEnter (instancia.baseframe.cabecalho.segmento.widget, _, true, true)
|
||||
segmentButton_OnEnter(instancia.baseframe.cabecalho.segmento.widget, _, true, true)
|
||||
instancia.LastMenuOpened = "segments"
|
||||
end
|
||||
else
|
||||
click_to_change_segment (instancia, button)
|
||||
changeSegmentOnClick(instancia, button)
|
||||
end
|
||||
end
|
||||
|
||||
baseframe.cabecalho.segmento = gump:NewButton(baseframe, nil, "DetailsSegmentButton"..instancia.meu_id, nil, 16, 16, segmento_button_click, nil, nil, [[Interface\AddOns\Details\images\segmentos_icone]])
|
||||
baseframe.cabecalho.segmento = gump:NewButton(baseframe, nil, "DetailsSegmentButton"..instancia.meu_id, nil, 16, 16, segmentSelector_OnClick, nil, nil, [[Interface\AddOns\Details\images\segmentos_icone]])
|
||||
baseframe.cabecalho.segmento:SetFrameLevel(baseframe.UPFrame:GetFrameLevel()+1)
|
||||
baseframe.cabecalho.segmento.widget._instance = instancia
|
||||
baseframe.cabecalho.segmento:SetPoint("left", baseframe.cabecalho.modo_selecao, "right", 0, 0)
|
||||
|
||||
--ativa bot�o do meio e direito
|
||||
baseframe.cabecalho.segmento:SetClickFunction(segmento_button_click, nil, nil, "rightclick")
|
||||
baseframe.cabecalho.segmento:SetClickFunction(segmentSelector_OnClick, nil, nil, "rightclick")
|
||||
|
||||
baseframe.cabecalho.segmento:SetScript("OnEnter", segmentButton_OnEnter)
|
||||
baseframe.cabecalho.segmento:SetScript("OnLeave", segmentButton_OnLeave)
|
||||
@@ -9744,7 +9655,7 @@ function gump:CriaCabecalho (baseframe, instancia)
|
||||
GameCooltip:ShowMe(false)
|
||||
instancia.LastMenuOpened = nil
|
||||
else
|
||||
atributo_on_enter (instancia.baseframe.cabecalho.atributo.widget, _, true, true)
|
||||
attributeButton_OnEnter (instancia.baseframe.cabecalho.atributo.widget, _, true, true)
|
||||
instancia.LastMenuOpened = "attributes"
|
||||
end
|
||||
end
|
||||
@@ -9755,8 +9666,8 @@ function gump:CriaCabecalho (baseframe, instancia)
|
||||
baseframe.cabecalho.atributo.widget._instance = instancia
|
||||
baseframe.cabecalho.atributo:SetPoint("left", baseframe.cabecalho.segmento.widget, "right", 0, 0)
|
||||
|
||||
baseframe.cabecalho.atributo:SetScript("OnEnter", atributo_on_enter)
|
||||
baseframe.cabecalho.atributo:SetScript("OnLeave", atributo_on_leave)
|
||||
baseframe.cabecalho.atributo:SetScript("OnEnter", attributeButton_OnEnter)
|
||||
baseframe.cabecalho.atributo:SetScript("OnLeave", attributeButton_OnLeave)
|
||||
|
||||
local b = baseframe.cabecalho.atributo.widget
|
||||
b:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
@@ -9766,39 +9677,36 @@ function gump:CriaCabecalho (baseframe, instancia)
|
||||
b:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
b:GetPushedTexture():SetTexCoord(68/256, 93/256, 0, 1)
|
||||
|
||||
--REPORTAR ~report ----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
local report_func = function()
|
||||
instancia:Reportar ("INSTANCE" .. instancia.meu_id)
|
||||
--report button ~report
|
||||
local reportButtton_OnClick = function()
|
||||
instancia:Reportar("INSTANCE" .. instancia.meu_id)
|
||||
GameCooltip2:Hide()
|
||||
end
|
||||
baseframe.cabecalho.report = gump:NewButton(baseframe, nil, "DetailsReportButton"..instancia.meu_id, nil, 8, 16, report_func)
|
||||
|
||||
baseframe.cabecalho.report = gump:NewButton(baseframe, nil, "DetailsReportButton"..instancia.meu_id, nil, 8, 16, reportButtton_OnClick)
|
||||
baseframe.cabecalho.report:SetFrameLevel(baseframe.UPFrame:GetFrameLevel()+1)
|
||||
baseframe.cabecalho.report.widget._instance = instancia
|
||||
baseframe.cabecalho.report:SetPoint("left", baseframe.cabecalho.atributo, "right", -6, 0)
|
||||
|
||||
baseframe.cabecalho.report:SetScript("OnEnter", report_on_enter)
|
||||
baseframe.cabecalho.report:SetScript("OnLeave", report_on_leave)
|
||||
baseframe.cabecalho.report:SetScript("OnEnter", reportButton_OnEnter)
|
||||
baseframe.cabecalho.report:SetScript("OnLeave", reportButton_OnLeave)
|
||||
|
||||
local b = baseframe.cabecalho.report.widget
|
||||
b:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
b:GetNormalTexture():SetTexCoord(96/256, 128/256, 0, 1)
|
||||
b:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
b:GetHighlightTexture():SetTexCoord(96/256, 128/256, 0, 1)
|
||||
b:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
b:GetPushedTexture():SetTexCoord(96/256, 128/256, 0, 1)
|
||||
local reportButton = baseframe.cabecalho.report.widget
|
||||
reportButton:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
reportButton:GetNormalTexture():SetTexCoord(96/256, 128/256, 0, 1)
|
||||
reportButton:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
reportButton:GetHighlightTexture():SetTexCoord(96/256, 128/256, 0, 1)
|
||||
reportButton:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
reportButton:GetPushedTexture():SetTexCoord(96/256, 128/256, 0, 1)
|
||||
|
||||
|
||||
|
||||
-- ~delete ~erase ~reset
|
||||
--reset ----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local reset_func = function()
|
||||
--reset button ~delete ~erase ~reset
|
||||
local resetButton_OnClick = function()
|
||||
if (Details.instances_menu_click_to_open) then
|
||||
if (instancia.LastMenuOpened == "reset" and GameCooltipFrame1:IsShown()) then
|
||||
GameCooltip:ShowMe(false)
|
||||
instancia.LastMenuOpened = nil
|
||||
else
|
||||
reset_button_onenter (instancia.baseframe.cabecalho.reset, _, true, true)
|
||||
resetButton_OnEnter(instancia.baseframe.cabecalho.reset, _, true, true)
|
||||
instancia.LastMenuOpened = "reset"
|
||||
end
|
||||
else
|
||||
@@ -9817,16 +9725,17 @@ function gump:CriaCabecalho (baseframe, instancia)
|
||||
baseframe.cabecalho.reset.instance = instancia
|
||||
baseframe.cabecalho.reset._instance = instancia
|
||||
|
||||
baseframe.cabecalho.reset:SetScript("OnClick", reset_func)
|
||||
baseframe.cabecalho.reset:SetScript("OnEnter", reset_button_onenter)
|
||||
baseframe.cabecalho.reset:SetScript("OnLeave", reset_button_onleave)
|
||||
baseframe.cabecalho.reset:SetScript("OnClick", resetButton_OnClick)
|
||||
baseframe.cabecalho.reset:SetScript("OnEnter", resetButton_OnEnter)
|
||||
baseframe.cabecalho.reset:SetScript("OnLeave", resetButton_OnLeave)
|
||||
|
||||
local b = baseframe.cabecalho.reset
|
||||
b:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
b:GetNormalTexture():SetTexCoord(128/256, 160/256, 0, 1)
|
||||
b:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
b:GetHighlightTexture():SetTexCoord(128/256, 160/256, 0, 1)
|
||||
b:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
b:GetPushedTexture():SetTexCoord(128/256, 160/256, 0, 1)
|
||||
local resetButton = baseframe.cabecalho.reset
|
||||
resetButton:SetNormalTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
resetButton:GetNormalTexture():SetTexCoord(128/256, 160/256, 0, 1)
|
||||
|
||||
resetButton:SetHighlightTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
resetButton:GetHighlightTexture():SetTexCoord(128/256, 160/256, 0, 1)
|
||||
|
||||
resetButton:SetPushedTexture([[Interface\AddOns\Details\images\toolbar_icons]])
|
||||
resetButton:GetPushedTexture():SetTexCoord(128/256, 160/256, 0, 1)
|
||||
end
|
||||
|
||||
@@ -2595,7 +2595,7 @@ do
|
||||
name = Loc ["STRING_OPTIONS_CLICK_TO_OPEN_MENUS"],
|
||||
desc = Loc ["STRING_OPTIONS_CLICK_TO_OPEN_MENUS_DESC"],
|
||||
},
|
||||
|
||||
|
||||
{--auto hide buttons
|
||||
type = "toggle",
|
||||
get = function() return currentInstance.auto_hide_menu.left end,
|
||||
@@ -5519,27 +5519,28 @@ do
|
||||
|
||||
for id, i in ipairs(optionsOrder) do
|
||||
local line = _G.CreateFrame("frame", nil, sectionFrame,"BackdropTemplate")
|
||||
line:SetSize(300, 22)
|
||||
line:SetSize(322, 22)
|
||||
line:SetPoint("topleft", sectionFrame, "topleft", right_start_at, yyy + ((id) * -23) + 4)
|
||||
DetailsFramework:ApplyStandardBackdrop(line)
|
||||
|
||||
local contextLabel = DetailsFramework:CreateLabel(line, typeCombatAlpha[i])
|
||||
contextLabel:SetPoint("left", line, "left", 2, 0)
|
||||
contextLabel.textsize = 10
|
||||
|
||||
local enabledCheckbox = DetailsFramework:NewSwitch(line, nil, nil, nil, 20, 20, nil, nil, false, nil, nil, nil, nil, options_switch_template)
|
||||
enabledCheckbox:SetPoint("left", line, "left", 118, 0)
|
||||
enabledCheckbox:SetPoint("left", line, "left", 140, 0)
|
||||
enabledCheckbox:SetAsCheckBox()
|
||||
enabledCheckbox.OnSwitch = onEnableHideContext
|
||||
enabledCheckbox:SetFixedParameter(i)
|
||||
|
||||
local reverseCheckbox = DetailsFramework:NewSwitch(line, nil, nil, nil, 20, 20, nil, nil, false, nil, nil, nil, nil, options_switch_template)
|
||||
reverseCheckbox:SetPoint("left", line, "left", 140, 0)
|
||||
reverseCheckbox:SetPoint("left", line, "left", 162, 0)
|
||||
reverseCheckbox:SetAsCheckBox()
|
||||
reverseCheckbox.OnSwitch = onInverseValue
|
||||
reverseCheckbox:SetFixedParameter(i)
|
||||
|
||||
local alphaSlider = DetailsFramework:CreateSlider(line, 138, 20, 0, 100, 1, 100, false, nil, nil, nil, options_slider_template)
|
||||
alphaSlider:SetPoint("left", line, "left", 162, 0)
|
||||
alphaSlider:SetPoint("left", line, "left", 184, 0)
|
||||
alphaSlider:SetHook("OnValueChanged", onAlphaChanged)
|
||||
alphaSlider:SetFixedParameter(i)
|
||||
alphaSlider.thumb:SetWidth(32)
|
||||
|
||||
Reference in New Issue
Block a user