Advertisement
Guest User

Nameplates.lua

a guest
Apr 27th, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.22 KB | None | 0 0
  1. local MODULE_NAME = "Nameplates"
  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. ------------------------------------------------------------------------
  11. -- Module Database
  12. ------------------------------------------------------------------------
  13.  
  14. local BASIC_BACKGROUND = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]]
  15. local BASIC_BORDERPANEL = [[Interface\AddOns\BasicUI\Media\UI-DialogBox-Border.blp]]
  16.  
  17. local db
  18. local defaults = {
  19. profile = {
  20. enable = true,
  21. enableTankMode = true, -- Color the nameplate threat border green, if you have no aggro
  22. colorNameWithThreat = true, -- The name has the same color as the threat of the unit (better visibility)
  23.  
  24. showFullHP = true,
  25. showLevel = true,
  26. showTargetBorder = true,
  27. showEliteBorder = true,
  28. showTotemIcon = true,
  29. abbrevLongNames = true,
  30. }
  31. }
  32.  
  33. ------------------------------------------------------------------------
  34. -- Module Functions
  35. ------------------------------------------------------------------------
  36.  
  37. function MODULE:OnInitialize()
  38. self.db = ADDON_NAME.db:RegisterNamespace(MODULE_NAME, defaults)
  39. db = self.db.profile
  40.  
  41. local _, class = UnitClass("player")
  42. classColor = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
  43.  
  44. self:SetEnabledState(ADDON_NAME:GetModuleEnabled(MODULE_NAME))
  45. end
  46.  
  47.  
  48. function MODULE:OnEnable()
  49. if db.enable ~= true then return end
  50.  
  51. local len = string.len
  52. local find = string.find
  53. local gsub = string.gsub
  54.  
  55. local select = select
  56. local tonumber = tonumber
  57.  
  58. local UnitName = UnitName
  59. local UnitCastingInfo = UnitCastingInfo
  60. local UnitChannelInfo = UnitChannelInfo
  61.  
  62. local borderColor = {0.47, 0.47, 0.47}
  63. local noThreatColor = {0, 1, 0}
  64.  
  65. local glowTexture = [[Interface\AddOns\BasicUI\Media\NameplateNewGlow_LessGlow]]
  66. local overlayTexture = [[Interface\AddOns\BasicUI\Media\NameplateOverlay]]
  67. local whiteOverlay = [[Interface\AddOns\BasicUI\Media\NameplateIconOverlay]]
  68.  
  69. local f = CreateFrame('Frame', nil, UIParent)
  70.  
  71. f.elapsed = 0
  72. f.elapsedLong = 0
  73.  
  74. -- Totem data and functions
  75.  
  76. local function TotemName(SpellID)
  77. local name = GetSpellInfo(SpellID)
  78. return name
  79. end
  80.  
  81. local function TotemIcon(SpellID)
  82. local _, _, icon = GetSpellInfo(SpellID)
  83. return icon
  84. end
  85.  
  86. local totemData = {
  87. -- Air
  88. [TotemName(8177)] = {TotemIcon(8177)}, -- Grounding Totem
  89. [TotemName(108269)] = {TotemIcon(108269)}, -- Capacitor Totem
  90. [TotemName(120668)] = {TotemIcon(120668)}, -- Stormlash Totem
  91. [TotemName(98009)] = {TotemIcon(98008)}, -- Spirit Link Totem
  92.  
  93. -- Earth
  94. [TotemName(2062)] = {TotemIcon(2062)}, -- Earth Elemental Totem
  95. [TotemName(2484)] = {TotemIcon(2484)}, -- Earthbind Totem
  96. [TotemName(8143)] = {TotemIcon(8143)}, -- Tremor Totem
  97.  
  98. -- Fire
  99. [TotemName(2894)] = {TotemIcon(2894)}, -- Fire Elemental Totem
  100. [TotemName(8190)] = {TotemIcon(8190)}, -- Magma Totem
  101. [TotemName(3599)] = {TotemIcon(3599)}, -- Searing Totem
  102.  
  103. -- Water
  104. [TotemName(16190)] = {TotemIcon(16190)}, -- Mana Tide Totem
  105. [TotemName(5394)] = {TotemIcon(5394)}, -- Healing Stream Totem
  106. }
  107.  
  108. -- Some general functions
  109.  
  110. local function FormatValue(number)
  111. if (number >= 1e6) then
  112. return tonumber(format('%.1f', number/1e6))..'m'
  113. elseif (number >= 1e3) then
  114. return tonumber(format('%.1f', number/1e3))..'k'
  115. else
  116. return number
  117. end
  118. end
  119.  
  120. local function RGBHex(r, g, b)
  121. if (type(r) == 'table') then
  122. if (r.r) then
  123. r, g, b = r.r, r.g, r.b
  124. else
  125. r, g, b = unpack(r)
  126. end
  127. end
  128.  
  129. return ('|cff%02x%02x%02x'):format(r * 255, g * 255, b * 255)
  130. end
  131.  
  132. -- The plate functions
  133.  
  134. local function GetUnitReaction(r, g, b)
  135. if (g + b == 0) then
  136. return true
  137. end
  138.  
  139. return false
  140. end
  141.  
  142. local function GetUnitCombatStatus(r, g, b)
  143. if (r >= 0.98) then
  144. return true
  145. end
  146.  
  147. return false
  148. end
  149.  
  150. local function IsTarget(self)
  151. local targetExists = UnitExists('target')
  152. if (not targetExists) then
  153. return false
  154. end
  155.  
  156. local targetName = UnitName('target')
  157. if (targetName == self.Name:GetText() and self:GetAlpha() >= 0.99) then
  158. return true
  159. else
  160. return false
  161. end
  162. end
  163.  
  164. local function CanHaveThreat(r, g, b)
  165. if (r < .01 and b < .01 and g > .99) then
  166. return false
  167. elseif (r < .01 and b > .99 and g < .01) then
  168. return false
  169. elseif (r > .99 and b < .01 and g > .99) then
  170. return false
  171. elseif (r > .99 and b < .01 and g < .01) then
  172. return true
  173. else
  174. return true
  175. end
  176. end
  177.  
  178. local function UpdateTotemIcon(self)
  179. if (totemData[self.Name:GetText()]) then
  180. if (not self.Icon) then
  181. self.Icon = CreateFrame('Frame', nil, self)
  182. self.Icon:EnableMouse(false)
  183. self.Icon:SetSize(24, 24)
  184. self.Icon:SetPoint('BOTTOM', self.NewName, 'TOP', 0, 1)
  185. end
  186.  
  187. local icon = totemData[self.Name:GetText()]
  188. self.Icon:SetBackdrop({
  189. bgFile = icon[1],
  190. edgeFile = 'Interface\\Buttons\\WHITE8x8',
  191. tile = true, tileSize = 16, edgeSize = 18,
  192. insets = { top = -0, left = -0, bottom = -0, right = -0 },
  193. })
  194.  
  195. local r, g, b = self.Health:GetStatusBarColor()
  196. self.Icon:SetBackdropBorderColor(r, g, b, 1)
  197. self.Icon:Show()
  198. else
  199. if (self.Icon) then
  200. self.Icon:SetBackdrop(nil)
  201. self.Icon:Hide()
  202. self.Icon = nil
  203. end
  204. end
  205. end
  206.  
  207. local function UpdateThreatColor(self)
  208. local r, g, b
  209. local playerInfight = InCombatLockdown()
  210. local unitInfight = GetUnitCombatStatus(self.Name:GetTextColor())
  211. local lowThreat = unitInfight and playerInfight
  212. local isEnemy = GetUnitReaction(self.Health:GetStatusBarColor())
  213.  
  214. if (lowThreat and not self.Glow:IsVisible() and isEnemy and db.enableTankMode) then
  215. r, g, b = unpack(noThreatColor)
  216. self.NewGlow:SetVertexColor(r, g, b)
  217.  
  218. if (not self.NewGlow:IsVisible()) then
  219. self.NewGlow:Show()
  220. end
  221.  
  222. if (db.colorNameWithThreat) then
  223. self.NewName:SetTextColor(r * 0.7, g * 0.7, b * 0.7)
  224. end
  225. elseif (self.Glow:IsVisible()) then
  226. r, g, b = self.Glow:GetVertexColor()
  227. self.NewGlow:SetVertexColor(r, g, b)
  228.  
  229. if (not self.NewGlow:IsVisible()) then
  230. self.NewGlow:Show()
  231. end
  232.  
  233. if (db.colorNameWithThreat) then
  234. self.NewName:SetTextColor(r, g, b)
  235. end
  236. else
  237. if (self.NewGlow:IsVisible()) then
  238. self.NewGlow:Hide()
  239.  
  240. if (db.colorNameWithThreat) then
  241. self.NewName:SetTextColor(1, 1, 1)
  242. end
  243. end
  244. end
  245. end
  246.  
  247. local function UpdateHealthText(self)
  248. local min, max = self.Health:GetMinMaxValues()
  249. local currentValue = self.Health:GetValue()
  250. local perc = (currentValue/max)*100
  251.  
  252. if (perc >= 100 and currentValue > 5 and db.showFullHP) then
  253. self.Health.Value:SetFormattedText('%s', FormatValue(currentValue))
  254. elseif (perc < 100 and currentValue > 5) then
  255. self.Health.Value:SetFormattedText('%s - %.0f%%', FormatValue(currentValue), perc-0.5)
  256. else
  257. self.Health.Value:SetText('')
  258. end
  259. end
  260.  
  261. local function UpdateHealthColor(self)
  262. local r, g, b = self.Health:GetStatusBarColor()
  263. if (r + g == 0) then
  264. self.Health:SetStatusBarColor(0, 0.35, 1)
  265. return
  266. end
  267. end
  268.  
  269. local function UpdateCastbarValue(self, curValue)
  270. local _, maxValue = self:GetMinMaxValues()
  271. local cast = UnitCastingInfo('target')
  272. local channel = UnitChannelInfo('target')
  273.  
  274. if (self.Shield:IsShown()) then
  275. self.Overlay:SetVertexColor(1, 0, 1, 1)
  276. self.Overlay:Show()
  277. else
  278. local r, g, b = unpack(borderColor)
  279. self.Overlay:SetVertexColor(r, g, b, 1 )
  280. end
  281.  
  282. if (channel) then
  283. self.CastTime:SetFormattedText('%.1fs', curValue)
  284. else
  285. self.CastTime:SetFormattedText('%.1fs', maxValue - curValue)
  286. end
  287.  
  288. self.Name:SetText(cast or channel)
  289. end
  290.  
  291. local function UpdateNameL(self)
  292. local newName = self.Name:GetText()
  293. if (db.abbrevLongNames) then
  294. newName = (len(newName) > 20) and gsub(newName, '%s?(.[\128-\191]*)%S+%s', '%1. ') or newName
  295. end
  296.  
  297. self.NewName:SetTextColor(1, 1, 1)
  298. if (db.showLevel) then
  299. local levelText = self.Level:GetText() or ''
  300. local levelColor = RGBHex(self.Level:GetTextColor())
  301. local eliteTexture = self.EliteIcon:IsVisible()
  302.  
  303. if (self.BossIcon:IsVisible()) then
  304. self.NewName:SetText('|cffff0000??|r '..newName)
  305. elseif (eliteTexture) then
  306. self.NewName:SetText('|cffffff00+|r'..levelColor..levelText..'|r '..newName)
  307. else
  308. self.NewName:SetText(levelColor..levelText..'|r '..newName)
  309. end
  310. else
  311. self.NewName:SetText(newName)
  312. end
  313. end
  314.  
  315. local function UpdateEliteTexture(self)
  316. local r, g, b = unpack(borderColor)
  317. if (self.BossIcon:IsVisible() or self.EliteIcon:IsVisible()) then
  318. self.Overlay:SetGradientAlpha('HORIZONTAL', r, g, b, 1, 1, 1, 0, 1)
  319. else
  320. self.Overlay:SetVertexColor(r, g, b, 1)
  321. end
  322. end
  323.  
  324. local function UpdatePlate(self)
  325. if (self.Level) then
  326. UpdateNameL(self)
  327. end
  328.  
  329. if (db.showEliteBorder) then
  330. UpdateEliteTexture(self)
  331. else
  332. local r, g, b = unpack(borderColor)
  333. self.Overlay:SetVertexColor(r, g, b, 1)
  334. end
  335.  
  336. if (db.showTotemIcon) then
  337. UpdateTotemIcon(self)
  338. end
  339.  
  340. UpdateHealthText(self)
  341. UpdateHealthColor(self)
  342. UpdateThreatColor(self)
  343.  
  344. self.Highlight:ClearAllPoints()
  345. self.Highlight:SetAllPoints(self.Health)
  346.  
  347. if (self.Castbar:IsVisible()) then
  348. self.Castbar:Hide()
  349. end
  350.  
  351. local r, g, b = self.Health:GetStatusBarColor()
  352. self.Castbar.IconOverlay:SetVertexColor(r, g, b)
  353. end
  354.  
  355. local function SkinPlate(self, nameFrame)
  356. self.Health, self.Castbar = self:GetChildren()
  357. _, self.Castbar.Overlay, self.Castbar.Shield, self.Castbar.Icon = self.Castbar:GetRegions()
  358. self.Glow, self.Overlay, self.Highlight, self.Level, self.BossIcon, self.RaidIcon, self.EliteIcon = self:GetRegions()
  359. self.Name = nameFrame:GetRegions()
  360.  
  361. -- Hide some nameplate objects
  362.  
  363. self.Glow:SetTexCoord(0, 0, 0, 0)
  364. self.BossIcon:SetTexCoord(0, 0, 0, 0)
  365. self.EliteIcon:SetTexCoord(0, 0, 0, 0)
  366. self.Castbar.Shield:SetTexCoord(0, 0, 0, 0)
  367.  
  368. self.Name:SetWidth(0.001)
  369. self.Level:SetWidth(0.0001)
  370.  
  371. -- Modify the overlay
  372.  
  373. self.Overlay:SetTexCoord(0, 1, 0, 1)
  374. self.Overlay:ClearAllPoints()
  375. self.Overlay:SetPoint('TOPRIGHT', self.Health, 35.66666667, 5.66666667)
  376. self.Overlay:SetPoint('BOTTOMLEFT', self.Health, -36.66666667, -5.66666667)
  377. --self.Overlay:SetPoint('TOPRIGHT', self.Health, 29.66666667, 4.66666667)
  378. --self.Overlay:SetPoint('BOTTOMLEFT', self.Health, -31.66666667, -4.66666667)
  379. self.Overlay:SetDrawLayer('BORDER')
  380. self.Overlay:SetTexture(overlayTexture)
  381.  
  382. -- Healtbar and background
  383.  
  384. self.Health:SetBackdrop({
  385. bgFile = 'Interface\\Buttons\\WHITE8x8',
  386. insets = { left = -1, right = -1, top = -1, bottom = -1 }
  387. })
  388. self.Health:SetBackdropColor(0, 0, 0, 0.55)
  389.  
  390. self.Health:SetScript('OnValueChanged', function()
  391. UpdateHealthText(self)
  392. UpdateHealthColor(self)
  393. end)
  394.  
  395. -- Create health value font string
  396.  
  397. if (not self.Health.Value) then
  398. self.Health.Value = self.Health:CreateFontString(nil, 'OVERLAY')
  399. self.Health.Value:SetPoint('CENTER', self.Health, 0, 0)
  400. self.Health.Value:SetFont(ADDON_NAME.db.profile.media.fontNormal, 12)
  401. self.Health.Value:SetShadowOffset(1, -1)
  402. end
  403.  
  404. if (not self.NewName) then
  405. self.NewName = self:CreateFontString(nil, 'ARTWORK')
  406. self.NewName:SetFont(ADDON_NAME.db.profile.media.fontNormal, 15, 'THINOUTLINE')
  407. self.NewName:SetShadowOffset(0, 0)
  408. -- self.NewName:SetPoint('CENTER', self.Health, 'CENTER', 0, 9)
  409. self.NewName:SetPoint('BOTTOM', self.Health, 'TOP', 0, 2)
  410. self.NewName:SetSize(110, 13)
  411. end
  412.  
  413. if (not self.NewGlow) then
  414. self.NewGlow = self.Health:CreateTexture(nil, 'BACKGROUND')
  415. self.NewGlow:SetTexture(glowTexture)
  416. self.NewGlow:SetAllPoints(self.Overlay)
  417. self.NewGlow:Hide()
  418. end
  419.  
  420. -- Castbar
  421.  
  422. self.Castbar:SetBackdrop({
  423. bgFile = 'Interface\\Buttons\\WHITE8x8',
  424. insets = { left = -1, right = -1, top = -1, bottom = -1 }
  425. })
  426. self.Castbar:SetBackdropColor(0.2, 0.2, 0.2, 0.5)
  427.  
  428. self.Castbar:ClearAllPoints()
  429. self.Castbar:SetPoint('TOPRIGHT', self.Health, 'BOTTOMRIGHT', 0, -9)
  430. self.Castbar:SetPoint('BOTTOMLEFT', self.Health, 'BOTTOMLEFT', 0, -20)
  431.  
  432. self.Castbar:HookScript('OnValueChanged', UpdateCastbarValue)
  433.  
  434. self.Castbar.Overlay:SetTexCoord(0, 1, 0, 1)
  435. self.Castbar.Overlay:SetDrawLayer('BORDER')
  436. self.Castbar.Overlay:SetTexture(overlayTexture)
  437. self.Castbar.Overlay:ClearAllPoints()
  438. self.Castbar.Overlay:SetPoint('TOPRIGHT', self.Castbar, 35.66666667, 5.66666667)
  439. self.Castbar.Overlay:SetPoint('BOTTOMLEFT', self.Castbar, -36.66666667, -5.66666667)
  440.  
  441. -- Castbar casttime font string
  442.  
  443. if (not self.Castbar.CastTime) then
  444. self.Castbar.CastTime = self.Castbar:CreateFontString(nil, 'OVERLAY')
  445. self.Castbar.CastTime:SetPoint('RIGHT', self.Castbar, 1.6666667, 0)
  446. self.Castbar.CastTime:SetFont(ADDON_NAME.db.profile.media.fontNormal, 16) -- , 'THINOUTLINE')
  447. self.Castbar.CastTime:SetTextColor(1, 1, 1)
  448. self.Castbar.CastTime:SetShadowOffset(1, -1)
  449. end
  450.  
  451. -- Castbar castname font string
  452.  
  453. if (not self.Castbar.Name) then
  454. self.Castbar.Name = self.Castbar:CreateFontString(nil, 'OVERLAY')
  455. self.Castbar.Name:SetPoint('LEFT', self.Castbar, 1.5, 0)
  456. self.Castbar.Name:SetPoint('RIGHT', self.Castbar.CastTime, 'LEFT', -6, 0)
  457. self.Castbar.Name:SetFont(ADDON_NAME.db.profile.media.fontNormal, 10)
  458. self.Castbar.Name:SetTextColor(1, 1, 1)
  459. self.Castbar.Name:SetShadowOffset(1, -1)
  460. self.Castbar.Name:SetJustifyH('LEFT')
  461. end
  462.  
  463. -- Castbar spellicon and overlay
  464.  
  465. self.Castbar.Icon:SetParent(self.Castbar)
  466. self.Castbar.Icon:ClearAllPoints()
  467. self.Castbar.Icon:SetPoint('BOTTOMLEFT', self.Castbar, 'BOTTOMRIGHT', 7, 3)
  468. self.Castbar.Icon:SetSize(24, 24)
  469. self.Castbar.Icon:SetTexCoord(0.08, 0.92, 0.08, 0.92)
  470. self.Castbar.Icon:SetDrawLayer('BACKGROUND')
  471.  
  472. if (not self.Castbar.IconOverlay) then
  473. self.Castbar.IconOverlay = self.Castbar:CreateTexture(nil, 'OVERLAY')
  474. self.Castbar.IconOverlay:SetPoint('TOPLEFT', self.Castbar.Icon, -1, 1)
  475. self.Castbar.IconOverlay:SetPoint('BOTTOMRIGHT', self.Castbar.Icon, 1, -1)
  476. self.Castbar.IconOverlay:SetTexture(whiteOverlay)
  477. end
  478.  
  479. -- Mouseover highlight
  480.  
  481. self.Highlight:SetTexture(1, 1, 1, 0.2)
  482.  
  483. -- Raidicons
  484.  
  485. self.RaidIcon:ClearAllPoints()
  486. self.RaidIcon:SetDrawLayer('OVERLAY')
  487. self.RaidIcon:SetPoint('CENTER', self.Health, 'TOP', 0, 12)
  488. self.RaidIcon:SetSize(16, 16)
  489.  
  490. -- Nameplates like cookies
  491.  
  492. UpdatePlate(self)
  493.  
  494. self:SetScript('OnUpdate', nil)
  495. self:SetScript('OnShow', UpdatePlate)
  496.  
  497. self:SetScript('OnHide', function(self)
  498. self.Highlight:Hide()
  499. end)
  500.  
  501. self:SetScript('OnUpdate', function(_, elapsed)
  502. f.elapsed = f.elapsed + elapsed
  503. if (f.elapsed >= 0.1) then
  504. if ((CanHaveThreat(self.Health:GetStatusBarColor()) and InCombatLockdown()) or self.NewGlow:IsShown()) then
  505. UpdateThreatColor(self)
  506. end
  507.  
  508. if (db.showTargetBorder) then
  509. if (IsTarget(self)) then
  510. if (not self.TargetHighlight) then
  511. self.TargetHighlight = self:CreateTexture(nil, 'ARTWORK')
  512. self.TargetHighlight:SetAllPoints(self.Overlay)
  513. self.TargetHighlight:SetTexture(overlayTexture)
  514. self.TargetHighlight:Hide()
  515. end
  516.  
  517. if (not self.TargetHighlight:IsVisible()) then
  518. self.TargetHighlight:Show()
  519. end
  520. else
  521. if (self.TargetHighlight and self.TargetHighlight:IsVisible()) then
  522. self.TargetHighlight:Hide()
  523. end
  524. end
  525. end
  526.  
  527. f.elapsed = 0
  528. end
  529.  
  530. f.elapsedLong = f.elapsedLong + elapsed
  531. if (f.elapsedLong >= 0.49) then
  532. UpdateHealthColor(self)
  533.  
  534. f.elapsedLong = 0
  535. end
  536.  
  537. end)
  538. end
  539.  
  540. -- Scan the worldframe for nameplates
  541.  
  542. local numFrames = 0
  543. local lastUpdate = 0
  544. local index = 1
  545. f:SetScript('OnUpdate', function(self, elapsed)
  546. lastUpdate = lastUpdate + elapsed
  547.  
  548. if (lastUpdate > 0.1) then
  549. local newNumFrames = WorldFrame:GetNumChildren()
  550.  
  551. if (newNumFrames ~= numFrames) then
  552. numFrames = newNumFrames
  553.  
  554. for i = index, numFrames do
  555. local frame = select(i, WorldFrame:GetChildren())
  556. local frameName = frame:GetName()
  557.  
  558. if (frameName and frameName:find('NamePlate') and not frame.NewName) then
  559. SkinPlate(frame:GetChildren())
  560. index = i
  561. end
  562. end
  563. end
  564.  
  565. lastUpdate = 0
  566. end
  567. end)
  568. end
  569.  
  570. ------------------------------------------------------------------------
  571. -- Module Options
  572. ------------------------------------------------------------------------
  573.  
  574. local options
  575. function MODULE:GetOptions()
  576. if options then
  577. return options
  578. end
  579.  
  580. local function isModuleDisabled()
  581. return not ADDON_NAME:GetModuleEnabled(MODULE_NAME)
  582. end
  583.  
  584. options = {
  585. type = "group",
  586. name = L[MODULE_NAME],
  587. get = function(info) return db[ info[#info] ] end,
  588. set = function(info, value) db[ info[#info] ] = value; end,
  589. args = {
  590. ---------------------------
  591. --Option Type Seperators
  592. sep1 = {
  593. type = "description",
  594. order = 2,
  595. name = " ",
  596. },
  597. sep2 = {
  598. type = "description",
  599. order = 3,
  600. name = " ",
  601. },
  602. sep3 = {
  603. type = "description",
  604. order = 4,
  605. name = " ",
  606. },
  607. sep4 = {
  608. type = "description",
  609. order = 5,
  610. name = " ",
  611. },
  612. ---------------------------
  613. reloadUI = {
  614. type = "execute",
  615. name = "Reload UI",
  616. desc = " ",
  617. order = 0,
  618. func = function()
  619. ReloadUI()
  620. end,
  621. },
  622. Text = {
  623. type = "description",
  624. order = 0,
  625. name = "When changes are made a reload of the UI is needed.",
  626. width = "full",
  627. },
  628. Text1 = {
  629. type = "description",
  630. order = 1,
  631. name = " ",
  632. width = "full",
  633. },
  634. enable = {
  635. type = "toggle",
  636. order = 1,
  637. name = L["Enable Nameplates Module"],
  638. width = "full",
  639. },
  640. enableTankMode = {
  641. type = "toggle",
  642. order = 2,
  643. name = L["Enable Tank Mode"],
  644. disabled = function() return isModuleDisabled() or not db.enable end,
  645. },
  646. colorNameWithThreat = {
  647. type = "toggle",
  648. order = 2,
  649. name = L["Color Name With Threat"],
  650. disabled = function() return isModuleDisabled() or not db.enable end,
  651. },
  652. showFullHP = {
  653. type = "toggle",
  654. order = 2,
  655. name = L["Show Full HP"],
  656. disabled = function() return isModuleDisabled() or not db.enable end,
  657. },
  658. showLevel = {
  659. type = "toggle",
  660. order = 2,
  661. name = L["Show Level"],
  662. disabled = function() return isModuleDisabled() or not db.enable end,
  663. },
  664. showTargetBorder = {
  665. type = "toggle",
  666. order = 2,
  667. name = L["Show Target Border"],
  668. disabled = function() return isModuleDisabled() or not db.enable end,
  669. },
  670. showEliteBorder = {
  671. type = "toggle",
  672. order = 2,
  673. name = L["Show Elite Border"],
  674. disabled = function() return isModuleDisabled() or not db.enable end,
  675. },
  676. showTotemIcon = {
  677. type = "toggle",
  678. order = 2,
  679. name = L["Show Totem Icon"],
  680. disabled = function() return isModuleDisabled() or not db.enable end,
  681. },
  682. abbrevLongNames = {
  683. type = "toggle",
  684. order = 2,
  685. name = L["Abbrev Long Names"],
  686. disabled = function() return isModuleDisabled() or not db.enable end,
  687. },
  688. },
  689. }
  690. return options
  691. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement