Alpha 1.16.0
- Added option to be able to save the window's size and position within the profile. - Added performance profile options. - Added auto switch based on group roles also a switch for wipe. - Fixed a bug where sometimes all non boss segments was considered boss encounters. - Fixed the padlock image when sliders are deactivated. - NewAPI: _detalhes:CheckForPerformanceProfile() check if is necessary change the performance profile. - NewAPI: _detalhes:GetActorsOnDamageCache() return damage object from raid members inside the parser cache. - NewAPI: _detalhes:GetActorsOnHealingCache() return healing object from raid members inside the parser cache.
This commit is contained in:
+6
-45
@@ -5,12 +5,12 @@
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
local _detalhes = _G._detalhes
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
|
||||
local _tempo = time()
|
||||
local _
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> local pointers
|
||||
|
||||
@@ -328,27 +328,11 @@
|
||||
_detalhes:UptadeRaidMembersCache()
|
||||
_detalhes:HaveOneCurrentInstance()
|
||||
|
||||
--> hide / alpha in combat
|
||||
--> hide / alpha / switch in combat
|
||||
for index, instancia in ipairs (_detalhes.tabela_instancias) do
|
||||
if (instancia.ativa) then
|
||||
|
||||
instancia:SetCombatAlpha (nil, nil, true)
|
||||
|
||||
if (instancia.auto_switch_to) then
|
||||
--salva o estado atual
|
||||
instancia.auto_switch_to_old = {instancia.modo, instancia.atributo, instancia.sub_atributo, instancia.segmento, instancia:GetRaidPluginName(), _detalhes.SoloTables.Mode}
|
||||
|
||||
--muda para um plugin de raid
|
||||
if (instancia.auto_switch_to [1] == "raid") then
|
||||
_detalhes.RaidTables:EnableRaidMode (instancia, instancia.auto_switch_to [2])
|
||||
else
|
||||
--muda para um atributo normal
|
||||
if (instancia.modo ~= _detalhes._detalhes_props["MODO_GROUP"]) then
|
||||
_detalhes:AlteraModo (instancia, _detalhes._detalhes_props["MODO_GROUP"])
|
||||
end
|
||||
_detalhes:TrocaTabela (instancia, nil, instancia.auto_switch_to [1], instancia.auto_switch_to [2])
|
||||
end
|
||||
end
|
||||
instancia:CheckSwitchOnCombatStart()
|
||||
end
|
||||
end
|
||||
|
||||
@@ -583,39 +567,16 @@
|
||||
instancia:SetCombatAlpha (nil, nil, true)
|
||||
|
||||
if (instancia.auto_switch_to_old) then
|
||||
instancia:SwitchBack()
|
||||
instancia:CheckSwitchOnCombatEnd()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
_table_wipe (_detalhes.encounter_table)
|
||||
|
||||
_detalhes:SendEvent ("COMBAT_PLAYER_LEAVE", nil, _detalhes.tabela_vigente)
|
||||
end
|
||||
|
||||
--backtable indexes: [1]: mode [2]: attribute [3]: sub attribute [4]: segment [5]: raidmode index [6]: solomode index
|
||||
|
||||
function _detalhes:SwitchBack()
|
||||
local backtable = self.auto_switch_to_old
|
||||
if (not backtable) then
|
||||
return
|
||||
end
|
||||
|
||||
if (self.modo ~= self.auto_switch_to_old [1]) then
|
||||
_detalhes:AlteraModo (self, self.auto_switch_to_old [1])
|
||||
end
|
||||
|
||||
if (self.modo == _detalhes._detalhes_props["MODO_RAID"]) then
|
||||
_detalhes.RaidTables:switch (nil, self.auto_switch_to_old [5], self)
|
||||
|
||||
elseif (self.modo == _detalhes._detalhes_props["MODO_ALONE"]) then
|
||||
_detalhes.SoloTables:switch (nil, self.auto_switch_to_old [6])
|
||||
|
||||
else
|
||||
_detalhes:TrocaTabela (self, self.auto_switch_to_old [4], self.auto_switch_to_old [2], self.auto_switch_to_old [3])
|
||||
end
|
||||
|
||||
self.auto_switch_to_old = nil
|
||||
end
|
||||
|
||||
function _detalhes:MakeEqualizeOnActor (player, realm, receivedActor)
|
||||
|
||||
local combat = _detalhes:GetCombat ("current")
|
||||
|
||||
+135
@@ -1,4 +1,8 @@
|
||||
local _detalhes = _G._detalhes
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
|
||||
|
||||
local GetNumGroupMembers = GetNumGroupMembers
|
||||
|
||||
function _detalhes:UpdateGears()
|
||||
|
||||
@@ -6,4 +10,135 @@ function _detalhes:UpdateGears()
|
||||
_detalhes:UpdateControl()
|
||||
_detalhes:UpdateCombat()
|
||||
|
||||
end
|
||||
|
||||
function _detalhes:SetWindowUpdateSpeed (interval, nosave)
|
||||
if (not interval) then
|
||||
interval = _detalhes.update_speed
|
||||
end
|
||||
|
||||
if (not nosave) then
|
||||
_detalhes.update_speed = interval
|
||||
end
|
||||
|
||||
_detalhes:CancelTimer (_detalhes.atualizador)
|
||||
_detalhes.atualizador = _detalhes:ScheduleRepeatingTimer ("AtualizaGumpPrincipal", interval, -1)
|
||||
end
|
||||
|
||||
function _detalhes:SetUseAnimations (enabled, nosave)
|
||||
if (enabled == nil) then
|
||||
enabled = _detalhes.use_row_animations
|
||||
end
|
||||
|
||||
if (not nosave) then
|
||||
_detalhes.use_row_animations = enabled
|
||||
end
|
||||
|
||||
_detalhes.is_using_row_animations = enabled
|
||||
end
|
||||
|
||||
function _detalhes:HavePerformanceProfileEnabled()
|
||||
return _detalhes.performance_profile_enabled
|
||||
end
|
||||
|
||||
_detalhes.PerformanceIcons = {
|
||||
["RaidFinder"] = {icon = [[Interface\PvPRankBadges\PvPRank15]], color = {1, 1, 1, 1}},
|
||||
["Raid15"] = {icon = [[Interface\PvPRankBadges\PvPRank15]], color = {1, .8, 0, 1}},
|
||||
["Raid30"] = {icon = [[Interface\PvPRankBadges\PvPRank15]], color = {1, .8, 0, 1}},
|
||||
["Mythic"] = {icon = [[Interface\PvPRankBadges\PvPRank15]], color = {1, .4, 0, 1}},
|
||||
["Battleground15"] = {icon = [[Interface\PvPRankBadges\PvPRank07]], color = {1, 1, 1, 1}},
|
||||
["Battleground40"] = {icon = [[Interface\PvPRankBadges\PvPRank07]], color = {1, 1, 1, 1}},
|
||||
["Arena"] = {icon = [[Interface\PvPRankBadges\PvPRank12]], color = {1, 1, 1, 1}},
|
||||
["Dungeon"] = {icon = [[Interface\PvPRankBadges\PvPRank01]], color = {1, 1, 1, 1}},
|
||||
}
|
||||
|
||||
function _detalhes:CheckForPerformanceProfile()
|
||||
|
||||
local type = _detalhes:GetPerformanceRaidType()
|
||||
|
||||
local profile = _detalhes.performance_profiles [type]
|
||||
|
||||
if (profile and profile.enabled) then
|
||||
_detalhes:SetWindowUpdateSpeed (profile.update_speed, true)
|
||||
_detalhes:SetUseAnimations (profile.use_row_animations, true)
|
||||
_detalhes:CaptureSet (profile.damage, "damage")
|
||||
_detalhes:CaptureSet (profile.heal, "heal")
|
||||
_detalhes:CaptureSet (profile.energy, "energy")
|
||||
_detalhes:CaptureSet (profile.miscdata, "miscdata")
|
||||
_detalhes:CaptureSet (profile.aura, "aura")
|
||||
|
||||
if (not _detalhes.performance_profile_lastenabled or _detalhes.performance_profile_lastenabled ~= type) then
|
||||
_detalhes:InstanceAlert (Loc ["STRING_OPTIONS_PERFORMANCE_PROFILE_LOAD"] .. type, {_detalhes.PerformanceIcons [type].icon, 14, 14, false, 0, 1, 0, 1, unpack (_detalhes.PerformanceIcons [type].color)} , 5, {_detalhes.empty_function})
|
||||
end
|
||||
|
||||
_detalhes.performance_profile_enabled = type
|
||||
_detalhes.performance_profile_lastenabled = type
|
||||
else
|
||||
_detalhes:SetWindowUpdateSpeed (_detalhes.update_speed)
|
||||
_detalhes:SetUseAnimations (_detalhes.use_row_animations)
|
||||
_detalhes:CaptureSet (_detalhes.capture_real ["damage"], "damage")
|
||||
_detalhes:CaptureSet (_detalhes.capture_real ["heal"], "heal")
|
||||
_detalhes:CaptureSet (_detalhes.capture_real ["energy"], "energy")
|
||||
_detalhes:CaptureSet (_detalhes.capture_real ["miscdata"], "miscdata")
|
||||
_detalhes:CaptureSet (_detalhes.capture_real ["aura"], "aura")
|
||||
_detalhes.performance_profile_enabled = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function _detalhes:GetPerformanceRaidType()
|
||||
|
||||
local name, type, difficulty, difficultyName, maxPlayers, playerDifficulty, isDynamicInstance, mapID, instanceGroupSize = GetInstanceInfo()
|
||||
|
||||
if (type == "none") then
|
||||
return nil
|
||||
end
|
||||
|
||||
if (type == "pvp") then
|
||||
if (maxPlayers == 40) then
|
||||
return "Battleground40"
|
||||
elseif (maxPlayers == 15) then
|
||||
return "Battleground15"
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
if (type == "arena") then
|
||||
return "Arena"
|
||||
end
|
||||
|
||||
if (type == "raid") then
|
||||
--mythic
|
||||
--if (difficulty == 15) then
|
||||
-- return "Mythic"
|
||||
--end
|
||||
|
||||
--raid finder
|
||||
if (difficulty == 7) then
|
||||
return "RaidFinder"
|
||||
end
|
||||
|
||||
--flex
|
||||
if (difficulty == 14) then
|
||||
if (GetNumGroupMembers > 15) then
|
||||
return "Raid30"
|
||||
else
|
||||
return "Raid15"
|
||||
end
|
||||
end
|
||||
|
||||
--normal heroic
|
||||
if (maxPlayers == 10) then
|
||||
return "Raid15"
|
||||
elseif (maxPlayers == 25) then
|
||||
return "Raid30"
|
||||
end
|
||||
end
|
||||
|
||||
if (type == "party") then
|
||||
return "Dungeon"
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
@@ -2457,6 +2457,7 @@
|
||||
end
|
||||
|
||||
_detalhes:SchedulePetUpdate (7)
|
||||
_detalhes:CheckForPerformanceProfile()
|
||||
end
|
||||
|
||||
function _detalhes.parser_functions:PLAYER_ENTERING_WORLD (...)
|
||||
@@ -2605,6 +2606,7 @@
|
||||
_detalhes:WipePets()
|
||||
_detalhes:SchedulePetUpdate (1)
|
||||
_detalhes:InstanceCall (_detalhes.SetCombatAlpha, nil, nil, true)
|
||||
_detalhes:CheckSwitchOnLogon()
|
||||
end
|
||||
else
|
||||
_detalhes.in_group = IsInGroup() or IsInRaid()
|
||||
@@ -2615,6 +2617,7 @@
|
||||
_detalhes:SchedulePetUpdate (1)
|
||||
_table_wipe (_detalhes.details_users)
|
||||
_detalhes:InstanceCall (_detalhes.SetCombatAlpha, nil, nil, true)
|
||||
_detalhes:CheckSwitchOnLogon()
|
||||
else
|
||||
_detalhes:SchedulePetUpdate (2)
|
||||
_detalhes:CheckDetailsUsers()
|
||||
@@ -2640,6 +2643,8 @@
|
||||
_detalhes.can_panic_mode = true
|
||||
end
|
||||
|
||||
_detalhes:CheckSwitchOnLogon() --eh logon mesmo
|
||||
|
||||
if (_detalhes.wipe_full_config) then
|
||||
_detalhes_global = nil
|
||||
_detalhes_database = nil
|
||||
@@ -2766,6 +2771,13 @@
|
||||
print ("group damage", #_detalhes.cache_healing_group)
|
||||
end
|
||||
|
||||
function _detalhes:GetActorsOnDamageCache()
|
||||
return _detalhes.cache_damage_group
|
||||
end
|
||||
function _detalhes:GetActorsOnHealingCache()
|
||||
return _detalhes.cache_damage_group
|
||||
end
|
||||
|
||||
function _detalhes:ClearParserCache()
|
||||
|
||||
--> clear cache | not sure if replacing the old table is the best approach
|
||||
|
||||
Reference in New Issue
Block a user