Skip to content

Commit

Permalink
small fixes for the npc ids update
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Feb 8, 2022
1 parent 989b62c commit 1dc2902
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 83 deletions.
13 changes: 8 additions & 5 deletions boot.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> global name declaration

_ = nil
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0")

local version, build, date, tocversion = GetBuildInfo()

_detalhes.build_counter = 9213
Expand All @@ -15,12 +15,12 @@
_detalhes.realversion = 145 --core version, this is used to check API version for scripts and plugins (see alias below)
_detalhes.APIVersion = _detalhes.realversion --core version
_detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" --simple stirng to show to players

_detalhes.BFACORE = 131 --core version on BFA launch
_detalhes.SHADOWLANDSCORE = 143 --core version on Shadowlands launch

Details = _detalhes

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> initialization stuff
local _
Expand All @@ -36,19 +36,22 @@ do

--[=[
Added an option to change your own bar color.
Added 'Ignore this Npc' into the Npc list under the spell list section.
Bookmark window now uses the same scale than the options panel.
Class Color window now uses the same scale than the options panel.
If not casted on the player itself Power Infusion now shows in the buff list of the target.
Allowed nicknames on custom displays (by Flamanis).
Aligned Text Columns enabled is now default for new installs.
Fodder to the flames DH ability won't count damage done by the player on the add summoned.
Fixed the load time for the Npc Ids panel on the spell list section.
Fixed all issues with the options panel scale.
Fixed tooltips overlap when the window is positioned at the top of the screen (fix by Flamanis).
Fixed auto hide windows which wasn't saving its group when unhiding (fix by Flamanis).
Fixed some XML Headers which was giving errors on loading (fix by github user h0tw1r3).
Fixed '/details me' on TBC, which wasn't working correctly (fix by github user Baugstein).
Fixed a typo on Vanguard plugin (fix by github user cruzerthebruzer).
Fixed font 'NuevaStd' where something the font didn't work at all.
Fixed an issue where for some characters the options panel won't open showing an error in the chat instead.
New API: combat:GetPlayerDeaths(deadPlayerName).
New API: Details:ShowDeathTooltip(combatObject, deathTable) for Cooltip tooltips.
]=]
Expand Down
16 changes: 13 additions & 3 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
_detalhes.OverridedSpellIds = override_spellId

--> list of ignored npcs by the user
local ignored_npcids = {
_detalhes.default_ignored_npcs = {
--necrotic wake --remove on 10.0
[163126] = true, --brittlebone mage
[163122] = true, --brittlebone warrior
Expand Down Expand Up @@ -292,6 +292,8 @@
[169430] = true,
}

local ignored_npcids = {}

--> ignore soul link (damage from the warlock on his pet - current to demonology only)
local SPELLID_WARLOCK_SOULLINK = 108446
--> when checking if can start a new combat, ignore the damage from warlock's burning rush
Expand Down Expand Up @@ -5987,8 +5989,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_recording_ability_with_buffs = _detalhes.RecordPlayerAbilityWithBuffs
_in_combat = _detalhes.in_combat

--> fill the ignored npcid directly from the user profile
--ignored_npcids = _detalhes.npcid_ignored
_table_wipe(ignored_npcids)
--fill it with the default npcs ignored
for npcId in pairs(_detalhes.default_ignored_npcs) do
ignored_npcids[npcId] = true
end
--fill it with the npcs the user ignored
for npcId in pairs(_detalhes.npcid_ignored) do
ignored_npcids[npcId] = true
end
Expand Down Expand Up @@ -6032,6 +6038,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1

return _detalhes:ClearParserCache()
end

function _detalhes.DumpIgnoredNpcs()
return ignored_npcids
end



Expand Down
155 changes: 82 additions & 73 deletions frames/window_forge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -656,15 +656,15 @@ function Details:OpenForge()
end
events = events:sub (1, #events - 3)
end
local spellName, _, spellIcon = GetSpellInfo (data[1])

local spellName, _, spellIcon = GetSpellInfo(data[1])

return {
index,
spellIcon,
{texture = spellIcon, texcoord = {.1, .9, .1, .9}},
{text = spellName or "", id = data[1] or 1},
data[1] or "",
Details:GetSpellSchoolFormatedName (Details.spell_school_cache [spellName]) or "",
Details:GetSpellSchoolFormatedName(Details.spell_school_cache [spellName]) or "",
data[3] .. "|r",
events,
data[4],
Expand All @@ -674,90 +674,98 @@ function Details:OpenForge()
end
end,
fill_name = "DetailsForgeEncounterBossSpellsFillPanel",
}


}

-----------------------------------------------

local npc_ids_module = {
name = "Npc IDs",
desc = "Show a list of known npc IDs",
--Npc Ids

local ignoreNpcFunc = function(row)
local data = all_modules[3].data[row]
local npcId = data[1]

if (not Details.npcid_ignored[npcId]) then
Details.npcid_ignored[npcId] = true
else
Details.npcid_ignored[npcId] = nil
end

Details:UpdateParserGears()
end

local allNpcsModule = {
name = "Npc List", --localize-me
desc = "Show a list of known npcs", --localize-me

filters_widgets = function()
if (not DetailsForgeEncounterNpcIDsFilterPanel) then

local w = CreateFrame ("frame", "DetailsForgeEncounterNpcIDsFilterPanel", f, "BackdropTemplate")
w:SetSize (600, 20)
w:SetPoint ("topleft", f, "topleft", 164, -40)
--npc name filter
local label = w:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
label:SetText ("Npc Name" .. ": ")
label:SetPoint ("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeEncounterNpcIDsFilter")
entry:SetHook ("OnTextChanged", function() f:refresh() end)
entry:SetPoint ("left", label, "right", 2, 0)
entry:SetTemplate (Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))
--
local npcIdFrame = CreateFrame ("frame", "DetailsForgeEncounterNpcIDsFilterPanel", f, "BackdropTemplate")
npcIdFrame:SetSize (600, 20)
npcIdFrame:SetPoint ("topleft", f, "topleft", 164, -40)

local filterSpellNameLabel = npcIdFrame:CreateFontString (nil, "overlay", "GameFontHighlightSmall")
filterSpellNameLabel:SetText (L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ")
filterSpellNameLabel:SetPoint ("left", npcIdFrame, "left", 5, 0)

local searchEntry = fw:CreateTextEntry(npcIdFrame, nil, 120, 20, "entry", "DetailsForgeEncounterNpcIDsFilter")
searchEntry:SetHook("OnTextChanged", function() f:refresh() end)
searchEntry:SetPoint("left", filterSpellNameLabel, "right", 2, 0)
searchEntry:SetTemplate(Details.gump:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))

end
return DetailsForgeEncounterNpcIDsFilterPanel
end,

search = function()
local t = {}

local filter_name = DetailsForgeEncounterNpcIDsFilter:GetText()
local lower_FilterNpcName = lower (filter_name)

local searchText = DetailsForgeEncounterNpcIDsFilter:GetText()
searchText = lower(searchText)

local npcPool = Details.npcid_pool
for npcID, npcName in pairs (npcPool) do
local can_add = true

if (lower_FilterNpcName ~= "") then
if (not lower (npcName):find (lower_FilterNpcName)) then
can_add = false
for npcId, npcName in pairs(npcPool) do
local canAdd = true
if (searchText ~= "") then
if (not npcName:lower():find(searchText)) then
canAdd = false
end
end

if (can_add) then
tinsert (t, {npcID, npcName})
if (canAdd) then
tinsert(t, {npcId, npcName})
end

table.sort (t, DetailsFramework.SortOrder2R)
end


table.sort(t, DetailsFramework.SortOrder2R)
return t
end,

header = {
{name = L["STRING_FORGE_HEADER_INDEX"], width = 40, type = "text", func = no_func},
{name = "NpcID", width = 100, type = "entry", func = no_func},
{name = "Npc Name", width = 400, type = "entry", func = no_func},
{name = L["STRING_FORGE_HEADER_NAME"], width = 200, type = "entry", func = no_func},
{name = "NpcId", width = 60, type = "entry", func = no_func},
{name = "Ignore", width = 50, type = "checkbox", func = ignoreNpcFunc, icon = [[Interface\Glues\LOGIN\Glues-CheckBox-Check]], notext = true, iconalign = "center"},
},

fill_panel = false,
fill_gettotal = function (self) return #self.module.data end,
fill_fillrows = function (index, self)
local data = self.module.data [index]
fill_fillrows = function (index, self)
local data = self.module.data[index]
if (data) then
local events = ""
if (EncounterSpellEvents and EncounterSpellEvents [data[1]]) then
for token, _ in pairs (EncounterSpellEvents [data[1]].token) do
token = token:gsub ("SPELL_", "")
events = events .. token .. ", "
end
events = events:sub (1, #events - 3)
end
local npcId = data[1]
local npcName = data[2]
local isIgnored = Details.npcid_ignored[npcId]

return {
index,
data[1],
data[2]
{text = npcName, id = npcName},
{text = npcId, id = npcId},
isIgnored
}
else
return nothing_to_show
end
end,
fill_name = "DetailsForgeNpcIDsFillPanel",
}
}

-----------------------------------------------

local dbm_open_aura_creator = function (row)
Expand All @@ -779,7 +787,7 @@ function Details:OpenForge()

Details:OpenAuraPanel (data[2], spellname, spellicon, data.id, DETAILS_WA_TRIGGER_DBM_TIMER, DETAILS_WA_AURATYPE_TEXT, {dbm_timer_id = data[2], spellid = data[7], text = "Next " .. spellname .. " In", text_size = 72, icon = spellicon})
end

local dbm_timers_module = {
name = L["STRING_FORGE_BUTTON_DBMTIMERS"],
desc = L["STRING_FORGE_BUTTON_DBMTIMERS_DESC"],
Expand Down Expand Up @@ -1080,20 +1088,21 @@ function Details:OpenForge()
f.SelectModule = select_module
f.AllModules = all_modules

f:InstallModule (all_spells_module)
f:InstallModule (encounter_spells_module)
f:InstallModule (npc_ids_module)
f:InstallModule (dbm_timers_module)
f:InstallModule (bigwigs_timers_module)
f:InstallModule (all_players_module)
f:InstallModule (all_enemies_module)
f:InstallModule (all_pets_module)
f:InstallModule(all_spells_module)
f:InstallModule(encounter_spells_module)

f:InstallModule(allNpcsModule)

f:InstallModule(dbm_timers_module)
f:InstallModule(bigwigs_timers_module)

f:InstallModule(all_players_module)
f:InstallModule(all_enemies_module)
f:InstallModule(all_pets_module)

local brackets = {
[4] = true,
[3] = true,
[4] = true,
[6] = true
}
local lastButton
Expand All @@ -1108,7 +1117,7 @@ function Details:OpenForge()
b:SetWidth (140)

if (lastButton) then
if (brackets [i]) then
if (brackets[i]) then
b:SetPoint ("topleft", lastButton, "bottomleft", 0, -23)
else
b:SetPoint ("topleft", lastButton, "bottomleft", 0, -8)
Expand Down
7 changes: 5 additions & 2 deletions frames/window_statistics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,6 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
local player2_string = DF:CreateLabel (f, Loc ["STRING_GUILDDAMAGERANK_PLAYERBASE_PLAYER"] .. ":", _, _, "GameFontNormal", "select_player2_label")
player2_dropdown:SetTemplate (DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))


function f:UpdateDropdowns(DoNotSelectRaid)

local currentGuild = guild_dropdown.value
Expand Down Expand Up @@ -985,8 +984,12 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
end
end

if (not statsWindow.UpdateDropdowns) then
Details:Msg("Failled to load statistics, Details! Storage is disabled?")
return
end

statsWindow:UpdateDropdowns()
--statsWindow:UpdateDropdowns()
statsWindow:Refresh()
statsWindow:Show()

Expand Down

0 comments on commit 1dc2902

Please sign in to comment.