- bug fixes.

This commit is contained in:
Tercio
2018-08-16 22:05:10 -03:00
parent 00d306a7b3
commit e3e63dcd67
7 changed files with 93 additions and 37 deletions
+15 -8
View File
@@ -2009,25 +2009,32 @@ end
function DF:ShowPromptPanel (message, func_true, func_false)
if (not DF.prompt_panel) then
local f = CreateFrame ("frame", "DetailsFrameworkPrompt", UIParent)
f:SetSize (400, 65)
local f = CreateFrame ("frame", "DetailsFrameworkPromptSimple", UIParent)
f:SetSize (400, 80)
f:SetFrameStrata ("DIALOG")
f:SetPoint ("center", UIParent, "center", 0, 300)
f:SetBackdrop ({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
f:SetBackdropColor (0, 0, 0, 0.8)
f:SetBackdropBorderColor (0, 0, 0, 1)
tinsert (UISpecialFrames, "DetailsFrameworkPromptSimple")
DF:CreateTitleBar (f, "Prompt!")
DF:ApplyStandardBackdrop (f)
local prompt = f:CreateFontString (nil, "overlay", "GameFontNormal")
prompt:SetPoint ("top", f, "top", 0, -15)
prompt:SetPoint ("top", f, "top", 0, -28)
prompt:SetJustifyH ("center")
f.prompt = prompt
local button_true = DF:CreateButton (f, nil, 60, 20, "Yes")
button_true:SetPoint ("bottomleft", f, "bottomleft", 5, 5)
local button_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")
local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
local button_true = DF:CreateButton (f, nil, 60, 20, "Yes", nil, nil, nil, nil, nil, nil, options_dropdown_template)
button_true:SetPoint ("bottomright", f, "bottomright", -5, 5)
f.button_true = button_true
local button_false = DF:CreateButton (f, nil, 60, 20, "No")
button_false:SetPoint ("bottomright", f, "bottomright", -5, 5)
local button_false = DF:CreateButton (f, nil, 60, 20, "No", nil, nil, nil, nil, nil, nil, options_dropdown_template)
button_false:SetPoint ("bottomleft", f, "bottomleft", 5, 5)
f.button_false = button_false
button_true:SetClickFunction (function()
+5 -2
View File
@@ -3,9 +3,9 @@
_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")
_detalhes.build_counter = 6177
_detalhes.build_counter = 6189
_detalhes.userversion = "v8.0.1." .. _detalhes.build_counter
_detalhes.realversion = 132 --core version
_detalhes.realversion = 133 --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")"
_detalhes.BFACORE = 131
Details = _detalhes
@@ -116,6 +116,9 @@ do
_detalhes.encounter_table = {}
_detalhes.encounter_counter = {}
_detalhes.encounter_dungeons = {}
--> reliable char data sources
--> actors that are using details! and sent character data, we don't need query inspect on these actors
_detalhes.trusted_characters = {}
--> informaes sobre a arena atual
_detalhes.arena_table = {}
_detalhes.arena_info = {
+14 -5
View File
@@ -443,6 +443,19 @@
end
end
function _detalhes:ScheduleSyncPlayerActorData()
if ((IsInGroup() or IsInRaid()) and (_detalhes.zone_type == "party" or _detalhes.zone_type == "raid")) then
--> do not sync if in battleground or arena
_detalhes:SendCharacterData()
end
end
function _detalhes:EndCombat()
if (_detalhes.in_combat) then
_detalhes:SairDoCombate()
end
end
-- ~end ~leave
function _detalhes:SairDoCombate (bossKilled, from_encounter_end)
@@ -573,11 +586,7 @@
end
--> send item level after a combat if is in raid or party group
if (IsInGroup() or IsInRaid()) then
C_Timer.After (1, function()
_detalhes:SentMyItemLevel()
end)
end
C_Timer.After (1, _detalhes.ScheduleSyncPlayerActorData)
if (not _detalhes.tabela_vigente.is_boss) then
+6 -2
View File
@@ -1726,6 +1726,9 @@ function _detalhes:IlvlFromNetwork (player, realm, core, serialNumber, itemLevel
return
end
--> won't inspect this actor
_detalhes.trusted_characters [serialNumber] = true
if (type (serialNumber) ~= "string") then
return
end
@@ -2063,7 +2066,8 @@ function ilvl_core:Loop()
return
end
if (inspecting [guid]) then
--> if already inspecting or the actor is in the list of trusted actors
if (inspecting [guid] or _detalhes.trusted_characters [guid]) then
return
end
@@ -2107,7 +2111,7 @@ end
function ilvl_core:OnEnter()
if (IsInRaid()) then
_detalhes:SentMyItemLevel()
_detalhes:SendCharacterData()
end
if (can_start_loop()) then
+34 -4
View File
@@ -76,7 +76,7 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> item level
function _detalhes:SentMyItemLevel()
function _detalhes:SendCharacterData()
--> only send if in group
if (not IsInGroup() and not IsInRaid()) then
return
@@ -124,7 +124,18 @@
--> get the character serial number
local serial = UnitGUID ("player")
_detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, serial, equipped, talents, currentSpec)
if (IsInRaid()) then
_detalhes:SendRaidData (CONST_ITEMLEVEL_DATA, serial, equipped, talents, currentSpec)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent ilevel data to Raid")
end
elseif (IsInGroup()) then
_detalhes:SendPartyData (CONST_ITEMLEVEL_DATA, serial, equipped, talents, currentSpec)
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent ilevel data to Party")
end
end
_detalhes.LastPlayerInfoSync = GetTime()
end
@@ -624,19 +635,38 @@
end
function _detalhes:SendRaidData (type, ...)
if (IsInRaid (LE_PARTY_CATEGORY_INSTANCE) and IsInInstance()) then
local isInInstanceGroup = IsInRaid (LE_PARTY_CATEGORY_INSTANCE)
if (isInInstanceGroup) then
_detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "INSTANCE_CHAT")
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent comm to INSTANCE raid group")
end
else
_detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "RAID")
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent comm to LOCAL raid group")
end
end
end
function _detalhes:SendPartyData (type, ...)
if (IsInGroup (LE_PARTY_CATEGORY_INSTANCE) and IsInInstance()) then
local isInInstanceGroup = IsInGroup (LE_PARTY_CATEGORY_INSTANCE)
if (isInInstanceGroup) then
_detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "INSTANCE_CHAT")
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent comm to INSTANCE party group")
end
else
_detalhes:SendCommMessage (CONST_DETAILS_PREFIX, _detalhes:Serialize (type, _UnitName ("player"), _GetRealmName(), _detalhes.realversion, ...), "PARTY")
if (_detalhes.debug) then
_detalhes:Msg ("(debug) sent comm to LOCAL party group")
end
end
end
function _detalhes:SendRaidOrPartyData (type, ...)
+18 -15
View File
@@ -4051,19 +4051,6 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
return _detalhes.parser_functions:ZONE_CHANGED_NEW_AREA (...)
end
function _detalhes.parser_functions:PLAYER_SPECIALIZATION_CHANGED()
local specIndex = GetSpecialization()
if (specIndex) then
local specID = GetSpecializationInfo (specIndex)
if (specID and specID ~= 0) then
local guid = UnitGUID ("player")
if (guid) then
_detalhes.cached_specs [guid] = specID
end
end
end
end
-- ~encounter
function _detalhes.parser_functions:ENCOUNTER_START (...)
if (_detalhes.debug) then
@@ -4361,18 +4348,29 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes.SendTalentTimer:Cancel()
end
_detalhes.SendTalentTimer = C_Timer.NewTimer (11, function()
_detalhes:SentMyItemLevel()
_detalhes:SendCharacterData()
end)
end
end
function _detalhes.parser_functions:PLAYER_SPECIALIZATION_CHANGED()
local specIndex = GetSpecialization()
if (specIndex) then
local specID = GetSpecializationInfo (specIndex)
if (specID and specID ~= 0) then
local guid = UnitGUID ("player")
if (guid) then
_detalhes.cached_specs [guid] = specID
end
end
end
if (IsInGroup() or IsInRaid()) then
if (_detalhes.SendTalentTimer and not _detalhes.SendTalentTimer._cancelled) then
_detalhes.SendTalentTimer:Cancel()
end
_detalhes.SendTalentTimer = C_Timer.NewTimer (11, function()
_detalhes:SentMyItemLevel()
_detalhes:SendCharacterData()
end)
end
end
@@ -4459,6 +4457,9 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:SendEvent ("GROUP_ONENTER")
_detalhes:DispatchAutoRunCode ("on_groupchange")
wipe (_detalhes.trusted_characters)
C_Timer.After (5, _detalhes.ScheduleSyncPlayerActorData)
end
else
_detalhes.in_group = IsInGroup() or IsInRaid()
@@ -4473,6 +4474,8 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:SendEvent ("GROUP_ONLEAVE")
_detalhes:DispatchAutoRunCode ("on_groupchange")
wipe (_detalhes.trusted_characters)
else
_detalhes:SchedulePetUpdate (2)
end
+1 -1
View File
@@ -1440,7 +1440,7 @@ Damage Update Status: @INSTANCEDAMAGESTATUS
elseif (msg == "senditemlevel") then
_detalhes:SentMyItemLevel()
_detalhes:SendCharacterData()
print ("Item level dispatched.")
elseif (msg == "talents") then