Advertisement
Wetxius

Untitled

Feb 20th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.33 KB | None | 0 0
  1. local T, C, L, _ = unpack(select(2, ...))
  2.  
  3. ----------------------------------------------------------------------------------------
  4. -- Move ObjectiveTrackerFrame
  5. ----------------------------------------------------------------------------------------
  6. local frame = CreateFrame("Frame", "WatchFrameAnchor", UIParent)
  7. frame:SetPoint(unpack(C.position.quest))
  8. frame:SetHeight(150)
  9. frame:SetWidth(224)
  10.  
  11. ObjectiveTrackerFrame:ClearAllPoints()
  12. ObjectiveTrackerFrame:SetPoint("TOPLEFT", frame, "TOPLEFT", 20, 0)
  13. ObjectiveTrackerFrame:SetHeight(T.getscreenheight / 1.6)
  14.  
  15. hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", function(_, _, parent)
  16. if parent ~= frame then
  17. ObjectiveTrackerFrame:ClearAllPoints()
  18. ObjectiveTrackerFrame:SetPoint("TOPLEFT", frame, "TOPLEFT", 20, 0)
  19. end
  20. end)
  21. ObjectiveTrackerFrame.HeaderMenu.Title:SetAlpha(0)
  22.  
  23. for _, headerName in pairs({"QuestHeader", "AchievementHeader", "ScenarioHeader"}) do
  24. ObjectiveTrackerFrame.BlocksFrame[headerName].Background:Hide()
  25. end
  26.  
  27. BONUS_OBJECTIVE_TRACKER_MODULE.Header.Background:Hide()
  28. ScenarioObjectiveTracker_AnimateReward = T.dummy
  29. OBJECTIVE_TRACKER_DOUBLE_LINE_HEIGHT = 30
  30.  
  31. ----------------------------------------------------------------------------------------
  32. -- Skin ObjectiveTrackerFrame item buttons
  33. ----------------------------------------------------------------------------------------
  34. hooksecurefunc(QUEST_TRACKER_MODULE, "SetBlockHeader", function(_, block)
  35. local item = block.itemButton
  36.  
  37. if item and not item.skinned then
  38. item:SetSize(C.actionbar.button_size, C.actionbar.button_size)
  39. item:SetTemplate("Default")
  40. item:StyleButton()
  41.  
  42. item:SetNormalTexture(nil)
  43.  
  44. item.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
  45. item.icon:SetPoint("TOPLEFT", item, 2, -2)
  46. item.icon:SetPoint("BOTTOMRIGHT", item, -2, 2)
  47.  
  48. item.Cooldown:SetAllPoints(item.icon)
  49.  
  50. item.HotKey:ClearAllPoints()
  51. item.HotKey:SetPoint("BOTTOMRIGHT", 0, 2)
  52. item.HotKey:SetFont(C.font.action_bars_font, C.font.action_bars_font_size, C.font.action_bars_font_style)
  53. item.HotKey:SetShadowOffset(C.font.action_bars_font_shadow and 1 or 0, C.font.action_bars_font_shadow and -1 or 0)
  54.  
  55. item.Count:ClearAllPoints()
  56. item.Count:SetPoint("TOPLEFT", 1, -1)
  57. item.Count:SetFont(C.font.action_bars_font, C.font.action_bars_font_size, C.font.action_bars_font_style)
  58. item.Count:SetShadowOffset(C.font.action_bars_font_shadow and 1 or 0, C.font.action_bars_font_shadow and -1 or 0)
  59.  
  60. item.skinned = true
  61. end
  62. end)
  63.  
  64. ----------------------------------------------------------------------------------------
  65. -- Difficulty color for ObjectiveTrackerFrame lines
  66. ----------------------------------------------------------------------------------------
  67. hooksecurefunc(QUEST_TRACKER_MODULE, "Update", function()
  68. for i = 1, GetNumQuestWatches() do
  69. local questID, _, questIndex = GetQuestWatchInfo(i)
  70. if not questID then
  71. break
  72. end
  73. local _, level = GetQuestLogTitle(questIndex)
  74. local col = GetQuestDifficultyColor(level)
  75. local block = QUEST_TRACKER_MODULE:GetExistingBlock(questID)
  76. block.HeaderText:SetTextColor(col.r, col.g, col.b)
  77. block.HeaderText.col = col
  78. end
  79. end)
  80.  
  81. hooksecurefunc("ObjectiveTrackerBlockHeader_OnLeave", function(self)
  82. local block = self:GetParent()
  83. if block.HeaderText.col then
  84. block.HeaderText:SetTextColor(block.HeaderText.col.r, block.HeaderText.col.g, block.HeaderText.col.b)
  85. end
  86. end)
  87.  
  88. ----------------------------------------------------------------------------------------
  89. -- Skin ObjectiveTrackerFrame.HeaderMenu.MinimizeButton
  90. ----------------------------------------------------------------------------------------
  91. if C.skins.blizzard_frames == true then
  92. local button = ObjectiveTrackerFrame.HeaderMenu.MinimizeButton
  93. button:SetSize(17, 17)
  94. button:StripTextures()
  95. button:SetTemplate("Overlay")
  96.  
  97. button.minus = button:CreateTexture(nil, "OVERLAY")
  98. button.minus:SetSize(5, 1)
  99. button.minus:SetPoint("CENTER")
  100. button.minus:SetTexture(C.media.blank)
  101.  
  102. button.plus = button:CreateTexture(nil, "OVERLAY")
  103. button.plus:SetSize(1, 5)
  104. button.plus:SetPoint("CENTER")
  105. button.plus:SetTexture(C.media.blank)
  106.  
  107. button:HookScript("OnEnter", T.SetModifiedBackdrop)
  108. button:HookScript("OnLeave", T.SetOriginalBackdrop)
  109.  
  110. button.plus:Hide()
  111. hooksecurefunc("ObjectiveTracker_Collapse", function()
  112. button.plus:Show()
  113. end)
  114.  
  115. hooksecurefunc("ObjectiveTracker_Expand", function()
  116. button.plus:Hide()
  117. end)
  118. end
  119.  
  120. -- local frame1 = CreateFrame("Frame")
  121. -- frame1:RegisterEvent("PLAYER_ENTERING_WORLD")
  122. -- frame1:SetScript("OnEvent", function(self, event)
  123. -- ObjectiveTracker_Collapse()
  124. -- end)
  125.  
  126. local function CreateVirtualFrame(frame, point)
  127. if point == nil then point = frame end
  128. if point.backdrop then return end
  129.  
  130. frame.backdrop = frame:CreateTexture(nil, "BACKGROUND")
  131. frame.backdrop:SetDrawLayer("BACKGROUND", -8)
  132. frame.backdrop:SetPoint("TOPLEFT", point, "TOPLEFT", -3, 3)
  133. frame.backdrop:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", 3, -3)
  134. frame.backdrop:SetTexture(unpack(C.media.backdrop_color))
  135.  
  136. frame.bordertop = frame:CreateTexture(nil, "BACKGROUND")
  137. frame.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -2, 2)
  138. frame.bordertop:SetPoint("TOPRIGHT", point, "TOPRIGHT", 2, 2)
  139. frame.bordertop:SetHeight(1)
  140. frame.bordertop:SetTexture(unpack(C.media.border_color))
  141. frame.bordertop:SetDrawLayer("BACKGROUND", -7)
  142.  
  143. frame.borderbottom = frame:CreateTexture(nil, "BACKGROUND")
  144. frame.borderbottom:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", -2, -2)
  145. frame.borderbottom:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", 2, -2)
  146. frame.borderbottom:SetHeight(1)
  147. frame.borderbottom:SetTexture(unpack(C.media.border_color))
  148. frame.borderbottom:SetDrawLayer("BACKGROUND", -7)
  149.  
  150. frame.borderleft = frame:CreateTexture(nil, "BACKGROUND")
  151. frame.borderleft:SetPoint("TOPLEFT", point, "TOPLEFT", -2, 2)
  152. frame.borderleft:SetPoint("BOTTOMLEFT", point, "BOTTOMLEFT", 2, -2)
  153. frame.borderleft:SetWidth(1)
  154. frame.borderleft:SetTexture(unpack(C.media.border_color))
  155. frame.borderleft:SetDrawLayer("BACKGROUND", -7)
  156.  
  157. frame.borderright = frame:CreateTexture(nil, "BACKGROUND")
  158. frame.borderright:SetPoint("TOPRIGHT", point, "TOPRIGHT", 2, 2)
  159. frame.borderright:SetPoint("BOTTOMRIGHT", point, "BOTTOMRIGHT", -2, -2)
  160. frame.borderright:SetWidth(1)
  161. frame.borderright:SetTexture(unpack(C.media.border_color))
  162. frame.borderright:SetDrawLayer("BACKGROUND", -7)
  163. end
  164.  
  165. ----------------------------------------------------------------------------------------
  166. -- Skin bonus objective progress bar
  167. ----------------------------------------------------------------------------------------
  168. hooksecurefunc(BONUS_OBJECTIVE_TRACKER_MODULE, "AddProgressBar", function(self, block, line)
  169. local progressBar = line.ProgressBar
  170. local bar = progressBar.Bar
  171. local icon = bar.Icon
  172.  
  173. if not progressBar.styled then
  174. local label = bar.Label
  175.  
  176. bar.BarFrame:Hide()
  177. bar.BarGlow:Kill()
  178. bar.IconBG:Kill()
  179. bar:SetSize(200, 20)
  180. bar:SetStatusBarTexture(C.media.texture)
  181. CreateVirtualFrame(bar)
  182.  
  183. label:ClearAllPoints()
  184. label:SetPoint("CENTER", 0, -1)
  185. label:SetFont(C.media.pixel_font, C.media.pixel_font_size, C.media.pixel_font_style)
  186.  
  187. icon:SetPoint("RIGHT", 27, 0)
  188. icon:SetSize(20, 20)
  189.  
  190. BonusObjectiveTrackerProgressBar_PlayFlareAnim = T.dummy
  191. progressBar.styled = true
  192. end
  193.  
  194. if icon:IsShown() then
  195. CreateVirtualFrame(bar, icon)
  196. end
  197. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement