Advertisement
fr0z3night

zDEAD WoW Addon Edit - WQTips - Copy&Paste [ENDED]

Mar 29th, 2018
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 125.38 KB | None | 0 0
  1. local addonName
  2. WorldQuestTips = CreateFrame("Frame"), {};
  3.  
  4. local version = 1.25
  5. local versionSuffix = ""
  6.  
  7. local playerName = UnitName("player")
  8. local profileKey = playerName.."-"..GetRealmName()
  9. local gender = UnitSex("player");
  10. local level = UnitLevel("player")
  11. local _,playerClass = UnitClass("player")
  12.  
  13. local locale = GetLocale()
  14. local L = { -- Default english
  15. TITLE = "World Quest Tips & Timers",
  16. AVERAGE = "Average",
  17. COMPLETED_IN = "completed in",
  18. PER_MINUTE = "per minute",
  19. WAYPOINT_PATH = "Path to",
  20. WAYPOINT_CAVE = "Cave entrance to",
  21. WAYPOINT_STAIRS = "Stairs to",
  22. WAYPOINT_BUILDING = "Building entrance to",
  23. WAYPOINT_PORTAL = "Portal to",
  24. OPTIONS_Q_INFO = "Quest Information",
  25. OPTIONS_Q_ID = "Quest ID",
  26. OPTIONS_Q_NOTE = "Set note for this quest",
  27. OPTIONS_Q_NOTE_TIP = "Alt-Click on a world quest or enter an ID",
  28. OPTIONS_Q_TT = "Total time spent, in Seconds",
  29. OPTIONS_Q_TC = "Number of times completed",
  30. OPTIONS_P_FOOTER = "You can ignore up to 3 tamers for each achievement",
  31. OPTIONS_G_REP_EX = "Continue to show faction after reaching exalted",
  32. OPTIONS_G_REP_CUR = "Show current reputation beside faction names",
  33. OPTIONS_G_TIMES = "Show current and/or average times",
  34. OPTIONS_G_OPEN_INFO = "Alt-Click on World Quest to open information",
  35. }
  36. local wowhead = "www.wowhead.com/quest="
  37. if locale ~= "enUS" then wowhead = locale:sub(1,2) .. ".wowhead.com/quest=" end
  38.  
  39. local debugging
  40.  
  41. local brokenIsleZones = {1015,1021,1014,1096,1024,1017,1033,1018} -- 1007 is the broken isles map
  42.  
  43. local leyraceWP = {
  44. [1018] = { -- Val'Sharah
  45. questID = 43753,
  46. waypoints = {
  47. { 58.2, 88.8 },{ 58.2, 88.8 },{ 57.7, 87.0 },{ 57.2, 85.5 },{ 56.8, 83.4 },{ 56.4, 81.5 },{ 56.7, 79.5 },{ 57.2, 78.5 },{ 57.7, 76.2 },{ 56.8, 71.0 },
  48. { 56.2, 69.5 },{ 56.5, 67.3 },{ 57.3, 64.6 },{ 56.8, 62.5 },{ 56.1, 61.6 },{ 55.9, 59.8 },{ 56.0, 57.7 },{ 55.0, 53.7 },{ 54.7, 51.5 },{ 53.3, 50.3 }
  49. }
  50. },
  51. [1024] = { -- Highmountain
  52. questID = 43764,
  53. waypoints = {
  54. { 31.80, 59.99 },{ 30.77, 59.28 },{ 30.15, 58.23 },{ 29.23, 57.12 },{ 27.39, 57.79 },{ 27.16, 56.87 },{ 28.68, 55.26 },{ 30.35, 50.34 },{ 30.64, 47.55 },{ 31.03, 43.96 },
  55. { 31.58, 41.67 },{ 30.46, 40.42 },{ 31.03, 37.55 },{ 30.96, 35.26 },{ 29.50, 33.59 },{ 29.08, 34.52 },{ 28.41, 35.18 },{ 28.69, 36.39 },{ 28.32, 37.49 }
  56. }
  57. },
  58. [1015] = { -- Azsuna
  59. questID = 43325,
  60. waypoints = {
  61. { 63.6, 28.0 },{ 64.9, 25.9 },{ 64.7, 25.4 },{ 64.0, 25.6 },{ 62.4, 24.4 },{ 60.7, 21.2 },{ 58.8, 19.3 },{ 55.6, 17.0 },{ 52.6, 16.9 },{ 50.5, 15.4 },
  62. { 48.4, 14.3 },{ 47.4, 11.4 },{ 45.5, 10.3 },{ 44.1, 9.2 },{ 42.5, 9.8 },{ 41.3, 12.2 },{ 39.5, 13.0 },{ 38.7, 15.7 },{ 37.1, 16.6 },{ 36.0, 19.1 }
  63. }
  64. },
  65. [1033] = { -- Suramar
  66. questID = 43774,
  67. waypoints = {
  68. { 31.5, 45.4 },{ 31.0, 44.0 },{ 31.2, 40.9 },{ 32.0, 37.6 },{ 30.3, 37.4 },{ 32.4, 39.8 },{ 34.7, 42.6 },{ 36.3, 44.9 },{ 39.5, 44.6 },{ 41.9, 43.3 },
  69. { 44.2, 43.2 },{ 46.3, 42.4 },{ 46.3, 40.3 },{ 45.6, 36.4 },{ 45.2, 33.4 },{ 44.8, 32.7 },{ 44.7, 31.2 },{ 45.5, 30.0 },{ 45.4, 28.3 },{ 42.7, 25.0 }
  70. }
  71. },
  72. [1017] = { -- Stormheim
  73. questID = 43769,
  74. waypoints = {
  75. { 35.8, 69.1 },{ 36.9, 67.0 },{ 39.8, 63.0 },{ 42.9, 59.1 },{ 44.9, 56.4 },{ 44.9, 49.9 },{ 44.3, 48.0 },{ 44.0, 44.9 },{ 42.5, 42.8 },{ 41.5, 42.0 },
  76. { 41.1, 40.6 },{ 41.4, 39.2 },{ 41.3, 36.1 },{ 40.2, 34.5 },{ 38.8, 33.5 },{ 38.1, 32.9 },{ 36.1, 30.7 },{ 33.4, 31.9 },{ 33.7, 33.8 },{ 33.4, 35.0 }
  77. }
  78. }
  79. }
  80.  
  81. -- -- -- -- -- -- -- -- -- -- -- -- --
  82. -- My original edits below were --
  83. -- New Enigmatic World Quest Added --
  84. -- New Puzzle Was Added --
  85. -- -- -- -- -- -- -- fr0z3night -- --
  86.  
  87. local enigmaticActive = false
  88. local enigmaticAttempting = false
  89. local enigmaticQuests = { [43767] = true, [43772] = true, [43328] = true, [43778] = true, [43756] = true }
  90. local enigmaticPaths = {
  91. { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0 },
  92. { 0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0 },
  93. { 0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0 },
  94. { 0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0 },
  95. { 0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0 },
  96. { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0 },
  97. { 0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0 },
  98. { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0 },
  99. { 0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0 },
  100. { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,0,1,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0 },
  101. { 0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,0,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 },
  102. { 0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 },
  103. { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 },
  104. { 0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0 },
  105. { 0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,1,1,1,0,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0 }
  106. }
  107.  
  108. -- -- -- -- -- -- --
  109. -- END OF EDITS --
  110. -- -- fr0z3night --
  111.  
  112.  
  113. --[[-- "WorldQuestWayPoints" - If user has TomTom, use these waypoints as exceptions to the the default PoI --]]--
  114. local wqwp = { -- "add" => add quest title to str; "rop" => RemoveOnPickup (removes waypoint on quest autoaccept)
  115. --[[
  116. To Do:
  117. -- investigate WANTED: Fathnyr
  118.  
  119. [43959] = { [1] = { x = 50, y = 50 } }, -- test with available quest
  120. [] = { [1] = { x = , y = , str = "" } }, -- --unverified accuracy
  121. --]]
  122.  
  123. -- "DANGER:" quests:
  124. [44190] = { [1] = { x = 41.65, y = 73.45, str = L.WAYPOINT_PATH, add = true } }, -- DANGER: Jade Darkhaven --unverified accuracy
  125. [42964] = { [1] = { x = 60.9, y = 71.8, str = L.WAYPOINT_PATH, add = true } }, -- DANGER: Lagertha --unverified accuracy
  126. [44114] = { [1] = { x = 46.49, y = 76.22, str = L.WAYPOINT_STAIRS, add = true } }, -- DANGER: Magistrix Vilessa --unverified accuracy
  127. [41703] = { [1] = { x = 52.27, y = 58.16, str = L.WAYPOINT_CAVE, add = true } }, -- DANGER: Ormagrogg --unverified accuracy
  128. [41816] = { [1] = { x = 48.2, y = 68.3, str = L.WAYPOINT_PATH, add = true } }, -- DANGER: Oubdob da Smasher --unverified accuracy
  129. [42963] = { [1] = { x = 84, y = 9, str = L.WAYPOINT_CAVE, add = true } }, -- DANGER: Rulf Bonesnapper --unverified accuracy
  130. [44193] = { [1] = { x = 40.5, y = 85.9, str = L.WAYPOINT_CAVE, add = true } }, -- DANGER: Sea King Tidross --unverified accuracy
  131. [44122] = { [1] = { x = 29.0, y = 84.3, str = L.WAYPOINT_CAVE, add = true } }, -- DANGER: Sorallus --unverified accuracy
  132. [42953] = { [1] = { x = 84.0, y = 9.5, str = L.WAYPOINT_CAVE, add = true } }, -- DANGER: Soulbinder Halldora --unverified accuracy
  133. [43101] = { [1] = { x = 23.90, y = 68.22, str = L.WAYPOINT_CAVE, add = true } }, -- DANGER: Withdoctor Grgl-Brgl --unverified accuracy
  134.  
  135. -- "WANTED:" quests, most have rare and normal versions:
  136. [42636] = { [1] = { x = 41.1, y = 35.3, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Arcanist Shal'iman --unverified accuracy
  137. [43605] = { [1] = { x = 41.1, y = 35.3, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Arcanist Shal'iman
  138. [41824] = { [1] = { x = 48.67, y = 49.96, str = L.WAYPOINT_CAVE, add = true }, -- WANTED: Arru --unverified accuracy
  139. [2] = { x = 46.29, y = 49.60, str = L.WAYPOINT_PATH, add = true, rop = true },
  140. [3] = { x = 47.9, y = 53.0, str = L.WAYPOINT_PATH, add = true, rop = true } },
  141. [44289] = { [1] = { x = 48.67, y = 49.96, str = L.WAYPOINT_CAVE, add = true }, -- WANTED: Arru
  142. [2] = { x = 46.29, y = 49.60, str = L.WAYPOINT_PATH, add = true, rop = true },
  143. [3] = { x = 47.9, y = 53.0, str = L.WAYPOINT_PATH, add = true, rop = true } },
  144. [43426] = { [1] = { x = 58.9, y = 50.0, str = L.WAYPOINT_PATH, add = true, rop = true }, -- WANTED: Brogozog --unverified accuracy
  145. [2] = { x = 59.2, y = 46.4 } },
  146. [43607] = { [1] = { x = 58.9, y = 50.0, str = L.WAYPOINT_PATH, add = true, rop = true }, -- WANTED: Brogozog
  147. [2] = { x = 59.2, y = 46.4 } },
  148. [43430] = { [1] = { x = 51.6, y = 44.6, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Captain Volo'ren --unverified accuracy
  149. [43608] = { [1] = { x = 51.6, y = 44.6, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Captain Volo'ren
  150. [41826] = { [1] = { x = 49.57, y = 39.74, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Crawshuk the Hungry --unverified accuracy
  151. [41826] = { [1] = { x = 49.57, y = 39.74, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Crawshuk the Hungry
  152. [43455] = { [1] = { x = 55.25, y = 44.41, str = L.WAYPOINT_CAVE, add = true, rop = true }, -- WANTED: Devouring Darkness --confirmed
  153. [2] = { x = 54.47, y = 41.37, add = true } },
  154. [43617] = { [1] = { x = 55.25, y = 44.41, str = L.WAYPOINT_CAVE, add = true, rop = true }, -- WANTED: Devouring Darkness --confirmed
  155. [2] = { x = 54.47, y = 41.37, add = true } },
  156. [43428] = { [1] = { x = 46.7, y = 28.2, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Doomlord Kazrok --unverified accuracy
  157. [43609] = { [1] = { x = 46.7, y = 28.2, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Doomlord Kazrok
  158. [43620] = { [1] = { x = 41.4, y = 31.9, str = L.WAYPOINT_CAVE, add = true } }, -- WANTED: Egyl the Enduring --unverified accuracy
  159. [43454] = { [1] = { x = 41.4, y = 31.9, str = L.WAYPOINT_CAVE, add = true } }, -- WANTED: Egyl the Enduring
  160. [42631] = { [1] = { x = 26.82, y = 49.06, str = L.WAYPOINT_PORTAL, add = true } }, -- WANTED: Inquisitor Tivos --confirmed
  161. [43611] = { [1] = { x = 26.82, y = 49.06, str = L.WAYPOINT_PORTAL, add = true } }, -- WANTED: Inquisitor Tivos
  162. [43612] = { [1] = { x = 50.20, y = 07.80, str = L.WAYPOINT_CAVE, add = true } }, -- WANTED: Normantis the Deposed --unverified accuracy
  163. [43432] = { [1] = { x = 50.20, y = 07.80, str = L.WAYPOINT_CAVE, add = true } }, -- WANTED: Normantis the Deposed
  164. [42795] = { [1] = { x = 21.3, y = 43.31, m = 1033, str = L.WAYPOINT_CAVE, add = true, rop = true }, -- WANTED: Sanaar --unverified accuracy
  165. [2] = { x = 39.7, y = 34.0, m = 1033 } }, -- WANTED: Sanaar --unverified accuracy
  166. [43429] = { [1] = { x = 66.4, y = 50.1, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Syphonus --unverified accuracy
  167. [43613] = { [1] = { x = 66.4, y = 50.1, str = L.WAYPOINT_PATH, add = true } }, -- WANTED: Syphonus
  168. [43437] = { [1] = { x = 41.94, y = 71.16, str = L.WAYPOINT_BUILDING, add = true } }, -- WANTED: Thane Irglov --unverified accuracy
  169. [43626] = { [1] = { x = 41.94, y = 71.16, str = L.WAYPOINT_BUILDING, add = true } }, -- WANTED: Thane Irglov
  170. [43451] = { [1] = { x = 64.8, y = 51.8, rop = true } }, -- WANTED: Urgev the Flayer --unverified accuracy
  171. [43628] = { [1] = { x = 64.8, y = 51.8, rop = true } }, -- WANTED: Urgev the Flayer
  172.  
  173. [44002] = { [1] = { x = 80.36, y = 70.53, str = "Southern pylon" }, -- Undersea Survey --confirmed
  174. [2] = { x = 79.54, y = 63.12, str = "Eastern Pylon" },
  175. [3] = { x = 74.44, y = 56.67, str = "Western Pylon" },
  176. [4] = { x = 78.61, y = 55.98, str = "Northern Pylon" } },
  177.  
  178. [44067] = { [1] = { x = 59.8, y = 58.1, str = "Callus" }, -- Consolidating Power --unverified accuracy
  179. [2] = { x = 61.9, y = 60.8, str = "Garion" },
  180. [3] = { x = 57.8, y = 62.0, str = "Leleyna" } },
  181.  
  182. [41950] = { [1] = { x = 37.46, y = 64.18 } }, -- Cry More Thunder! --confirmed
  183.  
  184. [42077] = { [1] = { x = 50.0, y = 85.6, rop = true } }, -- Waking Nightmares --unverified
  185.  
  186. [43951] = { [1] = { x = 40.7, y = 68.9, str = "Highmountain Prisoner" }, -- An Overdue Debt --confirmed
  187. [2] = { x = 40.2, y = 68.5, str = "Highmountain Prisoner" },
  188. [3] = { x = 42.4, y = 69.7, str = "Highmountain Prisoner" },
  189. [4] = { x = 42.7, y = 70.7, str = "Highmountain Prisoner" },
  190. [5] = { x = 45.7, y = 71.5, str = "Highmountain Prisoner" },
  191. [6] = { x = 46.4, y = 72.8, str = "Highmountain Prisoner" },
  192. [7] = { x = 41.8, y = 67.7, str = "Highmountain Prisoner" },
  193. [8] = { x = 43.8, y = 64.9, str = "Highmountain Prisoner" },
  194. [9] = { x = 44.9, y = 65.0, str = "Highmountain Prisoner" },
  195. [10]= { x = 45.5, y = 66.2, str = "Highmountain Prisoner" } },
  196. [41557] = { [1] = { x = 39.9, y = 29.4, str = L.WAYPOINT_CAVE, add = true }, -- Slab of Bacon (Suramar) --unverified accuracy
  197. [2] = { x = 39.8, y = 27.3, str = L.WAYPOINT_PATH, add = true, rop = true },
  198. [3] = { x = 40.2, y = 26.3, str = L.WAYPOINT_PATH, add = true, rop = true } },
  199. [41687] = { [1] = { x = 42.63, y = 25.21, str = L.WAYPOINT_CAVE, add = true, rop = true } , -- Snail Fight! --confirmed
  200. [2] = { x = 44.58, y = 22.55 } },
  201.  
  202. [44011] = { [1] = { x = 48.27, y = 68.34, str = L.WAYPOINT_PATH, add = true, rop = true }, -- Lost Wisp --unverified accuracy
  203. [2] = { x = 48.40, y = 64.32, rop = true } },
  204.  
  205. -- these quests appear to be missing the map id in the blizzrd api, and therefore falled to show waypoints
  206. [41836] = { [1] = { x = 36.6, y = 16.6, m = 1024, rop = true } }, -- WANTED: Bodash the Hoarder --unverified accuracy
  207. [43616] = { [1] = { x = 36.6, y = 16.6, m = 1024, rop = true } }, -- WANTED: Bodash the Hoarder
  208. [41692] = { [1] = { x = 46.6, y = 7.6, m = 1024, rop = true } }, -- Shipwreck Scavengers
  209. }
  210. local awqwp = {} -- Active WorldQuestWayPoints
  211.  
  212. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  213. -- EDITED BELOW --
  214. -- Credit to hajcus22 in the comments for the idea --
  215. -- His edit was down so I played with the code myself. --
  216. -- -- --
  217. -- If a coder or the orignal author comes back and can --
  218. -- pull the reputation part out and make a working --
  219. -- standalone add-on please do. Thanks --
  220. -- -- -- -- -- -- -- -- -- -- -- -- fr0z3night -- -- -- --
  221.  
  222. local repList = { 1090,1269,1270,1337,1341,1435,1387,1388,1859,1900,1883,1828,1948,1894,2165,2170 }
  223.  
  224. -- 1090, Kirin Tor
  225. -- Pandaria Reputations
  226. -- 1269, Golden Lotus
  227. -- 1270, Shado-Pan
  228. -- 1337, The Klaxxi
  229. -- 1341, August Celestials
  230. -- 1435, Shado-Pan Assault
  231. -- 1387, Kirin Tor Offensive (Alliance)
  232. -- 1388, Sunreaver Onslaught (Horde)
  233. -- Legion Reputations
  234. -- 1859,2089, The Nightfallen
  235. -- 1900,2087, Court of Farondis
  236. -- 1883,2088, Dreamweavers
  237. -- 1828,2085, Hightmountain Tribe
  238. -- 1948,2086, Valarjar
  239. -- 1894,2090, The Wardens
  240. -- 2045,2091, Armies of Legionfall
  241. -- 2165,2166, Army of the Light
  242. -- 2170,2167, Argussian Reach
  243. -- ^^^^^ Paragons
  244.  
  245.  
  246. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  247. -- Tried to add Paragon Reps, but didn't work --
  248. -- They may be able to be coded in by someone, or --
  249. -- not idk, left the paragon numbers just in case --
  250. -- I dont think they work the same way as exalted --
  251. -- -- -- -- -- -- -- -- -- -- -- fr0z3night -- -- --
  252.  
  253. local repitems = {
  254.  
  255. -- 7 LEGION EXPANSION
  256.  
  257. -- Argussian Reach (Argus)
  258. ["152954"] = 2170, -- Argussian Reach - BoA - 750
  259. ["152959"] = 2170, -- Argussian Reach - BoP - 250
  260. ["152960"] = 2170, -- Argussian Reach - BoA - 250
  261. ["152961"] = 2170, -- Argussian Reach - BoP - 750
  262. -- 2170, << Argussian Reach Exalted
  263. -- 2167, << Argussian Reach Paragon
  264. -- Army Of The Light (Argus)
  265. ["152955"] = 2165, -- Army Of The Light BoA 750
  266. ["152956"] = 2165, -- Army Of The Light BoA 750
  267. ["152957"] = 2165, -- Army Of The Light BoA 250
  268. ["152958"] = 2165, -- Army Of The Light BoP 250
  269. -- 2165, << Army Of The Light Exalted
  270. -- 2166, << Army Of The Light Paragon
  271. -- Dreamweavers (Val'sharah)
  272. ["139021"] = 1883, -- Dreamweavers - BoP - 250
  273. ["141339"] = 1883, -- Dreamweavers - BoA - 250
  274. ["141988"] = 1883, -- Dreamweavers - BoP - 1500
  275. ["146936"] = 1883, -- Dreamweavers - BoP - 250
  276. ["146942"] = 1883, -- Dreamweavers - BoA - 250
  277. ["147411"] = 1883, -- Dreamweavers - BoP - 1500
  278. ["150926"] = 1883, -- Dreamweavers - BoA - 1500
  279. -- 1883, << Dreamweavers Exalted
  280. -- 2088, << Dreamweavers Paragon
  281. -- Court of Farondis (Aszuna)
  282. ["139023"] = 1900, -- Farondis - BoP - 250
  283. ["141340"] = 1900, -- Farondis - BoA - 250
  284. ["141989"] = 1900, -- Farondis - BoP - 1500
  285. ["146937"] = 1900, -- Farondis - BoP - 250
  286. ["146943"] = 1900, -- Farondis - BoA - 250
  287. ["147410"] = 1900, -- Farondis - BoP - 1500
  288. ["150927"] = 1900, -- Farondis - BoP - 1500
  289. -- 1900, << Farondis Exalted
  290. -- 2087, << Farondis Paragon
  291. -- Highmountain Tribe (Highmountain)
  292. ["139024"] = 1828, -- Highmountain - BoP - 250
  293. ["141341"] = 1828, -- Highmountain - BoA - 250
  294. ["141990"] = 1828, -- Highmountain - BoP - 1500
  295. ["146938"] = 1828, -- Highmountain - BoP - 250
  296. ["146944"] = 1828, -- Highmountain - BoA - 250
  297. ["147412"] = 1828, -- Highmountain - BoP - 1500
  298. ["150928"] = 1828, -- Highmountain - BoA - 1500
  299. -- 1828, << Highmountain Exalted
  300. -- 2085, << Highmountain Paragon
  301. -- Legionfall (Broken Shore)
  302. ["146949"] = 2045, -- Legionfall - BoP - 250
  303. ["146950"] = 2045, -- Legionfall - BoA - 250
  304. ["147727"] = 2045, -- Legionfall - BoP - 750
  305. ["152464"] = 2045, -- Legionfall - BoP - 750
  306. -- 2045, << Legionfall Exalted
  307. -- 2091, << Legionfall Paragon
  308. -- Nightfallen (Suramar)
  309. ["139026"] = 1859, -- Nightfallen - BoP - 250
  310. ["140260"] = 1859, -- Nightfallen - BoP - 25
  311. ["141343"] = 1859, -- Nightfallen - BoA - 250
  312. ["141870"] = 1859, -- Nightfallen - BoP - 100
  313. ["141992"] = 1859, -- Nightfallen - BoP - 750
  314. ["146940"] = 1859, -- Nightfallen - BoP - 250
  315. ["146946"] = 1859, -- Nightfallen - BoA - 250
  316. ["147413"] = 1859, -- Nightfallen - BoP - 750
  317. ["147416"] = 1859, -- Nightfallen - BoP - 100
  318. ["150930"] = 1859, -- Nightfallen - BoA - 750
  319. -- 1859, << Nightfallen Exalted
  320. -- 2089, << Nightfallen Paragon
  321. -- Valarjar (Stormheim)
  322. ["139020"] = 1948, -- Valarjar - BoP - 250
  323. ["141338"] = 1948, -- Valarjar - BoA - 250
  324. ["141987"] = 1948, -- Valarjar - BoP - 1500
  325. ["146935"] = 1948, -- Valarjar - BoP - 250
  326. ["146941"] = 1948, -- Valarjar - BoA - 250
  327. ["147414"] = 1948, -- Valarjar - BoP - 1500
  328. ["150925"] = 1948, -- Valarjar - BoA - 1500
  329. -- 1948, << Valarjar Exalted
  330. -- 2086, << Valarjar Paragon
  331. -- Wardens (Aszuna)
  332. ["139025"] = 1894, -- Wardens - BoP - 250
  333. ["141342"] = 1894, -- Wardens - BoA - 250
  334. ["141991"] = 1894, -- Wardens - BoP - 750
  335. ["141992"] = 1894, -- Wardens - BoP - 750
  336. ["146939"] = 1894, -- Wardens - BoP - 250
  337. ["146945"] = 1894, -- Wardens - BoA - 250
  338. ["147415"] = 1894, -- Wardens - BoP - 1500
  339. ["150929"] = 1894, -- Wardens - BoA - 1500
  340. -- 1894, << Wardens Exalted
  341. -- 2090, << Wardens Paragon
  342. -- All Legion Factions (ALL)
  343. ["153113"] = 1948, -- All Legion Factions - BoA - 1000
  344.  
  345. -- 6 DRAENOR EXPANSION
  346.  
  347. -- Arakkoa Outcasts
  348. ["119136"] = 1515, -- Arakkoa Outcasts Tabard
  349. -- Council of Exarchs
  350. ["119135"] = 1731, -- Council of Exarchs Tabard
  351. -- Frostwolf Orcs (H)
  352. ["119133"] = 1445, -- Frostwolf Tabard
  353. -- Laughing Skull Orcs (H)
  354. ["119138"] = 1708, -- Laughing Skull Orcs Tabard
  355. -- Sha'tari Defense (A)
  356. ["119140"] = 1710, -- Sha'tari Defense Tabard
  357. -- Steamwheedle "Preservation" Society
  358. ["119137"] = 1711, -- Steamwheedle Society Tabard
  359. -- Vol'jin's Spear (H)
  360. ["115518"] = 1681, -- Vol'jin's Spear Tabard
  361. -- Wrynn's Vanguard (A)
  362. ["115517"] = 1682, -- Wrynn's Vanguard Tabard
  363. -- Order of the Awakened
  364. ["128450"] = 1849, -- Order of the Awakened Tabard
  365. -- Saberstalkers
  366. ["128449"] = 1850, -- Saberstalkers Tabard
  367.  
  368. -- 5 PANDARIA EXPANSION
  369.  
  370. -- Racial Tabards
  371. ["83079"] = 1353, -- Tushui Tabard
  372. ["83080"] = 1352, -- Huojin Tabard
  373. -- Shado-Pan, Townlong Steppes
  374. ["89800"] = 1270, -- Shado-Pan Tabard
  375. ["94223"] = 1270, -- Shado-Pan BoA 1000
  376. ["143936"] = 1270, -- Shado-Pan BoA 300
  377. -- Shado-Pan Assault, Raid
  378. ["97131"] = 1435, -- Shado-Pan Assault Tabard
  379. ["95496"] = 1435, -- Shado-Pan Assault BoA 100
  380. ["143945"] = 1341, -- Shado-Pan Assault BoA 300
  381. -- August Celestials
  382. ["89799"] = 1341, -- August Celestials Tabard
  383. ["94225"] = 1341, -- August Celestials BoA 1000
  384. ["143938"] = 1341, -- August Celestials BoA 300
  385. -- Order Of The Cloud Serpent, Jade Forest
  386. ["89796"] = 1271, -- Cloud Serpent Tabard
  387. ["143942"] = 1271, -- Cloud Serpent BoA 300
  388. -- Emperor Shaohao (Timeless Isle)
  389. ["143947"] = 1492, -- Emperor Shaohao BoA 500
  390. -- Tillers, Valley of the Four Winds
  391. ["89784"] = 1272, -- Tillers Tabard
  392. ["143941"] = 1272, -- Tillers BoA 300
  393. -- Tillers (Social), Valley of the Four Winds
  394. ["79266"] = 1282, -- FishFellreed - BoP - ???
  395. -- ["79266"] = 1275, -- Ella - BoP - ???
  396. ["79267"] = 1278, -- Sho - BoP - ???
  397. -- ["79267"] = 1273, -- Jogu The Drunk - BoP - ???
  398. ["79265"] = 1276, -- Old Hillpaw - BoP - ???
  399. -- ["79265"] = 1277, -- Chee Chee - BoP - ???
  400. ["79264"] = 1279, -- Haohan - BoP - ???
  401. -- ["79264"] = 1280, -- Tina Mudclaw - BoP - ???
  402. ["79268"] = 1283, -- Farmer Fung - BoP - ???
  403. -- ["79268"] = 1281, -- Gina Mudclaw - BoP - ???
  404. -- Klaxxi, Dread Wastes
  405. ["89798"] = 1337, -- Klaxxi Tabard
  406. ["94226"] = 1337, -- Klaxxi - BoA - 1000
  407. ["143935"] = 1337, -- Klaxxi - BoA - 300
  408. -- Lorewalkers
  409. ["89795"] = 1345, -- Lorewalkers Tabard
  410. -- Golden Lotus
  411. ["89797"] = 1269, -- Golden Lotus Tabard
  412. ["94227"] = 1269, -- Golden Lotus BoA 1000
  413. ["90815"] = 1269, -- Golden Lotus BoA ??
  414. ["90816"] = 1269, -- Golden Lotus BoA ??
  415. ["143937"] = 1269, -- Golden Lotus BoA 300
  416. -- Anglers, Krasarang Wilds
  417. ["89401"] = 1302, -- Anglers Tabard
  418. ["143946"] = 1302, -- Anglers BoA 300
  419. -- Kirin Tor Offensive (Alliance)
  420. ["95591"] = 1387, -- Kirin Tor Offensive Tabard
  421. ["95489"] = 1387, -- Kirin Tor Offensive BoA 25
  422. ["95490"] = 1387, -- Kirin Tor Offensive BoA 250
  423. -- Sunreaver Onslaught (Horde)
  424. ["95592"] = 1388, -- Sunreaver Onslaught Tabard
  425. ["95488"] = 1388, -- Sunreaver Onslaught BoA 250
  426. ["95487"] = 1388, -- Sunreaver Onslaught BoA 25
  427. ["143939"] = 1388, -- Sunreaver Onslaught BoA 300
  428.  
  429. ["143943"] = 1375, -- Dominance Offensive BoA 300
  430.  
  431. -- 4 CATACLYSM EXPANSION
  432.  
  433. -- Cataclysm Racial
  434. ["64882"] = 1134, -- Gilneas Tabard
  435. ["64884"] = 1133, -- Bilgewater Cartel Tabard
  436. -- Twilight Highlands
  437. ["65908"] = 1174, -- Wildhammer Clan Tabard
  438. ["133151"] = 1174, -- Wildhammer Clan BoA 500
  439. ["65909"] = 1172, -- Dragonmaw Clan Tabard
  440. ["133150"] = 1172, -- Dragonmaw Clan BoA 500
  441. -- Uldum
  442. ["65904"] = 1173, -- Ramkahen Tabard
  443. ["133154"] = 1173, -- Ramkahen BoA 500
  444. -- Vashjir
  445. ["65905"] = 1135, -- Earthen Ring Tabard
  446. ["133159"] = 1135, -- Earthen Ring BoA 500
  447. -- Mount Hyjal
  448. ["65906"] = 1158, -- Guardians of Hyjal Tabard
  449. ["133152"] = 1158, -- Guardians of Hyjal BoA 500
  450. -- Deepholm
  451. ["65907"] = 1171, -- Therazane Tabard
  452. ["133160"] = 1171, -- Therazane BoA 500
  453. -- Tol Barad
  454. ["63379"] = 1177, -- Baradin's Wardens Tabard
  455. ["63378"] = 1178, -- Hellscream's Reach Tabard
  456.  
  457. -- 3 WRATH EXPANSION
  458.  
  459. -- Argent Crusade
  460. ["43154"] = 1106, -- Argent Crusade Tabard
  461. ["129942"] = 1106, -- Argent Crusade BoA 500
  462. -- Ebon Blade
  463. ["43155"] = 1098, -- Ebon Blade Tabard
  464. ["129941"] = 1098, -- Ebon Blade BoA 500
  465. -- Kirin Tor
  466. ["43157"] = 1090, -- Kirin Tor Tabard
  467. ["129940"] = 1090, -- Kirin Tor BoA 500
  468. -- Sons Of Hodir
  469. ["129943"] = 1119, -- Sons Of Hodir BoA 500
  470. -- Wyrmrest Accord
  471. ["43156"] = 1091, -- Wyrmrest Accord Tabard
  472. ["129944"] = 1091, -- Wyrmrest Accord BoA 500
  473. -- Alliance Vanguard
  474. ["129955"] = 1037, -- Alliance Vanguard BoA 500
  475. -- Horde Expedition
  476. ["129954"] = 1052, -- Horde Expedition BoA 500
  477.  
  478. -- 2 OUTLAND EXPANSION
  479.  
  480. -- Outland Racial (Added in Wrath)
  481. ["45580"] = 930, -- Exodar Tabard
  482. ["45585"] = 911, -- Silvermoon City Tabard
  483. -- Hellfire Peninsula
  484. ["23999"] = 946, -- Honor Hold Tabard
  485. ["129948"] = 946, -- Honor Hold BoA 500
  486. ["24004"] = 947, -- Thrallmar Tabard
  487. ["129947"] = 947, -- Thrallmar BoA 500
  488. -- Zangarmarsh
  489. ["31804"] = 942, -- Cenarion Expedition Tabard
  490. ["129949"] = 942, -- Cenarion Expedition BoA 500
  491. ["31775"] = 970, -- Sporeggar Tabard
  492. -- Terokkar Forest
  493. ["32445"] = 1031, -- Skyguard Tabard
  494. -- Shattrath
  495. ["31779"] = 932, -- Aldor Tabard
  496. ["31780"] = 934, -- Scryers Tabard
  497. ["31778"] = 1011, -- Lower City Tabard
  498. ["129951"] = 1011, -- Lower City BoA 500
  499. ["31781"] = 935, -- Sha'tar Tabard
  500. ["129946"] = 935, -- Sha'tar BoA 500
  501. -- Nagrand
  502. ["31774"] = 978, -- Kurenai Tabard
  503. ["31773"] = 941, -- Mag'har Tabard
  504. ["31776"] = 933, -- Consortium Tabard
  505. ["129945"] = 933, -- Consortium BoA 500
  506. -- Blades Edge Mountain
  507. ["32828"] = 1038, -- Ogri'la Tabard
  508. --
  509. ["31777"] = 989, -- Keepers of Time Tabard
  510. ["129950"] = 989, -- Keepers of Time BoA 500
  511. -- Sunwell Plateau
  512. ["35221"] = 1077, -- Shattered Sun Tabard
  513.  
  514. -- 1 CLASSIC
  515.  
  516. -- Classic Racial (Added in Wrath)
  517. ["45579"] = 69, -- Darnassus Tabard
  518. ["45578"] = 54, -- Gnomeregan Tabard
  519. ["45577"] = 47, -- Ironforge Tabard
  520. ["45574"] = 72, -- Stormwind Tabard
  521. ["45582"] = 530, -- Darkspear Tabard
  522. ["45581"] = 76, -- Orgrimmar Tabard
  523. ["45584"] = 81, -- Thunder Bluff Tabard
  524. ["45583"] = 68, -- Undercity Tabard
  525.  
  526. -- PVP Tabards?
  527. ["20132"] = 509, -- Arathor Battle Tabard
  528. ["20131"] = 510, -- Battle Tabard of the Defilers
  529.  
  530. }
  531.  
  532. local zoneFactions = {
  533. [1015] = 1900, -- Azsuna = Farondis
  534. [1018] = 1883, -- Val'sharah = Dreamweavers
  535. [1033] = 1859, -- Suramar = Nightfallen
  536. [1024] = 1828, -- Highmountain = Highmountain
  537. [1017] = 1948, -- Stormheim = Valarjar
  538. [7543] = 2045, -- Broken Shore = Legionfall
  539. [8899] = 2170, -- Antoran Wastes = ArgussianReach
  540. [8701] = 2165, -- Mac'Aree = ArmyOfTheLight
  541. [8574] = 2166, -- Krokuun = ArmyOfTheLight
  542.  
  543. }
  544.  
  545. -- -- -- -- -- -- -- --
  546. -- END OF MY EDITS --
  547. -- -- -- fr0z3night --
  548.  
  549. local tracking = { }
  550. local trackingNames = {}
  551.  
  552. local pets = { -- links pet family to achievements (gets icons added too)
  553. [1] = { achID = 9692 }, -- Humanoid
  554. [2] = { achID = 9689 }, -- Dragonkin
  555. [3] = { achID = 9691 }, -- Flying
  556. [4] = { achID = 9695 }, -- Undead
  557. [5] = { achID = 9688 }, -- Critter
  558. [6] = { achID = 9693 }, -- Magic
  559. [7] = { achID = 9690 }, -- Elemental
  560. [8] = { achID = 9687 }, -- Beast
  561. [9] = { achID = 9686 }, -- Aquatic
  562. [10] = { achID = 9694 } -- Mechanical
  563. }
  564.  
  565. local ffamfm = {
  566. [41896] = { achID = 11475},
  567. [42023] = { achID = 11477},
  568. [42025] = { achID = 11476},
  569. [41013] = { achID = 11478}
  570. }
  571. local botbi = { }
  572. local fishingRTI = { }
  573. local fishingRTIdoubles = {
  574. [41243] = { 41608, 41609 }, -- Huge Highmountain Salmon
  575. [41280] = { 41617 }, -- Huge Runescale Koi
  576. [41265] = { 41611, 41610 }, -- Huge Cursed Queenfish
  577. [41275] = { 41614, 41615 }, -- Huge Stormrays
  578. [41270] = { 41612, 41613 }, -- Huge Mossgill Perch
  579. [41599] = { 41264, 41598 }, -- Lively Cursed Queenfish
  580. [41597] = { 41244, 41596 }, -- Lively Highmountain Salmon
  581. [41602] = { 41274 }, -- Lively Stormrays
  582. [41604] = { 41279 }, -- Lively Runescale Koi
  583. [41269] = { 41601 }, -- Lively Mossgill Perch
  584.  
  585. --[[
  586.  
  587. /run for i = 1, GetAchievementNumCriteria(10598) do local name,_,fishingRTICompleted,_,_,_,_,fishingRTIID = GetAchievementCriteriaInfo(10598, i) print( i,fishingRTIID,fishingRTICompleted,name ) end
  588.  
  589. 21 Lively Cursed Queenfish
  590. 22 Lively Highmountain Salmon
  591. 23 Lively Stormrays
  592. 24 Lively Runescale Koi
  593. 25 Lively Mossgill Perch
  594. -]]
  595. }
  596. local dataloaded = false
  597.  
  598. local pet_quests = {
  599. [1] = 42159, -- "Nightwatcher Merayl",
  600. [2] = 40299, -- "Bodhi Sunwayver",
  601. [3] = 40277, -- "Tiffany Nelson",
  602. [4] = 42442, -- "Amalia",
  603. [5] = 40298, -- "Sir Galveston",
  604. [6] = 40280, -- "Bredda Tenderhide",
  605. [7] = 40282, -- "Grixis Tinypop",
  606. [8] = 41687, -- "Odrogg",
  607. [9] = 40278, -- "Robert Craig",
  608. [10] = 41944, -- "Trapper Jarrun",
  609. [11] = 41895, -- "Aulier",
  610. [12] = 40337, -- "Master Tamer Flummox",
  611. [13] = 41990, -- "Varenne",
  612. [14] = 40279, -- "Durian Strongfruit",
  613. [15] = 41860, -- "Xorvasc",
  614. }
  615. --[[
  616. local pet_quests = {
  617. [1] = 40279, -- "Durian Strongfruit",
  618. [2] = 40278, -- "Robert Craig",
  619. [3] = 40280, -- "Bredda Tenderhide",
  620. [4] = 41990, -- "Varenne",
  621. [5] = 41860, -- "Xorvasc",
  622. [6] = 40337, -- "Master Tamer Flummox",
  623. [7] = 40277, -- "Tiffany Nelson",
  624. [8] = 40282, -- "Grixis Tinypop",
  625. [9] = 42442, -- "Amalia",
  626. [10] = 40298, -- "Sir Galveston",
  627. [11] = 41944, -- "Trapper Jarrun",
  628. [12] = 40299, -- "Bodhi Sunwayver",
  629. [13] = 41895, -- "Aulier",
  630. [14] = 41687, -- "Odrogg",
  631. [15] = 42159, -- "Nightwatcher Merayl",
  632. }
  633. --]]
  634.  
  635. local pet_tamers = {}
  636. local closedtimer = 0
  637. local refreshing = false
  638. local refreshingblock
  639.  
  640. --[[
  641. id, name, points, completed, month, day, year, description, flags, icon, rewardText, isGuildAch, wasEarnedByMe, earnedBy = GetAchievementInfo(id)
  642. description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(achievementID, index)
  643. (Index of one of the achievement's criteria (between 1 and GetAchievementNumCriteria(id))
  644. --]]
  645. local function getdata()
  646. if debugging then print("Getting data for achievement tips...") end
  647.  
  648. local _,fishingRTIName,_,fishingRTIAchcompleted = GetAchievementInfo(10598)
  649. fishingRTI.name = fishingRTIName
  650. fishingRTI.complete = fishingRTIAchcompleted
  651. fishingRTI.count = 0
  652. if not fishingRTIAchcompleted then
  653. for i = 1, GetAchievementNumCriteria(10598) do
  654. local _,_,fishingRTICompleted,_,_,_,_,fishingRTIID = GetAchievementCriteriaInfo(10598, i)
  655.  
  656. if i == 1 then fishingRTIID = 41270 -- Huge Mossgill Perch
  657. elseif i == 7 then fishingRTIID = 41265 -- Huge Cursed Queenfish
  658. elseif i == 9 then fishingRTIID = 41280 -- Huge Runescale Koi
  659. elseif i == 12 then fishingRTIID = 41243 -- Huge Highmountain Salmon
  660. elseif i == 15 then fishingRTIID = 41275 -- Huge Stormrays
  661. elseif i == 4 then fishingRTIID = 41599 -- Lively Cursed Queenfish
  662. elseif i == 10 then fishingRTIID = 41597 -- Lively Highmountain Salmon
  663. elseif i == 11 then fishingRTIID = 41602 -- Lively Stormrays
  664. elseif i == 3 then fishingRTIID = 41604 -- Lively Runescale Koi
  665. elseif i == 20 then fishingRTIID = 41269 end -- Lively Mossgill Perch
  666.  
  667. fishingRTI[fishingRTIID] = fishingRTICompleted
  668. if fishingRTICompleted then
  669. fishingRTI.count = fishingRTI.count + 1
  670. elseif fishingRTIdoubles[ fishingRTIID ] then
  671. for k,v in pairs( fishingRTIdoubles[ fishingRTIID ] ) do
  672. fishingRTI[ v ] = false
  673. end
  674. end
  675. end
  676. end
  677.  
  678. -- ffamfm
  679. -- description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(achievementID, index)
  680. --description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(achievementID, index)
  681. for k,v in pairs(ffamfm) do
  682. local _, name, _, completed = GetAchievementInfo(v.achID)
  683. local _, _, _, quantity, requiredQuantity = GetAchievementCriteriaInfo(v.achID, 1)
  684. -- print( k,v.achID )
  685. ffamfm[k].name = name
  686. ffamfm[k].completed = completed
  687. ffamfm[k].quantity = quantity
  688. ffamfm[k].requiredQuantity = requiredQuantity
  689. end
  690.  
  691. local _,botbiName,_,botbiAchcompleted = GetAchievementInfo(10876)
  692. botbi.name = botbiName
  693. botbi.complete = botbiAchcompleted
  694. botbi.count = 0
  695. if not botbiAchcompleted then
  696. for i = 1, GetAchievementNumCriteria(10876) do
  697. local _,_,botbiCompleted,_,_,_,_,botbiID = GetAchievementCriteriaInfo(10876, i)
  698. botbi[botbiID] = botbiCompleted
  699. if botbiCompleted then botbi.count = botbi.count + 1 end
  700. end
  701. end
  702. for i = 1, GetAchievementNumCriteria(9692) do
  703. local description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(9692, i)
  704. pet_tamers[description] = { }
  705. local quest = pet_quests[i]
  706. pet_quests[quest] = description
  707. end
  708.  
  709. -- local description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(9692, i)
  710. for f = 1, 10 do
  711. pets[f].icon = format("\124TInterface\\Icons\\Pet_Type_%s:16\124t",PET_TYPE_SUFFIX[f])
  712. pets[f].count = 0
  713. pets[f].ignored = 0
  714. local _,achname,_,achcompleted = GetAchievementInfo(pets[f].achID)
  715. pets[f].achName = achname
  716. for i = 1, GetAchievementNumCriteria(pets[f].achID) do
  717. local description, _, completed = GetAchievementCriteriaInfo(pets[f].achID, i)
  718. if WorldQuestTipsData.global.pets.ff[description] == nil then WorldQuestTipsData.global.pets.ff[description] = { } end
  719. if WorldQuestTipsData.global.pets.ff[description][f] == nil then WorldQuestTipsData.global.pets.ff[description][f] = true end
  720. if achcompleted then completed = true end
  721. pet_tamers[description][f] = completed
  722. if completed then pets[f].count = pets[f].count + 1 end
  723. end
  724. end
  725.  
  726. dataloaded = true
  727. end
  728.  
  729. local function wayPointsEnabled( source )
  730. local wayPointsEnabled = true
  731. if not TomTom then wayPointsEnabled = false
  732. elseif source == "auto" then wayPointsEnabled = WorldQuestTipsData.global.options.TomTomAQ
  733. elseif source == "click" then wayPointsEnabled = WorldQuestTipsData.global.options.TomTomMP
  734. elseif source == "leyrace" then wayPointsEnabled = WorldQuestTipsData.global.options.TomTomLR end
  735. return wayPointsEnabled
  736. end
  737.  
  738. local function addWayPoints( questID, source, m, f, x, y, title )
  739. if wayPointsEnabled( source ) then
  740. if awqwp[questID] == nil then awqwp[questID] = {} end
  741. if wqwp[questID] then
  742. local _, m = C_TaskQuest.GetQuestZoneID( questID )
  743. for i,quest in pairs( wqwp[questID] ) do
  744. local wp = wqwp[questID][i]
  745. title = C_TaskQuest.GetQuestInfoByQuestID(questID)
  746. if wp.str then
  747. if wp.add then title = wp.str .. " " .. title
  748. else title = wp.str end
  749. end
  750. if wp.m then m = wp.m end
  751. awqwp[questID][i] = TomTom:AddMFWaypoint(m, 0, wp.x/100, wp.y/100, {title=title, persistent=false })
  752. end
  753. elseif source == "click" then
  754. if ( m and f and x and y ) then awqwp[questID][1] = TomTom:AddMFWaypoint(m, f, x, y, {title=title, persistent=false }) end
  755. elseif source == "leyrace" then
  756. for j in pairs( awqwp[questID] ) do TomTom:RemoveWaypoint( awqwp[questID][j] ) end
  757. for i, wp in pairs( leyraceWP[ m ].waypoints ) do
  758. awqwp[questID][i] = TomTom:AddMFWaypoint(m, 0, wp[1]/100, wp[2]/100, {title=title, persistent=false })
  759. end
  760. end
  761.  
  762. if TomTom.SetClosestWaypoint then TomTom:SetClosestWaypoint() end
  763. end
  764. end
  765.  
  766.  
  767. local function addWorldQuest(id)
  768. local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(id)
  769. local tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex = GetQuestTagInfo(questID);
  770. if worldQuestType then
  771.  
  772. if debugging then print("WQT-Dedugging: Attempting to add World Quest - "..questID) end
  773.  
  774. addWayPoints( questID, "auto" )
  775.  
  776. if awqwp[questID] then
  777. for i in pairs( awqwp[questID] ) do
  778. if wqwp[questID] == nil or ( wqwp[questID] and wqwp[questID][i].rop ) then
  779. TomTom:RemoveWaypoint( awqwp[questID][i] )
  780. end
  781. end
  782. end
  783.  
  784. table.insert(trackingNames, title)
  785. local isInArea, isOnMap, numObjectives = GetTaskInfo(questID)
  786. local objectives = {}
  787. if numObjectives then
  788. for obj = 1, numObjectives do
  789. local objectiveText, objectiveType, finished = GetQuestObjectiveInfo(questID, obj, false);
  790. objectives[obj] = objectiveText
  791. if debugging then print(objectiveText) end
  792. end
  793. end
  794. local percent = C_TaskQuest.GetQuestProgressBarInfo(questID);
  795. objectives.percent = percent
  796. local expireTime = C_TaskQuest.GetQuestTimeLeftMinutes(questID) or 0
  797. expireTime = expireTime *60 + time()
  798. if tracking[questID] == nil then
  799. tracking[questID] = {
  800. progressed = false,
  801. duration = 0,
  802. expires = expireTime,
  803. objectives = objectives,
  804. objectivesInit = objectives
  805. }
  806. end
  807. if not tracking[questID].active then
  808. tracking[questID].active = true
  809. tracking[questID].start = time()
  810. end
  811. if tracking[questID].expires < time() then
  812. tracking[questID].duration = 0
  813. tracking[questID].expires = expireTime
  814. end
  815. if tracking[questID].active and enigmaticQuests[ questID ] then
  816. enigmaticActive = true
  817. if WorldQuestTipsData.global.options.useEnigmatic then
  818. if WorldQuestTips.enigmatic == nil then
  819. WorldQuestTips:loadEnigmatic()
  820. else
  821. WorldQuestTips.enigmatic:Show()
  822. end
  823. end
  824. end
  825. end
  826. end
  827.  
  828. local function findQuest( questID )
  829. -- print("findquest fired")
  830. --local function findQuest( questID, m )
  831. if questID then
  832. local title = C_TaskQuest.GetQuestInfoByQuestID(questID)
  833. local _, questZoneId = C_TaskQuest.GetQuestZoneID( questID )
  834. -- local x, y = C_TaskQuest.GetQuestLocation( questID, questZoneId )
  835. local coords = {
  836. default = {
  837. x = x,
  838. y = y,
  839. f = 0,
  840. m = questZoneId,
  841. }
  842. }
  843. if WorldQuestTipsData.global.worldQuests[questID] == nil then
  844. WorldQuestTipsData.global.worldQuests[questID] = {
  845. completed = 0,
  846. timespent = 0,
  847. }
  848. end
  849. WorldQuestTipsData.global.worldQuests[questID].coords = coords
  850. WorldQuestTipsData.global.worldQuests[questID].title = title
  851. else
  852. -- local viewedZone = GetCurrentMapAreaID()
  853. -- print( viewedZone )
  854. -- SetMapToCurrentZone()
  855. -- local thisZone = GetCurrentMapAreaID()
  856. -- if viewedZone ~= 1007 then
  857. -- SetMapByID( 1007 )
  858. -- SetMapByID( viewedZone )
  859. for _,mapID in pairs(brokenIsleZones) do
  860.  
  861.  
  862.  
  863. -- /run for _,mapID in pairs({1015,1021,1014,1096,1024,1017,1033,1018,1007}) do print(mapID, C_TaskQuest.GetQuestLocation( 41938, mapID )) end
  864. -- /run print(C_TaskQuest.GetQuestZoneID(41938))
  865. -- /run local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(1007) for i,info in pairs(taskInfo) do print(info.questId) end
  866.  
  867.  
  868. -- local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID( 1007 )
  869. local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID( mapID )
  870. if taskInfo then
  871. for i, info in pairs(taskInfo) do
  872. if info.questId then
  873. -- print( info.questId )
  874. local title = C_TaskQuest.GetQuestInfoByQuestID( info.questId )
  875. local _, questZoneId = C_TaskQuest.GetQuestZoneID( info.questId )
  876. -- local x, y = C_TaskQuest.GetQuestLocation( info.questId, questZoneId )
  877. if WorldQuestTipsData.global.worldQuests[info.questId] == nil then
  878. if debugging then print("WQT-Dedugging - New quest found: "..info.questId) end
  879. WorldQuestTipsData.global.worldQuests[info.questId] = {
  880. completed = 0,
  881. timespent = 0,
  882. coords = {
  883. default = {
  884. x = x,
  885. -- x = info.x,
  886. y = y,
  887. -- y = info.y,
  888. f = info.floor,
  889. -- m = mapID,
  890. m = questZoneId,
  891. }
  892. },
  893. title = title
  894. }
  895. -- elseif WorldQuestTipsData.global.worldQuests[info.questId].coords == nil then
  896. else
  897. WorldQuestTipsData.global.worldQuests[info.questId].coords = {
  898. default = {
  899. x = x,
  900. -- x = info.x,
  901. y = y,
  902. -- y = info.y,
  903. f = info.floor,
  904. -- m = mapID,
  905. m = questZoneId,
  906. }
  907. }
  908. WorldQuestTipsData.global.worldQuests[info.questId].title = title
  909. end
  910. end
  911. end
  912. end
  913. -- SetMapByID( viewedZone )
  914. end
  915. --[[
  916. else
  917. for _,mapID in pairs(brokenIsleZones) do
  918. local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID( mapID )
  919. for i, info in pairs(taskInfo) do
  920. if info.questId == questID then
  921. return info, mapID;
  922. end
  923. end
  924. end
  925. end
  926. return nil--]]
  927. end
  928. end
  929.  
  930. function WorldQuestTips:PLAYER_LOGIN(...)
  931. local defaultOptions = {
  932. debugging = false,
  933. TomTomAQ = true,
  934. TomTomMP = true,
  935. TomTomLR = true,
  936. PetFF = true,
  937. EditOnC = true,
  938. showExalted = true,
  939. showTimes = true,
  940. showCurrentRep = true,
  941. hideSmallGold = true,
  942. hideSmallGoldThreshold = 10,
  943. showRepOnItems = true,
  944. showAltRepOnItems = true,
  945. useEnigmatic = true,
  946. enigmaticRows = 3,
  947. enigmaticSize = 6,
  948. enigmaticMove = true,
  949. enigmaticPos = "CENTER",
  950. useEnigmaticHUD = true,
  951. enigmaticHUDSize = 32,
  952. enigmaticHUDPathA = 0.1,
  953. enigmaticHUDEdgeA = 0.3,
  954. enigmaticHUDPathDim = true,
  955. enigmaticHUDMove = true,
  956. enigmaticHUDPos = "CENTER",
  957. }
  958. if WorldQuestTipsData == nil then
  959. WorldQuestTipsData = {
  960. version = version,
  961. global = {
  962. options = defaultOptions,
  963. worldQuests = {},
  964. pets = { ff = {} },
  965. }
  966. }
  967. end
  968. for option, default in pairs( defaultOptions ) do
  969. if WorldQuestTipsData.global.options[option] == nil then WorldQuestTipsData.global.options[option] = default end
  970. end
  971.  
  972. --[[ -- Do stuff here if users data needs altering with update (or one of messages)
  973. if WorldQuestTipsData.version == nil or version > WorldQuestTipsData.version then
  974. -- WorldQuestTipsData.version = version
  975. end
  976. --]]
  977.  
  978. if WorldQuestTipsData[profileKey] == nil then WorldQuestTipsData[profileKey] = { worldQuestPartial = { } } end
  979. debugging = WorldQuestTipsData.global.options.debugging
  980. for questID, data in pairs(WorldQuestTipsData[profileKey].worldQuestPartial) do
  981. if data.expires > time() then
  982. if data.active then
  983. data.start = time()
  984. end
  985. tracking[questID] = data;
  986. end
  987. end
  988.  
  989. local o = CreateFrame("FRAME")
  990. o.name = L.TITLE
  991. InterfaceOptions_AddCategory(o)
  992. o.title = o:CreateFontString(nil, o, "GameFontNormalLarge" )
  993. o.title:SetText( L.TITLE )
  994. o.title:SetPoint("CENTER",0,20)
  995. o.version = o:CreateFontString(nil, o, "GameFontWhite" )
  996. o.version:SetText("v" .. format("%.2f",version) .. versionSuffix );
  997. o.version:SetPoint("TOP", o.title, "BOTTOM" )
  998. o.loadBtn = CreateFrame("BUTTON", nil, o, "UIPanelButtonTemplate")
  999. o.loadBtn:SetWidth(98)
  1000. o.loadBtn:SetHeight(24)
  1001. o.loadBtn:SetText( GAMEOPTIONS_MENU )
  1002. o.loadBtn:SetPoint("TOP", o.version, "BOTTOM", 0, -12)
  1003. o.loadBtn:SetScript("OnClick", function() WorldQuestTips:loadOptions() ;InterfaceOptionsFrame:Hide();ToggleGameMenu() end)
  1004. end
  1005.  
  1006. function WorldQuestTips:PLAYER_LOGOUT(...)
  1007. for questID, data in pairs(tracking) do
  1008. if data.active then
  1009. local isInArea, isOnMap, numObjectives = GetTaskInfo(questID)
  1010. local progressed = false
  1011. local objectives = {}
  1012. if numObjectives then
  1013. for obj = 1, numObjectives do
  1014. local objectiveText, objectiveType, finished = GetQuestObjectiveInfo(questID, obj, false);
  1015. if objectiveText ~= data.objectives[obj] then progressed = true end
  1016. objectives[obj] = objectiveText
  1017. end
  1018. end
  1019. local percent = C_TaskQuest.GetQuestProgressBarInfo(questID);
  1020. if percent and percent ~= data.objectives.percent then
  1021. progressed = true
  1022. objectives.percent = percent
  1023. end
  1024. if progressed then
  1025. data.objectives = objectives
  1026. tracking[questID].duration = data.duration + ( time() - data.start )
  1027. end
  1028. end
  1029. end
  1030. WorldQuestTipsData[profileKey].worldQuestPartial = tracking
  1031.  
  1032. WorldQuestTipsData[profileKey].info = {
  1033. name = playerName,
  1034. class = playerClass,
  1035. level = level
  1036. }
  1037.  
  1038. local factionStandings = {}
  1039.  
  1040. for k,factionID in pairs( repList ) do
  1041. local factionName,_,factionStanding,barMin,barMax,value = GetFactionInfoByID( factionID );
  1042. barMax = (barMax - barMin)/1000;
  1043. local barValue = math.floor( (value - barMin)/100 ) / 10
  1044. local factionStandingtext = GetText("FACTION_STANDING_LABEL"..factionStanding, gender);
  1045. local colour = "|cff808080"
  1046. if factionStanding < 8 then
  1047. factionStandingtext = factionStandingtext.." "..barValue.."k /"..barMax.."k"
  1048. colour = "|cffffd100"
  1049. end
  1050. factionStandings[ factionID ] = colour..factionStandingtext.."\124r"
  1051.  
  1052. end
  1053.  
  1054. WorldQuestTipsData[profileKey].reps = factionStandings
  1055. end
  1056.  
  1057. --[[-- Checks for world quests on load --]]--
  1058. function WorldQuestTips:PLAYER_ENTERING_WORLD()
  1059. if debugging then print("WQT-Dedugging: Checking quest log for World Quests - "..GetNumQuestLogEntries().." quest log entries found...") end
  1060. for q = 1, GetNumQuestLogEntries() do
  1061. addWorldQuest(q)
  1062. end
  1063. for questID, data in pairs(tracking) do
  1064. if GetQuestLogIndexByID(questID) == 0 then
  1065. data.active = false;
  1066. end
  1067. end
  1068. end
  1069.  
  1070. --[[-- Filter System Message (quest completed string) --]]--
  1071. local filter = function(frame, event, message, ...)
  1072. -- Filter function:
  1073. -- return true to remove message
  1074. -- return false with new message to ammend message
  1075. -- return false to leave message unchanged
  1076. local questFound = false;
  1077. for _, questName in ipairs(trackingNames) do
  1078. if (string.match(message, questName)) then
  1079. questFound = true;
  1080. end
  1081. end
  1082. if message:match("wqt:") then
  1083. local newmessage = message:gsub("wqt:", "")
  1084. return false, newmessage, ...
  1085. else
  1086. return questFound
  1087. end
  1088. end
  1089. ChatFrame_AddMessageEventFilter("CHAT_MSG_SYSTEM", filter)
  1090.  
  1091. --[[-- For filter debugging (prints system all messages) --]]--[[
  1092. function WorldQuestTips:CHAT_MSG_SYSTEM(message)
  1093. print( message )
  1094. end--]]
  1095.  
  1096. --[[ Checks chat links for customlink --]]
  1097. local OldSetItemRef = SetItemRef
  1098. function SetItemRef(link, text, button, chatFrame)
  1099. local func, questID = strmatch(link, "^quest:(%a+)(%d+)")
  1100. if func == "wqtLink" then
  1101. WorldQuestTips:loadOptions( tonumber(questID) )
  1102. else
  1103. OldSetItemRef(link, text, button, chatFrame)
  1104. end
  1105. end
  1106.  
  1107.  
  1108. function WorldQuestTips:QUEST_TURNED_IN(questID)
  1109. if pet_quests[questID] or botbi[questID] == false or fishingRTI[questID] == false then dataloaded = false end
  1110. if tracking[questID] then
  1111.  
  1112. if enigmaticQuests[ questID ] then
  1113. enigmaticActive = false
  1114. if WorldQuestTips.enigmatic then WorldQuestTips.enigmatic:Hide() end
  1115. if WorldQuestTips.enigmaticHUD then WorldQuestTips.enigmaticHUD:Hide() end
  1116. end
  1117.  
  1118. local totaltime = tracking[questID].duration + ( time() - tracking[questID].start )
  1119. if WorldQuestTipsData.global.worldQuests[questID] == nil then WorldQuestTipsData.global.worldQuests[questID] = { completed = 0, timespent = 0} end
  1120. WorldQuestTipsData.global.worldQuests[questID].completed = WorldQuestTipsData.global.worldQuests[questID].completed + 1;
  1121. WorldQuestTipsData.global.worldQuests[questID].timespent = WorldQuestTipsData.global.worldQuests[questID].timespent + totaltime;
  1122. local averageTime = math.floor( WorldQuestTipsData.global.worldQuests[questID].timespent/WorldQuestTipsData.global.worldQuests[questID].completed )
  1123. local title, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(questID);
  1124.  
  1125. local completionString = "wqt:\124cffffff00\124Hquest:wqtLink"..questID..":110\124h["..title.."]\124h\124r "..L.COMPLETED_IN.." "..SecondsToTime(totaltime).. "."
  1126. if WorldQuestTipsData.global.options.showTimes and WorldQuestTipsData.global.worldQuests[questID].completed > 1 then
  1127. completionString = completionString .. " ("..L.AVERAGE..": "..SecondsToTime(averageTime)..")"
  1128. end
  1129. SendSystemMessage( completionString );
  1130. if WorldQuestTipsData.global.options.showTimes and totaltime > 60 then
  1131. local timeInMin = totaltime/60;
  1132. local money = GetQuestLogRewardMoney(questID);
  1133. if ( money > 100000 ) then -- don't bother displaying for low values of gold
  1134. money = math.floor( money / timeInMin )
  1135. SendSystemMessage(YOU_EARNED_LABEL.." "..GetCoinTextureString(money).." "..L.PER_MINUTE..".")
  1136. end
  1137. local name, texture, numItems = GetQuestLogRewardCurrencyInfo(1, questID);
  1138. if name ~= nil then
  1139. numItems = math.floor( numItems / timeInMin )
  1140. local text = BONUS_OBJECTIVE_REWARD_WITH_COUNT_FORMAT:format(texture, numItems, name);
  1141. SendSystemMessage(YOU_EARNED_LABEL.." ".. text .." "..L.PER_MINUTE..".")
  1142. end
  1143. local honor = GetQuestLogRewardHonor(questID)
  1144. if honor > 0 then
  1145. averageHonor = math.floor( honor / timeInMin )
  1146. text = BONUS_OBJECTIVE_REWARD_WITH_COUNT_FORMAT:format("Interface\\ICONS\\Achievement_LegionPVPTier4", averageHonor, HONOR);
  1147. SendSystemMessage(YOU_EARNED_LABEL.." ".. text .." "..L.PER_MINUTE..".")
  1148. end
  1149. end
  1150. tracking[questID] = nil
  1151. end
  1152. end
  1153.  
  1154. function WorldQuestTips:UNIT_ENTERING_VEHICLE()
  1155. local collectingEnergy = GetSpellInfo(218813)
  1156. if UnitDebuff("player", collectingEnergy) then
  1157. local viewedZone = GetCurrentMapAreaID()
  1158. SetMapToCurrentZone()
  1159. local thisZone = GetCurrentMapAreaID()
  1160. local zone = thisZone or viewedZone
  1161. SetMapByID( viewedZone )
  1162.  
  1163. -- local _, zone = C_TaskQuest.GetQuestZoneID( questID ) --use this instead?
  1164.  
  1165. if leyraceWP[ zone ] then
  1166. addWayPoints( leyraceWP[ zone ].questID, "leyrace", zone, nil, nil, nil, "Ley Line Node" )
  1167. end
  1168. end
  1169. end
  1170.  
  1171. local function addpetlines( tt, name, botbip )
  1172. if WorldQuestTipsData.global.options.PetFF then
  1173. local tamer = pet_tamers[name]
  1174. local headerAdded = false
  1175. --tt:AddLine("\n"..ACHIEVEMENT_PROGRESSED..":")
  1176. if botbip == false and not botbi.complete then
  1177. tt:AddLine("\n"..ACHIEVEMENT_PROGRESSED..":")
  1178. headerAdded = true
  1179. tt:AddDoubleLine("|cffffff00[" .. botbi.name .. "]", "|cffffffff(".. botbi.count .. "/30)")
  1180. end
  1181. if tamer ~= nil then
  1182. for f, complete in pairs(tamer) do
  1183. if not complete and WorldQuestTipsData.global.pets.ff[name][f] ~= false then
  1184. if not headerAdded then
  1185. tt:AddLine("\n"..ACHIEVEMENT_PROGRESSED..":")
  1186. headerAdded = true
  1187. end
  1188. tt:AddDoubleLine(pets[f].icon .. "|cffffff00[" .. pets[f].achName .. "]", "|cffffffff(".. pets[f].count .. "/12)")
  1189. end
  1190. end
  1191. end
  1192. end
  1193. end
  1194.  
  1195. function WorldQuestTips:UNIT_QUEST_LOG_CHANGED(unitID)
  1196. if unitID == "player" then
  1197. for q = 1, GetNumQuestLogEntries() do
  1198. local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(q)
  1199. local tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex = GetQuestTagInfo(questID);
  1200. if worldQuestType and tracking[questID] then
  1201.  
  1202. if enigmaticQuests[ questID ] then enigmaticAttempting = false end
  1203.  
  1204. local isInArea, isOnMap, numObjectives = GetTaskInfo(questID)
  1205. if numObjectives then
  1206. for obj = 1, numObjectives do
  1207. local objectiveText, objectiveType, finished = GetQuestObjectiveInfo(questID, obj, false);
  1208. if objectiveText ~= tracking[questID].objectives[obj] and objectiveText ~= tracking[questID].objectivesInit[obj] then
  1209. tracking[questID].objectives[obj] = objectiveText;
  1210. tracking[questID].progressed = true;
  1211. end
  1212. end
  1213. end
  1214. local percent = C_TaskQuest.GetQuestProgressBarInfo(questID);
  1215. if percent and percent ~= tracking[questID].objectives.percent and percent > 0 then
  1216. tracking[questID].objectives.percent = percent;
  1217. tracking[questID].progressed = true;
  1218. end
  1219. end
  1220. end
  1221. end
  1222. end
  1223.  
  1224. function WorldQuestTips:QUEST_REMOVED(questID)
  1225. if awqwp[questID] then
  1226. for i in pairs( awqwp[questID] ) do
  1227. TomTom:RemoveWaypoint( awqwp[questID][i] )
  1228. end
  1229. end
  1230. if tracking[questID] then
  1231. if enigmaticQuests[ questID ] then
  1232. enigmaticActive = false
  1233. if WorldQuestTips.enigmatic then WorldQuestTips.enigmatic:Hide() end
  1234. if WorldQuestTips.enigmaticHUD then WorldQuestTips.enigmaticHUD:Hide() end
  1235. end
  1236. if tracking[questID].progressed then
  1237. tracking[questID].duration = tracking[questID].duration + ( time() - tracking[questID].start )
  1238. tracking[questID].start = time()
  1239. end
  1240. if debugging then print( "QUEST_REMOVED :"..questID.." - timer should pause at:"..tracking[questID].duration ) end
  1241. tracking[questID].progressed = false
  1242. tracking[questID].active = false
  1243. end
  1244. end
  1245.  
  1246. function WorldQuestTips:QUEST_ACCEPTED(self)
  1247. addWorldQuest(self)
  1248. end
  1249.  
  1250. hooksecurefunc ("ObjectiveTracker_Update", function ()
  1251. findQuest()
  1252. end)
  1253.  
  1254. --[[hooksecurefunc ("TaskPOI_OnClick", function (self, button)
  1255. if self.worldQuest and button == "LeftButton" then
  1256. if IsAltKeyDown() and WorldQuestTipsData.global.options.EditOnC then
  1257. WorldQuestTips:loadOptions( self.questID )
  1258. end
  1259. end
  1260. end)]]--
  1261.  
  1262. --[[-- Adds tooltip to world quests on map --]]--
  1263. hooksecurefunc ("TaskPOI_OnEnter", function (self)
  1264. --function TaskPOI_OnEnter(self)
  1265. WorldMapTooltip:SetOwner(self, "ANCHOR_RIGHT");
  1266.  
  1267. if ( not HaveQuestData(self.questID) ) then
  1268. WorldMapTooltip:SetText(RETRIEVING_DATA, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b);
  1269. WorldMapTooltip:Show();
  1270. return;
  1271. end
  1272.  
  1273. local title, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(self.questID);
  1274.  
  1275.  
  1276. -- Handling other addons changing the PoI frame name willynillily
  1277. if ( IsAltKeyDown() and WorldQuestTipsData.global.options.EditOnC ) and ( WorldQuestTrackerAddon or AngryWorldQuests ) then
  1278. local mtable = GetMouseFocus()
  1279. if mtable and mtable:HasScript("OnClick") then
  1280. local orginalScript = mtable:GetScript("OnClick")
  1281. mtable:SetScript("OnClick", function (self, button)
  1282. if button == "LeftButton" and WorldQuestTipsData.global.options.EditOnC and IsAltKeyDown() then
  1283. WorldQuestTips:loadOptions( self.questID )
  1284. else
  1285. orginalScript( self )
  1286. end
  1287. end)
  1288. end
  1289. end
  1290.  
  1291. if ( self.worldQuest ) then
  1292. if not dataloaded then getdata() end
  1293. local averageTime
  1294. if WorldQuestTipsData.global.worldQuests[self.questID] == nil then
  1295. findQuest(self.questID)
  1296. end
  1297. if WorldQuestTipsData.global.worldQuests[self.questID].coords == nil then
  1298. findQuest(self.questID)
  1299. end
  1300. if WorldQuestTipsData.global.worldQuests[self.questID] and WorldQuestTipsData.global.worldQuests[self.questID].completed > 0 then
  1301. averageTime = math.floor( WorldQuestTipsData.global.worldQuests[self.questID].timespent/WorldQuestTipsData.global.worldQuests[self.questID].completed )
  1302. end
  1303. local tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex = GetQuestTagInfo(self.questID);
  1304. local color = WORLD_QUEST_QUALITY_COLORS[rarity];
  1305. WorldMapTooltip:SetText(title, color.r, color.g, color.b);
  1306. if ( factionID ) then
  1307. --name, description, standingID, barMin, barMax, barValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, hasRep, isWatched, isChild, factionID, hasBonusRepGain, canBeLFGBonus = GetFactionInfoByID(factionID)
  1308. local factionName,_,factionStanding,barMin,barMax,value = GetFactionInfoByID(factionID);
  1309. barMax = (barMax - barMin)/1000;
  1310. local barValue = math.floor( (value - barMin)/100 ) / 10
  1311. local factionStandingtext = GetText("FACTION_STANDING_LABEL"..factionStanding, gender);
  1312. if ( factionName ) then
  1313. if capped then
  1314. if WorldQuestTipsData.global.options.showCurrentRep then
  1315. factionName = factionName.." ("..factionStandingtext..")"
  1316. end
  1317. if WorldQuestTipsData.global.options.showExalted then
  1318. WorldMapTooltip:AddLine(factionName, GRAY_FONT_COLOR:GetRGB());
  1319. end
  1320. else
  1321. if WorldQuestTipsData.global.options.showCurrentRep then
  1322. factionName = factionName.." ("..factionStandingtext.." "..barValue.."k /"..barMax.."k)";
  1323. end
  1324. if factionStanding == 8 and not WorldQuestTipsData.global.options.showExalted then
  1325. factionName = nil;
  1326. end
  1327. WorldMapTooltip:AddLine(factionName);
  1328. end
  1329. end
  1330.  
  1331. -- local _, fmap = C_TaskQuest.GetQuestZoneID( self.questID )
  1332. local fmap = WorldQuestTipsData.global.worldQuests[self.questID].coords.default.m
  1333. -- if WorldQuestTipsData.global.worldQuests[self.questID] and WorldQuestTipsData.global.worldQuests[self.questID].coords then
  1334. -- fmap = WorldQuestTipsData.global.worldQuests[self.questID].coords.default.m
  1335. -- else
  1336. -- _, fmap = findQuest( self.questID )
  1337. -- end
  1338. -- local fmap = WorldQuestTipsData.global.worldQuests[self.questID].coords.default.m
  1339. if zoneFactions[fmap] and zoneFactions[fmap] ~= factionID then
  1340. local factionName2,_,factionStanding2,barMin2,barMax2,value2 = GetFactionInfoByID(zoneFactions[fmap]);
  1341. barMax2 = (barMax2 - barMin2)/1000;
  1342. local barValue2 = math.floor( (value2 - barMin2)/100 ) / 10
  1343. local factionStandingtext2 = GetText("FACTION_STANDING_LABEL"..factionStanding2, gender);
  1344. if ( factionName2 ) then
  1345. if value2 == 42999 then
  1346. if WorldQuestTipsData.global.options.showCurrentRep then
  1347. factionName2 = factionName2.." ("..factionStandingtext2..")"
  1348. end
  1349. if WorldQuestTipsData.global.options.showExalted then
  1350. WorldMapTooltip:AddLine(factionName2, GRAY_FONT_COLOR:GetRGB());
  1351. end
  1352. else
  1353. if WorldQuestTipsData.global.options.showCurrentRep then
  1354. factionName2 = factionName2.." ("..factionStandingtext2.." "..barValue2.."k /"..barMax2.."k)";
  1355. end
  1356. if factionStanding2 == 8 and not WorldQuestTipsData.global.options.showExalted then
  1357. factionName2 = nil;
  1358. end
  1359. WorldMapTooltip:AddLine(factionName2);
  1360. end
  1361. end
  1362. end
  1363. end
  1364.  
  1365. local currentTime = 0
  1366. if tracking[self.questID] then
  1367. if tracking[self.questID].active then
  1368. currentTime = tracking[self.questID].duration + ( time() - tracking[self.questID].start )
  1369. else
  1370. currentTime = tracking[self.questID].duration
  1371. end
  1372. end
  1373. if WorldQuestTipsData.global.options.showTimes and ( ( averageTime and averageTime > 0 ) or currentTime > 0 ) then
  1374. if ( averageTime and averageTime > 0 ) and currentTime > 0 then
  1375. WorldMapTooltip:AddDoubleLine( TIME_LABEL.." "..SecondsToTime(currentTime), "("..L.AVERAGE..": "..SecondsToTime(averageTime)..")" )
  1376. elseif ( averageTime and averageTime > 0 ) then
  1377. WorldMapTooltip:AddLine( L.AVERAGE..": "..SecondsToTime(averageTime) )
  1378. else
  1379. WorldMapTooltip:AddLine( TIME_LABEL.." "..SecondsToTime(currentTime) )
  1380. end
  1381. end
  1382.  
  1383. WorldMap_AddQuestTimeToTooltip(self.questID);
  1384. else
  1385. WorldMapTooltip:SetText(title);
  1386. end
  1387.  
  1388. if tracking[self.questID] then
  1389. for k,v in pairs(tracking[self.questID].objectives) do
  1390. if k ~= "percent" then
  1391. local color = HIGHLIGHT_FONT_COLOR;
  1392. WorldMapTooltip:AddLine(QUEST_DASH .. v, color.r, color.g, color.b, true);
  1393. end
  1394. end
  1395. else
  1396. for objectiveIndex = 1, self.numObjectives do
  1397. local objectiveText, objectiveType, finished = GetQuestObjectiveInfo(self.questID, objectiveIndex, false);
  1398. if ( objectiveText and #objectiveText > 0 ) then
  1399. local color = finished and GRAY_FONT_COLOR or HIGHLIGHT_FONT_COLOR;
  1400. WorldMapTooltip:AddLine(QUEST_DASH .. objectiveText, color.r, color.g, color.b, true);
  1401. end
  1402. end
  1403. end
  1404.  
  1405. local percent
  1406. if tracking[self.questID] then
  1407. percent = tracking[self.questID].objectives.percent;
  1408. else
  1409. percent = C_TaskQuest.GetQuestProgressBarInfo(self.questID);
  1410. end
  1411. if ( percent ) then
  1412. GameTooltip_InsertFrame(WorldMapTooltip, WorldMapTaskTooltipStatusBar);
  1413. WorldMapTaskTooltipStatusBar.Bar:SetValue(percent);
  1414. WorldMapTaskTooltipStatusBar.Bar.Label:SetFormattedText(PERCENTAGE_STRING, percent);
  1415. end
  1416.  
  1417. if fishingRTI[ self.questID ] == false and not fishingRTI.complete then
  1418. WorldMapTooltip:AddLine("\n"..ACHIEVEMENT_PROGRESSED..":")
  1419. WorldMapTooltip:AddDoubleLine("|cffffff00[" .. fishingRTI.name .. "]", "|cffffffff(".. fishingRTI.count .. "/25)")
  1420. end
  1421.  
  1422. if ffamfm[ self.questID ] and not ffamfm[ self.questID ].completed then
  1423. WorldMapTooltip:AddLine("\n"..ACHIEVEMENT_PROGRESSED..":")
  1424. WorldMapTooltip:AddDoubleLine("|cffffff00[" .. ffamfm[ self.questID ].name .. "]", "|cffffffff(".. ffamfm[ self.questID ].quantity .. "/" .. ffamfm[ self.questID ].requiredQuantity .. ")")
  1425. end
  1426.  
  1427. if pet_tamers[pet_quests[self.questID]] ~= nil or botbi[self.questID] == false then
  1428. addpetlines( WorldMapTooltip, pet_quests[self.questID], botbi[self.questID] )
  1429. end
  1430.  
  1431. if WorldQuestTipsData.global.worldQuests[self.questID] and WorldQuestTipsData.global.worldQuests[self.questID].note ~= nil then
  1432. WorldMapTooltip:AddLine("|cffffff00"..LABEL_NOTE..": |cffffffff"..WorldQuestTipsData.global.worldQuests[self.questID].note,1,1,1, true)
  1433. end
  1434.  
  1435. GameTooltip_AddQuestRewardsToTooltip(WorldMapTooltip, self.questID);
  1436.  
  1437. if ( self.worldQuest and WorldMapTooltip.AddDebugWorldQuestInfo ) then
  1438. WorldMapTooltip:AddDebugWorldQuestInfo(self.questID);
  1439. end
  1440. WorldMapTooltip:Show();
  1441. end)
  1442.  
  1443. hooksecurefunc ("GameTooltip_AddQuestRewardsToTooltip", function (tooltip, questID)
  1444. --function WorldMap_AddQuestRewardsToTooltip(questID)
  1445. local averageTime
  1446. local averageTimeInMin
  1447. if WorldQuestTipsData.global.worldQuests[questID] and WorldQuestTipsData.global.worldQuests[questID].completed > 0 then
  1448. averageTime = math.floor( WorldQuestTipsData.global.worldQuests[questID].timespent/WorldQuestTipsData.global.worldQuests[questID].completed )
  1449. averageTimeInMin = averageTime/60;
  1450. end
  1451.  
  1452. -- money
  1453. local money = GetQuestLogRewardMoney(questID);
  1454. if ( money > 0 ) then
  1455. local moneyString = GetCoinTextureString(money);
  1456. local moneyAverage = ""
  1457. if money > 100000 and WorldQuestTipsData.global.options.showTimes and averageTime and averageTimeInMin > 1 then
  1458. local averageMoney = math.floor( ( (money/10000) / averageTimeInMin ) + 0.5 )
  1459. moneyAverage = "(".. averageMoney.." "..L.PER_MINUTE..")"
  1460. WorldMapTooltipMoneyFrame1SuffixText:SetText(" "..moneyAverage)
  1461. WorldMapTooltipMoneyFrame1SuffixText:SetPoint("LEFT", WorldMapTooltipMoneyFrame1CopperButton, "RIGHT",5, 0);
  1462. WorldMapTooltipMoneyFrame1SuffixText:Show()
  1463. end
  1464. if WorldQuestTipsData.global.options.hideSmallGold and money < WorldQuestTipsData.global.options.hideSmallGoldThreshold*10000 then
  1465. GameTooltip_ClearMoney(WorldMapTooltip)
  1466. if _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()]:GetText() == " " then _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()]:SetText() end
  1467. if _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()-1]:GetText() == " " then _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()-1]:SetText() end
  1468. end
  1469. end
  1470.  
  1471. local honor = GetQuestLogRewardHonor(questID)
  1472. local line = 0
  1473. if honor > 0 then line = 1 end
  1474.  
  1475. -- currency
  1476. local numQuestCurrencies = GetNumQuestLogRewardCurrencies(questID);
  1477. if numQuestCurrencies > 0 and averageTime and averageTimeInMin > 1 then
  1478. -- for i = 1, numQuestCurrencies do
  1479. local name, texture, numItems = GetQuestLogRewardCurrencyInfo(1, questID);
  1480. local averageNumItems = math.floor( numItems / averageTimeInMin )
  1481. local text = _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()-line]:GetText()
  1482. -- print(text)
  1483. if WorldQuestTipsData.global.options.showTimes then text = text .. " (" .. averageNumItems .. " "..L.PER_MINUTE..")" end
  1484. _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()-line]:SetText( text )
  1485. -- end
  1486. end
  1487.  
  1488. -- honor
  1489. if honor > 0 and averageTime and averageTimeInMin > 1 then
  1490. local honorLine = 0
  1491. local averageHonor = math.floor( honor / averageTimeInMin )
  1492. local text = _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()]:GetText()
  1493. if text == " " then
  1494. text = _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()-1]:GetText()
  1495. honorLine = 1
  1496. end
  1497. if WorldQuestTipsData.global.options.showTimes then text = text .. " (" .. averageHonor .. " "..L.PER_MINUTE..")" end
  1498. _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines() - honorLine]:SetText( text )
  1499. end
  1500.  
  1501. -- items
  1502. local numQuestRewards = GetNumQuestLogRewards(questID);
  1503. if numQuestRewards > 0 then
  1504. local artifactPower
  1505. local itemType = WorldMapTooltipTooltipTextLeft2:GetText()
  1506. -- if (itemType and itemType:match ("|cFFE6CC80")) then -- If itemType is Artifact colour
  1507. -- local ap = string.match(WorldMapTooltipTooltipTextLeft4:GetText(), '%d+,?%d+,?%d+'):gsub(",","")
  1508. -- artifactPower = tonumber ( ap )
  1509. -- end
  1510. if WorldQuestTipsData.global.options.showTimes and artifactPower and averageTime and averageTimeInMin > 1 then
  1511. local averageArtifactPower = math.floor( artifactPower / averageTimeInMin )
  1512. -- WorldMapTooltip.ItemTooltip.Tooltip:AddLine("|cffe6cc80"..averageArtifactPower.. " Artifact Power per minute")
  1513. -- WorldMapTooltip:AddLine("|cffffffff"..averageArtifactPower.." "..itemType.."|cffffffff per min")
  1514. WorldMapTooltipTooltipTextLeft2:SetText( itemType.." ("..averageArtifactPower.." "..L.PER_MINUTE..")" )
  1515. end
  1516. if debugging then WorldMapTooltip.ItemTooltip.Tooltip:AddDoubleLine("QuestID:", questID) end
  1517. WorldMapTooltip.ItemTooltip.Tooltip:Show()
  1518. else
  1519. if debugging then WorldMapTooltip:AddDoubleLine("QuestID:", questID) end
  1520. end
  1521. end)
  1522.  
  1523. local enigma = GetSpellInfo(219247)
  1524. local function enigmaticUpdate()
  1525. if WorldQuestTipsData.global.options.useEnigmatic then
  1526. if UnitDebuff("player", enigma) then
  1527. if not enigmaticAttempting then
  1528. enigmaticAttempting = true
  1529. WorldQuestTips:loadEnigmatic()
  1530. WorldQuestTips:loadEnigmaticHUD()
  1531. end
  1532. else
  1533. if enigmaticAttempting then
  1534. enigmaticAttempting = false
  1535. WorldQuestTips.enigmaticHUD:Hide()
  1536. WorldQuestTips:loadEnigmatic()
  1537. end
  1538. end
  1539. end
  1540. end
  1541.  
  1542. local function onUpdate(self,elapsed)
  1543. closedtimer = closedtimer + elapsed
  1544. if closedtimer >= 1 then
  1545. if refreshing then
  1546. BonusObjectiveTracker_ShowRewardsTooltip(refreshingblock);
  1547. closedtimer = 0
  1548. end
  1549. if enigmaticActive then
  1550. enigmaticUpdate()
  1551. closedtimer = 0
  1552. else
  1553. enigmaticAttempting = false
  1554. end
  1555. end
  1556. if enigmaticAttempting and WorldQuestTips.enigmaticHUD then
  1557. local enigmaticHUD = WorldQuestTips.enigmaticHUD
  1558. local facing = GetPlayerFacing()
  1559. if facing then
  1560. local newFacing = facing - enigmaticHUD.initialMP.r
  1561. enigmaticHUD.arrow.texture:SetRotation( newFacing )
  1562.  
  1563. local unitX, unitY = GetPlayerMapPosition("player")
  1564.  
  1565. local movedX = enigmaticHUD.zone.x * ( unitX - enigmaticHUD.initialMP.x )
  1566. local movedY = enigmaticHUD.zone.y * ( unitY - enigmaticHUD.initialMP.y )
  1567.  
  1568. local dist = math.sqrt( movedX^2 + movedY^2 )
  1569.  
  1570. local actualAng = math.atan2( movedX, movedY ) + math.pi
  1571.  
  1572. movedX = ( dist * math.sin( enigmaticHUD.initialMP.r - actualAng ) ) * 0.4
  1573. movedY = ( dist * math.cos( enigmaticHUD.initialMP.r - actualAng ) ) * 0.4
  1574.  
  1575. local movedTextureX = enigmaticHUD.initialTP.x + movedX * WorldQuestTipsData.global.options.enigmaticHUDSize
  1576. local movedTextureY = enigmaticHUD.initialTP.y + movedY * WorldQuestTipsData.global.options.enigmaticHUDSize
  1577.  
  1578. enigmaticHUD.arrow:SetPoint("CENTER", enigmaticHUD, "BOTTOMLEFT", movedTextureX, movedTextureY )
  1579. end
  1580. end
  1581. end
  1582. local f = CreateFrame("frame")
  1583. f:SetScript("OnUpdate", onUpdate)
  1584.  
  1585. hooksecurefunc ("BonusObjectiveTracker_OnBlockClick", function (self)
  1586. if IsAltKeyDown() and WorldQuestTipsData.global.options.EditOnC then
  1587. WorldQuestTips:loadOptions( self.id )
  1588. end
  1589. end)
  1590.  
  1591. local lastTrackedQuestID = nil
  1592.  
  1593. hooksecurefunc ("BonusObjectiveTracker_TrackWorldQuest", function (questID, hardWatch)
  1594. if lastTrackedQuestID and not IsWorldQuestWatched(lastTrackedQuestID) then
  1595. if awqwp[lastTrackedQuestID] then
  1596. for i in pairs( awqwp[lastTrackedQuestID] ) do TomTom:RemoveWaypoint( awqwp[lastTrackedQuestID][i] ) end
  1597. end
  1598. end
  1599. if hardWatch then lastTrackedQuestID = nil else lastTrackedQuestID = questID end
  1600.  
  1601. local info = WorldQuestTipsData.global.worldQuests[ questID ].coords.default
  1602. local title, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(questID);
  1603. addWayPoints( questID, "click", info.m, info.f, info.x, info.y, title )
  1604. end)
  1605.  
  1606. hooksecurefunc ("BonusObjectiveTracker_UntrackWorldQuest", function (questID)
  1607. if awqwp[questID] then
  1608. for i in pairs( awqwp[questID] ) do TomTom:RemoveWaypoint( awqwp[questID][i] ) end
  1609. end
  1610. end)
  1611.  
  1612. hooksecurefunc ("BonusObjectiveTracker_OnBlockLeave", function (self)
  1613. refreshing = false
  1614. end)
  1615.  
  1616. hooksecurefunc ("BonusObjectiveTracker_ShowRewardsTooltip", function (self)
  1617. local tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex = GetQuestTagInfo(self.id);
  1618. if worldQuestType then
  1619. local title, factionID, capped = C_TaskQuest.GetQuestInfoByQuestID(self.id);
  1620. local faction1, faction2 = "", "";
  1621.  
  1622. if WorldQuestTipsData.global.worldQuests[self.id] == nil then
  1623. findQuest(self.questID)
  1624. end
  1625. if WorldQuestTipsData.global.worldQuests[self.id].coords == nil then
  1626. findQuest(self.questID)
  1627. end
  1628. -- local info, zone = findQuest( self.id )
  1629. if ( factionID ) then
  1630. --name, description, standingID, barMin, barMax, barValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, hasRep, isWatched, isChild, factionID, hasBonusRepGain, canBeLFGBonus = GetFactionInfoByID(factionID)
  1631. local factionName,_,factionStanding,barMin,barMax,value = GetFactionInfoByID(factionID);
  1632. barMax = (barMax - barMin)/1000;
  1633. local barValue = math.floor( (value - barMin)/100 ) / 10
  1634. local factionStandingtext = GetText("FACTION_STANDING_LABEL"..factionStanding, gender);
  1635. if ( factionName ) then
  1636. if (capped) then
  1637. if WorldQuestTipsData.global.options.showExalted then
  1638. if WorldQuestTipsData.global.options.showCurrentRep then
  1639. faction1 = factionName.." ("..factionStandingtext..")"
  1640. else
  1641. faction1 = factionName
  1642. end
  1643. end
  1644. else
  1645. if WorldQuestTipsData.global.options.showCurrentRep then
  1646. faction1 = factionName.." ("..factionStandingtext.." "..barValue.."k /"..barMax.."k)"
  1647. else
  1648. faction1 = factionName
  1649. end
  1650. if factionStanding == 8 and not WorldQuestTipsData.global.options.showExalted then
  1651. faction1 = "";
  1652. end
  1653. end
  1654. end
  1655. -- if WorldQuestTipsData.global.worldQuests[self.id].coords then
  1656. -- local _, zone = C_TaskQuest.GetQuestZoneID( self.questID )
  1657. local zone = WorldQuestTipsData.global.worldQuests[self.id].coords.default.m
  1658. -- end
  1659. if zoneFactions[zone] and zoneFactions[zone] ~= factionID then
  1660. local factionName2,_,factionStanding2,barMin2,barMax2,value2 = GetFactionInfoByID(zoneFactions[zone]);
  1661. barMax2 = (barMax2 - barMin2)/1000;
  1662. local barValue2 = math.floor( (value2 - barMin2)/100 ) / 10
  1663. local factionStandingtext2 = GetText("FACTION_STANDING_LABEL"..factionStanding2, gender);
  1664. if ( factionName2 ) then
  1665. if value2 == 42999 then
  1666. if WorldQuestTipsData.global.options.showExalted then
  1667. if WorldQuestTipsData.global.options.showCurrentRep then
  1668. faction2 = factionName2.." ("..factionStandingtext2..")"
  1669. else
  1670. faction2 = factionName2
  1671. end
  1672. end
  1673. else
  1674. if WorldQuestTipsData.global.options.showCurrentRep then
  1675. faction2 = factionName2.." ("..factionStandingtext2.." "..barValue2.."k /"..barMax2.."k)"
  1676. else
  1677. faction2 = factionName2
  1678. end
  1679. if factionStanding2 == 8 and not WorldQuestTipsData.global.options.showExalted then
  1680. faction2 = "";
  1681. end
  1682. end
  1683. if faction1 ~= "" then faction1 = faction1.."\n" end
  1684. end
  1685. end
  1686. end
  1687. local timeLeftMinutes = C_TaskQuest.GetQuestTimeLeftMinutes(self.id) * 60
  1688. if timeLeftMinutes then
  1689. if faction1 ~= "" or faction2 ~= "" then
  1690. GameTooltipTextLeft2:SetText("|cffffd100"..faction1..faction2.."\n"..BONUS_OBJECTIVE_TIME_LEFT:format(SecondsToTime(timeLeftMinutes)))
  1691. else
  1692. GameTooltipTextLeft2:SetText("|cffffd100"..BONUS_OBJECTIVE_TIME_LEFT:format(SecondsToTime(timeLeftMinutes)).."\n ")
  1693. end
  1694. end
  1695. refreshing = true
  1696. refreshingblock = self
  1697. if not dataloaded then getdata() end
  1698. if pet_tamers[pet_quests[self.id] ] ~= nil or botbi[self.id] == false then
  1699. addpetlines( GameTooltip, pet_quests[self.id], botbi[self.id] )
  1700. end
  1701.  
  1702. if WorldQuestTipsData.global.worldQuests[self.id] and WorldQuestTipsData.global.worldQuests[self.id].note ~= nil then
  1703. GameTooltip:AddLine("|cffffff00"..LABEL_NOTE..": |cffffffff"..WorldQuestTipsData.global.worldQuests[self.id].note,1,1,1, true)
  1704. end
  1705.  
  1706. local averageTime
  1707. local averageTimeStr = " "
  1708. local currentTimeStr = " "
  1709. if WorldQuestTipsData.global.worldQuests[self.id] and WorldQuestTipsData.global.worldQuests[self.id].completed > 0 then
  1710. averageTime = math.floor( WorldQuestTipsData.global.worldQuests[self.id].timespent/WorldQuestTipsData.global.worldQuests[self.id].completed )
  1711. if averageTime > 0 then averageTimeStr = "("..L.AVERAGE..": "..SecondsToTime(averageTime)..")" end
  1712. end
  1713. if tracking[self.id] then
  1714. local currentTime
  1715. if tracking[self.id].active then
  1716. currentTime = tracking[self.id].duration + ( time() - tracking[self.id].start )
  1717. else
  1718. currentTime = tracking[self.id].duration
  1719. end
  1720. if currentTime > 0 then currentTimeStr = TIME_LABEL.." "..SecondsToTime(currentTime) end
  1721. end
  1722. if WorldQuestTipsData.global.options.showTimes and (averageTime or tracking[self.id]) then GameTooltip:AddDoubleLine( currentTimeStr, averageTimeStr ) end
  1723.  
  1724. GameTooltip:Show()
  1725. end
  1726. end)
  1727.  
  1728. -- This snipet is thanks to Vildiesel - EU Well of Eternity "Precise World Quest Timer"
  1729. hooksecurefunc("WorldMap_AddQuestTimeToTooltip", function(questID)
  1730. local timeLeftMinutes = C_TaskQuest.GetQuestTimeLeftMinutes(questID) * 60
  1731. if timeLeftMinutes then
  1732. _G["WorldMapTooltipTextLeft"..WorldMapTooltip:NumLines()]:SetText(BONUS_OBJECTIVE_TIME_LEFT:format(SecondsToTime(timeLeftMinutes)).."\n")
  1733. end
  1734. end)
  1735.  
  1736. --[[ Adds tooltip to NPCs --]]
  1737. GameTooltip:HookScript("OnTooltipSetUnit", function(self)
  1738. if not dataloaded then getdata() end
  1739. if C_PetBattles.IsInBattle() then return end
  1740. local unit = select(2, self:GetUnit())
  1741. if unit then
  1742. local name = UnitName(unit) or ""
  1743. if pet_tamers[name] ~= nil then
  1744. local questID
  1745. for k, v in pairs(pet_quests) do
  1746. if v == name then questID = k end
  1747. end
  1748. addpetlines( GameTooltip, name, botbi[questID] )
  1749. GameTooltip:Show()
  1750. end
  1751. end
  1752. end)
  1753.  
  1754. local function addRepToToolTip( self, factionID )
  1755. if WorldQuestTipsData.global.options.showRepOnItems then
  1756. local factionName,_,factionStanding,barMin,barMax,value = GetFactionInfoByID( factionID );
  1757. barMax = (barMax - barMin)/1000;
  1758. local barValue = math.floor( (value - barMin)/100 ) / 10
  1759. local factionStandingtext = GetText("FACTION_STANDING_LABEL"..factionStanding, gender);
  1760. local colour = "|cff808080"
  1761. if factionStanding < 8 then
  1762. factionStandingtext = factionStandingtext.." "..barValue.."k /"..barMax.."k"
  1763. colour = "|cffffd100"
  1764. end
  1765. if not ( factionStanding == 8 and not WorldQuestTipsData.global.options.showExalted ) then
  1766. _G[ self:GetName().."TextLeft2" ]:SetText( colour..factionStandingtext.."\124r\n".._G[ self:GetName().."TextLeft2" ]:GetText().." ")
  1767. end
  1768.  
  1769. if WorldQuestTipsData.global.options.showAltRepOnItems then
  1770. for i = 1, self:NumLines() do
  1771. -- if string.find(_G[ self:GetName().."TextLeft"..i ]:GetText(),ITEM_BNETACCOUNTBOUND) and IsAltKeyDown() then
  1772. if string.find(_G[ self:GetName().."TextLeft"..i ]:GetText(),ITEM_BNETACCOUNTBOUND) or string.find(_G[ self:GetName().."TextLeft"..i ]:GetText(),ITEM_BIND_TO_BNETACCOUNT) then
  1773. for k,v in pairs( WorldQuestTipsData ) do
  1774. if k ~= "global" and k ~= "version" and k ~= profileKey then
  1775. if v.info and v.info.level > 100 then
  1776. local color = RAID_CLASS_COLORS[v.info.class]
  1777. local level = ""
  1778. if v.info.level < 110 then level = "|cffffffff ("..v.info.level..")" end
  1779. -- if not ( string.find( v.reps[ factionID ], "|cff808080" ) and not WorldQuestTipsData.global.options.showExalted ) then
  1780. -- self:AddDoubleLine( v.info.name..level, v.reps[factionID], color.r, color.g, color.b )
  1781. end
  1782. end
  1783. end
  1784. end
  1785. end
  1786. end
  1787. end
  1788. self:Show()
  1789. end
  1790. --end
  1791.  
  1792. hooksecurefunc(ItemRefTooltip, "SetHyperlink", function(self, link)
  1793. local type, id = string.match(link,"^(%a+):(%d+)")
  1794. if type == "item" and repitems[ id ] then
  1795. addRepToToolTip( self, repitems[ id ] )
  1796. end
  1797. end)
  1798.  
  1799. --[[hooksecurefunc(WorldMapFrame.UIElementsFrame.BountyBoard, "ShowBountyTooltip", function(self, i)
  1800. addRepToToolTip( WorldMapTooltip, self.bounties[ i ].factionID )
  1801. end)]]--
  1802.  
  1803. GameTooltip:HookScript("OnTooltipSetItem", function(self)
  1804. local link = select(2, self:GetItem())
  1805. if link then
  1806. local id = string.match(link, "item:(%d*)")
  1807. if id and repitems[ id ] then
  1808. addRepToToolTip( self, repitems[ id ] )
  1809. end
  1810. end
  1811. end)
  1812.  
  1813. WorldMapFrame:HookScript("OnShow", function(self)
  1814. if wqto then
  1815. wqto:SetParent("WorldMapFrame")
  1816. wqto:SetFrameLevel(999)
  1817. end
  1818. end)
  1819.  
  1820. WorldMapFrame:HookScript("OnHide", function(self)
  1821. if wqto then
  1822. wqto:SetParent("UIParent")
  1823. end
  1824. end)
  1825.  
  1826. local currentQuestEdit
  1827.  
  1828. local function fillQuestInfo( questID )
  1829. if questID ~= nil then
  1830. currentQuestEdit = questID
  1831. else
  1832. currentQuestEdit = wqto.q.qid:GetNumber()
  1833. end
  1834. --local title = C_TaskQuest.GetQuestInfoByQuestID( currentQuestEdit )
  1835. local title
  1836. if currentQuestEdit ~= 0 and WorldQuestTipsData.global.worldQuests[ currentQuestEdit ] ~= nil then title = WorldQuestTipsData.global.worldQuests[ currentQuestEdit ].title end
  1837. if title then
  1838. wqto.q.qlink.name:SetText( "[ "..title.." ]" )
  1839. end
  1840. if WorldQuestTipsData.global.worldQuests[currentQuestEdit] ~= nil then
  1841. if WorldQuestTipsData.global.worldQuests[currentQuestEdit].note then
  1842. wqto.q.qnote:SetText( WorldQuestTipsData.global.worldQuests[currentQuestEdit].note )
  1843. else
  1844. wqto.q.qnote:SetText( "" )
  1845. WorldQuestTipsData.global.worldQuests[currentQuestEdit].note = nil
  1846. end
  1847. if wqto.q.qid:GetNumber() ~= currentQuestEdit then wqto.q.qid:SetNumber( currentQuestEdit ) end
  1848. wqto.q.qnote:Enable()
  1849. wqto.q.qnote:SetTextColor( 1,1,1 )
  1850. wqto.q.qwowhead:SetText( wowhead .. currentQuestEdit )
  1851. wqto.q.qtc:Enable()
  1852. wqto.q.qtc:SetTextColor( 1,1,1 )
  1853. wqto.q.qtc:SetText( WorldQuestTipsData.global.worldQuests[currentQuestEdit].completed )
  1854. wqto.q.qtt:Enable()
  1855. wqto.q.qtt:SetTextColor( 1,1,1 )
  1856. wqto.q.qtt:SetText( WorldQuestTipsData.global.worldQuests[currentQuestEdit].timespent )
  1857. local averageTime = math.floor( WorldQuestTipsData.global.worldQuests[currentQuestEdit].timespent/WorldQuestTipsData.global.worldQuests[currentQuestEdit].completed )
  1858. if WorldQuestTipsData.global.worldQuests[currentQuestEdit].completed > 0 then
  1859. wqto.q.qave:SetText( L.AVERAGE..": "..SecondsToTime(averageTime) )
  1860. else
  1861. wqto.q.qave:SetText( "" )
  1862. end
  1863. else
  1864. if currentQuestEdit == 0 then wqto.q.qlink.name:SetText( " " )
  1865. else wqto.q.qlink.name:SetText( "Data not found for ".. L.OPTIONS_Q_ID ..": "..currentQuestEdit ) end
  1866. currentQuestEdit = nil
  1867. wqto.q.qnote:SetText( L.OPTIONS_Q_NOTE_TIP .. "..." )
  1868. wqto.q.qnote:SetTextColor( GRAY_FONT_COLOR:GetRGB() )
  1869. wqto.q.qnote:Disable()
  1870. wqto.q.qtc:SetText( "" )
  1871. wqto.q.qtc:Disable()
  1872. wqto.q.qtt:SetText( "" )
  1873. wqto.q.qtt:Disable()
  1874. wqto.q.qwowhead:SetText( "" )
  1875. wqto.q.qave:SetText( "" )
  1876. end
  1877. if botbi[currentQuestEdit] then wqto.q.qxufu:Show(); wqto.q.qxufu:SetText("www.wow-petguide.com/index.php?m=LegionWQ") else wqto.q.qxufu:Hide() end
  1878. end
  1879.  
  1880. function WorldQuestTips:loadOptions( questID )
  1881.  
  1882. if not dataloaded then getdata() end
  1883.  
  1884. local tablist = { g = GENERAL, r = REPUTATION, o = TOOLTIP_BATTLE_PET, q = QUESTS_LABEL, e = "Enigmatic" }
  1885. if wqto == nil then
  1886. local initParent = UIParent
  1887. if WorldMapFrame:IsShown() then initParent = WorldMapFrame end
  1888.  
  1889. wqto = CreateFrame("FRAME", nil, initParent)
  1890. wqto:SetWidth(410)
  1891. wqto:SetHeight(440)
  1892. wqto:SetPoint("CENTER", UIParent, "CENTER")
  1893. wqto:SetBackdrop({
  1894. bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
  1895. edgeFile = "Interface/DialogFrame/UI-DialogBox-Border",
  1896. tile = true, tileSize = 32, edgeSize = 32,
  1897. insets = { left = 11, right = 12, top = 12, bottom = 11 }
  1898. })
  1899. wqto:SetFrameLevel(999)
  1900. wqto:SetMovable(true)
  1901.  
  1902. wqto.tabs = CreateFrame("FRAME", nil, wqto)
  1903. wqto.tabs:SetWidth(200)
  1904. wqto.tabs:SetHeight(440)
  1905. wqto.tabs:SetPoint("RIGHT", wqto, "LEFT", 16, 0)
  1906. wqto.tabs:SetBackdrop({
  1907. bgFile = "Interface/DialogFrame/UI-DialogBox-Background",
  1908. edgeFile = "Interface/DialogFrame/UI-DialogBox-Border",
  1909. tile = true, tileSize = 32, edgeSize = 32,
  1910. insets = { left = 11, right = 12, top = 12, bottom = 11 }
  1911. })
  1912. wqto.tabs.footer = wqto.tabs:CreateFontString(nil, wqto.tabs, "GameFontWhite" )
  1913. wqto.tabs.footer:SetText("v" .. format("%.2f",version) .. versionSuffix );
  1914. wqto.tabs.footer:SetPoint("BOTTOM", 0, 20 )
  1915.  
  1916. wqto.header = CreateFrame("FRAME", nil, wqto)
  1917. wqto.header:SetSize(384, 64)
  1918. wqto.header:SetBackdrop({ bgFile = "Interface/DialogFrame/UI-DialogBox-Header" })
  1919. wqto.header:SetPoint("TOP", wqto, "TOP", 0, 12)
  1920. wqto.header:EnableMouse(true)
  1921. wqto.header:SetScript("OnMouseDown", function(self) self:GetParent():StartMoving() end )
  1922. wqto.header:SetScript("OnMouseUp", function(self) self:GetParent():StopMovingOrSizing() end )
  1923. wqto.header.text = wqto.header:CreateFontString(nil, wqto.header, "GameFontNormal" )
  1924. wqto.header.text:SetText( L.TITLE )
  1925. wqto.header.text:SetPoint("TOP", 0, -14)
  1926.  
  1927. local tabbtnoffset = -32;
  1928. local function makeTabBtns( x, v )
  1929. wqto.tabBtno = CreateFrame("BUTTON", nil, wqto.tabs, "UIPanelButtonTemplate")
  1930. wqto.tabBtno:SetWidth(150)
  1931. wqto.tabBtno:SetHeight(24)
  1932. wqto.tabBtno:SetText( v )
  1933. wqto.tabBtno:SetPoint("TOP", wqto.tabs, 0, tabbtnoffset )
  1934. wqto.tabBtno:SetScript("OnClick", function() for z in pairs(tablist) do wqto[z]:Hide() end wqto[x]:Show() end)
  1935. wqto.tabBtno:SetAlpha(1)
  1936. wqto.tabBtno:Show()
  1937. end
  1938. for x, v in pairs(tablist) do
  1939. makeTabBtns( x, v )
  1940. tabbtnoffset = tabbtnoffset - 32
  1941. end
  1942.  
  1943. local g = CreateFrame("FRAME", nil, wqto)
  1944. g:SetWidth(410)
  1945. g:SetHeight(440)
  1946. g:SetPoint("CENTER", wqto, "CENTER")
  1947. g.subtitle_tomtom = g:CreateFontString(nil, g, "GameFontNormal" )
  1948. g.subtitle_tomtom:SetText("TomTom support:");
  1949. g.subtitle_tomtom:SetPoint("TOPLEFT", 20, -60 )
  1950.  
  1951. g.option_TomTomMP = CreateFrame("CheckButton", nil, g, "UICheckButtonTemplate");
  1952. g.option_TomTomMP:SetPoint("TOPLEFT", g.subtitle_tomtom, "BOTTOMLEFT", 10, -5);
  1953. g.option_TomTomMP.text:SetText("Add way point on World Map quest tracking");
  1954. g.option_TomTomMP.text:SetFontObject("GameFontNormal")
  1955. g.option_TomTomMP:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Adds a useful waypoint if there's data for it\ne.g. \"Cave entrance to WANTED:x\"\n\nAdds a waypoint to Blizzards PoI if there's no data"); GameTooltip:Show() end)
  1956. g.option_TomTomMP:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  1957. if WorldQuestTipsData.global.options.TomTomMP then g.option_TomTomMP:SetChecked(true) end
  1958. g.option_TomTomMP:SetScript("OnClick", function() if g.option_TomTomMP:GetChecked() then WorldQuestTipsData.global.options.TomTomMP = true; else WorldQuestTipsData.global.options.TomTomMP = false end end);
  1959.  
  1960. g.option_TomTomAQ = CreateFrame("CheckButton", nil, g, "UICheckButtonTemplate");
  1961. g.option_TomTomAQ:SetPoint("TOPLEFT", g.subtitle_tomtom, "BOTTOMLEFT", 10, -30);
  1962. g.option_TomTomAQ.text:SetText("Add way point on World Quest auto accept");
  1963. g.option_TomTomAQ.text:SetFontObject("GameFontNormal")
  1964. g.option_TomTomAQ:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Adds a useful waypoint if there's data for it\ne.g. \"Cave entrance to WANTED:x\""); GameTooltip:Show() end)
  1965. g.option_TomTomAQ:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  1966. if WorldQuestTipsData.global.options.TomTomAQ then g.option_TomTomAQ:SetChecked(true) end
  1967. g.option_TomTomAQ:SetScript("OnClick", function() if g.option_TomTomAQ:GetChecked() then WorldQuestTipsData.global.options.TomTomAQ = true; else WorldQuestTipsData.global.options.TomTomAQ = false end end);
  1968.  
  1969. g.option_TomTomLR = CreateFrame("CheckButton", nil, g, "UICheckButtonTemplate");
  1970. g.option_TomTomLR:SetPoint("TOPLEFT", g.subtitle_tomtom, "BOTTOMLEFT", 10, -55);
  1971. g.option_TomTomLR.text:SetText("Add way points for Ley Races");
  1972. g.option_TomTomLR.text:SetFontObject("GameFontNormal")
  1973. -- g.option_TomTomLR:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Adds waypoints for"); GameTooltip:Show() end)
  1974. -- g.option_TomTomLR:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  1975. if WorldQuestTipsData.global.options.TomTomLR then g.option_TomTomLR:SetChecked(true) end
  1976. g.option_TomTomLR:SetScript("OnClick", function() if g.option_TomTomLR:GetChecked() then WorldQuestTipsData.global.options.TomTomLR = true; else WorldQuestTipsData.global.options.TomTomLR = false end end);
  1977.  
  1978. g.subtitle_EditQ = g:CreateFontString(nil, g, "GameFontNormal" )
  1979. g.subtitle_EditQ:SetText( L.OPTIONS_Q_INFO ..":" );
  1980. g.subtitle_EditQ:SetPoint("TOPLEFT", g, 20, -165 )
  1981.  
  1982. g.option_EditOnC = CreateFrame("CheckButton", nil, g, "UICheckButtonTemplate");
  1983. g.option_EditOnC:SetPoint("TOPLEFT", g.subtitle_EditQ, "BOTTOMLEFT", 10, -5);
  1984. g.option_EditOnC.text:SetText( L.OPTIONS_G_OPEN_INFO );
  1985. g.option_EditOnC.text:SetFontObject("GameFontNormal")
  1986. --g.option_EditOnC:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("You can alt click on the Wolrd Quest on the world map\nor on the World Quest in the objective tracker"); GameTooltip:Show() end)
  1987. --g.option_EditOnC:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  1988. if WorldQuestTipsData.global.options.EditOnC then g.option_EditOnC:SetChecked(true) end
  1989. g.option_EditOnC:SetScript("OnClick", function() if g.option_EditOnC:GetChecked() then WorldQuestTipsData.global.options.EditOnC = true; else WorldQuestTipsData.global.options.EditOnC = false end end);
  1990.  
  1991. g.subtitle_ShowT = g:CreateFontString(nil, g, "GameFontNormal" )
  1992. g.subtitle_ShowT:SetText( QUEST_TIMERS .. ":");
  1993. g.subtitle_ShowT:SetPoint("TOPLEFT", g, 20, -220 )
  1994.  
  1995. g.option_ShowT = CreateFrame("CheckButton", nil, g, "UICheckButtonTemplate");
  1996. g.option_ShowT:SetPoint("TOPLEFT", g.subtitle_ShowT, "BOTTOMLEFT", 10, -5);
  1997. g.option_ShowT.text:SetText( L.OPTIONS_G_TIMES );
  1998. g.option_ShowT.text:SetFontObject("GameFontNormal")
  1999. --g.option_ShowT:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Disable if you're not interested in seeing\ntimes in the tooltips or at quest completion"); GameTooltip:Show() end)
  2000. --g.option_ShowT:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2001. if WorldQuestTipsData.global.options.showTimes then g.option_ShowT:SetChecked(true) end
  2002. g.option_ShowT:SetScript("OnClick", function() if g.option_ShowT:GetChecked() then WorldQuestTipsData.global.options.showTimes = true; else WorldQuestTipsData.global.options.showTimes = false end end);
  2003.  
  2004.  
  2005. g.subtitle_Other = g:CreateFontString(nil, g, "GameFontNormal" )
  2006. g.subtitle_Other:SetText( OTHER .. ":"); --BONUS_ROLL_REWARD_MONEY ="Gold"
  2007. g.subtitle_Other:SetPoint("TOPLEFT", g, 20, -275 )
  2008.  
  2009. g.option_HideSG = CreateFrame("CheckButton", nil, g, "UICheckButtonTemplate");
  2010. g.option_HideSG:SetPoint("TOPLEFT", g.subtitle_Other, "BOTTOMLEFT", 10, -5);
  2011. g.option_HideSG.text:SetText( "Hide small gold rewards from tooltip" );
  2012. g.option_HideSG.text:SetFontObject("GameFontNormal")
  2013. --g.option_HideSG:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Disable if you're not interested in seeing\ntimes in the tooltips or at quest completion"); GameTooltip:Show() end)
  2014. --g.option_HideSG:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2015. if WorldQuestTipsData.global.options.hideSmallGold then g.option_HideSG:SetChecked(true) end
  2016. g.option_HideSG:SetScript("OnClick", function() if g.option_HideSG:GetChecked() then WorldQuestTipsData.global.options.hideSmallGold = true; else WorldQuestTipsData.global.options.hideSmallGold = false end end);
  2017.  
  2018. wqto.g = g;
  2019.  
  2020. local r = CreateFrame("FRAME", nil, wqto)
  2021. r:SetWidth(410)
  2022. r:SetHeight(440)
  2023. r:SetPoint("CENTER", wqto, "CENTER")
  2024. r.subtitle_Rep = r:CreateFontString(nil, r, "GameFontNormal" )
  2025. r.subtitle_Rep:SetText( REPUTATION .. ":")
  2026. r.subtitle_Rep:SetPoint("TOPLEFT", 20, -60 )
  2027.  
  2028. r.option_CurRep = CreateFrame("CheckButton", nil, r, "UICheckButtonTemplate");
  2029. r.option_CurRep:SetPoint("TOPLEFT", r.subtitle_Rep, "BOTTOMLEFT", 10, -5);
  2030. r.option_CurRep.text:SetText( L.OPTIONS_G_REP_CUR );
  2031. r.option_CurRep.text:SetFontObject("GameFontNormal")
  2032. --r.option_CurRep:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Show your current standing with the relevant faction\nin tooltips, in the format \"Standing (#k / #k)\""); GameTooltip:Show() end)
  2033. --r.option_CurRep:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2034. if WorldQuestTipsData.global.options.showCurrentRep then r.option_CurRep:SetChecked(true) end
  2035. r.option_CurRep:SetScript("OnClick", function() if r.option_CurRep:GetChecked() then WorldQuestTipsData.global.options.showCurrentRep = true; else WorldQuestTipsData.global.options.showCurrentRep = false end end);
  2036.  
  2037. r.option_ShowEx = CreateFrame("CheckButton", nil, r, "UICheckButtonTemplate");
  2038. r.option_ShowEx:SetPoint("TOPLEFT", r.subtitle_Rep, "BOTTOMLEFT", 10, -30);
  2039. r.option_ShowEx.text:SetText( L.OPTIONS_G_REP_EX );
  2040. r.option_ShowEx.text:SetFontObject("GameFontNormal")
  2041. --r.option_ShowEx:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Disable to stop showing faction names in\ntooltips once you've reached exalted"); GameTooltip:Show() end)
  2042. --r.option_ShowEx:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2043. if WorldQuestTipsData.global.options.showExalted then r.option_ShowEx:SetChecked(true) end
  2044. r.option_ShowEx:SetScript("OnClick", function() if r.option_ShowEx:GetChecked() then WorldQuestTipsData.global.options.showExalted = true; else WorldQuestTipsData.global.options.showExalted = false end end);
  2045.  
  2046. r.option_ShowROI = CreateFrame("CheckButton", nil, r, "UICheckButtonTemplate");
  2047. r.option_ShowROI:SetPoint("TOPLEFT", r.subtitle_Rep, "BOTTOMLEFT", 10, -55);
  2048. r.option_ShowROI.text:SetText( "Show reputation on faction insignia" );
  2049. r.option_ShowROI.text:SetFontObject("GameFontNormal")
  2050. --r.option_ShowROI:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Disable to stop showing faction names in\ntooltips once you've reached exalted"); GameTooltip:Show() end)
  2051. --r.option_ShowROI:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2052. if WorldQuestTipsData.global.options.showExalted then r.option_ShowROI:SetChecked(true) end
  2053. r.option_ShowROI:SetScript("OnClick", function() if r.option_ShowROI:GetChecked() then WorldQuestTipsData.global.options.showRepOnItems = true; else WorldQuestTipsData.global.options.showRepOnItems = false end end);
  2054.  
  2055. r.option_ShowAROI = CreateFrame("CheckButton", nil, r, "UICheckButtonTemplate");
  2056. r.option_ShowAROI:SetPoint("TOPLEFT", r.subtitle_Rep, "BOTTOMLEFT", 10, -80);
  2057. r.option_ShowAROI.text:SetText( "Show alts reputations on BOA faction insignia" );
  2058. r.option_ShowAROI.text:SetFontObject("GameFontNormal")
  2059. --r.option_ShowAROI:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Disable to stop showing faction names in\ntooltips once you've reached exalted"); GameTooltip:Show() end)
  2060. --r.option_ShowAROI:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2061. if WorldQuestTipsData.global.options.showExalted then r.option_ShowAROI:SetChecked(true) end
  2062. r.option_ShowAROI:SetScript("OnClick", function() if r.option_ShowAROI:GetChecked() then WorldQuestTipsData.global.options.showAltRepOnItems = true; else WorldQuestTipsData.global.options.showAltRepOnItems = false end end);
  2063.  
  2064. r:Hide()
  2065. wqto.r = r;
  2066.  
  2067. local e = CreateFrame("FRAME", nil, wqto)
  2068. e:SetWidth(410)
  2069. e:SetHeight(440)
  2070. e:SetPoint("CENTER", wqto, "CENTER")
  2071. e.subtitle_enigmatic = e:CreateFontString(nil, e, "GameFontNormal" )
  2072. e.subtitle_enigmatic:SetText("Enigmatic Path Helper:");
  2073. e.subtitle_enigmatic:SetPoint("TOPLEFT", 20, -60 )
  2074.  
  2075. e.option_useEnigmatic = CreateFrame("CheckButton", nil, e, "UICheckButtonTemplate");
  2076. e.option_useEnigmatic:SetPoint("TOPLEFT", e.subtitle_enigmatic, "BOTTOMLEFT", 10, -5);
  2077. e.option_useEnigmatic.text:SetText("Enable Enigmatic Path Helper");
  2078. e.option_useEnigmatic.text:SetFontObject("GameFontNormal")
  2079. if WorldQuestTipsData.global.options.useEnigmatic then e.option_useEnigmatic:SetChecked(true) end
  2080. e.option_useEnigmatic:SetScript("OnClick", function()
  2081. if e.option_useEnigmatic:GetChecked() then
  2082. WorldQuestTipsData.global.options.useEnigmatic = true
  2083. if enigmaticActive then
  2084. if WorldQuestTips.enigmatic == nil then WorldQuestTips:loadEnigmatic() end
  2085. WorldQuestTips.enigmatic:Show()
  2086. end
  2087. else
  2088. WorldQuestTipsData.global.options.useEnigmatic = false
  2089. if WorldQuestTips.enigmatic then WorldQuestTips.enigmatic:Hide() end
  2090. if WorldQuestTips.enigmaticHUD then WorldQuestTips.enigmaticHUD:Hide() end
  2091. end
  2092. end);
  2093.  
  2094. e.subtitle_enigmaticPaths = e:CreateFontString(nil, e, "GameFontNormal" )
  2095. e.subtitle_enigmaticPaths:SetText("Enigmatic Path Selector:");
  2096. e.subtitle_enigmaticPaths:SetPoint("TOPLEFT", 20, -115 )
  2097.  
  2098. e.option_enimaticMove = CreateFrame("CheckButton", nil, e, "UICheckButtonTemplate");
  2099. e.option_enimaticMove:SetPoint("TOPLEFT", e.subtitle_enigmaticPaths, "BOTTOMLEFT", 10, -5);
  2100. e.option_enimaticMove.text:SetText("Enable dragging");
  2101. e.option_enimaticMove.text:SetFontObject("GameFontNormal")
  2102. e.option_enimaticMove:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Enable/Lock moving the path selection frame\nThe position is saved between sessions"); GameTooltip:Show() end)
  2103. e.option_enimaticMove:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2104. if WorldQuestTipsData.global.options.enigmaticMove then e.option_enimaticMove:SetChecked(true) end
  2105. e.option_enimaticMove:SetScript("OnClick", function() if e.option_enimaticMove:GetChecked() then WorldQuestTipsData.global.options.enigmaticMove = true; else WorldQuestTipsData.global.options.enigmaticMove = false end WorldQuestTips:loadEnigmatic( "optionUpdate" ) end);
  2106.  
  2107. e.toggleBtn = CreateFrame("BUTTON", nil, e, "UIPanelButtonTemplate")
  2108. e.toggleBtn:SetWidth(64)
  2109. e.toggleBtn:SetHeight(24)
  2110. e.toggleBtn:SetText( "Toggle" )
  2111. e.toggleBtn:SetPoint("TOPRIGHT", -20, -60 )
  2112. e.toggleBtn:SetScript("OnClick", function()
  2113. if WorldQuestTips.enigmatic == nil then
  2114. WorldQuestTips:loadEnigmatic()
  2115. elseif WorldQuestTips.enigmatic:IsShown() then
  2116. -- WorldQuestTipsData.global.options.enigmaticPos = { left = WorldQuestTips.enigmatic:GetLeft(), bottom = WorldQuestTips.enigmatic:GetBottom() }
  2117. WorldQuestTips.enigmatic:Hide()
  2118. if WorldQuestTips.enigmaticHUD then WorldQuestTips.enigmaticHUD:Hide() end
  2119. else
  2120. WorldQuestTips.enigmatic:Show()
  2121. end
  2122. end)
  2123.  
  2124. e.resetPosBtn = CreateFrame("BUTTON", nil, e, "UIPanelButtonTemplate")
  2125. e.resetPosBtn:SetWidth(64)
  2126. e.resetPosBtn:SetHeight(24)
  2127. e.resetPosBtn:SetText( "Reset" )
  2128. e.resetPosBtn:SetPoint("LEFT", e.option_enimaticMove.text, "RIGHT" );
  2129. e.resetPosBtn:SetScript("OnClick", function()
  2130. WorldQuestTipsData.global.options.enigmaticPos = "CENTER"
  2131. WorldQuestTips:loadEnigmatic( "optionUpdate" )
  2132. end)
  2133.  
  2134. e.rowsSlider = CreateFrame('Slider', 'wqt_enigmatic_rowSlider', e, 'OptionsSliderTemplate')
  2135. e.rowsSlider:SetPoint("TOPRIGHT", e, -40, -180);
  2136. e.rowsSlider:SetMinMaxValues(1, table.getn( enigmaticPaths ) )
  2137. e.rowsSlider:SetValue( WorldQuestTipsData.global.options.enigmaticRows )
  2138. wqt_enigmatic_rowSliderLow:SetText(1);
  2139. wqt_enigmatic_rowSliderHigh:SetText(table.getn( enigmaticPaths ));
  2140. wqt_enigmatic_rowSliderText:SetText("Rows ("..WorldQuestTipsData.global.options.enigmaticRows..")");
  2141. e.rowsSlider:SetScript("OnValueChanged", function(self, value)
  2142. value = math.floor(value + 0.5)
  2143. self:SetValue( value )
  2144. wqt_enigmatic_rowSliderText:SetText("Rows ("..value..")");
  2145. WorldQuestTipsData.global.options.enigmaticRows = value
  2146. WorldQuestTips:loadEnigmatic( "optionUpdate" )
  2147. end)
  2148.  
  2149. e.sizeSlider = CreateFrame('Slider', 'wqt_enigmatic_sizeSlider', e, 'OptionsSliderTemplate')
  2150. e.sizeSlider:SetPoint("TOPLEFT", e, 40, -180);
  2151. e.sizeSlider:SetMinMaxValues(1, 32 )
  2152. e.sizeSlider:SetValue( WorldQuestTipsData.global.options.enigmaticSize )
  2153. wqt_enigmatic_sizeSliderLow:SetText(1);
  2154. wqt_enigmatic_sizeSliderHigh:SetText(32);
  2155. wqt_enigmatic_sizeSliderText:SetText("Size ("..WorldQuestTipsData.global.options.enigmaticSize..")");
  2156. e.sizeSlider:SetScript("OnValueChanged", function(self, value)
  2157. value = math.floor(value + 0.5)
  2158. self:SetValue( value )
  2159. wqt_enigmatic_sizeSliderText:SetText("Size ("..value..")");
  2160. WorldQuestTipsData.global.options.enigmaticSize = value
  2161. WorldQuestTips:loadEnigmatic( "optionUpdate" )
  2162. end)
  2163.  
  2164.  
  2165. e.subtitle_enigmaticHUD = e:CreateFontString(nil, e, "GameFontNormal" )
  2166. e.subtitle_enigmaticHUD:SetText("Enigmatic HUD:");
  2167. e.subtitle_enigmaticHUD:SetPoint("TOPLEFT", 20, -220 )
  2168.  
  2169. e.option_useEnigmaticHUD = CreateFrame("CheckButton", nil, e, "UICheckButtonTemplate");
  2170. e.option_useEnigmaticHUD:SetPoint("TOPLEFT", e.subtitle_enigmaticHUD, "BOTTOMLEFT", 10, -5);
  2171. e.option_useEnigmaticHUD.text:SetText("Enable Enigmatic HUD");
  2172. e.option_useEnigmaticHUD.text:SetFontObject("GameFontNormal")
  2173. if WorldQuestTipsData.global.options.useEnigmaticHUD then e.option_useEnigmaticHUD:SetChecked(true) end
  2174. e.option_useEnigmaticHUD:SetScript("OnClick", function()
  2175. if e.option_useEnigmaticHUD:GetChecked() then
  2176. WorldQuestTipsData.global.options.useEnigmaticHUD = true
  2177. else
  2178. WorldQuestTipsData.global.options.useEnigmaticHUD = false
  2179. if WorldQuestTips.enigmaticHUD then WorldQuestTips.enigmaticHUD:Hide() end
  2180. end
  2181. end);
  2182.  
  2183. e.option_enimaticHUDMove = CreateFrame("CheckButton", nil, e, "UICheckButtonTemplate");
  2184. e.option_enimaticHUDMove:SetPoint("TOPLEFT", e.subtitle_enigmaticHUD, "BOTTOMLEFT", 10, -30);
  2185. e.option_enimaticHUDMove.text:SetText("Enable dragging");
  2186. e.option_enimaticHUDMove.text:SetFontObject("GameFontNormal")
  2187. e.option_enimaticHUDMove:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Enable/Lock moving the HUD frame\nThe position is saved between sessions"); GameTooltip:Show() end)
  2188. e.option_enimaticHUDMove:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2189. if WorldQuestTipsData.global.options.enigmaticHUDMove then e.option_enimaticHUDMove:SetChecked(true) end
  2190. e.option_enimaticHUDMove:SetScript("OnClick", function() if e.option_enimaticHUDMove:GetChecked() then WorldQuestTipsData.global.options.enigmaticHUDMove = true; else WorldQuestTipsData.global.options.enigmaticHUDMove = false end WorldQuestTips:loadEnigmaticHUD( "optionUpdate" ) end);
  2191.  
  2192. e.resetHUDPosBtn = CreateFrame("BUTTON", nil, e, "UIPanelButtonTemplate")
  2193. e.resetHUDPosBtn:SetWidth(64)
  2194. e.resetHUDPosBtn:SetHeight(24)
  2195. e.resetHUDPosBtn:SetText( "Reset" )
  2196. e.resetHUDPosBtn:SetPoint("LEFT", e.option_enimaticHUDMove.text, "RIGHT" );
  2197. e.resetHUDPosBtn:SetScript("OnClick", function()
  2198. WorldQuestTipsData.global.options.enigmaticHUDPos = "CENTER"
  2199. WorldQuestTips:loadEnigmaticHUD( "optionUpdate" )
  2200. end)
  2201. e.HUDsizeSlider = CreateFrame('Slider', 'wqt_enigmatic_HUDsizeSlider', e, 'OptionsSliderTemplate')
  2202. e.HUDsizeSlider:SetPoint("TOPLEFT", e, 40, -310);
  2203. e.HUDsizeSlider:SetMinMaxValues(1, 96 )
  2204. e.HUDsizeSlider:SetValue( WorldQuestTipsData.global.options.enigmaticHUDSize )
  2205. wqt_enigmatic_HUDsizeSliderLow:SetText(1);
  2206. wqt_enigmatic_HUDsizeSliderHigh:SetText(96);
  2207. wqt_enigmatic_HUDsizeSliderText:SetText("Size ("..WorldQuestTipsData.global.options.enigmaticHUDSize..")");
  2208. e.HUDsizeSlider:SetScript("OnValueChanged", function(self, value)
  2209. value = math.floor(value + 0.5)
  2210. self:SetValue( value )
  2211. wqt_enigmatic_HUDsizeSliderText:SetText("Size ("..value..")");
  2212. WorldQuestTipsData.global.options.enigmaticHUDSize = value
  2213. WorldQuestTips:loadEnigmaticHUD( "optionUpdate" )
  2214. end)
  2215.  
  2216. e.option_enimaticHUDPathDim = CreateFrame("CheckButton", nil, e, "UICheckButtonTemplate");
  2217. e.option_enimaticHUDPathDim:SetPoint("TOPLEFT", e.subtitle_enigmaticHUD, "BOTTOMLEFT", 10, -120);
  2218. e.option_enimaticHUDPathDim.text:SetText("Invert path");
  2219. e.option_enimaticHUDPathDim.text:SetFontObject("GameFontNormal")
  2220. e.option_enimaticHUDPathDim:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Enable/Lock moving the HUD frame\nThe position is saved between sessions"); GameTooltip:Show() end)
  2221. e.option_enimaticHUDPathDim:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2222. if WorldQuestTipsData.global.options.enigmaticHUDPathDim then e.option_enimaticHUDPathDim:SetChecked(true) end
  2223. e.option_enimaticHUDPathDim:SetScript("OnClick", function()
  2224. if e.option_enimaticHUDPathDim:GetChecked() then
  2225. WorldQuestTipsData.global.options.enigmaticHUDPathDim = true;
  2226. else
  2227. WorldQuestTipsData.global.options.enigmaticHUDPathDim = false
  2228. end
  2229. local pathA = WorldQuestTipsData.global.options.enigmaticHUDEdgeA
  2230. local edgeA = WorldQuestTipsData.global.options.enigmaticHUDPathA
  2231. wqt_enigmatic_HUDEdgeASliderText:SetText("Edge Alpha ("..edgeA..")");
  2232. WorldQuestTipsData.global.options.enigmaticHUDEdgeA = edgeA
  2233. wqto.e.HUDEdgeASlider:SetValue( edgeA )
  2234. wqt_enigmatic_HUDPathASliderText:SetText("Path Alpha ("..pathA..")");
  2235. WorldQuestTipsData.global.options.enigmaticHUDPathA = pathA
  2236. wqto.e.HUDPathASlider:SetValue( pathA )
  2237. WorldQuestTips:loadEnigmaticHUD( "optionUpdate" )
  2238. end);
  2239.  
  2240. e.HUDPathASlider = CreateFrame('Slider', 'wqt_enigmatic_HUDPathASlider', e, 'OptionsSliderTemplate')
  2241. e.HUDPathASlider:SetPoint("TOPRIGHT", e, -40, -310);
  2242. e.HUDPathASlider:SetMinMaxValues(0, 1 )
  2243. e.HUDPathASlider:SetValue( WorldQuestTipsData.global.options.enigmaticHUDPathA )
  2244. wqt_enigmatic_HUDPathASliderLow:SetText(0);
  2245. wqt_enigmatic_HUDPathASliderHigh:SetText(1);
  2246. wqt_enigmatic_HUDPathASliderText:SetText("Path Alpha ("..WorldQuestTipsData.global.options.enigmaticHUDPathA..")");
  2247. e.HUDPathASlider:SetScript("OnValueChanged", function(self, value)
  2248. value = math.floor(value*100 + 0.5)/100
  2249. self:SetValue( value )
  2250. wqt_enigmatic_HUDPathASliderText:SetText("Path Alpha ("..value..")");
  2251. WorldQuestTipsData.global.options.enigmaticHUDPathA = value
  2252. WorldQuestTips:loadEnigmaticHUD( "optionUpdate" )
  2253. end)
  2254.  
  2255. e.HUDEdgeASlider = CreateFrame('Slider', 'wqt_enigmatic_HUDEdgeASlider', e, 'OptionsSliderTemplate')
  2256. e.HUDEdgeASlider:SetPoint("TOPRIGHT", e, -40, -360);
  2257. e.HUDEdgeASlider:SetMinMaxValues(0, 1 )
  2258. e.HUDEdgeASlider:SetValue( WorldQuestTipsData.global.options.enigmaticHUDEdgeA )
  2259. wqt_enigmatic_HUDEdgeASliderLow:SetText(0);
  2260. wqt_enigmatic_HUDEdgeASliderHigh:SetText(1);
  2261. wqt_enigmatic_HUDEdgeASliderText:SetText("Edge Alpha ("..WorldQuestTipsData.global.options.enigmaticHUDEdgeA..")");
  2262. e.HUDEdgeASlider:SetScript("OnValueChanged", function(self, value)
  2263. value = math.floor(value*100 + 0.5)/100
  2264. self:SetValue( value )
  2265. wqt_enigmatic_HUDEdgeASliderText:SetText("Edge Alpha ("..value..")");
  2266. WorldQuestTipsData.global.options.enigmaticHUDEdgeA = value
  2267. WorldQuestTips:loadEnigmaticHUD( "optionUpdate" )
  2268. end)
  2269.  
  2270. e:Hide()
  2271. wqto.e = e;
  2272.  
  2273.  
  2274. local q = CreateFrame("FRAME", nil, wqto)
  2275. q:SetWidth(410)
  2276. q:SetHeight(440)
  2277. q:SetPoint("CENTER", wqto, "CENTER")
  2278. q.subtitle_qi = q:CreateFontString(nil, q, "GameFontNormal" )
  2279. q.subtitle_qi:SetText( L.OPTIONS_Q_INFO .. ":" );
  2280. q.subtitle_qi:SetPoint("TOPLEFT", 20, -60 )
  2281.  
  2282. q.qid = CreateFrame("EditBox", nil, q, "InputBoxTemplate");
  2283. q.qid:SetPoint("TOPRIGHT", -20, -54);
  2284. q.qid:SetFontObject("GameFontWhite")
  2285. q.qid:SetMaxLetters(6)
  2286. q.qid:SetNumeric(true)
  2287. q.qid:SetAutoFocus(false)
  2288. q.qid:SetWidth(64)
  2289. q.qid:SetHeight(24)
  2290. q.qid:SetCursorPosition(0)
  2291. q.qid:SetJustifyH("CENTER")
  2292. q.qidt = q:CreateFontString();
  2293. q.qidt:SetPoint("RIGHT", q.qid, "LEFT", -10, 0);
  2294. q.qidt:SetFontObject("GameFontNormal");
  2295. q.qidt:SetText( L.OPTIONS_Q_ID .. ":" )
  2296. q.qid:SetScript("OnEnterPressed", function(self)
  2297. self:ClearFocus();
  2298. currentQuestEdit = self:GetNumber()
  2299. fillQuestInfo( currentQuestEdit )
  2300. end);
  2301.  
  2302. q.qlink = CreateFrame("FRAME", nil, q)
  2303. q.qlink:SetWidth(410)
  2304. q.qlink:SetHeight(24)
  2305. q.qlink:SetPoint("TOP", q, 0, -100 )
  2306. q.qlink.name = q.qlink:CreateFontString(nil, q, "GameFontNormalLarge" )
  2307. q.qlink.name:SetPoint("CENTER", q.qlink)
  2308.  
  2309. q.qnotet = q.qlink:CreateFontString(nil, q, "GameFontNormal" )
  2310. q.qnotet:SetText( L.OPTIONS_Q_NOTE .. ":");
  2311. q.qnotet:SetPoint("TOP", q.qlink, "BOTTOM", 0, -10)
  2312.  
  2313. q.qnote = CreateFrame("EditBox", nil, q, "InputBoxTemplate");
  2314. q.qnote:SetPoint("TOP", q.qnotet, "BOTTOM");
  2315. q.qnote:SetMaxLetters(256)
  2316. q.qnote:SetAutoFocus(false)
  2317. q.qnote:SetWidth(360)
  2318. q.qnote:SetHeight(24)
  2319. q.qnote:SetCursorPosition(0)
  2320. q.qnote:SetJustifyH("LEFT")
  2321. q.qnote:SetText( L.OPTIONS_Q_NOTE_TIP .. "..." )
  2322. q.qnote:SetTextColor( GRAY_FONT_COLOR:GetRGB() )
  2323. -- q.qnote:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText(""); GameTooltip:Show() end)
  2324. -- q.qnote:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2325.  
  2326. q.qnote:SetScript("OnKeyDown", function(self, key)
  2327. local oldNote = WorldQuestTipsData.global.worldQuests[currentQuestEdit].note or ""
  2328. q.qnote:SetTextColor( 1,1,1 )
  2329. if key == "ESCAPE" then q.qnote:SetText( oldNote )
  2330. elseif key == "ENTER" then
  2331. q.qnote:ClearFocus()
  2332. local newNote = q.qnote:GetText()
  2333. if newNote == nil or newNote == "" then
  2334. WorldQuestTipsData.global.worldQuests[currentQuestEdit].note = nil
  2335. else WorldQuestTipsData.global.worldQuests[currentQuestEdit].note = newNote end
  2336. else
  2337. q.qnote:SetTextColor( GREEN_FONT_COLOR:GetRGB() )
  2338. end
  2339. end)
  2340.  
  2341. q.qnote:Disable()
  2342.  
  2343. -- g.option_TomTomMP:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("Adds a useful waypoint if there's data for it\ne.g. \"Cave entrance to WANTED:x\"\n\nAdds a waypoint to Blizzards PoI if there's no data"); GameTooltip:Show() end)
  2344. -- g.option_TomTomMP:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2345.  
  2346. q.qwowhead = CreateFrame("EditBox", nil, q, "InputBoxTemplate");
  2347. q.qwowhead:SetPoint("BOTTOM", q, "BOTTOM", 0, 60);
  2348. q.qwowhead:SetMaxLetters(256)
  2349. q.qwowhead:SetAutoFocus(false)
  2350. q.qwowhead:SetWidth(360)
  2351. q.qwowhead:SetHeight(24)
  2352. q.qwowhead:SetCursorPosition(0)
  2353. q.qwowhead:SetJustifyH("CENTER")
  2354. q.qwowhead:SetTextColor( 1,1,1 )
  2355.  
  2356. q.qxufu = CreateFrame("EditBox", nil, q, "InputBoxTemplate");
  2357. q.qxufu:SetPoint("BOTTOM", q.qwowhead, "TOP");
  2358. q.qxufu:SetMaxLetters(256)
  2359. q.qxufu:SetAutoFocus(false)
  2360. q.qxufu:SetWidth(360)
  2361. q.qxufu:SetHeight(24)
  2362. q.qxufu:SetCursorPosition(0)
  2363. q.qxufu:SetJustifyH("CENTER")
  2364. q.qxufu:SetTextColor( 1,1,1 )
  2365. q.qxufu:Hide()
  2366.  
  2367. q.qave = q:CreateFontString(nil, q, "GameFontNormal" )
  2368. q.qave:SetPoint("BOTTOMLEFT", q.qxufu, "TOPLEFT", 90, 20)
  2369.  
  2370. q.qtc = CreateFrame("EditBox", nil, q, "InputBoxTemplate");
  2371. q.qtc:SetPoint("BOTTOMLEFT", q.qave, "TOPLEFT");
  2372. q.qtc:SetMaxLetters(6)
  2373. q.qtc:SetAutoFocus(false)
  2374. q.qtc:SetNumeric(true)
  2375. q.qtc:SetWidth(36)
  2376. q.qtc:SetHeight(24)
  2377. q.qtc:SetCursorPosition(0)
  2378. q.qtc:SetJustifyH("CENTER")
  2379. q.qtc:SetScript("OnKeyDown", function(self, key)
  2380. local oldVal = WorldQuestTipsData.global.worldQuests[currentQuestEdit].completed or 0
  2381. self:SetTextColor( 1,1,1 )
  2382. if key == "ESCAPE" then self:SetNumber( oldVal )
  2383. elseif key == "ENTER" then
  2384. self:ClearFocus()
  2385. local newVal = math.floor(math.abs(self:GetNumber()))
  2386. if newVal == nil or newVal == "" then
  2387. WorldQuestTipsData.global.worldQuests[currentQuestEdit].completed = 0
  2388. else WorldQuestTipsData.global.worldQuests[currentQuestEdit].completed = newVal end
  2389. fillQuestInfo( currentQuestEdit )
  2390. else
  2391. self:SetTextColor( GREEN_FONT_COLOR:GetRGB() )
  2392. end
  2393. end)
  2394. q.qtc:Disable()
  2395.  
  2396. q.qtc.text = q.qtc:CreateFontString(nil, q, "GameFontNormal" )
  2397. q.qtc.text:SetText( L.OPTIONS_Q_TC );
  2398. q.qtc.text:SetPoint("LEFT", q.qtc, "RIGHT", 5, 0)
  2399.  
  2400. q.qtt = CreateFrame("EditBox", nil, q, "InputBoxTemplate");
  2401. q.qtt:SetPoint("BOTTOMLEFT", q.qtc, "TOPLEFT");
  2402. q.qtt:SetMaxLetters(6)
  2403. q.qtt:SetAutoFocus(false)
  2404. q.qtt:SetNumeric(true)
  2405. q.qtt:SetWidth(36)
  2406. q.qtt:SetHeight(24)
  2407. q.qtt:SetCursorPosition(0)
  2408. q.qtt:SetJustifyH("CENTER")
  2409. q.qtt:SetScript("OnKeyDown", function(self, key)
  2410. local oldVal = WorldQuestTipsData.global.worldQuests[currentQuestEdit].timespent or 0
  2411. self:SetTextColor( 1,1,1 )
  2412. if key == "ESCAPE" then self:SetNumber( oldVal )
  2413. elseif key == "ENTER" then
  2414. self:ClearFocus()
  2415. local newVal = math.floor(math.abs(self:GetNumber()))
  2416. if newVal == nil or newVal == "" then
  2417. WorldQuestTipsData.global.worldQuests[currentQuestEdit].timespent = 0
  2418. else WorldQuestTipsData.global.worldQuests[currentQuestEdit].timespent = newVal end
  2419. fillQuestInfo( currentQuestEdit )
  2420. else
  2421. self:SetTextColor( GREEN_FONT_COLOR:GetRGB() )
  2422. end
  2423. end)
  2424. q.qtt:Disable()
  2425.  
  2426. q.qtt.text = q.qtt:CreateFontString(nil, q, "GameFontNormal" )
  2427. q.qtt.text:SetText( L.OPTIONS_Q_TT );
  2428. q.qtt.text:SetPoint("LEFT", q.qtt, "RIGHT", 5, 0)
  2429.  
  2430. q:Hide()
  2431. wqto.q = q;
  2432.  
  2433.  
  2434. local o = CreateFrame("FRAME", nil, wqto)
  2435. o:SetWidth(410)
  2436. o:SetHeight(440)
  2437. o:SetPoint("CENTER", wqto, "CENTER")
  2438.  
  2439. o.option_PetFF = CreateFrame("CheckButton", nil, o, "UICheckButtonTemplate");
  2440. o.option_PetFF:SetPoint("TOPLEFT", o, "TOPLEFT", 25, -25);
  2441. o.option_PetFF.text:SetText( BATTLE_PETS_ACHIEVEMENT .. " " .. TRACKING );
  2442. o.option_PetFF.text:SetFontObject("GameFontNormal")
  2443. if WorldQuestTipsData.global.options.PetFF then o.option_PetFF:SetChecked(true) end
  2444. o.option_PetFF:SetScript("OnClick", function() if o.option_PetFF:GetChecked() then WorldQuestTipsData.global.options.PetFF = true; else WorldQuestTipsData.global.options.PetFF = false end end);
  2445.  
  2446. local y = 80
  2447. local x = 0
  2448. for k, tamer in pairs(pet_tamers) do
  2449. for f, complete in pairs(tamer) do
  2450. o[k] = o:CreateFontString(nil, o, "GameFontNormal" )
  2451. o[k]:SetText(k);
  2452. o[k]:SetPoint("TOPLEFT", 20, -y )
  2453. o[k..f] = CreateFrame("CheckButton", nil, o, "UICheckButtonTemplate");
  2454. o[k..f]:SetPoint("LEFT", o[k], "LEFT", 200+x, 0);
  2455. o[k..f]:SetScale(0.75);
  2456. if WorldQuestTipsData.global.pets.ff[k][f] ~= false or complete then o[k..f]:SetChecked(true) else pets[f].ignored = pets[f].ignored + 1 end
  2457.  
  2458. if o[f] == nil then
  2459. o[f] = CreateFrame("FRAME", nil, o)
  2460. o[f]:SetWidth(16)
  2461. o[f]:SetHeight(16)
  2462. o[f]:SetPoint("TOP", o[k..f], 0, 15);
  2463. o[f].icon = o[f]:CreateFontString(nil, o, "GameFontNormal" )
  2464. o[f].icon:SetText(pets[f].icon);
  2465. o[f].icon:SetPoint("CENTER");
  2466. o[f]:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT",0,0); GameTooltip:SetAchievementByID(pets[f].achID); GameTooltip:AddLine(ACHIEVEMENT_PROGRESSED .. ": "..pets[f].count.." / "..( 15 - pets[f].ignored )); GameTooltip:Show() end)
  2467. o[f]:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2468. end
  2469.  
  2470. -- o[k..f]:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetToyByItemID(k); GameTooltip:AddLine(c, 1, 0, 0); GameTooltip:Show() end)
  2471. -- o[k..f]:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2472. o[k..f]:SetScript("OnClick", function()
  2473. o.footer:SetTextColor(1,1,1);
  2474. if o[k..f]:GetChecked() then
  2475. WorldQuestTipsData.global.pets.ff[k][f] = true
  2476. pets[f].ignored = pets[f].ignored - 1
  2477. else
  2478. if pets[f].ignored == 3 then
  2479. o.footer:SetTextColor(1,0,0);
  2480. o[k..f]:SetChecked(true)
  2481. else
  2482. WorldQuestTipsData.global.pets.ff[k][f] = false
  2483. pets[f].ignored = pets[f].ignored + 1
  2484. end
  2485. end
  2486. end);
  2487. if complete then
  2488. o[k..f]:Disable();
  2489. end
  2490. x = x + 30
  2491. end
  2492. x = 0
  2493. y = y + 20
  2494. end
  2495.  
  2496. o.footer = o:CreateFontString(nil, o, "GameFontWhite" )
  2497. o.footer:SetText( L.OPTIONS_P_FOOTER );
  2498. o.footer:SetPoint("BOTTOM", 0, 50 )
  2499. o:Hide()
  2500. wqto.o = o;
  2501.  
  2502. wqto.doneBtn = CreateFrame("BUTTON", nil, wqto, "UIPanelButtonTemplate")
  2503. wqto.doneBtn:SetWidth(64)
  2504. wqto.doneBtn:SetHeight(24)
  2505. wqto.doneBtn:SetText( DONE )
  2506. wqto.doneBtn:SetPoint("BOTTOM", wqto, 0, 12)
  2507. wqto.doneBtn:SetScript("OnClick", function()
  2508. wqto:Hide()
  2509. currentQuestEdit = 0
  2510. if not enigmaticActive then
  2511. if WorldQuestTips.enigmatic then WorldQuestTips.enigmatic:Hide() end
  2512. if WorldQuestTips.enigmaticHUD then WorldQuestTips.enigmaticHUD:Hide() end
  2513. end
  2514. end)
  2515.  
  2516. -- tinsert(UISpecialFrames, "wqto")
  2517. end
  2518.  
  2519. wqto:Show()
  2520.  
  2521. if questID then
  2522. if questID == currentQuestEdit then
  2523. wqto:Hide()
  2524. currentQuestEdit = 0
  2525. else
  2526. fillQuestInfo( questID )
  2527. for z in pairs(tablist) do wqto[z]:Hide() end wqto.q:Show()
  2528. end
  2529. else
  2530. fillQuestInfo()
  2531. end
  2532. end
  2533.  
  2534. local function activateEnigmatic( z )
  2535. WorldQuestTips.enigmatic["path"..z]:SetAlpha(1)
  2536. WorldQuestTips.enigmatic["path"..z].aplha = 1
  2537. for x = 1, 49 do
  2538. if enigmaticPaths[z][x] == 0 then
  2539. WorldQuestTips.enigmatic["path"..z].sq[x].texture:SetDesaturated(false)
  2540. WorldQuestTips.enigmatic["path"..z].sq[x]:SetAlpha(1)
  2541. if WorldQuestTips.enigmaticHUD then
  2542. WorldQuestTips.enigmaticHUD.sq[x].texture:SetDesaturated(not WorldQuestTipsData.global.options.enigmaticHUDPathDim)
  2543. WorldQuestTips.enigmaticHUD.sq[x]:SetAlpha(WorldQuestTipsData.global.options.enigmaticHUDEdgeA)
  2544. end
  2545. else
  2546. WorldQuestTips.enigmatic["path"..z].sq[x].texture:SetDesaturated(true)
  2547. WorldQuestTips.enigmatic["path"..z].sq[x]:SetAlpha(0.2)
  2548. if WorldQuestTips.enigmaticHUD then
  2549. WorldQuestTips.enigmaticHUD.sq[x].texture:SetDesaturated(WorldQuestTipsData.global.options.enigmaticHUDPathDim)
  2550. WorldQuestTips.enigmaticHUD.sq[x]:SetAlpha(WorldQuestTipsData.global.options.enigmaticHUDPathA)
  2551. end
  2552. end
  2553. end
  2554. WorldQuestTips.enigmatic["path"..z].sq[41]:Show()
  2555. end
  2556.  
  2557. local function deactivateEnigmatic( z )
  2558. for x = 1, 49 do
  2559. if enigmaticPaths[z][x] == 0 then
  2560. WorldQuestTips.enigmatic["path"..z].sq[x].texture:SetDesaturated(true)
  2561. WorldQuestTips.enigmatic["path"..z].sq[x]:SetAlpha(0.2)
  2562. else
  2563. WorldQuestTips.enigmatic["path"..z].sq[x].texture:SetDesaturated(false)
  2564. WorldQuestTips.enigmatic["path"..z].sq[x]:SetAlpha(1)
  2565. end
  2566. end
  2567. WorldQuestTips.enigmatic["path"..z].sq[41]:Hide()
  2568. end
  2569.  
  2570. function WorldQuestTips:loadEnigmatic( event )
  2571. local size = WorldQuestTipsData.global.options.enigmaticSize
  2572. local rows = WorldQuestTipsData.global.options.enigmaticRows
  2573. local length = table.getn( enigmaticPaths )
  2574. local cols = math.ceil( length / rows )
  2575.  
  2576. local width = ( cols * size * 8 ) + size
  2577. local height = ( rows * size * 8 ) + size + 12
  2578.  
  2579. local enigmatic
  2580. if WorldQuestTips.enigmatic == nil then
  2581. if event == "optionUpdate" then return end
  2582. enigmatic = CreateFrame("FRAME")
  2583. else enigmatic = WorldQuestTips.enigmatic end
  2584. enigmatic:SetSize( width, height )
  2585. enigmatic:ClearAllPoints()
  2586. enigmatic:SetMovable(true)
  2587.  
  2588. if WorldQuestTipsData.global.options.enigmaticPos == "CENTER" then enigmatic:SetPoint("LEFT", UIParent, "CENTER")
  2589. else enigmatic:SetPoint("BOTTOMLEFT", UIParent, WorldQuestTipsData.global.options.enigmaticPos.left, WorldQuestTipsData.global.options.enigmaticPos.bottom ) end
  2590.  
  2591. if enigmatic.draglabel == nil then
  2592. enigmatic.draglabel = CreateFrame("FRAME", nil, enigmatic)
  2593. enigmatic.draglabel:SetPoint("BOTTOMLEFT", enigmatic, "TOPLEFT",0,-12 )
  2594. enigmatic.draglabel.texture = enigmatic.draglabel:CreateTexture()
  2595. enigmatic.draglabel.texture:SetTexture("Interface\\CHATFRAME\\ChatFrameTab")
  2596. enigmatic.draglabel.texture:SetAllPoints()
  2597. enigmatic.draglabel.text = enigmatic.draglabel:CreateFontString(nil, enigmatic.draglabel, "GameFontNormalSmall" )
  2598. enigmatic.draglabel.text:SetText( "Drag" );
  2599. enigmatic.draglabel.text:SetPoint("TOP",0,-10 )
  2600.  
  2601. enigmatic.draglabel:EnableMouse(true)
  2602. enigmatic.draglabel:SetScript("OnMouseDown", function(self) self:GetParent():StartMoving() end )
  2603. enigmatic.draglabel:SetScript("OnMouseUp", function(self)
  2604. self:GetParent():StopMovingOrSizing()
  2605. WorldQuestTipsData.global.options.enigmaticPos = { left = WorldQuestTips.enigmatic:GetLeft(), bottom = WorldQuestTips.enigmatic:GetBottom() }
  2606. end )
  2607. enigmatic.draglabel:SetScript("OnEnter", function(self)
  2608. GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32);
  2609. local text = "To use; select a path to display in\nthe Enigmatic HUD\n\n"
  2610. if not WorldQuestTipsData.global.options.useEnigmaticHUD then text = "To use; just select a path to set\nas a reminder\n\n" end
  2611. GameTooltip:SetText( text.."To configure, type:\n /wqt\n\nIf you see a path that isn't here,\nplease contact the author");
  2612. GameTooltip:Show() end)
  2613. enigmatic.draglabel:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2614.  
  2615. end
  2616. if WorldQuestTipsData.global.options.enigmaticMove then
  2617. enigmatic:EnableMouse(true)
  2618. enigmatic.draglabel:Show()
  2619. else
  2620. enigmatic:EnableMouse(false)
  2621. enigmatic.draglabel:Hide()
  2622. end
  2623. enigmatic.draglabel:SetSize( size * 7, 22 )
  2624.  
  2625. for k,v in pairs( enigmaticPaths ) do
  2626. local findrow = math.modf( (k-1) / cols )
  2627. if enigmatic["path"..k] == nil then
  2628. enigmatic["path"..k] = CreateFrame("Button", nil, enigmatic, "SecureActionButtonTemplate")
  2629. enigmatic["path"..k].k = k
  2630.  
  2631. enigmatic["path"..k]:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square")
  2632. enigmatic["path"..k]:SetScript("OnEnter", function(self)
  2633. enigmatic["path"..k].aplha = enigmatic["path"..k]:GetAlpha()
  2634. enigmatic["path"..k]:SetAlpha(0.7)
  2635. end)
  2636. enigmatic["path"..k]:SetScript("OnLeave", function(self)
  2637. enigmatic["path"..k]:SetAlpha( enigmatic["path"..k].aplha )
  2638. end)
  2639. enigmatic["path"..k]:SetScript("OnClick", function(self)
  2640. for z = 1, table.getn( enigmaticPaths ) do
  2641. enigmatic["path"..z]:SetAlpha(0.2)
  2642. deactivateEnigmatic( z )
  2643. end
  2644. if WorldQuestTips.enigmaticHUD == nil then WorldQuestTips:loadEnigmaticHUD() end
  2645. if WorldQuestTipsData.global.options.useEnigmaticHUD then WorldQuestTips.enigmaticHUD:Show() end
  2646. WorldQuestTips.enigmaticHUD.k = self.k
  2647. activateEnigmatic( self.k )
  2648. end)
  2649.  
  2650. enigmatic["path"..k].arrow = CreateFrame("FRAME", nil, enigmatic["path"..k])
  2651. enigmatic["path"..k].arrow.texture = enigmatic["path"..k].arrow:CreateTexture()
  2652. enigmatic["path"..k].arrow.texture:SetTexture("Interface\\MINIMAP\\MinimapArrow")
  2653. enigmatic["path"..k].arrow.texture:SetAllPoints()
  2654. enigmatic["path"..k].arrow:SetFrameLevel(50)
  2655.  
  2656. end
  2657. enigmatic["path"..k]:SetWidth(size*7)
  2658. enigmatic["path"..k]:SetHeight(size*7)
  2659. enigmatic["path"..k]:SetPoint("TOPLEFT", enigmatic, (k-1-findrow*cols)*size*8, -findrow*size*8-12 )
  2660.  
  2661. local sq
  2662. if enigmatic["path"..k].sq == nil then sq = {} else sq = enigmatic["path"..k].sq end
  2663. for i = 0,6 do
  2664. for j = 0,6 do
  2665. local thisSq = i*7 + j + 1
  2666. if sq[thisSq] == nil then
  2667. sq[thisSq] = CreateFrame("FRAME", nil, enigmatic["path"..k])
  2668. sq[thisSq].texture = sq[thisSq]:CreateTexture()
  2669. sq[thisSq].texture:SetTexture("Interface\\Icons\\spell_holy_holybolt")
  2670. sq[thisSq].texture:SetAllPoints()
  2671. end
  2672. sq[thisSq]:SetSize(size, size)
  2673. sq[thisSq]:SetPoint("TOPLEFT", enigmatic["path"..k], j*size, -i*size )
  2674. enigmatic["path"..k].sq = sq
  2675. end
  2676. end
  2677. local arrowsize = math.min( 48, size*2 )
  2678. enigmatic["path"..k].arrow:SetSize(arrowsize, arrowsize)
  2679. enigmatic["path"..k].arrow:SetPoint("CENTER", enigmatic["path"..k].sq[41] )
  2680. end
  2681. WorldQuestTips.enigmatic = enigmatic
  2682. for z = 1, table.getn( enigmaticPaths ) do
  2683. enigmatic["path"..z]:SetAlpha(1)
  2684. deactivateEnigmatic( z )
  2685. end
  2686. end
  2687.  
  2688. function WorldQuestTips:loadEnigmaticHUD( event )
  2689.  
  2690. local viewedZone = GetCurrentMapAreaID()
  2691. SetMapToCurrentZone()
  2692. local unitX, unitY = GetPlayerMapPosition("player")
  2693. local rotation = GetPlayerFacing()
  2694. local _,TLx,TLy,BRx,BRy = GetCurrentMapZone()
  2695. SetMapByID( viewedZone )
  2696. local size = WorldQuestTipsData.global.options.enigmaticHUDSize
  2697. local currentPosX = 5.5*size
  2698. local currentPosY = 1.5*size
  2699.  
  2700. local enigmaticHUD
  2701. if WorldQuestTips.enigmaticHUD == nil then
  2702. if event == "optionUpdate" then return end
  2703. -- enigmaticHUD = CreateFrame("FRAME", nil, UIParent)
  2704. enigmaticHUD = CreateFrame("FRAME")
  2705. else enigmaticHUD = WorldQuestTips.enigmaticHUD end
  2706.  
  2707. enigmaticHUD:SetSize( 7*size, 7*size + 12 )
  2708. enigmaticHUD:ClearAllPoints()
  2709. enigmaticHUD:SetMovable(true)
  2710.  
  2711. if WorldQuestTipsData.global.options.enigmaticHUDPos == "CENTER" then enigmaticHUD:SetPoint("RIGHT", UIParent, "CENTER")
  2712. else enigmaticHUD:SetPoint("BOTTOMLEFT", UIParent, WorldQuestTipsData.global.options.enigmaticHUDPos.left, WorldQuestTipsData.global.options.enigmaticHUDPos.bottom ) end
  2713.  
  2714. if enigmaticHUD.draglabel == nil then
  2715. enigmaticHUD.draglabel = CreateFrame("FRAME", nil, enigmaticHUD)
  2716. enigmaticHUD.draglabel:SetPoint("BOTTOMLEFT", enigmaticHUD, "TOPLEFT",0,-12 )
  2717. enigmaticHUD.draglabel.texture = enigmaticHUD.draglabel:CreateTexture()
  2718. enigmaticHUD.draglabel.texture:SetTexture("Interface\\CHATFRAME\\ChatFrameTab")
  2719. enigmaticHUD.draglabel.texture:SetAllPoints()
  2720. enigmaticHUD.draglabel.text = enigmaticHUD.draglabel:CreateFontString(nil, enigmaticHUD.draglabel, "GameFontNormalSmall" )
  2721. enigmaticHUD.draglabel.text:SetText( "Drag" );
  2722. enigmaticHUD.draglabel.text:SetPoint("TOP",0,-10 )
  2723.  
  2724. enigmaticHUD.draglabel:EnableMouse(true)
  2725. enigmaticHUD.draglabel:SetScript("OnMouseDown", function(self) self:GetParent():StartMoving() end )
  2726. enigmaticHUD.draglabel:SetScript("OnMouseUp", function(self)
  2727. self:GetParent():StopMovingOrSizing()
  2728. WorldQuestTipsData.global.options.enigmaticHUDPos = { left = WorldQuestTips.enigmaticHUD:GetLeft(), bottom = WorldQuestTips.enigmaticHUD:GetBottom() }
  2729. end )
  2730. enigmaticHUD.draglabel:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT",0,-32); GameTooltip:SetText("To use, select a path from the Enigmatic Paths frame\nthen keep the player arrow on the path!\n\nTo configure, type:\n /wqt"); GameTooltip:Show() end)
  2731. enigmaticHUD.draglabel:SetScript("OnLeave", function(self) GameTooltip:Hide() end)
  2732. -- enigmaticHUD.dragRegion = enigmaticHUD:CreateTitleRegion()
  2733. -- enigmaticHUD.dragRegion:SetPoint("TOPLEFT", enigmaticHUD )
  2734. end
  2735.  
  2736. if WorldQuestTipsData.global.options.enigmaticHUDMove then
  2737. enigmaticHUD:EnableMouse(true)
  2738. enigmaticHUD.draglabel:Show()
  2739. else
  2740. enigmaticHUD:EnableMouse(false)
  2741. enigmaticHUD.draglabel:Hide()
  2742. end
  2743. enigmaticHUD.draglabel:SetSize( 42, 22 )
  2744. --enigmaticHUD.dragRegion:SetSize( 42, 22 )
  2745.  
  2746. local sq
  2747. if enigmaticHUD.sq == nil then sq = {} else sq = enigmaticHUD.sq end
  2748. for i = 0,6 do
  2749. for j = 0,6 do
  2750. local thisSq = i*7 + j + 1
  2751. if sq[thisSq] == nil then
  2752. sq[thisSq] = CreateFrame("FRAME", nil, enigmaticHUD)
  2753. sq[thisSq].texture = sq[thisSq]:CreateTexture()
  2754. -- sq[thisSq].texture:SetTexture("Interface\\Icons\\spell_holy_holybolt")
  2755. sq[thisSq].texture:SetTexture("Interface\\Buttons\\CheckButtonHilight")
  2756. sq[thisSq].texture:SetAllPoints()
  2757. end
  2758. if enigmaticHUD.k == nil then
  2759. if not ( thisSq < 8 or thisSq > 42 or thisSq%7 == 0 or (thisSq-1)%7 == 0 ) then
  2760. sq[thisSq].texture:SetDesaturated(true)
  2761. sq[thisSq]:SetAlpha(WorldQuestTipsData.global.options.enigmaticHUDPathA)
  2762. else
  2763. sq[thisSq]:SetAlpha(WorldQuestTipsData.global.options.enigmaticHUDEdgeA)
  2764. end
  2765. end
  2766. sq[thisSq]:SetSize(size, size)
  2767. sq[thisSq]:SetPoint("TOPLEFT", enigmaticHUD, j*size, -i*size-12 )
  2768. enigmaticHUD.sq = sq
  2769. end
  2770. end
  2771. if enigmaticHUD.arrow == nil then
  2772. enigmaticHUD.arrow = CreateFrame("FRAME", nil, enigmaticHUD)
  2773. enigmaticHUD.arrow.texture = enigmaticHUD.arrow:CreateTexture()
  2774. enigmaticHUD.arrow.texture:SetTexture("Interface\\MINIMAP\\MinimapArrow")
  2775. enigmaticHUD.arrow.texture:SetAllPoints()
  2776. enigmaticHUD.arrow:SetFrameLevel(50)
  2777. end
  2778. local arrowsize = math.min( 48, size*2 )
  2779. enigmaticHUD.arrow:SetSize(arrowsize, arrowsize)
  2780.  
  2781. enigmaticHUD.initialTP = { x = currentPosX, y = currentPosY }
  2782.  
  2783. if event == "optionUpdate" then
  2784. if enigmaticHUD.k then
  2785. activateEnigmatic( enigmaticHUD.k )
  2786. end
  2787. else
  2788. enigmaticHUD.arrow:SetPoint("CENTER", enigmaticHUD, "BOTTOMLEFT", currentPosX, currentPosY )
  2789. enigmaticHUD.initialMP = { x = unitX, y = unitY, r = rotation }
  2790. enigmaticHUD.zone = { x = TLx-BRx, y = TLy-BRy } -- width / height of zone in yards
  2791. enigmaticHUD:Hide()
  2792. end
  2793.  
  2794. WorldQuestTips.enigmaticHUD = enigmaticHUD
  2795. end
  2796.  
  2797. SLASH_WorldQuestTips1= "/wqt";
  2798. function SlashCmdList.WorldQuestTips(msg)
  2799. if msg == "" then
  2800. WorldQuestTips:loadOptions()
  2801. else
  2802. if msg == 'debug true' then debugging = true; print('WorldQuestTips: Debugging messages on')
  2803. elseif msg == 'debug false' then debugging = false; print('WorldQuestTips: Debugging messages off') end
  2804.  
  2805. if msg == 'test' then
  2806.  
  2807. for k,v in pairs( WorldQuestTipsData ) do
  2808. print( k, v)
  2809. end
  2810. WorldQuestTips:loadEnigmatic()
  2811. print("test fired")
  2812. for i = 1, GetAchievementNumCriteria(9692) do
  2813. local description, type, completed, quantity, requiredQuantity, characterName, flags, assetID, quantityString, criteriaID = GetAchievementCriteriaInfo(9692, i)
  2814. print(description)
  2815. end
  2816.  
  2817. end
  2818.  
  2819. WorldQuestTipsData.global.options.debugging = debugging;
  2820. end
  2821. end
  2822.  
  2823.  
  2824. ----------------------------------------------
  2825. --[[-- Register events and call functions --]]--
  2826. ----------------------------------------------
  2827. WorldQuestTips:SetScript("OnEvent", function(self, event, ...)
  2828. WorldQuestTips[event](self, ...);
  2829. end);
  2830. --[[for k, v in pairs(WorldQuestTips) do
  2831. WorldQuestTips:RegisterEvent(k); -- Registers all events for which handlers have been defined
  2832. end]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement