Skip to content
Browse files

Add custom icons for enchanting panels (and elsewhere?)

  • Loading branch information...
1 parent 4e86054 commit 430a7328e17b17b5d69791e01a72d49dc6641ffa @tekkub tekkub committed
Showing with 40 additions and 27 deletions.
  1. +17 −3 ButtonFactory.lua
  2. +21 −22 Enchanting.lua
  3. +2 −2 PanelFactory.lua
View
20 ButtonFactory.lua
@@ -3,8 +3,20 @@ local HideTooltip, ShowTooltip, GS, G = Panda.HideTooltip, Panda.ShowTooltip, Pa
local auc = LibStub("tekAucQuery")
-local UNK = "Interface\\Icons\\INV_Misc_QuestionMark"
local server = GetRealmName().." "..UnitFactionGroup("player")
+local UNK, ICONS = "Interface\\Icons\\INV_Misc_QuestionMark", {
+ STA = "Spell_Nature_UnyeildingStamina", RES = "Spell_Holy_ChampionsGrace",
+ AGI = "Spell_Holy_BlessingOfAgility", AP = "Spell_Holy_FistOfJustice", STR = "Spell_Nature_Strength", DAM = "Ability_Gouge",
+ ARM = "INV_Misc_ArmorKit_25", BLKR = "Ability_Warrior_DefensiveStance", BLKV = "INV_Shield_04", DEF = "Ability_Defend",
+ INT = "Spell_Holy_MagicalSentry", SPI = "Spell_Holy_DivineSpirit", SP = "Spell_Holy_MindVision",
+ BEAST = "Ability_Druid_FerociousBite", ELEM = "Spell_Frost_SummonWaterElemental", DEMON = "Spell_Shadow_DemonicTactics",
+ RALL = "Spell_Frost_WizardMark", RFR = "Spell_Frost_FrostWard", RSH = "Spell_Shadow_AntiShadow", RFI = "Spell_Fire_FireArmor", RAR = "Spell_Nature_StarFall", RNA = "Spell_Nature_ResistNature",
+ HP = "INV_Potion_51", MP = "INV_Potion_72", HMP = "INV_Potion_79", MPR = "Spell_Magic_ManaGain",
+ STAT = "Spell_ChargePositive", EXP = "Spell_Holy_BlessingOfStrength", SPE = "Spell_Fire_BurningSpeed",
+ HIT = "Ability_Marksmanship",
+ MONGOOSE = "Spell_Nature_UnrelentingStorm", BERSERK = "Spell_Shadow_DeathPact", FROST = "Spell_Frost_FrostShock", UNHOLY = "Spell_Shadow_CurseOfMannoroth",
+ CRUSADER = "Spell_Holy_BlessingOfStrength", FIERY = "Spell_Fire_Immolation", WINTER = "Spell_Frost_FrostNova", LIFESTEAL = "Spell_Shadow_LifeDrain",
+}
local function OnEvent(self)
@@ -38,7 +50,9 @@ function Panda.CraftMacro(name, id)
end
-function Panda.ButtonFactory(parent, id, secure, notext, ...)
+function Panda.ButtonFactory(parent, id, secure, notext, extra, ...)
+ local customicon = extra ~= "" and extra
+
local f = CreateFrame(secure and "CheckButton" or "Frame", id == 6948 and "MassMill" or nil, parent, secure and "SecureActionButtonTemplate")
local name, link, _, _, _, _, _, _, _, texture = GetItemInfo(id)
f.link, f.id, f.name = link, id, name or ""
@@ -55,7 +69,7 @@ function Panda.ButtonFactory(parent, id, secure, notext, ...)
local icon = f:CreateTexture(nil, "ARTWORK")
icon:SetAllPoints(f)
- icon:SetTexture(texture or UNK)
+ icon:SetTexture(texture and (customicon and ("Interface\\Icons\\".. ICONS[customicon]) or texture) or UNK)
f.icon = icon
if not notext then
View
43 Enchanting.lua
@@ -16,12 +16,11 @@ end
Panda.PanelFactory(L["Enchant Bracer"], SPELLID,
-[[38768 38811 38842 38899 0 38984 0 38898 38987
- 38771 38793 38812 38849 38855 38902
- 38778 38797 38817 38846 38854 38897 0 38938 38971 44815
- 38803 38829 38852 38937 38968 0 0 38903 38997 38900
- 38774 38783 38809 38832 38853 38980 0 38882 38900 38996
- 38777 0 38881 38901 0 38679
+[[38768:DEF 38811:DEF 38842:DEF 38899:DEF 0 38984:EXP 0 38898:STAT 38987:STAT
+ 38771:STA 38793:STA 38812:STA 38849:STA 38855:STA 38902:STA 0 38679:HP
+ 38778:STR 38797:STR 38817:STR 38846:STR 38854:STR 38897:STR 0 38938:AP 38971:AP 44815:AP 0 38777:AGI
+ 38803:INT 38829:INT 38852:INT 38937:INT 38968:INT 0 0 38903:SP 38997:SP 38900:SP 0 38881:MPR 38901:MPR
+ 38774:SPI 38783:SPI 38809:SPI 38832:SPI 38853:SPI 38980:SPI 0 38882:SP 38900:SP 38996:SP
]], nil, function(frame)
frame:SetAttribute("type", "macro")
frame:SetAttribute("macrotext", MakeMacro(frame.id, frame.name))
@@ -29,12 +28,12 @@ end)
Panda.PanelFactory(L["Enchant Cloak"], SPELLID,
-[[38789 38835 38940 38959 44457 0 0 0 0 0 0 0 0 38770 38826 38858 38915
- 38775 38790 38806 38825 38859 38914 39001 0 0 0 0 0 0 38784 38815 38891 38969
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38795 38942 38977
- 0 0 38939 38894 38893 39000 38895 0 0 0 0 0 0 0 0 38941 38982
- 44456 39003 38973 39004 38993 38978 0 0 0 0 0 0 0 0 0 38892 38956
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38950
+[[38789:AGI 38835:AGI 38940:AGI 38959:AGI 44457:AGI 0 0 0 0 0 0 0 0 38770:RALL 38826:RALL 38858:RALL 38915:RALL
+ 38775:ARM 38790:ARM 38806:ARM 38825:ARM 38859:ARM 38914:ARM 39001:ARM 0 0 0 0 0 0 38784:RFI 38815:RFI 38891:RFI 38969:RFI
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38795:RSH 38942:RSH 38977:RSH
+ 0 0 38939 38894 38893 39000:DEF 38895 0 0 0 0 0 0 0 0 38941:RAR 38982:RAR
+ 44456 39003 38973 39004 38993 38978:DEF 0 0 0 0 0 0 0 0 0 38892:RNA 38956:RNA
+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 38950:RFR
]], nil, function(frame)
frame:SetAttribute("type", "macro")
frame:SetAttribute("macrotext", MakeMacro(frame.id, frame.name))
@@ -42,10 +41,10 @@ end)
Panda.PanelFactory(L["Enchant Shield"], SPELLID,
-[[38787 38805 38828 38861 38945 38983 0 38949
- 38791 0 38904 0 38820 38906 0 38954
- 38792 38816 38839 38860 0 38905 44455
- 38843 0 38907
+[[38787:STA 38805:STA 38828:STA 38861:STA 38945:STA 38983:STA 0 38949:RES
+ 38791:ARM 0 38904:BLKV 0 38820:BLKR 38906:BLKR 0 38954:DEF
+ 38792:SPI 38816:SPI 38839:SPI 38860:SPI 0 38905:INT 44455:INT
+ 38843:RFR 0 38907:RALL
]], nil, function(frame)
frame:SetAttribute("type", "macro")
frame:SetAttribute("macrotext", MakeMacro(frame.id, frame.name))
@@ -53,12 +52,12 @@ end)
Panda.PanelFactory(L["Enchant Weapon"], SPELLID,
-[[38779 38813 0 38814 0 38840
- 38780 38794 38821 38848 38870 38917 38957 0 0 0 0 0 38772 38796 38822 38845 38869
- 38880 38947 38947 38995 0 38879 38920 0 0 0 0 0 0 38896 38922 0 38919
- 38883 38963 0 38918 38884 38958 0 0 0 0 0 0 38788 38874 0 38781 38875
- 38878 38946 38994 0 38877 38921 38991 44467
- 38876 38838 38868 38872 38873 38871 0 38925 38927 38926 38924 38923 0 44453 44493 44497 38998
+[[38780:DAM 38794:DAM 38821:DAM 38848:DAM 38870:DAM 38917:DAM 38957:DAM 0 0 0 0 0 38772:DAM 38796:DAM 38822:DAM 38845:DAM 38869:DAM
+ 38880:AGI 38947:AGI 38995:AGI 0 38879:STR 38920:STR 0 44453:AP 0 0 0 0 0 38896:AGI 38922:AGI 0 38919:AP
+ 38883:SPI 38963:SPI 0 38918:INT 38884:INT 38958:INT 0 0 0 0 0 0 38788:SPI 38874:SPI 0 38781:INT 38875:INT
+ 38878:SP 38946:SP 38994:SP 0 38877:SP 38921:SP 38991:SP 44467:SP
+ 38876:WINTER 38838:FIERY 38868:FROST 38872:UNHOLY 38873:CRUSADER 38871:LIFESTEAL 0 38925:MONGOOSE 38927:LIFESTEAL 38926:MPR 38924:SP 38923:SP 0 44493:BERSERK 44497:HIT 38998:FROST
+ 38779:BEAST 38813:BEAST 0 38814:ELEM 0 38840:DEMON
]], nil, function(frame)
frame:SetAttribute("type", "macro")
frame:SetAttribute("macrotext", MakeMacro(frame.id, frame.name, true))
View
4 PanelFactory.lua
@@ -51,13 +51,13 @@ function Panda:PanelFiller()
lastrow = row
local gap, lastframe = 0
- for id in ids:gmatch("%d+") do
+ for id,extra in ids:gmatch("(%d+):?(%S*)") do
local craftable = not nocombine:match(id)
gap = gap + (lastframe and HGAP or 0)
id = tonumber(id)
if id == 0 then gap = gap + 32 + (not lastframe and HGAP or 0)
else
- lastframe = factory(self, id, (type(craftDetail) == "function" or craftable) and craftDetail, nil, "TOPLEFT", lastframe or row, lastframe and "TOPRIGHT" or "TOPLEFT", gap, 0)
+ lastframe = factory(self, id, (type(craftDetail) == "function" or craftable) and craftDetail, nil, extra, "TOPLEFT", lastframe or row, lastframe and "TOPRIGHT" or "TOPLEFT", gap, 0)
buttons[id] = lastframe
if func then func(id, lastframe) end
if not GetItemInfo(id) then uncached[lastframe] = true end

0 comments on commit 430a732

Please sign in to comment.
Something went wrong with that request. Please try again.