mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-04 04:30:01 +00:00
nameplates: add new option to define offtanks
This commit is contained in:
@@ -768,13 +768,16 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("nameplates", nil, "barcombatstate", "0")
|
||||
|
||||
pfUI:UpdateConfig("nameplates", nil, "ccombatthreat", "1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "ccombatofftank", "1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "ccombatnothreat", "1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "ccombatstun", "1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "ccombatcasting", "0")
|
||||
pfUI:UpdateConfig("nameplates", nil, "combatthreat", ".7,.2,.2,1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "combatofftank", ".7,.4,.2,1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "combatnothreat", ".7,.7,.2,1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "combatstun", ".2,.7,.7,1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "combatcasting", ".7,.2,.7,1")
|
||||
pfUI:UpdateConfig("nameplates", nil, "combatofftanks", "")
|
||||
|
||||
pfUI:UpdateConfig("nameplates", nil, "outfriendly", "0")
|
||||
pfUI:UpdateConfig("nameplates", nil, "outfriendlynpc", "1")
|
||||
|
||||
@@ -2349,13 +2349,16 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
|
||||
CreateConfig(U["nameplates"], T["Overwrite Border Color With Combat State"], C.nameplates, "outcombatstate", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Overwrite Health Color With Combat State"], C.nameplates, "barcombatstate", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Overwrite If Unit Is Attacking You"], C.nameplates, "ccombatthreat", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Overwrite If Unit Is Attacking Off-Tank"], C.nameplates, "ccombatofftank", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Overwrite If Unit Is Attacking Others"], C.nameplates, "ccombatnothreat", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Overwrite If Unit Is Attacking No One"], C.nameplates, "ccombatstun", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Overwrite If Unit Is Casting"], C.nameplates, "ccombatcasting", "checkbox")
|
||||
CreateConfig(U["nameplates"], T["Unit Is Attacking You Color"], C.nameplates, "combatthreat", "color")
|
||||
CreateConfig(U["nameplates"], T["Unit Is Attacking Off-Tank Color"], C.nameplates, "combatofftank", "color")
|
||||
CreateConfig(U["nameplates"], T["Unit Is Attacking Others Color"], C.nameplates, "combatnothreat", "color")
|
||||
CreateConfig(U["nameplates"], T["Unit Is Attacking No One Color"], C.nameplates, "combatstun", "color")
|
||||
CreateConfig(U["nameplates"], T["Unit Is Casting Color"], C.nameplates, "combatcasting", "color")
|
||||
CreateConfig(U["nameplates"], T["Off-Tank Names"], C.nameplates, "combatofftanks", "list")
|
||||
end)
|
||||
|
||||
CreateGUIEntry(T["Thirdparty"], T["Integrations"], function()
|
||||
|
||||
@@ -10,8 +10,11 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
||||
["FRIENDLY_PLAYER"] = { .2, .6, 1, .8 }
|
||||
}
|
||||
|
||||
local offtanks = {}
|
||||
|
||||
local combatstate = {
|
||||
-- gets overwritten by user config
|
||||
["OFFTANK"] = { r = .7, g = .4, b = .2, a = 1 },
|
||||
["NOTHREAT"] = { r = .7, g = .7, b = .2, a = 1 },
|
||||
["THREAT"] = { r = .7, g = .2, b = .2, a = 1 },
|
||||
["CASTING"] = { r = .7, g = .2, b = .7, a = 1 },
|
||||
@@ -46,6 +49,8 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
||||
color = combatstate.CASTING
|
||||
elseif C.nameplates.ccombatthreat == "1" and UnitIsUnit(target, "player") then
|
||||
color = combatstate.THREAT
|
||||
elseif C.nameplates.ccombatofftank == "1" and offtanks[strlower(UnitName(target))] then
|
||||
color = combatstate.OFFTANK
|
||||
elseif C.nameplates.ccombatnothreat == "1" and UnitExists(target) then
|
||||
color = combatstate.NOTHREAT
|
||||
elseif C.nameplates.ccombatstun == "1" and not UnitExists(target) and not UnitIsPlayer(guid) then
|
||||
@@ -513,8 +518,14 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
||||
c.CASTING.r, c.CASTING.g, c.CASTING.b, c.CASTING.a = GetStringColor(C.nameplates.combatcasting)
|
||||
c.THREAT.r, c.THREAT.g, c.THREAT.b, c.THREAT.a = GetStringColor(C.nameplates.combatthreat)
|
||||
c.NOTHREAT.r, c.NOTHREAT.g, c.NOTHREAT.b, c.NOTHREAT.a = GetStringColor(C.nameplates.combatnothreat)
|
||||
c.OFFTANK.r, c.OFFTANK.g, c.OFFTANK.b, c.OFFTANK.a = GetStringColor(C.nameplates.combatofftank)
|
||||
c.STUN.r, c.STUN.g, c.STUN.b, c.STUN.a = GetStringColor(C.nameplates.combatstun)
|
||||
|
||||
offtanks = {}
|
||||
for k, v in pairs({strsplit("#", C.nameplates.combatofftanks)}) do
|
||||
offtanks[string.lower(v)] = true
|
||||
end
|
||||
|
||||
nameplate:SetWidth(plate_width)
|
||||
nameplate:SetHeight(plate_height)
|
||||
nameplate:SetPoint("TOP", parent, "TOP", 0, 0)
|
||||
|
||||
Reference in New Issue
Block a user