Fixing small issues

This commit is contained in:
Tercio Jose
2022-02-17 13:59:25 -03:00
parent 3381746314
commit 8594fbb854
6 changed files with 190 additions and 84 deletions
+25 -48
View File
@@ -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"},
[196917] = {name = lightOfTheMartyr_Name .. " (" .. Loc ["STRING_DAMAGE"] .. ")", icon = lightOfTheMartyr_Icon},
[108271] = {name = GetSpellInfo (108271), icon = "Interface\\Addons\\Details\\images\\icon_astral_shift"}, --
--> shadowlands trinkets
[345020] = {name = GetSpellInfo (345020) .. " (Trinket)"},
--> 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