/Tukui/modules/skins/others.lua

http://github.com/Asphyxia/Tukui · Lua · 200 lines · 197 code · 2 blank · 1 comment · 1 complexity · 2dc0848f32366e269b07c9604b4a6364 MD5 · raw file

  1. local T, C, L = unpack(select(2, ...))
  2. local function LoadSkin()
  3. -- Others Blizzard frame we want to reskin
  4. local skins = {
  5. "StaticPopup1",
  6. "StaticPopup2",
  7. "StaticPopup3",
  8. "StaticPopup4",
  9. "GameMenuFrame",
  10. "InterfaceOptionsFrame",
  11. "VideoOptionsFrame",
  12. "AudioOptionsFrame",
  13. "LFDDungeonReadyStatus",
  14. "BNToastFrame",
  15. "TicketStatusFrameButton",
  16. "LFDSearchStatus",
  17. "AutoCompleteBox",
  18. "ConsolidatedBuffsTooltip",
  19. "ReadyCheckFrame",
  20. "StackSplitFrame",
  21. "CharacterFrame",
  22. }
  23. for i = 1, getn(skins) do
  24. _G[skins[i]]:SetTemplate("Transparent")
  25. if _G[skins[i]] ~= _G["AutoCompleteBox"] then -- frame to blacklist from create shadow function
  26. _G[skins[i]]:CreateShadow("Transparent")
  27. end
  28. end
  29. -- Skin all DropDownList[i]
  30. local function SkinDropDownList(level, index)
  31. for i = 1, UIDROPDOWNMENU_MAXLEVELS do
  32. local menubackdrop = _G["DropDownList"..i.."MenuBackdrop"]
  33. local backdrop = _G["DropDownList"..i.."Backdrop"]
  34. if not backdrop.isSkinned then
  35. menubackdrop:SetTemplate("Transparent")
  36. backdrop:SetTemplate("Transparent")
  37. backdrop.isSkinned = true
  38. end
  39. end
  40. end
  41. hooksecurefunc("UIDropDownMenu_CreateFrames", SkinDropDownList)
  42. local ChatMenus = {
  43. "ChatMenu",
  44. "EmoteMenu",
  45. "LanguageMenu",
  46. "VoiceMacroMenu",
  47. }
  48. --
  49. for i = 1, getn(ChatMenus) do
  50. if _G[ChatMenus[i]] == _G["ChatMenu"] then
  51. _G[ChatMenus[i]]:HookScript("OnShow", function(self) self:SetTemplate("Transparent", true) self:SetBackdropColor(unpack(C["media"].backdropcolor)) self:ClearAllPoints() self:SetPoint("BOTTOMLEFT", ChatFrame1, "TOPLEFT", 0, T.Scale(30)) end)
  52. else
  53. _G[ChatMenus[i]]:HookScript("OnShow", function(self) self:SetTemplate("Transparent", true) self:SetBackdropColor(unpack(C["media"].backdropcolor)) end)
  54. end
  55. end
  56. --LFD Role Picker frame
  57. LFDRoleCheckPopup:StripTextures()
  58. LFDRoleCheckPopup:SetTemplate("Transparent")
  59. T.SkinButton(LFDRoleCheckPopupAcceptButton)
  60. T.SkinButton(LFDRoleCheckPopupDeclineButton)
  61. T.SkinCheckBox(LFDRoleCheckPopupRoleButtonTank:GetChildren())
  62. T.SkinCheckBox(LFDRoleCheckPopupRoleButtonDPS:GetChildren())
  63. T.SkinCheckBox(LFDRoleCheckPopupRoleButtonHealer:GetChildren())
  64. LFDRoleCheckPopupRoleButtonTank:GetChildren():SetFrameLevel(LFDRoleCheckPopupRoleButtonTank:GetChildren():GetFrameLevel() + 1)
  65. LFDRoleCheckPopupRoleButtonDPS:GetChildren():SetFrameLevel(LFDRoleCheckPopupRoleButtonDPS:GetChildren():GetFrameLevel() + 1)
  66. LFDRoleCheckPopupRoleButtonHealer:GetChildren():SetFrameLevel(LFDRoleCheckPopupRoleButtonHealer:GetChildren():GetFrameLevel() + 1)
  67. -- reskin popup buttons
  68. for i = 1, 4 do
  69. for j = 1, 3 do
  70. T.SkinButton(_G["StaticPopup"..i.."Button"..j])
  71. T.SkinEditBox(_G["StaticPopup"..i.."EditBox"])
  72. T.SkinEditBox(_G["StaticPopup"..i.."MoneyInputFrameGold"])
  73. T.SkinEditBox(_G["StaticPopup"..i.."MoneyInputFrameSilver"])
  74. T.SkinEditBox(_G["StaticPopup"..i.."MoneyInputFrameCopper"])
  75. _G["StaticPopup"..i.."EditBox"].backdrop:Point("TOPLEFT", -2, -4)
  76. _G["StaticPopup"..i.."EditBox"].backdrop:Point("BOTTOMRIGHT", 2, 4)
  77. _G["StaticPopup"..i.."ItemFrameNameFrame"]:Kill()
  78. _G["StaticPopup"..i.."ItemFrame"]:GetNormalTexture():Kill()
  79. _G["StaticPopup"..i.."ItemFrame"]:SetTemplate("Transparent")
  80. _G["StaticPopup"..i.."ItemFrame"]:StyleButton()
  81. _G["StaticPopup"..i.."ItemFrameIconTexture"]:SetTexCoord(.08, .92, .08, .92)
  82. _G["StaticPopup"..i.."ItemFrameIconTexture"]:ClearAllPoints()
  83. _G["StaticPopup"..i.."ItemFrameIconTexture"]:Point("TOPLEFT", 2, -2)
  84. _G["StaticPopup"..i.."ItemFrameIconTexture"]:Point("BOTTOMRIGHT", -2, 2)
  85. end
  86. end
  87. -- reskin all esc/menu buttons
  88. local BlizzardMenuButtons = {
  89. "Options",
  90. "SoundOptions",
  91. "UIOptions",
  92. "Keybindings",
  93. "Macros",
  94. "Ratings",
  95. "AddOns",
  96. "Logout",
  97. "Quit",
  98. "Continue",
  99. "MacOptions",
  100. "Help"
  101. }
  102. for i = 1, getn(BlizzardMenuButtons) do
  103. local ElvuiMenuButtons = _G["GameMenuButton"..BlizzardMenuButtons[i]]
  104. if ElvuiMenuButtons then
  105. T.SkinButton(ElvuiMenuButtons)
  106. end
  107. end
  108. if IsAddOnLoaded("OptionHouse") then
  109. T.SkinButton(GameMenuButtonOptionHouse)
  110. end
  111. -- hide header textures and move text/buttons.
  112. local BlizzardHeader = {
  113. "GameMenuFrame",
  114. "InterfaceOptionsFrame",
  115. "AudioOptionsFrame",
  116. "VideoOptionsFrame",
  117. }
  118. for i = 1, getn(BlizzardHeader) do
  119. local title = _G[BlizzardHeader[i].."Header"]
  120. if title then
  121. title:SetTexture("")
  122. title:ClearAllPoints()
  123. if title == _G["GameMenuFrameHeader"] then
  124. title:SetPoint("TOP", GameMenuFrame, 0, 7)
  125. else
  126. title:SetPoint("TOP", BlizzardHeader[i], 0, 0)
  127. end
  128. end
  129. end
  130. -- here we reskin all "normal" buttons
  131. local BlizzardButtons = {
  132. "VideoOptionsFrameOkay",
  133. "VideoOptionsFrameCancel",
  134. "VideoOptionsFrameDefaults",
  135. "VideoOptionsFrameApply",
  136. "AudioOptionsFrameOkay",
  137. "AudioOptionsFrameCancel",
  138. "AudioOptionsFrameDefaults",
  139. "InterfaceOptionsFrameDefaults",
  140. "InterfaceOptionsFrameOkay",
  141. "InterfaceOptionsFrameCancel",
  142. "ReadyCheckFrameYesButton",
  143. "ReadyCheckFrameNoButton",
  144. "StackSplitOkayButton",
  145. "StackSplitCancelButton",
  146. "RolePollPopupAcceptButton"
  147. }
  148. for i = 1, getn(BlizzardButtons) do
  149. local ElvuiButtons = _G[BlizzardButtons[i]]
  150. if ElvuiButtons then
  151. T.SkinButton(ElvuiButtons)
  152. end
  153. end
  154. -- if a button position is not really where we want, we move it here
  155. _G["VideoOptionsFrameCancel"]:ClearAllPoints()
  156. _G["VideoOptionsFrameCancel"]:SetPoint("RIGHT",_G["VideoOptionsFrameApply"],"LEFT",-4,0)
  157. _G["VideoOptionsFrameOkay"]:ClearAllPoints()
  158. _G["VideoOptionsFrameOkay"]:SetPoint("RIGHT",_G["VideoOptionsFrameCancel"],"LEFT",-4,0)
  159. _G["AudioOptionsFrameOkay"]:ClearAllPoints()
  160. _G["AudioOptionsFrameOkay"]:SetPoint("RIGHT",_G["AudioOptionsFrameCancel"],"LEFT",-4,0)
  161. _G["InterfaceOptionsFrameOkay"]:ClearAllPoints()
  162. _G["InterfaceOptionsFrameOkay"]:SetPoint("RIGHT",_G["InterfaceOptionsFrameCancel"],"LEFT", -4,0)
  163. _G["ReadyCheckFrameYesButton"]:SetParent(_G["ReadyCheckFrame"])
  164. _G["ReadyCheckFrameNoButton"]:SetParent(_G["ReadyCheckFrame"])
  165. _G["ReadyCheckFrameYesButton"]:ClearAllPoints()
  166. _G["ReadyCheckFrameNoButton"]:ClearAllPoints()
  167. _G["ReadyCheckFrameYesButton"]:SetPoint("RIGHT", _G["ReadyCheckFrame"], "CENTER", -2, -20)
  168. _G["ReadyCheckFrameNoButton"]:SetPoint("LEFT", _G["ReadyCheckFrameYesButton"], "RIGHT", 3, 0)
  169. _G["ReadyCheckFrameText"]:SetParent(_G["ReadyCheckFrame"])
  170. _G["ReadyCheckFrameText"]:ClearAllPoints()
  171. _G["ReadyCheckFrameText"]:SetPoint("TOP", 0, -12)
  172. -- others
  173. _G["ReadyCheckListenerFrame"]:SetAlpha(0)
  174. _G["ReadyCheckFrame"]:HookScript("OnShow", function(self) if UnitIsUnit("player", self.initiator) then self:Hide() end end) -- bug fix, don't show it if initiator
  175. _G["StackSplitFrame"]:GetRegions():Hide()
  176. RolePollPopup:SetTemplate("Transparent")
  177. RolePollPopup:CreateShadow("Transparent")
  178. LFDDungeonReadyDialog:SetTemplate("Transparent")
  179. LFDDungeonReadyDialog:CreateShadow("Transparent")
  180. T.SkinButton(LFDDungeonReadyDialogEnterDungeonButton)
  181. T.SkinButton(LFDDungeonReadyDialogLeaveQueueButton)
  182. end
  183. tinsert(T.SkinFuncs["Tukui"], LoadSkin)