From bdf5344f5ee4016200bd617fe7d5266e4cc8a79e Mon Sep 17 00:00:00 2001 From: Tercio Date: Mon, 20 Aug 2018 21:29:47 -0300 Subject: [PATCH] - Fixed the latest raid check update. - Added NpcID storage. --- Libs/DF/fw.lua | 2 +- boot.lua | 4 +- classes/container_combatentes.lua | 26 +++++- functions/link.lua | 90 ++++++++++++++++++- functions/profiles.lua | 1 + functions/skins.lua | 34 +++---- .../Details_RaidCheck/Details_RaidCheck.lua | 4 +- startup.lua | 17 +++- 8 files changed, 146 insertions(+), 32 deletions(-) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index 98cabb14..775d5bb3 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,5 +1,5 @@ -local dversion = 98 +local dversion = 99 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) diff --git a/boot.lua b/boot.lua index b361dcbc..565f30c3 100644 --- a/boot.lua +++ b/boot.lua @@ -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 = 6221 + _detalhes.build_counter = 6231 _detalhes.userversion = "v8.0.1." .. _detalhes.build_counter - _detalhes.realversion = 133 --core version + _detalhes.realversion = 134 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" _detalhes.BFACORE = 131 Details = _detalhes diff --git a/classes/container_combatentes.lua b/classes/container_combatentes.lua index a335b0eb..7c615fea 100644 --- a/classes/container_combatentes.lua +++ b/classes/container_combatentes.lua @@ -204,7 +204,7 @@ local read_actor_flag = function (novo_objeto, dono_do_pet, serial, flag, nome, container_type) if (flag) then - + --> � um player if (_bit_band (flag, OBJECT_TYPE_PLAYER) ~= 0) then @@ -333,21 +333,39 @@ --end else + --> anything else that isn't a player or a pet novo_objeto.displayName = nome + --[=[ --Chromie - From 'The Deaths of Chromie' if (serial and type (serial) == "string") then if (serial:match ("^Creature%-0%-%d+%-%d+%-%d+%-122663%-%w+$")) then novo_objeto.grupo = true end end + --]=] end - --> � inimigo + --> check if is hostile if (_bit_band (flag, REACTION_HOSTILE) ~= 0) then - if (_bit_band (flag, OBJECT_TYPE_PLAYER) == 0 and _bit_band (flag, OBJECT_TYPE_PETGUARDIAN) == 0) then - novo_objeto.monster = true + + if (_bit_band (flag, OBJECT_TYPE_PLAYER) == 0) then + --> is hostile and isn't a player + + if (_bit_band (flag, OBJECT_TYPE_PETGUARDIAN) == 0) then + --> isn't a pet or guardian + novo_objeto.monster = true + end + + if (serial and type (serial) == "string") then + local npcID = _detalhes:GetNpcIdFromGuid (serial) + if (npcID and not _detalhes.npcid_pool [npcID] and type (npcID) == "number") then + _detalhes.npcid_pool [npcID] = nome + end + end + end + end end diff --git a/functions/link.lua b/functions/link.lua index dc97d368..97570d26 100644 --- a/functions/link.lua +++ b/functions/link.lua @@ -2991,7 +2991,7 @@ end end - if (not have_plugins_enabled) then + if (not have_plugins_enabled and false) then local nopluginLabel = f:CreateFontString (nil, "overlay", "GameFontNormal") local nopluginIcon = f:CreateTexture (nil, "overlay") nopluginIcon:SetPoint ("bottomleft", f, "bottomleft", 10, 10) @@ -3595,6 +3595,87 @@ } + ----------------------------------------------- + + local npc_ids_module = { + name = "Npc IDs", + desc = "Show a list of known npc IDs", + filters_widgets = function() + if (not DetailsForgeEncounterNpcIDsFilterPanel) then + + local w = CreateFrame ("frame", "DetailsForgeEncounterNpcIDsFilterPanel", f) + 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 (_detalhes.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 npcPool = _detalhes.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 + end + end + + if (can_add) then + tinsert (t, {npcID, npcName}) + end + + table.sort (t, DetailsFramework.SortOrder2R) + end + + 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 = 200, type = "entry", func = no_func}, + }, + + fill_panel = false, + fill_gettotal = function (self) return #self.module.data end, + 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 + + return { + index, + data[1], + data[2] + } + else + return nothing_to_show + end + end, + fill_name = "DetailsForgeNpcIDsFillPanel", + } + ----------------------------------------------- local dbm_open_aura_creator = function (row) @@ -3723,7 +3804,6 @@ end, fill_name = "DetailsForgeDBMBarsFillPanel", } - ----------------------------------------------- @@ -3921,6 +4001,8 @@ f:InstallModule (encounter_spells_module) f:InstallModule (all_spells_module) + f:InstallModule (npc_ids_module) + f:InstallModule (dbm_timers_module) f:InstallModule (bigwigs_timers_module) @@ -3929,8 +4011,8 @@ f:InstallModule (all_pets_module) local brackets = { - [3] = true, - [5] = true + [4] = true, + [6] = true } local lastButton diff --git a/functions/profiles.lua b/functions/profiles.lua index 85e1f13b..5ffe42b5 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -1312,6 +1312,7 @@ local default_global_data = { }, spell_pool = {}, encounter_spell_pool = {}, + npcid_pool = {}, --> aura creation frame libwindow createauraframe = {}, diff --git a/functions/skins.lua b/functions/skins.lua index 66e1d378..cd5c9e85 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -165,8 +165,8 @@ local _ ["start_after_icon"] = true, ["font_face_file"] = "Fonts\\ARIALN.TTF", ["textL_custom_text"] = "{data1}. {data3}{data2}", - ["font_size"] = 14, - ["height"] = 18, + ["font_size"] = 16, + ["height"] = 21, ["texture_file"] = "Interface\\AddOns\\Details\\images\\bar4", ["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small", ["textR_bracket"] = "(", @@ -430,8 +430,8 @@ local _ ["start_after_icon"] = true, ["font_face_file"] = "Interface\\Addons\\Details\\fonts\\Accidental Presidency.ttf", ["textL_custom_text"] = "{data1}. {data3}{data2}", - ["font_size"] = 14, - ["height"] = 17, + ["font_size"] = 16, + ["height"] = 21, ["texture_file"] = "Interface\\AddOns\\Details\\images\\BantoBar", ["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small", ["textR_bracket"] = "(", @@ -576,8 +576,8 @@ local _ ["start_after_icon"] = true, ["font_face_file"] = "Fonts\\ARIALN.TTF", ["textL_custom_text"] = "{data1}. {data3}{data2}", - ["font_size"] = 12, - ["height"] = 18, + ["font_size"] = 16, + ["height"] = 21, ["texture_file"] = "Interface\\AddOns\\Details\\images\\bar_serenity", ["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small", ["textR_bracket"] = "(", @@ -863,12 +863,12 @@ local _ ["lower_alpha"] = 0.1, ["upper_enabled"] = false, }, - ["height"] = 20, ["texture_file"] = "Interface\\AddOns\\Details\\images\\bar_background", ["textR_bracket"] = "[", ["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small", ["icon_grayscale"] = false, ["font_size"] = 16, + ["height"] = 21, ["use_spec_icons"] = true, ["texture_custom"] = "", ["backdrop"] = { @@ -1248,11 +1248,11 @@ local _ ["textR_class_colors"] = false, ["alpha"] = 1, ["no_icon"] = false, - ["font_size"] = 14, + ["font_size"] = 16, + ["height"] = 21, ["texture_background"] = "Details Serenity", ["font_face"] = "FORCED SQUARE", ["texture_class_colors"] = true, - ["height"] = 18, ["texture_file"] = "Interface\\AddOns\\Details\\images\\bar4", ["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight", ["percent_type"] = 1, @@ -1546,8 +1546,8 @@ local _ ["start_after_icon"] = true, ["font_face_file"] = "Interface\\Addons\\Details\\fonts\\FORCED SQUARE.ttf", ["textL_custom_text"] = "{data1}. {data3}{data2}", - ["font_size"] = 14, - ["height"] = 18, + ["font_size"] = 16, + ["height"] = 21, ["texture_file"] = "Interface\\AddOns\\Details\\images\\bar4", ["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small", ["textR_bracket"] = "[", @@ -1768,11 +1768,11 @@ local _ ["texture_background"] = "BantoBar", ["textL_custom_text"] = "{data1}. {data3}{data2}", ["no_icon"] = false, - ["font_size"] = 14, + ["font_size"] = 16, + ["height"] = 21, ["textL_class_colors"] = false, ["font_face"] = "FORCED SQUARE", ["texture_class_colors"] = true, - ["height"] = 18, ["texture_file"] = "Interface\\AddOns\\Details\\images\\bar_background", ["textL_show_number"] = true, ["fixed_texture_color"] = {0.862745098039216,0.862745098039216,0.862745098039216,1}, @@ -2044,8 +2044,8 @@ local _ ["start_after_icon"] = false, ["font_face_file"] = "Interface\\Addons\\Details\\fonts\\Accidental Presidency.ttf", ["textL_custom_text"] = "{data1}. {data3}{data2}", - ["font_size"] = 14, - ["height"] = 18, + ["font_size"] = 16, + ["height"] = 21, ["texture_file"] = "Interface\\AddOns\\Details\\images\\bar_background", ["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small_alpha", ["textR_bracket"] = "(", @@ -2248,8 +2248,8 @@ local _ }, ["texture"] = "Details BarBorder 2", }, - ["font_size"] = 10, - ["height"] = 14, + ["font_size"] = 16, + ["height"] = 21, ["texture_file"] = "Interface\\RaidFrame\\Raid-Bar-Hp-Fill", ["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small", ["textR_bracket"] = "(", diff --git a/plugins/Details_RaidCheck/Details_RaidCheck.lua b/plugins/Details_RaidCheck/Details_RaidCheck.lua index ba146dfd..167d09de 100644 --- a/plugins/Details_RaidCheck/Details_RaidCheck.lua +++ b/plugins/Details_RaidCheck/Details_RaidCheck.lua @@ -567,7 +567,7 @@ end local itemLevelTable = _detalhes.ilevel:GetIlvl (unitSerial) local talentsTable = _detalhes:GetTalents (unitSerial) - tinsert (PlayerData, { + tinsert (PlayerData, {unitName, Name = unitName, Class = unitClass, Role = unitRole, @@ -594,7 +594,7 @@ end local itemLevelTable = _detalhes.ilevel:GetIlvl (unitSerial) local talentsTable = _detalhes:GetTalents (unitSerial) - tinsert (PlayerData, { + tinsert (PlayerData, {unitName, Name = unitName, Class = unitClass, Role = unitRole, diff --git a/startup.lua b/startup.lua index b1fa686f..5533c9cd 100644 --- a/startup.lua +++ b/startup.lua @@ -1311,8 +1311,21 @@ function _G._detalhes:Start() _detalhes:FillUserCustomSpells() _detalhes:AddDefaultCustomDisplays() - --> show streamer update panel - --[ + if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < 134 and enable_reset_warning) then + C_Timer.After (10, function() + for ID, instance in _detalhes:ListInstances() do + if (instance:IsEnabled()) then + local lineHeight = instance.row_info.height + local textSize = instance.row_info.font_size + if (lineHeight <= textSize) then + instance.row_info.height = textSize + 2 + instance.row_info.font_size = textSize - 1 + end + end + end + end) + end + if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < _detalhes.BFACORE and enable_reset_warning) then --> BFA launch