Advertisement
Cokedriver

Unitframes.lua

Apr 27th, 2014
1,238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.94 KB | None | 0 0
  1. local MODULE_NAME = "Unitframes"
  2. local ADDON_NAME = LibStub("AceAddon-3.0"):GetAddon("BasicUI")
  3. local MODULE = ADDON_NAME:NewModule(MODULE_NAME, "AceEvent-3.0")
  4. local L = setmetatable({}, { __index = function(t,k)
  5. local v = tostring(k)
  6. rawset(t, k, v)
  7. return v
  8. end })
  9.  
  10. local db
  11.  
  12. local defaults = {
  13. profile = {
  14. enable = true,
  15. --abbrevRealmNames = true,
  16. player = {
  17. enable = true, -- Enable Player Frame Adjustments
  18. scale = 1.15, -- Player Frame Scale
  19. fontSize = 13, -- Stausbar Font Size
  20. fontSizepet = 10, -- Stausbar Font Size
  21. },
  22. target = {
  23. enable = true, -- Enable Target Frame Adjustments
  24. scale = 1.15, -- Target Frame Scale
  25. fontSize = 13, -- Stausbar Font Size
  26. },
  27. focus = {
  28. enable = true, -- Enable Focus Frame Adjustments
  29. scale = 1.15, -- Focus Frame Scale
  30. fontSize = 13, -- Stausbar Font Size
  31. },
  32. party = {
  33. enable = true,
  34. scale = 1.15,
  35. fontSize = 11, -- Stausbar Font Size
  36. position = {
  37. relAnchor = "TOPLEFT",
  38. offSetX = 10, -- Controls the X offset. (Left - Right)
  39. offSetY = -150, -- Controls the Y offset. (Up - Down)
  40. },
  41. },
  42. arena = {
  43. enable = true,
  44. scale = 1.5,
  45. fontSize = 11, -- Stausbar Font Size
  46. },
  47. boss = {
  48. enable = true,
  49. scale = 1.15,
  50. --fontSize = 13, -- Stausbar Font Size
  51. position = {
  52. relAnchor = "RIGHT",
  53. offSet = -50, -- Controls the X offset. (Left - Right)
  54. offSetY = -250, -- Controls the Y offset. (Up - Down)
  55. },
  56. },
  57. },
  58. }
  59.  
  60. local CUSTOM_FACTION_BAR_COLORS = {
  61. [1] = {r = 1, g = 0, b = 0},
  62. [2] = {r = 1, g = 0, b = 0},
  63. [3] = {r = 1, g = 1, b = 0},
  64. [4] = {r = 1, g = 1, b = 0},
  65. [5] = {r = 0, g = 1, b = 0},
  66. [6] = {r = 0, g = 1, b = 0},
  67. [7] = {r = 0, g = 1, b = 0},
  68. [8] = {r = 0, g = 1, b = 0},
  69. }
  70.  
  71. -- Font Style
  72. local shorts = {
  73. { 1e10, 1e9, "%.0fB" }, -- 10b+ as 12b
  74. { 1e9, 1e9, "%.1fB" }, -- 1b+ as 8.3b
  75. { 1e7, 1e6, "%.0fM" }, -- 10m+ as 14m
  76. { 1e6, 1e6, "%.1fM" }, -- 1m+ as 7.4m
  77. { 1e5, 1e3, "%.0fK" }, -- 100k+ as 840k
  78. { 1e3, 1e3, "%.1fK" }, -- 1k+ as 2.5k
  79. { 0, 1, "%d" }, -- < 1k as 974
  80. }
  81. for i = 1, #shorts do
  82. shorts[i][4] = shorts[i][3] .. " (%.0f%%)"
  83. end
  84.  
  85. function MODULE:OnInitialize()
  86. self.db = ADDON_NAME.db:RegisterNamespace(MODULE_NAME, defaults)
  87. db = self.db.profile
  88.  
  89. self:SetEnabledState(ADDON_NAME:GetModuleEnabled(MODULE_NAME))
  90. end
  91.  
  92. function MODULE:OnEnable()
  93.  
  94. if InCombatLockdown() then
  95. return self:RegisterEvent("PLAYER_REGEN_ENABLED", "OnEnable")
  96. end
  97. self:UnregisterEvent("PLAYER_REGEN_ENABLED")
  98.  
  99. db = self.db.profile
  100.  
  101. if enabled or not db.enable then return end
  102. enabled = true -- since most of this stuff is non-undoable (eg. hooksecurefunc)
  103.  
  104. -- Move Party Frames
  105. PartyMemberFrame1:SetPoint(db.party.position.relAnchor, UIParent, db.party.position.offSetX, db.party.position.offSetY);
  106.  
  107. -- Move Boss Frames
  108. local movingBossFrame
  109. hooksecurefunc(Boss1TargetFrame, "SetPoint", function(f, ...)
  110. if movingBossFrame or InCombatLockdown() then
  111. return
  112. end
  113. movingBossFrame = true
  114. Boss1TargetFrame:ClearAllPoints()
  115. Boss1TargetFrame:SetPoint(db.boss.position.relAnchor, UIParent, db.boss.position.offSetX, db.boss.position.offSetY)
  116. movingBossFrame = nil
  117. end)
  118.  
  119. -- Update Unit Frames
  120. self:ApplySettings()
  121.  
  122. -- Disable healing/damage spam over player/pet frame:
  123. PlayerHitIndicator:SetText(nil)
  124. PlayerHitIndicator.SetText = function() end
  125. PetHitIndicator:SetText(nil)
  126. PetHitIndicator.SetText = function() end
  127.  
  128. -- Change other frames' name backgrounds to match player frame
  129. for _, region in pairs({
  130. TargetFrameNameBackground,
  131. FocusFrameNameBackground,
  132. Boss1TargetFrameNameBackground,
  133. Boss2TargetFrameNameBackground,
  134. Boss3TargetFrameNameBackground,
  135. Boss4TargetFrameNameBackground,
  136. }) do
  137. region:SetTexture(0, 0, 0, 0.5)
  138. end
  139.  
  140. -- Font Style / Color thanks to Phanx from WoWinterface.
  141. hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", function(statusBar, fontString, value, valueMin, valueMax)
  142. if value == 0 then
  143. return fontString:SetText("")
  144. end
  145.  
  146. local style = GetCVar("statusTextDisplay")
  147. if style == "PERCENT" then
  148. return fontString:SetFormattedText("%.0f%%", value / valueMax * 100)
  149. end
  150. for i = 1, #shorts do
  151. local t = shorts[i]
  152. if value >= t[1] then
  153. if style == "BOTH" then
  154. return fontString:SetFormattedText(t[4], value / t[2], value / valueMax * 100)
  155. else
  156. if value < valueMax then
  157. for j = 1, #shorts do
  158. local v = shorts[j]
  159. if valueMax >= v[1] then
  160. return fontString:SetFormattedText(t[3] .. " / " .. v[3], value / t[2], valueMax / v[2])
  161. end
  162. end
  163. end
  164. return fontString:SetFormattedText(t[3], value / t[2])
  165. end
  166. end
  167. end
  168. end)
  169.  
  170. -- Font Color
  171. hooksecurefunc("UnitFrame_Update", function(self, isParty)
  172. if not self.name or not self:IsShown() then return end
  173.  
  174. local PET_COLOR = { r = 157/255, g = 197/255, b = 255/255 }
  175. local unit, color = self.unit
  176. if UnitPlayerControlled(unit) then
  177. if UnitIsPlayer(unit) then
  178. local _, class = UnitClass(unit)
  179. color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
  180. else
  181. color = PET_COLOR
  182. end
  183. elseif UnitIsDeadOrGhost(unit) or UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) then
  184. color = GRAY_FONT_COLOR
  185. else
  186. color = CUSTOM_FACTION_BAR_COLORS[UnitIsEnemy(unit, "player") and 1 or UnitReaction(unit, "player") or 5]
  187. end
  188.  
  189. if not color then
  190. color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)["PRIEST"]
  191. end
  192.  
  193. self.name:SetTextColor(color.r, color.g, color.b)
  194. if isParty then
  195. self.name:SetText(GetUnitName(self.overrideName or unit))
  196. end
  197. end)
  198. end
  199.  
  200. function MODULE:ApplySettings(event)
  201.  
  202. db = self.db.profile
  203.  
  204. if event then
  205. self:UnregisterEvent(event)
  206. end
  207.  
  208. if InCombatLockdown() then
  209. return self:RegisterEvent("PLAYER_REGEN_ENABLED", "ApplySettings")
  210. end
  211.  
  212. local failure
  213. for unit, func in pairs(self.UnitFunctions) do
  214. if db[unit].enable then
  215. if func(self) then
  216. failure = true
  217. end
  218. end
  219. end
  220.  
  221. if failure then
  222. self:RegisterEvent("ADDON_LOADED", "ApplySettings")
  223. end
  224.  
  225. end
  226.  
  227. ------------------------------------------------------------------------
  228.  
  229.  
  230. MODULE.UnitFunctions = {
  231.  
  232.  
  233. player = function(self)
  234. PlayerFrame:SetScale(db.player.scale)
  235. PlayerFrameHealthBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.player.fontSize,"THINOUTLINE")
  236. PlayerFrameManaBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.player.fontSize, "THINOUTLINE")
  237. PlayerFrameAlternateManaBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.player.fontSize, "THINOUTLINE")
  238.  
  239. PetFrameHealthBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.player.fontSizepet,"THINOUTLINE")
  240. PetFrameManaBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.player.fontSizepet, "THINOUTLINE")
  241. end,
  242.  
  243. target = function(self)
  244. TargetFrame:SetScale(db.target.scale)
  245. TargetFrameTextureFrameHealthBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.target.fontSize, "THINOUTLINE")
  246. TargetFrameTextureFrameManaBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.target.fontSize, "THINOUTLINE")
  247. end,
  248.  
  249. focus = function(self)
  250. FocusFrame:SetScale(db.focus.scale)
  251. FocusFrameTextureFrameHealthBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.focus.fontSize,"THINOUTLINE")
  252. FocusFrameTextureFrameManaBarText:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.focus.fontSize,"THINOUTLINE")
  253. end,
  254.  
  255. party = function(self)
  256. for i = 1, MAX_PARTY_MEMBERS do
  257. local partyFrame = "PartyMemberFrame"..i
  258. _G[partyFrame]:SetScale(db.party.scale)
  259. _G[partyFrame.."HealthBarText"]:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.party.fontSize, "THINOUTLINE")
  260. _G[partyFrame.."ManaBarText"]:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.party.fontSize, "THINOUTLINE")
  261. end
  262. end,
  263.  
  264. arena = function(self)
  265. if not ArenaEnemyFrame1 then
  266. return true
  267. end
  268.  
  269. for i = 1, MAX_ARENA_ENEMIES do
  270. local prepFrame = "ArenaPrepFrame"..i
  271. _G[prepFrame]:SetScale(db.arena.scale)
  272. _G[prepFrame.."HealthBarText"]:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.arena.fontSize,"THINOUTLINE")
  273. _G[prepFrame.."ManaBarText"]:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.arena.fontSize, "THINOUTLINE")
  274.  
  275. local arenaFrame = "ArenaEnemyFrame"..i
  276. _G[arenaFrame]:SetScale(db.arena.scale)
  277. _G[arenaFrame.."HealthBarText"]:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.arena.fontSize,"THINOUTLINE")
  278. _G[arenaFrame.."ManaBarText"]:SetFont(ADDON_NAME.db.profile.media.fontNormal, db.arena.fontSize, "THINOUTLINE")
  279. end
  280. end,
  281.  
  282. boss = function(self)
  283. for i = 1, MAX_BOSS_FRAMES do
  284. local bossFrame = "Boss"..i.."TargetFrame"
  285. _G[bossFrame]:SetScale(db.boss.scale)
  286. end
  287. end,
  288.  
  289. }
  290. ------------------------------------------------------------------------------
  291.  
  292. -- Leave this out if the module doesn't have any settings:
  293. function MODULE:Refresh()
  294. db = self.db.profile -- update the upvalue
  295.  
  296. -- change stuff here
  297. end
  298.  
  299. -- Leave this out if the module doesn't have any options:
  300. local options
  301. function MODULE:GetOptions()
  302.  
  303.  
  304. local regions = {
  305. ['BOTTOM'] = L['Bottom'],
  306. ['BOTTOMLEFT'] = L['Bottom Left'],
  307. ['BOTTOMRIGHT'] = L['Bottom Right'],
  308. ['CENTER'] = L['Center'],
  309. ['LEFT'] = L['Left'],
  310. ['RIGHT'] = L['Right'],
  311. ['TOP'] = L['Top'],
  312. ['TOPLEFT'] = L['Top Left'],
  313. ['TOPRIGHT'] = L['Top Right'],
  314. }
  315.  
  316. if options then
  317. return options
  318. end
  319.  
  320. local function isModuleDisabled()
  321. return not ADDON_NAME:GetModuleEnabled(MODULE_NAME)
  322. end
  323.  
  324. options = {
  325. type = "group",
  326. name = L[MODULE_NAME],
  327. get = function(info) return db[ info[#info] ] end,
  328. set = function(info, value) db[ info[#info] ] = value; self:ApplySettings(event) end,
  329. disabled = isModuleDisabled(),
  330. args = {
  331. reloadUI = {
  332. type = "execute",
  333. name = "Reload UI",
  334. desc = " ",
  335. order = 0,
  336. func = function()
  337. ReloadUI()
  338. end,
  339. },
  340. Text = {
  341. type = "description",
  342. order = 0,
  343. name = "When you enable or disable a Unitframe a reload of the UI is needed.",
  344. width = "full",
  345. },
  346. Text1 = {
  347. type = "description",
  348. order = 1,
  349. name = " ",
  350. width = "full",
  351. },
  352. enable = {
  353. type = "toggle",
  354. order = 1,
  355. name = L["Enable Uniframes Module"],
  356. width = "full",
  357. disabled = false,
  358. },
  359. Text2 = {
  360. type = "description",
  361. order = 2,
  362. name = " ",
  363. width = "full",
  364. },
  365. player = {
  366. type = "group",
  367. order = 2,
  368. name = L["Player Frame Adjustments"],
  369. get = function(info) return db.player[ info[#info] ] end,
  370. set = function(info, value) db.player[ info[#info] ] = value; self:ApplySettings(event) end,
  371. disabled = function() return isModuleDisabled() or not db.enable end,
  372. guiInline = true,
  373. args = {
  374. enable = {
  375. type = "toggle",
  376. order = 0,
  377. name = L["Enable Player Frame"],
  378. width = "full",
  379. },
  380. Text1 = {
  381. type = "description",
  382. order = 1,
  383. name = " ",
  384. width = "full",
  385. },
  386. scale = {
  387. type = "range",
  388. order = 1,
  389. name = L["Frame Scale"],
  390. desc = L["Controls the scaling of Blizzard's Player Frame"],
  391. min = 0.5, max = 2, step = 0.05,
  392. disabled = function() return isModuleDisabled() or not db.enable or not db.player.enable end,
  393. },
  394. fontSize= {
  395. type = "range",
  396. order = 2,
  397. name = L["HP/Mana Font Size"],
  398. desc = L["Controls the Player Healthbar/Manabar value font size."],
  399. min = 8, max = 25, step = 1,
  400. disabled = function() return isModuleDisabled() or not db.enable or not db.player.enable end,
  401. },
  402. Text2 = {
  403. type = "description",
  404. order = 2,
  405. name = " ",
  406. width = "full",
  407. },
  408. fontSizepet= {
  409. type = "range",
  410. order = 2,
  411. name = L["HP/Mana Font Size for your pet"],
  412. desc = L["Controls the Player Pet Healthbar/Manabar value font size."],
  413. min = 8, max = 25, step = 1,
  414. disabled = function() return isModuleDisabled() or not db.enable or not db.player.enable end,
  415. },
  416. },
  417. },
  418. target = {
  419. type = "group",
  420. order = 4,
  421. name = L["Target Frame Adjustments"],
  422. get = function(info) return db.target[ info[#info] ] end,
  423. set = function(info, value) db.target[ info[#info] ] = value; self:ApplySettings(event) end,
  424. disabled = function() return isModuleDisabled() or not db.enable end,
  425. guiInline = true,
  426. args = {
  427. ---------------------------
  428. --Option Type Seperators
  429. sep1 = {
  430. type = "description",
  431. order = 1,
  432. name = " ",
  433. },
  434. sep2 = {
  435. type = "description",
  436. order = 2,
  437. name = " ",
  438. },
  439. sep3 = {
  440. type = "description",
  441. order = 3,
  442. name = " ",
  443. },
  444. sep4 = {
  445. type = "description",
  446. order = 4,
  447. name = " ",
  448. },
  449. ---------------------------
  450. enable = {
  451. type = "toggle",
  452. order = 0,
  453. name = L["Enable Target Frame"],
  454. width = "full",
  455. },
  456. scale = {
  457. type = "range",
  458. order = 1,
  459. name = L["Frame Scale"],
  460. desc = L["Controls the scaling of Blizzard's Target Frame"],
  461. min = 0.5, max = 2, step = 0.05,
  462. disabled = function() return isModuleDisabled() or not db.enable or not db.target.enable end,
  463. },
  464. fontSize= {
  465. type = "range",
  466. order = 2,
  467. name = L["HP/Mana Font Size"],
  468. desc = L["Controls the Target Healthbar/Manabar value font size."],
  469. min = 8, max = 25, step = 1,
  470. disabled = function() return isModuleDisabled() or not db.enable or not db.target.enable end,
  471. },
  472. },
  473. },
  474. focus = {
  475. type = "group",
  476. order = 5,
  477. name = L["Focus Frame Adjustments"],
  478. get = function(info) return db.focus[ info[#info] ] end,
  479. set = function(info, value) db.focus[ info[#info] ] = value; self:ApplySettings(event) end,
  480. disabled = function() return isModuleDisabled() or not db.enable end,
  481. guiInline = true,
  482. args = {
  483. ---------------------------
  484. --Option Type Seperators
  485. sep1 = {
  486. type = "description",
  487. order = 1,
  488. name = " ",
  489. },
  490. sep2 = {
  491. type = "description",
  492. order = 2,
  493. name = " ",
  494. },
  495. sep3 = {
  496. type = "description",
  497. order = 3,
  498. name = " ",
  499. },
  500. sep4 = {
  501. type = "description",
  502. order = 4,
  503. name = " ",
  504. },
  505. ---------------------------
  506. enable = {
  507. type = "toggle",
  508. order = 0,
  509. name = L["Enable Focus Frame"],
  510. width = "full",
  511. },
  512. scale = {
  513. type = "range",
  514. order = 1,
  515. name = L["Frame Scale"],
  516. desc = L["Controls the scaling of Blizzard's Focus Frame"],
  517. min = 0.5, max = 2, step = 0.05,
  518. disabled = function() return isModuleDisabled() or not db.enable or not db.focus.enable end,
  519. },
  520. fontSize= {
  521. type = "range",
  522. order = 2,
  523. name = L["HP/Mana Font Size"],
  524. desc = L["Controls the Focus Healthbar/Manabar value font size."],
  525. min = 8, max = 25, step = 1,
  526. disabled = function() return isModuleDisabled() or not db.enable or not db.focus.enable end,
  527. },
  528. },
  529. },
  530. party = {
  531. type = "group",
  532. order = 6,
  533. name = L["Party Frame Adjustments"],
  534. get = function(info) return db.party[ info[#info] ] end,
  535. set = function(info, value) db.party[ info[#info] ] = value; self:ApplySettings(event) end,
  536. disabled = function() return isModuleDisabled() or not db.enable end,
  537. guiInline = true,
  538. args = {
  539. ---------------------------
  540. sep1 = {
  541. type = "description",
  542. order = 1,
  543. name = " ",
  544. },
  545. sep2 = {
  546. type = "description",
  547. order = 2,
  548. name = " ",
  549. },
  550. sep3 = {
  551. type = "description",
  552. order = 3,
  553. name = " ",
  554. },
  555. sep4 = {
  556. type = "description",
  557. order = 4,
  558. name = " ",
  559. },
  560. sep5 = {
  561. type = "description",
  562. order = 5,
  563. name = " ",
  564. },
  565. ---------------------------
  566. enable = {
  567. type = "toggle",
  568. order = 0,
  569. name = L["Enable Party Frame"],
  570. width = "full",
  571. },
  572. scale = {
  573. type = "range",
  574. order = 1,
  575. name = L["Scale"],
  576. desc = L["Controls the scaling of Blizzard's Party Frame"],
  577. min = 0.5, max = 2, step = 0.05,
  578. disabled = function() return isModuleDisabled() or not db.enable or not db.party.enable end,
  579. },
  580. fontSize= {
  581. type = "range",
  582. order = 2,
  583. name = L["HP/Mana Font Size"],
  584. desc = L["Controls the Party Healthbar/Manabar value font size."],
  585. min = 8, max = 25, step = 1,
  586. disabled = function() return isModuleDisabled() or not db.enable or not db.party.enable end,
  587. },
  588. position = {
  589. type = "group",
  590. order = 2,
  591. childGroups = "tree",
  592. name = L["Party Frame Position"],
  593. disabled = function() return isModuleDisabled() or not db.enable or not db.party.enable end,
  594. get = function(info) return db.party.position[ info[#info] ] end,
  595. set = function(info, value) db.party.position[ info[#info] ] = value; self:ApplySettings(event) end,
  596.  
  597. args = {
  598. ---------------------------
  599. --Option Type Seperators
  600. sep1 = {
  601. type = "description",
  602. order = 1,
  603. name = " ",
  604. },
  605. sep2 = {
  606. type = "description",
  607. order = 2,
  608. name = " ",
  609. },
  610. sep3 = {
  611. type = "description",
  612. order = 3,
  613. name = " ",
  614. },
  615. sep4 = {
  616. type = "description",
  617. order = 4,
  618. name = " ",
  619. },
  620. ---------------------------
  621. relAnchor = {
  622. order = 1,
  623. name = L["Self Anchor"],
  624. type = "select",
  625. values = regions,
  626. disabled = function() return isModuleDisabled() or not db.enable or not db.party.enable end,
  627. },
  628. offSetX = {
  629. type = "range",
  630. order = 2,
  631. name = L["X Offset"],
  632. desc = L["Controls the X offset. (Left - Right)"],
  633. min = -250, max = 250, step = 5,
  634. disabled = function() return isModuleDisabled() or not db.enable or not db.party.enable end,
  635. },
  636. offSetY = {
  637. type = "range",
  638. order = 3,
  639. name = L["Y Offset"],
  640. desc = L["Controls the Y offset. (Up - Down)"],
  641. min = -250, max = 250, step = 5,
  642. disabled = function() return isModuleDisabled() or not db.enable or not db.party.enable end,
  643. },
  644. },
  645. },
  646. },
  647. },
  648. arena = {
  649. type = "group",
  650. order = 7,
  651. name = L["Arena Frame Adjustments"],
  652. get = function(info) return db.arena[ info[#info] ] end,
  653. set = function(info, value) db.arena[ info[#info] ] = value; self:ApplySettings(event) end,
  654. disabled = function() return isModuleDisabled() or not db.enable end,
  655. guiInline = true,
  656. args = {
  657. ---------------------------
  658. sep1 = {
  659. type = "description",
  660. order = 1,
  661. name = " ",
  662. },
  663. sep2 = {
  664. type = "description",
  665. order = 2,
  666. name = " ",
  667. },
  668. sep3 = {
  669. type = "description",
  670. order = 3,
  671. name = " ",
  672. },
  673. sep4 = {
  674. type = "description",
  675. order = 4,
  676. name = " ",
  677. },
  678. ---------------------------
  679. enable = {
  680. type = "toggle",
  681. order = 0,
  682. name = L["Enable Arena Frame"],
  683. },
  684. scale = {
  685. type = "range",
  686. order = 1,
  687. name = L["Scale"],
  688. desc = L["Controls the scaling of Blizzard's Arena Frames"],
  689. min = 0.5, max = 2, step = 0.05,
  690. disabled = function() return isModuleDisabled() or not db.enable or not db.arena.enable end,
  691. },
  692. fontSize= {
  693. type = "range",
  694. order = 2,
  695. name = L["HP/Mana Font Size"],
  696. desc = L["Controls the Arena Healthbar/Manabar value font size."],
  697. min = 8, max = 25, step = 1,
  698. disabled = function() return isModuleDisabled() or not db.enable or not db.arena.enable end,
  699. },
  700. },
  701. },
  702. boss = {
  703. type = "group",
  704. order = 8,
  705. name = L["Boss Frame Adjustments"],
  706. get = function(info) return db.boss[ info[#info] ] end,
  707. set = function(info, value) db.boss[ info[#info] ] = value; self:ApplySettings(event) end,
  708. disabled = function() return isModuleDisabled() or not db.enable end,
  709. guiInline = true,
  710. args = {
  711. ---------------------------
  712. sep1 = {
  713. type = "description",
  714. order = 1,
  715. name = " ",
  716. },
  717. sep2 = {
  718. type = "description",
  719. order = 2,
  720. name = " ",
  721. },
  722. sep3 = {
  723. type = "description",
  724. order = 3,
  725. name = " ",
  726. },
  727. sep4 = {
  728. type = "description",
  729. order = 4,
  730. name = " ",
  731. },
  732. sep5 = {
  733. type = "description",
  734. order = 5,
  735. name = " ",
  736. },
  737. ---------------------------
  738. enable = {
  739. type = "toggle",
  740. order = 0,
  741. name = L["Enable Boss Frame"],
  742. width = "full",
  743. },
  744. scale = {
  745. type = "range",
  746. order = 1,
  747. name = L["Scale"],
  748. desc = L["Controls the scaling of Blizzard's Boss Frames"],
  749. min = 0.5, max = 2, step = 0.05,
  750. disabled = function() return isModuleDisabled() or not db.enable or not db.boss.enable end,
  751. },
  752. --[[fontSize= {
  753. type = "range",
  754. order = 2,
  755. name = L["HP/Mana Font Size"],
  756. desc = L["Controls the Boss Healthbar/Manabar value font size."],
  757. min = 8, max = 25, step = 1,
  758. disabled = function() return not db.enable or not db.boss.enable end,
  759. },]]
  760. position = {
  761. type = "group",
  762. order = 5,
  763. childGroups = "tree",
  764. name = L["Position"],
  765. --desc = L["Combo Points Options"],
  766. disabled = function() return isModuleDisabled() or not db.enable or not db.boss.enable end,
  767. get = function(info) return db.boss.position[ info[#info] ] end,
  768. set = function(info, value) db.boss.position[ info[#info] ] = value; self:ApplySettings(event) end,
  769. args = {
  770. ---------------------------
  771. --Option Type Seperators
  772. sep1 = {
  773. type = "description",
  774. order = 1,
  775. name = " ",
  776. },
  777. sep2 = {
  778. type = "description",
  779. order = 2,
  780. name = " ",
  781. },
  782. sep3 = {
  783. type = "description",
  784. order = 3,
  785. name = " ",
  786. },
  787. sep4 = {
  788. type = "description",
  789. order = 4,
  790. name = " ",
  791. },
  792. ---------------------------
  793. relAnchor = {
  794. type = "select",
  795. order = 1,
  796. name = L["Relative Anchor"],
  797. desc = L["Relative Anchor Position."],
  798. disabled = function() return isModuleDisabled() or not db.enable or not db.boss.enable end,
  799. values = regions,
  800. },
  801. offSetX = {
  802. type = "range",
  803. order = 2,
  804. name = L["X Offset"],
  805. desc = L["Controls the X offset. (Left - Right)"],
  806. min = -250, max = 250, step = 5,
  807. disabled = function() return isModuleDisabled() or not db.enable or not db.boss.enable end,
  808. },
  809. offSetY = {
  810. type = "range",
  811. order = 3,
  812. name = L["Y Offset"],
  813. desc = L["Controls the Y offset. (Up - Down)"],
  814. min = -250, max = 250, step = 5,
  815. disabled = function() return isModuleDisabled() or not db.enable or not db.boss.enable end,
  816. },
  817. },
  818. }
  819. },
  820. },
  821. },
  822. }
  823. return options
  824. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement