From 14c3a45d1afd5a758c61c187a93d1b6bc342b1ad Mon Sep 17 00:00:00 2001 From: andrew6180 <16847730+andrew6180@users.noreply.github.com> Date: Sun, 26 May 2024 18:49:31 -0700 Subject: [PATCH] use new spec icon file --- Libs/DF/fw.lua | 2 +- classes/include_instance.lua | 2 +- .../window_playerbreakdown.lua | 2 +- frames/window_eventtracker.lua | 2 +- frames/window_main.lua | 2 +- functions/classes.lua | 4 +- functions/playerclass.lua | 10 +-- functions/profiles.lua | 62 ++++--------------- functions/skins.lua | 20 +++--- .../Details_EncounterDetails/frames_chart.lua | 4 +- plugins/Details_Streamer/Details_Streamer.lua | 4 +- 11 files changed, 39 insertions(+), 75 deletions(-) diff --git a/Libs/DF/fw.lua b/Libs/DF/fw.lua index e2b48d17..5c703893 100644 --- a/Libs/DF/fw.lua +++ b/Libs/DF/fw.lua @@ -1174,7 +1174,7 @@ function DF:AddClassIconToText(text, playerName, englishClassName, useSpec, icon local specString = "" local L, R, T, B = unpack(Details.class_specs_coords[spec]) if (L) then - specString = "|TInterface\\AddOns\\Details\\images\\spec_icons_normal:" .. size .. ":" .. size .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t" + specString = "|TInterface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS:" .. size .. ":" .. size .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t" return specString .. " " .. text end end diff --git a/classes/include_instance.lua b/classes/include_instance.lua index ee8f9d85..fe34e191 100644 --- a/classes/include_instance.lua +++ b/classes/include_instance.lua @@ -320,7 +320,7 @@ _detalhes.instance_defaults = { fast_ps_update = false, --show spec icons use_spec_icons = false, - spec_file = [[Interface\AddOns\Details\images\spec_icons_normal]], + spec_file = [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]], --show faction icon show_faction_icon = true, faction_icon_size_offset = -10, diff --git a/frames/window_breakdown/window_playerbreakdown.lua b/frames/window_breakdown/window_playerbreakdown.lua index 972c2053..d1fac28f 100644 --- a/frames/window_breakdown/window_playerbreakdown.lua +++ b/frames/window_breakdown/window_playerbreakdown.lua @@ -739,7 +739,7 @@ function breakdownWindowFrame.SetClassIcon(actorObject, class) breakdownWindowFrame.classIcon:SetTexCoord(.1, .9, .1, .9) elseif (actorObject.spec) then - breakdownWindowFrame.classIcon:SetTexture([[Interface\AddOns\Details\images\spec_icons_normal_alpha]]) + breakdownWindowFrame.classIcon:SetTexture([[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]]) breakdownWindowFrame.classIcon:SetTexCoord(unpack(_detalhes.class_specs_coords [actorObject.spec])) else local coords = CLASS_ICON_TCOORDS[class] diff --git a/frames/window_eventtracker.lua b/frames/window_eventtracker.lua index b7543f7f..6e9ed416 100644 --- a/frames/window_eventtracker.lua +++ b/frames/window_eventtracker.lua @@ -447,7 +447,7 @@ function Details:CreateEventTrackerFrame(parentObject, name) local get_player_icon = function(spec, class) if (spec) then - return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack(Details.class_specs_coords [spec]) + return [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]], unpack(Details.class_specs_coords [spec]) elseif (class) then return [[Interface\AddOns\Details\images\classes_small]], unpack(Details.class_coords [class]) else diff --git a/frames/window_main.lua b/frames/window_main.lua index 1c937816..f752005f 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -2093,7 +2093,7 @@ local iconFrame_OnEnter = function(self) end if (specL) then - GameCooltip:AddIcon([[Interface\AddOns\Details\images\spec_icons_normal_alpha]], 1, 2, iconSize, iconSize, specL, specR, specT, specB) + GameCooltip:AddIcon([[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]], 1, 2, iconSize, iconSize, specL, specR, specT, specB) else GameCooltip:AddIcon([[Interface\GossipFrame\IncompleteQuestIcon]], 1, 2, iconSize, iconSize) end diff --git a/functions/classes.lua b/functions/classes.lua index 685f226d..e2d10def 100644 --- a/functions/classes.lua +++ b/functions/classes.lua @@ -363,9 +363,9 @@ do local L, R, T, B = unpack(Details.class_specs_coords[spec]) if (L) then if (useAlphaIcons) then - specString = "|TInterface\\AddOns\\Details\\images\\spec_icons_normal_alpha:" .. iconSize .. ":" .. iconSize .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t" + specString = "|TInterface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS:" .. iconSize .. ":" .. iconSize .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t" else - specString = "|TInterface\\AddOns\\Details\\images\\spec_icons_normal:" .. iconSize .. ":" .. iconSize .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t" + specString = "|TInterface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS:" .. iconSize .. ":" .. iconSize .. ":0:0:512:512:" .. (L * 512) .. ":" .. (R * 512) .. ":" .. (T * 512) .. ":" .. (B * 512) .. "|t" end return specString .. " " .. thisString end diff --git a/functions/playerclass.lua b/functions/playerclass.lua index ac5bbe42..5ce8bf59 100644 --- a/functions/playerclass.lua +++ b/functions/playerclass.lua @@ -86,9 +86,9 @@ do if (iconType == "spec") then if (bWithAlpha) then - return [[Interface\AddOns\Details\images\spec_icons_normal_alpha]] + return [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]] else - return [[Interface\AddOns\Details\images\spec_icons_normal]] + return [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]] end else --if is class if (bWithAlpha) then @@ -206,9 +206,9 @@ do end if (useAlpha) then - return [[Interface\AddOns\Details\images\spec_icons_normal_alpha]], unpack(Details.class_specs_coords [spec]) + return [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]], unpack(Details.class_specs_coords [spec]) else - return [[Interface\AddOns\Details\images\spec_icons_normal]], unpack(Details.class_specs_coords[spec]) + return [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]], unpack(Details.class_specs_coords[spec]) end end @@ -251,7 +251,7 @@ do if (playerObject) then local spec = playerObject.spec if (spec) then - texturePath = [[Interface\AddOns\Details\images\spec_icons_normal]] + texturePath = [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]] left, right, top, bottom = unpack(Details.class_specs_coords[spec]) elseif (playerObject.classe) then diff --git a/functions/profiles.lua b/functions/profiles.lua index 8f5535f7..67990852 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -557,55 +557,7 @@ end local default_profile = { --spec coords, reset with: /run Details.class_specs_coords = nil - class_specs_coords = { - [577] = {128/512, 192/512, 256/512, 320/512}, --havoc demon hunter - [581] = {192/512, 256/512, 256/512, 320/512}, --vengeance demon hunter - - [250] = {0, 64/512, 0, 64/512}, --blood dk - [251] = {64/512, 128/512, 0, 64/512}, --frost dk - [252] = {128/512, 192/512, 0, 64/512}, --unholy dk - - [102] = {192/512, 256/512, 0, 64/512}, -- druid balance - [103] = {256/512, 320/512, 0, 64/512}, -- druid feral - [104] = {320/512, 384/512, 0, 64/512}, -- druid guardian - [105] = {384/512, 448/512, 0, 64/512}, -- druid resto - - [253] = {448/512, 512/512, 0, 64/512}, -- hunter bm - [254] = {0, 64/512, 64/512, 128/512}, --hunter marks - [255] = {64/512, 128/512, 64/512, 128/512}, --hunter survivor - - [62] = {(128/512) + 0.001953125, 192/512, 64/512, 128/512}, --mage arcane - [63] = {192/512, 256/512, 64/512, 128/512}, --mage fire - [64] = {256/512, 320/512, 64/512, 128/512}, --mage frost - - [268] = {320/512, 384/512, 64/512, 128/512}, --monk bm - [269] = {448/512, 512/512, 64/512, 128/512}, --monk ww - [270] = {384/512, 448/512, 64/512, 128/512}, --monk mw - - [65] = {0, 64/512, 128/512, 192/512}, --paladin holy - [66] = {64/512, 128/512, 128/512, 192/512}, --paladin protect - [70] = {(128/512) + 0.001953125, 192/512, 128/512, 192/512}, --paladin ret - - [256] = {192/512, 256/512, 128/512, 192/512}, --priest disc - [257] = {256/512, 320/512, 128/512, 192/512}, --priest holy - [258] = {(320/512) + (0.001953125 * 4), 384/512, 128/512, 192/512}, --priest shadow - - [259] = {384/512, 448/512, 128/512, 192/512}, --rogue assassination - [260] = {448/512, 512/512, 128/512, 192/512}, --rogue combat - [261] = {0, 64/512, 192/512, 256/512}, --rogue sub - - [262] = {64/512, 128/512, 192/512, 256/512}, --shaman elemental - [263] = {128/512, 192/512, 192/512, 256/512}, --shamel enhancement - [264] = {192/512, 256/512, 192/512, 256/512}, --shaman resto - - [265] = {256/512, 320/512, 192/512, 256/512}, --warlock aff - [266] = {320/512, 384/512, 192/512, 256/512}, --warlock demo - [267] = {384/512, 448/512, 192/512, 256/512}, --warlock destro - - [71] = {448/512, 512/512, 192/512, 256/512}, --warrior arms - [72] = {0, 64/512, 256/512, 320/512}, --warrior fury - [73] = {64/512, 128/512, 256/512, 320/512}, --warrior protect - }, + class_specs_coords = {}, --class icons and colors class_icons_small = [[Interface\AddOns\Details\images\classes_small]], @@ -999,6 +951,18 @@ for class, color in pairs(RAID_CLASS_COLORS) do default_profile.class_colors[class] = { color.r, color.g, color.b } end +for _, class in ipairs(CLASS_SORT_ORDER) do + local specs = C_ClassInfo.GetAllSpecs(class) + if specs then + for _, spec in ipairs(specs) do + local spec_info = C_ClassInfo.GetSpecInfo(class, spec) + if spec_info then + default_profile.class_specs_coords [spec_info.ID] = {AtlasUtil:GetCoords("specicon-"..class.."-"..spec_info.Spec)} + end + end + end +end + Details.default_profile = default_profile diff --git a/functions/skins.lua b/functions/skins.lua index fc206d3b..072d77c6 100644 --- a/functions/skins.lua +++ b/functions/skins.lua @@ -178,7 +178,7 @@ local addonName, Details222 = ... ["bars_grow_direction"] = 1, ["row_info"] = { ["textR_outline"] = true, - ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal", + ["spec_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["textL_outline"] = true, ["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight", ["textR_show_data"] = { @@ -447,7 +447,7 @@ local addonName, Details222 = ... ["stretch_button_side"] = 1, ["row_info"] = { ["textR_outline"] = false, - ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal", + ["spec_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["textL_outline"] = false, ["textR_outline_small"] = true, ["textL_outline_small"] = true, @@ -596,7 +596,7 @@ local addonName, Details222 = ... ["backdrop_texture"] = "Details Ground", ["row_info"] = { ["textR_outline"] = false, - ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal", + ["spec_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["textL_outline"] = false, ["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight", ["textR_show_data"] = { @@ -876,7 +876,7 @@ local addonName, Details222 = ... ["bars_grow_direction"] = 1, ["row_info"] = { ["textR_outline"] = false, - ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal", + ["spec_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["textL_outline"] = false, ["textR_outline_small"] = true, ["textL_outline_small"] = true, @@ -1242,7 +1242,7 @@ local addonName, Details222 = ... 0, }, ["use_spec_icons"] = true, - ["icon_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal_alpha", + ["icon_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["textL_show_number"] = true, ["texture"] = "Skyline", ["texture_background_file"] = "Interface\\AddOns\\Details\\images\\bar4", @@ -1444,7 +1444,7 @@ local addonName, Details222 = ... }, ["row_info"] = { ["textR_outline"] = false, - ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal", + ["spec_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["textL_outline"] = false, ["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight", ["textR_show_data"] = { @@ -1653,7 +1653,7 @@ local addonName, Details222 = ... ["textL_outline"] = false, ["use_spec_icons"] = true, ["textL_enable_custom_text"] = false, - ["icon_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal", + ["icon_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["texture_background_file"] = "Interface\\AddOns\\Details\\images\\BantoBar", ["start_after_icon"] = true, ["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight", @@ -1855,7 +1855,7 @@ local addonName, Details222 = ... ["clickthrough_toolbaricons"] = false, ["row_info"] = { ["textR_outline"] = false, - ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal", + ["spec_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["textL_outline"] = false, ["textR_outline_small"] = true, ["textL_outline_small"] = true, @@ -2431,7 +2431,7 @@ local addonName, Details222 = ... ["textR_outline"] = true, ["textL_outline_small"] = false, ["textR_outline_small"] = false, - ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal_alpha", + ["spec_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight", ["textR_show_data"] = { true, -- [1] @@ -2627,7 +2627,7 @@ local addonName, Details222 = ... }, ["row_info"] = { ["textR_outline"] = false, - ["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal", + ["spec_file"] = "Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS", ["textL_outline"] = false, ["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight", ["textR_show_data"] = { diff --git a/plugins/Details_EncounterDetails/frames_chart.lua b/plugins/Details_EncounterDetails/frames_chart.lua index 57e9a2c0..5f909bac 100644 --- a/plugins/Details_EncounterDetails/frames_chart.lua +++ b/plugins/Details_EncounterDetails/frames_chart.lua @@ -448,7 +448,7 @@ function encounterDetails:CreatePhaseIndicators(chartPanel, phaseTooltip) tooltipBar:SetStatusBarColor(red, green, blue) if (spec) then - tooltipBar.icon.texture = [[Interface\AddOns\Details\images\spec_icons_normal]] + tooltipBar.icon.texture = [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECSl]] tooltipBar.icon.texcoord = encounterDetails.class_specs_coords[spec] elseif (class) then @@ -496,7 +496,7 @@ function encounterDetails:CreatePhaseIndicators(chartPanel, phaseTooltip) tooltipBar:SetStatusBarColor(red, green, blue) if (spec) then - tooltipBar.icon.texture = [[Interface\AddOns\Details\images\spec_icons_normal]] + tooltipBar.icon.texture = [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]] tooltipBar.icon.texcoord = encounterDetails.class_specs_coords[spec] elseif (class) then diff --git a/plugins/Details_Streamer/Details_Streamer.lua b/plugins/Details_Streamer/Details_Streamer.lua index 7833b55e..8cad8dfb 100644 --- a/plugins/Details_Streamer/Details_Streamer.lua +++ b/plugins/Details_Streamer/Details_Streamer.lua @@ -983,12 +983,12 @@ local parse_target_icon = function (targetObject, target) icon2coords = PetCoords elseif (class and RAID_CLASS_COLORS [class]) then if (targetObject.spec) then - icon2 = [[Interface\AddOns\Details\images\spec_icons_normal_alpha]] + icon2 = [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]] icon2coords = Details.class_specs_coords [targetObject.spec] else local spec_from_cache = Details.cached_specs [targetObject.serial] if (spec_from_cache) then - icon2 = [[Interface\AddOns\Details\images\spec_icons_normal_alpha]] + icon2 = [[Interface\\GLUES\\CHARACTERCREATE\\UI-CHARACTERCREATE-CLASSES-SPECS]] icon2coords = Details.class_specs_coords [spec_from_cache] else icon2 = [[Interface\AddOns\Details\images\classes_small_alpha]]