From 8594fbb85406dbf0113c15af39a34ee6efd45dd2 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Thu, 17 Feb 2022 13:59:25 -0300 Subject: [PATCH] Fixing small issues --- Libs/DF/fw.lua | 2 +- Libs/DF/panel.lua | 65 +++++++------- Libs/LibOpenRaid/LibOpenRaid.lua | 2 +- Libs/LibOpenRaid/ThingsToMantain.lua | 126 ++++++++++++++++++++++++++- boot.lua | 8 +- functions/spellcache.lua | 73 ++++++---------- 6 files changed, 191 insertions(+), 85 deletions(-) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index a7dfd8ca3..dc0c1db2a 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1,6 +1,6 @@ -local dversion = 286 +local dversion = 287 local major, minor = "DetailsFramework-1.0", dversion local DF, oldminor = LibStub:NewLibrary (major, minor) diff --git a/Libs/DF/panel.lua b/Libs/DF/panel.lua index d69fb9b9e..7eee3f809 100644 --- a/Libs/DF/panel.lua +++ b/Libs/DF/panel.lua @@ -1983,50 +1983,52 @@ local SimplePanel_frame_backdrop_border_color = {0, 0, 0, 1} --with_label was making the frame stay in place while its parent moves --the slider was anchoring to with_label and here here were anchoring the slider again function DF:CreateScaleBar(frame, config) - local scaleBar, text = DF:CreateSlider (frame, 120, 14, 0.6, 1.6, 0.1, config.scale, true, "ScaleBar", nil, "Scale:", DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE"), DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) + local scaleBar, text = DF:CreateSlider(frame, 120, 14, 0.6, 1.6, 0.1, config.scale, true, "ScaleBar", nil, "Scale:", DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE"), DF:GetTemplate ("font", "ORANGE_FONT_TEMPLATE")) scaleBar.thumb:SetWidth(24) scaleBar:SetValueStep(0.1) scaleBar:SetObeyStepOnDrag(true) scaleBar.mouseDown = false rawset(scaleBar, "lockdown", true) - --> create a custom editbox to enter the scale from text - local editbox = CreateFrame("editbox", nil, scaleBar.widget, "BackdropTemplate") - editbox:SetSize(40, 20) - editbox:SetJustifyH("center") - editbox:SetBackdrop({bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], - edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", --edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], - tile = true, edgeSize = 8, tileSize = 5}) - editbox:SetFontObject("GameFontHighlightSmall") - - editbox:SetScript("OnEnterPressed", function() - editbox:ClearFocus() - editbox:Hide() - local text = editbox:GetText() - local newScale = DF.TextToFloor(text) + --create a custom editbox to enter the scale from text + local editbox = CreateFrame("editbox", nil, scaleBar.widget, "BackdropTemplate") + editbox:SetSize(40, 20) + editbox:SetJustifyH("center") + editbox:SetBackdrop({bgFile = [[Interface\ACHIEVEMENTFRAME\UI-GuildAchievement-Parchment-Horizontal-Desaturated]], + edgeFile = [[Interface\Buttons\WHITE8X8]], + tile = true, edgeSize = 1, tileSize = 64}) + editbox:SetFontObject("GameFontHighlightSmall") + editbox:SetBackdropColor(0, 0, 0, 1) + + editbox:SetScript("OnEditFocusGained", function() + end) - if (newScale) then - config.scale = newScale - scaleBar:SetValue(newScale) - frame:SetScale(newScale) - editbox.defaultValue = newScale - end - end) - - editbox:SetScript("OnEscapePressed", function() - editbox:ClearFocus() - editbox:Hide() - editbox:SetText(editbox.defaultValue) - end) + editbox:SetScript("OnEnterPressed", function() + editbox:ClearFocus() + editbox:Hide() + local text = editbox:GetText() + local newScale = DF.TextToFloor(text) - editbox:SetScript("OnTextChanged", function() - end) + if (newScale) then + config.scale = newScale + scaleBar:SetValue(newScale) + frame:SetScale(newScale) + editbox.defaultValue = newScale + end + end) + + editbox:SetScript("OnEscapePressed", function() + editbox:ClearFocus() + editbox:Hide() + editbox:SetText(editbox.defaultValue) + end) scaleBar:SetScript("OnMouseDown", function(_, mouseButton) if (mouseButton == "RightButton") then editbox:Show() editbox:SetAllPoints() editbox:SetText(config.scale) + editbox:SetFocus(true) editbox.defaultValue = config.scale elseif (mouseButton == "LeftButton") then @@ -2052,7 +2054,8 @@ function DF:CreateScaleBar(frame, config) scaleBar:SetAlpha(0.70) editbox.defaultValue = config.scale - + editbox:SetFocus(false) + editbox:SetAutoFocus(false) return scaleBar end diff --git a/Libs/LibOpenRaid/LibOpenRaid.lua b/Libs/LibOpenRaid/LibOpenRaid.lua index 91776cafd..49ee10daa 100644 --- a/Libs/LibOpenRaid/LibOpenRaid.lua +++ b/Libs/LibOpenRaid/LibOpenRaid.lua @@ -1,6 +1,6 @@ local major = "LibOpenRaid-1.0" -local CONST_LIB_VERSION = 21 +local CONST_LIB_VERSION = 22 LIB_OPEN_RAID_CAN_LOAD = false --declae the library within the LibStub diff --git a/Libs/LibOpenRaid/ThingsToMantain.lua b/Libs/LibOpenRaid/ThingsToMantain.lua index be5dc391d..d4e5e1433 100644 --- a/Libs/LibOpenRaid/ThingsToMantain.lua +++ b/Libs/LibOpenRaid/ThingsToMantain.lua @@ -5,6 +5,79 @@ if (not LIB_OPEN_RAID_CAN_LOAD) then return end +--localization +local gameLanguage = GetLocale() + +local L = { --default localization + ["STRING_EXPLOSION"] = "explosion", + ["STRING_MIRROR_IMAGE"] = "Mirror Image", + ["STRING_CRITICAL_ONLY"] = "critical", + ["STRING_BLOOM"] = "Bloom", --lifebloom 'bloom' healing + ["STRING_GLAIVE"] = "Glaive", --DH glaive toss + ["STRING_MAINTARGET"] = "Main Target", + ["STRING_AOE"] = "AoE", --multi targets + ["STRING_SHADOW"] = "Shadow", --the spell school 'shadow' + ["STRING_PHYSICAL"] = "Physical", --the spell school 'physical' + ["STRING_PASSIVE"] = "Passive", --passive spell + ["STRING_TEMPLAR_VINDCATION"] = "Templar's Vindication", --paladin spell + ["STRING_PROC"] = "proc", --spell proc + ["STRING_TRINKET"] = "Trinket", --trinket +} + +if (gameLanguage == "enUS") then + --default language + +elseif (gameLanguage == "deDE") then + L["STRING_EXPLOSION"] = "Explosion" + L["STRING_MIRROR_IMAGE"] = "Bilder spiegeln" + L["STRING_CRITICAL_ONLY"] = "kritisch" + +elseif (gameLanguage == "esES") then + L["STRING_EXPLOSION"] = "explosión" + L["STRING_MIRROR_IMAGE"] = "Imagen de espejo" + L["STRING_CRITICAL_ONLY"] = "crítico" + +elseif (gameLanguage == "esMX") then + L["STRING_EXPLOSION"] = "explosión" + L["STRING_MIRROR_IMAGE"] = "Imagen de espejo" + L["STRING_CRITICAL_ONLY"] = "crítico" + +elseif (gameLanguage == "frFR") then + L["STRING_EXPLOSION"] = "explosion" + L["STRING_MIRROR_IMAGE"] = "Effet miroir" + L["STRING_CRITICAL_ONLY"] = "critique" + +elseif (gameLanguage == "itIT") then + L["STRING_EXPLOSION"] = "esplosione" + L["STRING_MIRROR_IMAGE"] = "Immagine Speculare" + L["STRING_CRITICAL_ONLY"] = "critico" + +elseif (gameLanguage == "koKR") then + L["STRING_EXPLOSION"] = "폭발" + L["STRING_MIRROR_IMAGE"] = "미러 이미지" + L["STRING_CRITICAL_ONLY"] = "치명타" + +elseif (gameLanguage == "ptBR") then + L["STRING_EXPLOSION"] = "explosão" + L["STRING_MIRROR_IMAGE"] = "Imagem Espelhada" + L["STRING_CRITICAL_ONLY"] = "critico" + +elseif (gameLanguage == "ruRU") then + L["STRING_EXPLOSION"] = "взрыв" + L["STRING_MIRROR_IMAGE"] = "Зеркальное изображение" + L["STRING_CRITICAL_ONLY"] = "критический" + +elseif (gameLanguage == "zhCN") then + L["STRING_EXPLOSION"] = "爆炸" + L["STRING_MIRROR_IMAGE"] = "镜像" + L["STRING_CRITICAL_ONLY"] = "爆击" + +elseif (gameLanguage == "zhTW") then + L["STRING_EXPLOSION"] = "爆炸" + L["STRING_MIRROR_IMAGE"] = "鏡像" + L["STRING_CRITICAL_ONLY"] = "致命" +end + LIB_OPEN_RAID_BLOODLUST = { [2825] = true, --bloodlust [32182] = true, --heroism @@ -210,6 +283,7 @@ LIB_OPEN_RAID_COOLDOWNS_BY_SPEC = { [64044] = 5, --Psychic Horror [8122] = 5, --Psychic Scream [205369] = 5, --Mind Bomb + [228260] = 1, --Void Erruption }, --ROGUE @@ -816,6 +890,7 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = { [15286] = {cooldown = 120, duration = 15, talent = false, charges = 1, class = "PRIEST", type = 4}, --Vampiric Embrace [64044] = {cooldown = 45, duration = 4, talent = 21752, charges = 1, class = "PRIEST", type = 5}, --Psychic Horror [205369] = {cooldown = 30, duration = 6, talent = 23375, charges = 1, class = "PRIEST", type = 5}, --Mind Bomb + [228260] = {cooldown = 90, duration = 15, talent = false, charges = 1, class = "PRIEST", type = 1}, --Void Erruption --> rogue [79140] = {cooldown = 120, duration = 20, talent = false, charges = 1, class = "ROGUE", type = 1}, --Vendetta @@ -830,4 +905,53 @@ LIB_OPEN_RAID_COOLDOWNS_INFO = { [199754] = {cooldown = 120, duration = 10, talent = false, charges = 1, class = "ROGUE", type = 2}, --Riposte [343142] = {cooldown = 90, duration = 10, talent = 19250, charges = 1, class = "ROGUE", type = 5}, --Dreadblades [121471] = {cooldown = 180, duration = 20, talent = false, charges = 1, class = "ROGUE", type = 1}, --Shadow Blades -} \ No newline at end of file +} + +--[=[ +Spell customizations: + Many times there's spells with the same name which does different effects + In here you find a list of spells which has its name changed to give more information to the player + you may add into the list any other parameter your addon uses declaring for example 'icon = ' or 'texcoord = ' etc. + +Implamentation Example: + if (LIB_OPEN_RAID_SPELL_CUSTOM_NAMES) then + for spellId, customTable in pairs(LIB_OPEN_RAID_SPELL_CUSTOM_NAMES) do + local name = customTable.name + if (name) then + MyCustomSpellTable[spellId] = name + end + end + end +--]=] + +LIB_OPEN_RAID_SPELL_CUSTOM_NAMES = {} --default fallback + +if (GetBuildInfo():match ("%d") == "1") then + LIB_OPEN_RAID_SPELL_CUSTOM_NAMES = {} + +elseif (GetBuildInfo():match ("%d") == "2") then + LIB_OPEN_RAID_SPELL_CUSTOM_NAMES = {} + +else + LIB_OPEN_RAID_SPELL_CUSTOM_NAMES = { + [44461] = {name = GetSpellInfo(44461) .. " (" .. L["STRING_EXPLOSION"] .. ")"}, --> Living Bomb (explosion) + [59638] = {name = GetSpellInfo(59638) .. " (" .. L["STRING_MIRROR_IMAGE"] .. ")"}, --> Mirror Image's Frost Bolt (mage) + [88082] = {name = GetSpellInfo(88082) .. " (" .. L["STRING_MIRROR_IMAGE"] .. ")"}, --> Mirror Image's Fireball (mage) + [94472] = {name = GetSpellInfo(94472) .. " (" .. L["STRING_CRITICAL_ONLY"] .. ")"}, --> Atonement critical hit (priest) + [33778] = {name = GetSpellInfo(33778) .. " (" .. L["STRING_BLOOM"] .. ")"}, --lifebloom (bloom) + [121414] = {name = GetSpellInfo(121414) .. " (" .. L["STRING_GLAIVE"] .. " #1)"}, --> glaive toss (hunter) + [120761] = {name = GetSpellInfo(120761) .. " (" .. L["STRING_GLAIVE"] .. " #2)"}, --> glaive toss (hunter) + [212739] = {name = GetSpellInfo(212739) .. " (" .. L["STRING_MAINTARGET"] .. ")"}, --DK Epidemic + [215969] = {name = GetSpellInfo(215969) .. " (" .. L["STRING_AOE"] .. ")"}, --DK Epidemic + [70890] = {name = GetSpellInfo(70890) .. " (" .. L["STRING_SHADOW"] .. ")"}, --DK Scourge Strike + [55090] = {name = GetSpellInfo(55090) .. " (" .. L["STRING_PHYSICAL"] .. ")"}, --DK Scourge Strike + [49184] = {name = GetSpellInfo(49184) .. " (" .. L["STRING_MAINTARGET"] .. ")"}, --DK Howling Blast + [237680] = {name = GetSpellInfo(237680) .. " (" .. L["STRING_AOE"] .. ")"}, --DK Howling Blast + [228649] = {name = GetSpellInfo(228649) .. " (" .. L["STRING_PASSIVE"] .. ")"}, --Monk Mistweaver Blackout kick - Passive Teachings of the Monastery + [339538] = {name = GetSpellInfo(224266) .. " (" .. L["STRING_TEMPLAR_VINDCATION"] .. ")"}, -- + [343355] = {name = GetSpellInfo(343355) .. " (" .. L["STRING_PROC"] .. ")"}, --shadow priest's void bold proc + + --> shadowlands trinkets + [345020] = {name = GetSpellInfo(345020) .. " (" .. L["STRING_TRINKET"] .. ")"}, + } +end \ No newline at end of file diff --git a/boot.lua b/boot.lua index f733a09ac..0b0883860 100644 --- a/boot.lua +++ b/boot.lua @@ -6,8 +6,8 @@ local version, build, date, tocversion = GetBuildInfo() - _detalhes.build_counter = 9692 - _detalhes.alpha_build_counter = 9692 --if this is higher than the regular counter, use it instead + _detalhes.build_counter = 9693 + _detalhes.alpha_build_counter = 9693 --if this is higher than the regular counter, use it instead _detalhes.bcc_counter = 31 _detalhes.dont_open_news = true _detalhes.game_version = version @@ -43,6 +43,7 @@ do 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. + Spell customization now get date from Lib-OpenRaid. 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). @@ -274,11 +275,12 @@ do -- /script Details:OpenPlugin ('Advanced Death Logs'); local a = Details_DeathGraphsModeEnduranceButton and Details_DeathGraphsModeEnduranceButton.MyObject:Click() {Name = "Report What is Shown In the Window", Desc = "Report the current data shown in the window, the number 1 is the window number, replace it to report another window.", MacroText = "/script Details:FastReportWindow(1)"}, } - + --> current instances of the exp (need to maintain) _detalhes.InstancesToStoreData = { --mapId [2296] = true, --castle narnia [2450] = true, --sanctum of domination + [2481] = true, --sepulcher of the first ones } --> armazena os escudos - Shields information for absorbs diff --git a/functions/spellcache.lua b/functions/spellcache.lua index 26ecce7d4..10e6e5450 100644 --- a/functions/spellcache.lua +++ b/functions/spellcache.lua @@ -104,11 +104,11 @@ do local lightOfTheMartyr_Name, _, lightOfTheMartyr_Icon = _GetSpellInfo (196917) lightOfTheMartyr_Name = lightOfTheMartyr_Name or "Deprecated Spell - Light of the Martyr" lightOfTheMartyr_Icon = lightOfTheMartyr_Icon or "" - - local default_user_spells - + + local defaultSpellCustomization = {} + if (DetailsFramework.IsClassicWow()) then - default_user_spells = { + defaultSpellCustomization = { [1] = {name = Loc ["STRING_MELEE"], icon = [[Interface\ICONS\INV_Sword_04]]}, [2] = {name = Loc ["STRING_AUTOSHOT"], icon = [[Interface\ICONS\INV_Weapon_Bow_07]]}, [3] = {name = Loc ["STRING_ENVIRONMENTAL_FALLING"], icon = [[Interface\ICONS\Spell_Magic_FeatherFall]]}, @@ -120,7 +120,7 @@ do } elseif (DetailsFramework.IsTBCWow()) then - default_user_spells = { + defaultSpellCustomization = { [1] = {name = _G["MELEE"], icon = [[Interface\ICONS\INV_Sword_04]]}, [2] = {name = Loc ["STRING_AUTOSHOT"], icon = [[Interface\ICONS\INV_Weapon_Bow_07]]}, [3] = {name = Loc ["STRING_ENVIRONMENTAL_FALLING"], icon = [[Interface\ICONS\Spell_Magic_FeatherFall]]}, @@ -132,7 +132,7 @@ do } else - default_user_spells = { + defaultSpellCustomization = { [1] = {name = Loc ["STRING_MELEE"], icon = [[Interface\ICONS\INV_Sword_04]]}, [2] = {name = Loc ["STRING_AUTOSHOT"], icon = [[Interface\ICONS\INV_Weapon_Bow_07]]}, [3] = {name = Loc ["STRING_ENVIRONMENTAL_FALLING"], icon = [[Interface\ICONS\Spell_Magic_FeatherFall]]}, @@ -141,42 +141,11 @@ do [6] = {name = Loc ["STRING_ENVIRONMENTAL_FIRE"], icon = [[Interface\ICONS\INV_SummerFest_FireSpirit]]}, [7] = {name = Loc ["STRING_ENVIRONMENTAL_LAVA"], icon = [[Interface\ICONS\Ability_Rhyolith_Volcano]]}, [8] = {name = Loc ["STRING_ENVIRONMENTAL_SLIME"], icon = [[Interface\ICONS\Ability_Creature_Poison_02]]}, - - [196917] = {name = lightOfTheMartyr_Name .. " (" .. Loc ["STRING_DAMAGE"] .. ")", icon = lightOfTheMartyr_Icon}, - [98021] = {name = Loc ["STRING_SPIRIT_LINK_TOTEM"]}, - - [44461] = {name = GetSpellInfo (44461) .. " (" .. Loc ["STRING_EXPLOSION"] .. ")"}, --> Living Bomb (explosion) - - [59638] = {name = GetSpellInfo (59638) .. " (" .. Loc ["STRING_MIRROR_IMAGE"] .. ")"}, --> Mirror Image's Frost Bolt (mage) - [88082] = {name = GetSpellInfo (88082) .. " (" .. Loc ["STRING_MIRROR_IMAGE"] .. ")"}, --> Mirror Image's Fireball (mage) - - [94472] = {name = GetSpellInfo (94472) .. " (" .. Loc ["STRING_CRITICAL_ONLY"] .. ")"}, --> Atonement critical hit (priest) - - [33778] = {name = GetSpellInfo (33778) .. " (Bloom)"}, --lifebloom (bloom) - - [121414] = {name = GetSpellInfo (121414) .. " (Glaive #1)"}, --> glaive toss (hunter) - [120761] = {name = GetSpellInfo (120761) .. " (Glaive #2)"}, --> glaive toss (hunter) - - [212739] = {name = GetSpellInfo (212739) .. " (Main Target)"}, --DK Epidemic - [215969] = {name = GetSpellInfo (215969) .. " (AoE)"}, --DK Epidemic - - [70890] = {name = GetSpellInfo (70890) .. " (Shadow)"}, --DK Scourge Strike - [55090] = {name = GetSpellInfo (55090) .. " (Physical)"}, --DK Scourge Strike - - [49184] = {name = GetSpellInfo (49184) .. " (Main Target)"}, --DK Howling Blast - [237680] = {name = GetSpellInfo (237680) .. " (AoE)"}, --DK Howling Blast - - [228649] = {name = GetSpellInfo (228649) .. " (Passive)"}, --Monk Mistweaver Blackout kick - Passive Teachings of the Monastery - - [339538] = {name = GetSpellInfo (224266) .. " (Templar's Vindication)"}, -- - - [108271] = {name = GetSpellInfo (108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"}, -- - - --> shadowlands trinkets - [345020] = {name = GetSpellInfo (345020) .. " (Trinket)"}, + [108271] = {name = GetSpellInfo (108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"}, + [196917] = {name = lightOfTheMartyr_Name .. " (" .. Loc ["STRING_DAMAGE"] .. ")", icon = lightOfTheMartyr_Icon}, - --> bfa trinkets + --> bfa trinkets (deprecated) [278155] = {name = GetSpellInfo (278155) .. " (Trinket)"}, --[Twitching Tentacle of Xalzaix] [279664] = {name = GetSpellInfo (279664) .. " (Trinket)"}, --[Vanquished Tendril of G'huun] [278227] = {name = GetSpellInfo (278227) .. " (Trinket)"}, --[T'zane's Barkspines] @@ -197,12 +166,20 @@ do [277181] = {name = GetSpellInfo (277181) .. " (Trinket)"}, --[Dread Gladiator's Insignia] [277185] = {name = GetSpellInfo (277185) .. " (Trinket)"}, --[Dread Gladiator's Badge] [278057] = {name = GetSpellInfo (278057) .. " (Trinket)"}, --[Vigilant's Bloodshaper] - } end - + + if (LIB_OPEN_RAID_SPELL_CUSTOM_NAMES) then + for spellId, customTable in pairs(LIB_OPEN_RAID_SPELL_CUSTOM_NAMES) do + local name = customTable.name + if (name) then + defaultSpellCustomization[spellId] = name + end + end + end + function _detalhes:UserCustomSpellUpdate (index, name, icon) - local t = _detalhes.savedCustomSpells [index] + local t = _detalhes.savedCustomSpells[index] if (t) then t [2], t [3] = name or t [2], icon or t [3] return _rawset (_detalhes.spellcache, t [1], {t [2], 1, t [3]}) @@ -212,14 +189,14 @@ do end function _detalhes:UserCustomSpellReset (index) - local t = _detalhes.savedCustomSpells [index] + local t = _detalhes.savedCustomSpells[index] if (t) then local spellid = t [1] local name, _, icon = _GetSpellInfo (spellid) - if (default_user_spells [spellid]) then - name = default_user_spells [spellid].name - icon = default_user_spells [spellid].icon or icon or [[Interface\InventoryItems\WoWUnknownItem01]] + if (defaultSpellCustomization [spellid]) then + name = defaultSpellCustomization [spellid].name + icon = defaultSpellCustomization [spellid].icon or icon or [[Interface\InventoryItems\WoWUnknownItem01]] end if (not name) then @@ -237,7 +214,7 @@ do end function _detalhes:FillUserCustomSpells() - for spellid, t in pairs (default_user_spells) do + for spellid, t in pairs (defaultSpellCustomization) do local already_have for index, spelltable in ipairs (_detalhes.savedCustomSpells) do