A round of general bug fixes
This commit is contained in:
+5
-2
@@ -437,9 +437,11 @@
|
||||
end
|
||||
|
||||
function Details:ScheduleSyncPlayerActorData()
|
||||
if ((IsInGroup() or IsInRaid()) and (Details.zone_type == "party" or Details.zone_type == "raid")) then
|
||||
--do not sync if in battleground or arena
|
||||
Details:SendCharacterData()
|
||||
if ((IsInGroup() or IsInRaid()) and (Details.zone_type == "party" or Details.zone_type == "raid")) then
|
||||
--do a random delay
|
||||
local delay = RandomFloatInRange(1, 4)
|
||||
C_Timer.After(delay, Details.SendCharacterData)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1354,6 +1356,7 @@
|
||||
GameCooltip:SetOption("TextColor", Details.tooltip.fontcolor)
|
||||
GameCooltip:SetOption("TextColorRight", Details.tooltip.fontcolor_right)
|
||||
GameCooltip:SetOption("TextShadow", Details.tooltip.fontshadow and "OUTLINE")
|
||||
GameCooltip:SetOption("TextContour", Details.tooltip.fontcontour)
|
||||
|
||||
GameCooltip:SetOption("LeftBorderSize", -0) --offset between the left border and the left icon, default: 10 + offset
|
||||
GameCooltip:SetOption("RightBorderSize", 0) --offset between the right border and the right icon, default: -10 + offset
|
||||
|
||||
+20
-12
@@ -837,6 +837,16 @@ Details222.Parser.EventFrame:SetScript("OnEvent", function(self, event, ...)
|
||||
end
|
||||
end)
|
||||
|
||||
--create a details listener which registers the combat enter event, create the function to receive the registerted event ad call the Details222.Parser.EventFrame:OnEvent with player_regen_disable
|
||||
local detailsEnterInCombatListener = Details:CreateEventListener()
|
||||
detailsEnterInCombatListener:RegisterEvent("COMBAT_PLAYER_ENTER") --COMBAT_PLAYER_ENTER from events.lua, this event is triggered when Details! enter in combat
|
||||
function detailsEnterInCombatListener:OnEvent()
|
||||
if (Details222.Parser.GetState() == "STATE_RESTRICTED") then
|
||||
Details222.Parser.EventFrame:GetScript("OnEvent")(Details222.Parser.EventFrame, "PLAYER_REGEN_DISABLED")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function Details222.Parser.GetState()
|
||||
local parserEngine = Details222.parser_frame:GetScript("OnEvent")
|
||||
if (parserEngine == Details222.Parser.OnParserEvent) then
|
||||
@@ -2195,7 +2205,7 @@ local MAX_INSPECT_AMOUNT = 1
|
||||
local MIN_ILEVEL_TO_STORE = 1
|
||||
local LOOP_TIME = 7
|
||||
|
||||
function Details:IlvlFromNetwork(player, realm, core, serialNumber, itemLevel, talentsSelected, currentSpec)
|
||||
function Details:IlvlFromNetwork(unitName, realmName, coreVersion, unitGUID, itemLevel, talentsSelected, currentSpec)
|
||||
if (Details.debug and false) then
|
||||
local talents = "Invalid Talents"
|
||||
if (type(talentsSelected) == "table") then
|
||||
@@ -2204,44 +2214,44 @@ function Details:IlvlFromNetwork(player, realm, core, serialNumber, itemLevel, t
|
||||
talents = talents .. talentsSelected [i] .. ","
|
||||
end
|
||||
end
|
||||
Details222.DebugMsg("Received PlayerInfo Data: " ..(player or "Invalid Player Name") .. " | " ..(itemLevel or "Invalid Item Level") .. " | " ..(currentSpec or "Invalid Spec") .. " | " .. talents .. " | " ..(serialNumber or "Invalid Serial"))
|
||||
Details222.DebugMsg("Received PlayerInfo Data: " ..(unitName or "Invalid Player Name") .. " | " ..(itemLevel or "Invalid Item Level") .. " | " ..(currentSpec or "Invalid Spec") .. " | " .. talents .. " | " ..(unitGUID or "Invalid Serial"))
|
||||
end
|
||||
|
||||
if (not player) then
|
||||
if (not unitName) then
|
||||
return
|
||||
end
|
||||
|
||||
--older versions of details wont send serial nor talents nor spec
|
||||
if (not serialNumber or not itemLevel or not talentsSelected or not currentSpec) then
|
||||
if (not unitGUID or not itemLevel or not talentsSelected or not currentSpec) then
|
||||
--if any data is invalid, abort
|
||||
return
|
||||
end
|
||||
|
||||
--won't inspect this actor
|
||||
Details.trusted_characters[serialNumber] = true
|
||||
Details.trusted_characters[unitGUID] = true
|
||||
|
||||
if (type(serialNumber) ~= "string") then
|
||||
if (type(unitGUID) ~= "string") then
|
||||
return
|
||||
end
|
||||
|
||||
--store the item level
|
||||
if (type(itemLevel) == "number") then
|
||||
Details.item_level_pool[serialNumber] = {name = player, ilvl = itemLevel, time = time()}
|
||||
Details.item_level_pool[unitGUID] = {name = unitName, ilvl = itemLevel, time = time()}
|
||||
end
|
||||
|
||||
--store talents
|
||||
if (type(talentsSelected) == "table") then
|
||||
if (talentsSelected[1]) then
|
||||
Details.cached_talents[serialNumber] = talentsSelected
|
||||
Details.cached_talents[unitGUID] = talentsSelected
|
||||
end
|
||||
|
||||
elseif (type(talentsSelected) == "string" and talentsSelected ~= "") then
|
||||
Details.cached_talents[serialNumber] = talentsSelected
|
||||
Details.cached_talents[unitGUID] = talentsSelected
|
||||
end
|
||||
|
||||
--store the spec the player is playing
|
||||
if (type(currentSpec) == "number") then
|
||||
Details.cached_specs[serialNumber] = currentSpec
|
||||
Details.cached_specs[unitGUID] = currentSpec
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2529,9 +2539,7 @@ function ilvl_core:ZoneChanged(zone_type)
|
||||
end
|
||||
|
||||
function ilvl_core:OnEnter()
|
||||
if (IsInRaid()) then
|
||||
Details:SendCharacterData()
|
||||
end
|
||||
|
||||
if (can_start_loop()) then
|
||||
ilvl_core:Reset()
|
||||
|
||||
+17
-11
@@ -631,8 +631,7 @@
|
||||
Details:Msg(Details.WhoAggroTimer.HitBy)
|
||||
end
|
||||
|
||||
--local spellInfo = C_Spell.GetSpellInfo(spellId)
|
||||
--print("1 spell:", spellId, spellInfo.name)
|
||||
local spellInfo = C_Spell.GetSpellInfo(spellId)
|
||||
Details222.StartCombat(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags)
|
||||
else
|
||||
--entrar em combate se for dot e for do jogador e o ultimo combate ter sido a mais de 10 segundos atr�s
|
||||
@@ -643,7 +642,6 @@
|
||||
|
||||
--can't start a combat with a dot with the latest combat finished less than 10 seconds ago
|
||||
if (Details.last_combat_time + 10 < _tempo) then
|
||||
--print("2 spell:", spellId)
|
||||
Details222.StartCombat(sourceSerial, sourceName, sourceFlags, targetSerial, targetName, targetFlags)
|
||||
end
|
||||
end
|
||||
@@ -865,22 +863,25 @@
|
||||
thisEvent[3] = amount --amount of damage or healing
|
||||
thisEvent[4] = time --parser time
|
||||
|
||||
--current unit heal
|
||||
--current unit healh
|
||||
if (targetActor.arena_enemy) then
|
||||
--this is an arena enemy, get the heal with the unit Id
|
||||
local unitId = Details.arena_enemies[targetName]
|
||||
if (not unitId) then
|
||||
unitId = Details:GuessArenaEnemyUnitId(targetName)
|
||||
end
|
||||
|
||||
if (unitId) then
|
||||
thisEvent[5] = UnitHealth(unitId) / UnitHealthMax(unitId)
|
||||
local health = UnitHealth(unitId)
|
||||
local maxHealth = max(UnitHealthMax(unitId), SMALL_FLOAT)
|
||||
thisEvent[5] = health / maxHealth
|
||||
else
|
||||
thisEvent[5] = cacheAnything.arenaHealth[targetName] or 100000
|
||||
end
|
||||
|
||||
cacheAnything.arenaHealth[targetName] = thisEvent[5]
|
||||
else
|
||||
thisEvent[5] = UnitHealth(targetName) / UnitHealthMax(targetName)
|
||||
thisEvent[5] = UnitHealth(targetName) / max(UnitHealthMax(targetName), SMALL_FLOAT)
|
||||
end
|
||||
|
||||
thisEvent[6] = sourceName --source name
|
||||
@@ -981,7 +982,7 @@
|
||||
thisEvent[2] = spellId --spellid || false if this is a battle ress line
|
||||
thisEvent[3] = amount --amount of damage or healing
|
||||
thisEvent[4] = time --parser time
|
||||
thisEvent[5] = UnitHealth(targetName) / UnitHealthMax(targetName) --current unit heal
|
||||
thisEvent[5] = UnitHealth(targetName) / max(UnitHealthMax(targetName), SMALL_FLOAT) --current unit heal
|
||||
thisEvent[6] = sourceName --source name
|
||||
thisEvent[7] = absorbed
|
||||
thisEvent[8] = spellType or school
|
||||
@@ -2162,12 +2163,12 @@
|
||||
unitId = Details:GuessArenaEnemyUnitId(targetName)
|
||||
end
|
||||
if (unitId) then
|
||||
thisEvent[5] = UnitHealth(unitId) / UnitHealthMax(unitId)
|
||||
thisEvent[5] = UnitHealth(unitId) / max(UnitHealthMax(unitId), SMALL_FLOAT)
|
||||
else
|
||||
thisEvent[5] = 0
|
||||
end
|
||||
else
|
||||
thisEvent[5] = UnitHealth(targetName) / UnitHealthMax(targetName)
|
||||
thisEvent[5] = UnitHealth(targetName) / max(UnitHealthMax(targetName), SMALL_FLOAT)
|
||||
end
|
||||
|
||||
thisEvent[6] = sourceName
|
||||
@@ -5975,7 +5976,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
local eraNamedSpellsToID = {}
|
||||
|
||||
-- ~parserstart ~startparser ~cleu ~parser
|
||||
Details.UnitNameCache = {}
|
||||
|
||||
function Details222.Parser.OnParserEvent(self, event, ...)
|
||||
local time, token, hidding, who_serial, who_name, who_flags, who_flags2, target_serial, target_name, target_flags, target_flags2, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12 = CombatLogGetCurrentEventInfo(...)
|
||||
@@ -5987,12 +5987,18 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
|
||||
end
|
||||
|
||||
--open world out of combat spell damage
|
||||
local outofcombat_spell_damage = function(unused, token, time, whoGUID, whoName, whoFlags, targetGUID, targetName, targetFlags)
|
||||
local outofcombat_spell_damage = function(unused, token, time, whoGUID, whoName, whoFlags, targetGUID, targetName, targetFlags, targetFlags2, ...)
|
||||
--identify if the attacker is a group member
|
||||
local IS_GROUP_OBJECT = 0x00000007
|
||||
local bIsValidGroupMember = bitBand(whoFlags, IS_GROUP_OBJECT) ~= 0
|
||||
if (bIsValidGroupMember) then
|
||||
token_list[token](nil, token, time, whoGUID, whoName, whoFlags, targetGUID, targetName, targetFlags, targetFlags2, ...)
|
||||
end
|
||||
end
|
||||
|
||||
local out_of_combat_interresting_events = {
|
||||
["SPELL_SUMMON"] = parser.summon,
|
||||
["SWING_DAMAGE"] = outofcombat_spell_damage,
|
||||
["SPELL_DAMAGE"] = outofcombat_spell_damage,
|
||||
}
|
||||
|
||||
|
||||
@@ -3733,7 +3733,7 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
if (pluginObject.OpenOptionsPanel) then
|
||||
if (rawget(pluginObject, "OpenOptionsPanel")) then
|
||||
DF:NewButton(bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
|
||||
bframe ["OptionsButton"..i]:SetPoint("topleft", anchorFrame, "topleft", 510, y-0)
|
||||
bframe ["OptionsButton"..i]:SetTextColor(button_color_rgb)
|
||||
@@ -4314,10 +4314,29 @@ do
|
||||
Details.tooltip.fontshadow = value
|
||||
afterUpdate()
|
||||
end,
|
||||
name = Loc ["STRING_OPTIONS_TEXT_LOUTILINE"],
|
||||
name = Loc ["STRING_OPTIONS_TEXT_OUTLINE"],
|
||||
desc = Loc ["STRING_OPTIONS_TOOLTIPS_FONTSHADOW_DESC"],
|
||||
},
|
||||
|
||||
{--shadow color
|
||||
type = "color",
|
||||
get = function()
|
||||
local r, g, b, a = unpack(Details.tooltip.fontcontour)
|
||||
return {r, g, b, a}
|
||||
end,
|
||||
set = function(self, r, g, b, a)
|
||||
local color = Details.tooltip.fontcontour
|
||||
color[1] = r
|
||||
color[2] = g
|
||||
color[3] = b
|
||||
color[4] = a
|
||||
afterUpdate()
|
||||
end,
|
||||
name = "Shadow Color",
|
||||
desc = "Color of the text shadow",
|
||||
hidden = true,
|
||||
},
|
||||
|
||||
{--text size
|
||||
type = "range",
|
||||
get = function() return Details.tooltip.fontsize end,
|
||||
|
||||
Reference in New Issue
Block a user