Advertisement
Cokedriver

FacePaint.lua

Apr 29th, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.27 KB | None | 0 0
  1. local cUI, CFG = unpack(select(2, ...)) -- Import: cUI - function; CFG - Config
  2.  
  3. if CFG['general'].facepaint.enable ~= true then return end
  4.  
  5. ------------------------------------------------------------
  6. -- FacePaint ~ paints the default interface (w/<3) ~ by Aprikot
  7. ------------------------------------------------------------
  8.  
  9. -- Load TimeManager (to color the clock button later)
  10. if not IsAddOnLoaded("Blizzard_TimeManager") then
  11. LoadAddOn("Blizzard_TimeManager")
  12. end
  13.  
  14. -- Objects to paint
  15. --------------------
  16. local objects = {
  17. -- Rune Bar
  18. RuneButtonIndividual1:GetRegions(),
  19. RuneButtonIndividual1Border:GetRegions(),
  20. RuneButtonIndividual2:GetRegions(),
  21. RuneButtonIndividual2Border:GetRegions(),
  22. RuneButtonIndividual3:GetRegions(),
  23. RuneButtonIndividual3Border:GetRegions(),
  24. RuneButtonIndividual4:GetRegions(),
  25. RuneButtonIndividual4Border:GetRegions(),
  26. RuneButtonIndividual5:GetRegions(),
  27. RuneButtonIndividual5Border:GetRegions(),
  28. RuneButtonIndividual6:GetRegions(),
  29. RuneButtonIndividual6Border:GetRegions(),
  30.  
  31. -- Unit frames
  32. PlayerFrameTexture,
  33. TargetFrameTextureFrameTexture,
  34. FocusFrameTextureFrameTexture,
  35. TargetFrameToTTextureFrameTexture,
  36. FocusFrameToTTextureFrameTexture,
  37. PetFrameTexture,
  38. select(2, PlayerFrameAlternateManaBar:GetRegions()),
  39.  
  40. -- Party Frame
  41. PartyMemberFrame1Texture,
  42. PartyMemberFrame2Texture,
  43. PartyMemberFrame3Texture,
  44. PartyMemberFrame4Texture,
  45.  
  46. -- Party Pet Frames
  47. PartyMemberFrame1PetFrameTexture,
  48. PartyMemberFrame2PetFrameTexture,
  49. PartyMemberFrame3PetFrameTexture,
  50. PartyMemberFrame4PetFrameTexture,
  51.  
  52. -- Raid Frame
  53. CompactRaidFrameContainerBorderFrameBorderBottom,
  54. CompactRaidFrameContainerBorderFrameBorderBottomLeft,
  55. CompactRaidFrameContainerBorderFrameBorderBottomRight,
  56. CompactRaidFrameContainerBorderFrameBorderLeft,
  57. CompactRaidFrameContainerBorderFrameBorderRight,
  58. CompactRaidFrameContainerBorderFrameBorderTop,
  59. CompactRaidFrameContainerBorderFrameBorderTopLeft,
  60. CompactRaidFrameContainerBorderFrameBorderTopRight,
  61.  
  62. -- Raid Frame Manager
  63. CompactRaidFrameManagerToggleButton:GetRegions(),
  64. CompactRaidFrameManagerBg,
  65. CompactRaidFrameManagerBorderBottom,
  66. CompactRaidFrameManagerBorderBottomLeft,
  67. CompactRaidFrameManagerBorderBottomRight,
  68. CompactRaidFrameManagerBorderRight,
  69. CompactRaidFrameManagerBorderTopLeft,
  70. CompactRaidFrameManagerBorderTopRight,
  71. CompactRaidFrameManagerBorderTop,
  72.  
  73. -- Minimap
  74. MinimapBackdrop,
  75. MinimapBorder,
  76. MiniMapMailBorder,
  77. MiniMapTrackingButtonBorder,
  78. MinimapBorderTop,
  79. MinimapZoneTextButton,
  80. MiniMapWorldMapButton,
  81. MiniMapWorldMapButton,
  82. MiniMapWorldIcon,
  83. MinimapZoomIn:GetRegions(),
  84. select(3, MinimapZoomIn:GetRegions()),
  85. MinimapZoomOut:GetRegions(),
  86. select(3, MinimapZoomOut:GetRegions()),
  87. TimeManagerClockButton:GetRegions(),
  88. MiniMapWorldMapButton:GetRegions(),
  89. select(6, GameTimeFrame:GetRegions()),
  90.  
  91. -- Action bars
  92. ReputationWatchBarTexture0,
  93. ReputationWatchBarTexture1,
  94. ReputationWatchBarTexture2,
  95. ReputationWatchBarTexture3,
  96. ReputationXPBarTexture0,
  97. ReputationXPBarTexture1,
  98. ReputationXPBarTexture2,
  99. ReputationXPBarTexture3,
  100. MainMenuBarTexture0,
  101. MainMenuBarTexture1,
  102. MainMenuBarTexture2,
  103. MainMenuBarTexture3,
  104. MainMenuMaxLevelBar0,
  105. MainMenuMaxLevelBar1,
  106. MainMenuMaxLevelBar2,
  107. MainMenuMaxLevelBar3,
  108. MainMenuXPBarTextureRightCap,
  109. MainMenuXPBarTextureMid,
  110. MainMenuXPBarTextureLeftCap,
  111. ActionBarUpButton:GetRegions(),
  112. ActionBarDownButton:GetRegions(),
  113. BonusActionBarFrame:GetRegions(),
  114. select(2, BonusActionBarFrame:GetRegions()),
  115.  
  116. -- Exp bubble dividers
  117. MainMenuXPBarDiv1,
  118. MainMenuXPBarDiv2,
  119. MainMenuXPBarDiv3,
  120. MainMenuXPBarDiv4,
  121. MainMenuXPBarDiv5,
  122. MainMenuXPBarDiv6,
  123. MainMenuXPBarDiv7,
  124. MainMenuXPBarDiv8,
  125. MainMenuXPBarDiv9,
  126. MainMenuXPBarDiv10,
  127. MainMenuXPBarDiv11,
  128. MainMenuXPBarDiv12,
  129. MainMenuXPBarDiv13,
  130. MainMenuXPBarDiv14,
  131. MainMenuXPBarDiv15,
  132. MainMenuXPBarDiv16,
  133. MainMenuXPBarDiv17,
  134. MainMenuXPBarDiv18,
  135. MainMenuXPBarDiv19,
  136.  
  137.  
  138. -- Chat frame buttons
  139. select(2, FriendsMicroButton:GetRegions()),
  140. ChatFrameMenuButton:GetRegions(),
  141. ChatFrame1ButtonFrameUpButton:GetRegions(),
  142. ChatFrame1ButtonFrameDownButton:GetRegions(),
  143. select(2, ChatFrame1ButtonFrameBottomButton:GetRegions()),
  144. ChatFrame2ButtonFrameUpButton:GetRegions(),
  145. ChatFrame2ButtonFrameDownButton:GetRegions(),
  146. select(2, ChatFrame2ButtonFrameBottomButton:GetRegions()),
  147.  
  148. -- Chat edit box
  149. select(6, ChatFrame1EditBox:GetRegions()),
  150. select(7, ChatFrame1EditBox:GetRegions()),
  151. select(8, ChatFrame1EditBox:GetRegions()),
  152. select(5, ChatFrame1EditBox:GetRegions()),
  153.  
  154. -- Micro menu buttons
  155. select(2, SpellbookMicroButton:GetRegions()),
  156. select(3, CharacterMicroButton:GetRegions()),
  157. select(2, TalentMicroButton:GetRegions()),
  158. select(2, AchievementMicroButton:GetRegions()),
  159. select(2, QuestLogMicroButton:GetRegions()),
  160. select(2, GuildMicroButton:GetRegions()),
  161. select(3, PVPMicroButton:GetRegions()),
  162. select(2, LFDMicroButton:GetRegions()),
  163. select(4, MainMenuMicroButton:GetRegions()),
  164. select(2, HelpMicroButton:GetRegions()),
  165.  
  166. -- Other
  167. CalendarFrameBorder,
  168. select(2, CastingBarFrame:GetRegions()),
  169. select(2, MirrorTimer1:GetRegions()),
  170. select(3,TargetFrameSpellBar:GetRegions()),
  171. select(3,FocusFrameSpellBar:GetRegions()),
  172. }
  173.  
  174.  
  175.  
  176. -- Paint function
  177. --------------
  178. local paint = function(object)
  179. object:SetDesaturated(1)
  180. if CFG['general'].facepaint.custom.gradient then
  181. object:SetGradientAlpha("VERTICAL", CFG['general'].facepaint.custom.bottomcolor.r, CFG['general'].facepaint.custom.bottomcolor.g, CFG['general'].facepaint.custom.bottomcolor.b, CFG['general'].facepaint.custom.bottomalpha, CFG['general'].facepaint.custom.topcolor.r, CFG['general'].facepaint.custom.topcolor.g, CFG['general'].facepaint.custom.topcolor.b, CFG['general'].facepaint.custom.topalpha)
  182. else
  183. if CFG['general'].classcolor then
  184. object:SetVertexColor((cUI.ccolor.r * 1.2), (cUI.ccolor.g * 1.2), (cUI.ccolor.b * 1.2))
  185. else
  186. object:SetVertexColor(CFG['general'].color.r, CFG['general'].color.g, CFG['general'].color.b)
  187. end
  188. end
  189. end
  190.  
  191. --[[for i = 0, 5 do
  192. for _, object in pairs({
  193.  
  194. -- Actionbars
  195. _G['MainMenuMaxLevelBar'..i],
  196. _G['MainMenuXPBar'..i],
  197. _G['ReputationWatchBarTexture'..i],
  198. _G['ReputationXPBarTexture'..i],
  199. _G['MainMenuBarTexture'..i],
  200.  
  201. -- Party Pet Frame
  202. _G['PartyMemberFrame'..i..'PetFrameTexture'],
  203. _G['PartyMemberFrame'..i..'Texture'],
  204. }) do
  205. if CFG['general'].facepaint.custom.gradient then
  206. object:SetGradientAlpha("VERTICAL", CFG['general'].facepaint.custom.bottomcolor.r, CFG['general'].facepaint.custom.bottomcolor.g, CFG['general'].facepaint.custom.bottomcolor.b, CFG['general'].facepaint.custom.bottomalpha, CFG['general'].facepaint.custom.topcolor.r, CFG['general'].facepaint.custom.topcolor.g, CFG['general'].facepaint.custom.topcolor.b, CFG['general'].facepaint.custom.topalpha)
  207. else
  208. if CFG['general'].classcolor then
  209. object:SetVertexColor((cUI.ccolor.r * 1.2), (cUI.ccolor.g * 1.2), (cUI.ccolor.b * 1.2))
  210. else
  211. object:SetVertexColor(CFG['general'].color.r, CFG['general'].color.g, CFG['general'].color.b)
  212. end
  213. end
  214. end
  215. end]]
  216.  
  217. -- Execute!
  218. ------------
  219. local exec = function()
  220. for i,v in pairs(objects) do
  221. if v:GetObjectType() == "Texture" then
  222. paint(v)
  223. end
  224. end
  225. end
  226. exec()
  227.  
  228. -- Miscellaneous
  229. -------------
  230. -- Calendar button text
  231. --select(5, GameTimeFrame:GetRegions()):SetVertexColor(1, 1, 1)
  232.  
  233. -- Desaturation fix for elite target texture (thanks SDPhantom!)
  234. hooksecurefunc("TargetFrame_CheckClassification", function(self)
  235. self.borderTexture:SetDesaturated(1);
  236. end);
  237.  
  238. -- Opposing horizontal gradients for the gryphons <3
  239. if CFG['general'].facepaint.custom.gradient then
  240. MainMenuBarLeftEndCap:SetGradientAlpha("HORIZONTAL", CFG['general'].facepaint.custom.bottomcolor.r, CFG['general'].facepaint.custom.bottomcolor.g, CFG['general'].facepaint.custom.bottomcolor.b, bottomalpha, CFG['general'].facepaint.custom.topcolor.r, CFG['general'].facepaint.custom.topcolor.g, CFG['general'].facepaint.custom.topcolor.b, topalpha)
  241. MainMenuBarRightEndCap:SetGradientAlpha("HORIZONTAL", CFG['general'].facepaint.custom.topcolor.r, CFG['general'].facepaint.custom.topcolor.g, CFG['general'].facepaint.custom.topcolor.b, topalpha, CFG['general'].facepaint.custom.bottomcolor.r, CFG['general'].facepaint.custom.bottomcolor.g, CFG['general'].facepaint.custom.bottomcolor.b, bottomalpha)
  242. else
  243. if CFG['general'].classcolor then
  244. MainMenuBarLeftEndCap:SetVertexColor((cUI.ccolor.r * 1.2), (cUI.ccolor.g * 1.2), (cUI.ccolor.b * 1.2))
  245. MainMenuBarRightEndCap:SetVertexColor((cUI.ccolor.r * 1.2), (cUI.ccolor.g * 1.2), (cUI.ccolor.b * 1.2))
  246. else
  247. MainMenuBarLeftEndCap:SetVertexColor(CFG['general'].color.r, CFG['general'].color.g, CFG['general'].color.b)
  248. MainMenuBarRightEndCap:SetVertexColor(CFG['general'].color.r, CFG['general'].color.g, CFG['general'].color.b)
  249. end
  250. end
  251.  
  252. -- Game tooltip
  253. --TOOLTIP_DEFAULT_COLOR = { r = CFG['general'].facepaint.custom.topcolor.r * 0.5, g = CFG['general'].facepaint.custom.topcolor.g * 0.5, b = CFG['general'].facepaint.custom.topcolor.b * 0.5 };
  254. --TOOLTIP_DEFAULT_BACKGROUND_COLOR = { r = CFG['general'].facepaint.custom.bottomcolor.r * 0.2, g = CFG['general'].facepaint.custom.bottomcolor.g * 0.2, b = CFG['general'].facepaint.custom.bottomcolor.b * 0.2};
  255.  
  256. -- ShardBar via SetVertexColor per SetGradientAlpha fail
  257. if CFG['general'].classcolor then
  258. select(5,ShardBarFrameShard1:GetRegions()):SetVertexColor((cUI.ccolor.r * 1.2), (cUI.ccolor.g * 1.2), (cUI.ccolor.b * 1.2))
  259. select(5,ShardBarFrameShard2:GetRegions()):SetVertexColor((cUI.ccolor.r * 1.2), (cUI.ccolor.g * 1.2), (cUI.ccolor.b * 1.2))
  260. select(5,ShardBarFrameShard3:GetRegions()):SetVertexColor((cUI.ccolor.r * 1.2), (cUI.ccolor.g * 1.2), (cUI.ccolor.b * 1.2))
  261. else
  262. select(5,ShardBarFrameShard1:GetRegions()):SetVertexColor(CFG['general'].color.r, CFG['general'].color.g, CFG['general'].color.b)
  263. select(5,ShardBarFrameShard2:GetRegions()):SetVertexColor(CFG['general'].color.r, CFG['general'].color.g, CFG['general'].color.b)
  264. select(5,ShardBarFrameShard3:GetRegions()):SetVertexColor(CFG['general'].color.r, CFG['general'].color.g, CFG['general'].color.b)
  265. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement