diff --git a/api/config.lua b/api/config.lua index 6f38f1962..32d099a90 100644 --- a/api/config.lua +++ b/api/config.lua @@ -747,6 +747,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("nameplates", nil, "enemyclassc", "1") pfUI:UpdateConfig("nameplates", nil, "friendclassc", "1") pfUI:UpdateConfig("nameplates", nil, "friendclassnamec", "0") + pfUI:UpdateConfig("nameplates", nil, "nameoffsetx", "0") + pfUI:UpdateConfig("nameplates", nil, "nameoffsety", "0") + pfUI:UpdateConfig("nameplates", nil, "leveloffsetx", "-3") + pfUI:UpdateConfig("nameplates", nil, "leveloffsety", "0") pfUI:UpdateConfig("nameplates", nil, "raidiconsize", "16") pfUI:UpdateConfig("nameplates", nil, "raidiconpos", "CENTER") pfUI:UpdateConfig("nameplates", nil, "raidiconoffx", "0") diff --git a/env/translations_deDE.lua b/env/translations_deDE.lua index 683f2732c..8488f4439 100644 --- a/env/translations_deDE.lua +++ b/env/translations_deDE.lua @@ -511,8 +511,13 @@ pfUI_translation["deDE"] = { ["Name | Health Missing"] = nil, ["Name (Linebreak) -Health Missing"] = nil, ["Nameplate Border Size"] = nil, - ["Nameplates"] = nil, - ["Nameplate Width"] = nil, + ["Nameplates"] = nil, ["Nameplate Width"] = nil, + ["Name Position"] = "Name Position", + ["Name X-Offset"] = "Name X-Versatz", + ["Name Y-Offset"] = "Name Y-Versatz", + ["Level Position"] = "Level Position", + ["Level X-Offset"] = "Level X-Versatz", + ["Level Y-Offset"] = "Level Y-Versatz", ["Name (Short)"] = nil, ["Name (Short) | Health Missing"] = nil, ["Native"] = nil, diff --git a/env/translations_enUS.lua b/env/translations_enUS.lua index b57c92f05..9adf29007 100644 --- a/env/translations_enUS.lua +++ b/env/translations_enUS.lua @@ -513,8 +513,12 @@ pfUI_translation["enUS"] = { ["Nameplate Border Size"] = nil, ["Nameplates"] = nil, ["Nameplate Width"] = nil, - ["Name (Short)"] = nil, - ["Name (Short) | Health Missing"] = nil, + ["Name Position"]=nil, + ["Name X-Offset"] = nil, + ["Name Y-Offset"] = nil, + ["Level Position"]=nil, + ["Level X-Offset"] = nil, + ["Level Y-Offset"] = nil, ["Native"] = nil, ["Network Down"] = nil, ["Network Latency"] = nil, diff --git a/env/translations_esES.lua b/env/translations_esES.lua index 334bd90bd..24e40d6fc 100644 --- a/env/translations_esES.lua +++ b/env/translations_esES.lua @@ -511,8 +511,13 @@ pfUI_translation["esES"] = { ["Name | Health Missing"] = "Nombre | Falta de salud", ["Name (Linebreak) -Health Missing"] = nil, ["Nameplate Border Size"] = "Tamaño del borde de las placas de nombre", - ["Nameplates"] = "Placas identificativas", - ["Nameplate Width"] = "Ancho de las placas identificativas", + ["Nameplates"] = "Placas identificativas", ["Nameplate Width"] = "Ancho de las placas identificativas", + ["Name Position"] = "Posición del nombre", + ["Name X-Offset"] = "Desplazamiento X del nombre", + ["Name Y-Offset"] = "Desplazamiento Y del nombre", + ["Level Position"] = "Posición del nivel", + ["Level X-Offset"] = "Desplazamiento X del nivel", + ["Level Y-Offset"] = "Desplazamiento Y del nivel", ["Name (Short)"] = "Nombre (corto)", ["Name (Short) | Health Missing"] = "Nombre (corto) | Falta de salud", ["Native"] = "Nativo", diff --git a/env/translations_frFR.lua b/env/translations_frFR.lua index f5e417bbd..335ffd64b 100644 --- a/env/translations_frFR.lua +++ b/env/translations_frFR.lua @@ -511,8 +511,13 @@ pfUI_translation["frFR"] = { ["Name | Health Missing"] = "Nom | santé manquante", ["Name (Linebreak) -Health Missing"] = nil, ["Nameplate Border Size"] = "Taille de la bordure des barres de vie flottantes", - ["Nameplates"] = "Barres de vie flottantes", - ["Nameplate Width"] = "Largeur des barres de vie flottantes", + ["Nameplates"] = "Barres de vie flottantes", ["Nameplate Width"] = "Largeur des barres de vie flottantes", + ["Name Position"] = "Position du nom", + ["Name X-Offset"] = "Décalage X du nom", + ["Name Y-Offset"] = "Décalage Y du nom", + ["Level Position"] = "Position du niveau", + ["Level X-Offset"] = "Décalage X du niveau", + ["Level Y-Offset"] = "Décalage Y du niveau", ["Name (Short)"] = "Nom (Court)", ["Name (Short) | Health Missing"] = "Nom (court) | santé manquante", ["Native"] = "Native", diff --git a/env/translations_koKR.lua b/env/translations_koKR.lua index d264126d5..97a72d88b 100644 --- a/env/translations_koKR.lua +++ b/env/translations_koKR.lua @@ -511,8 +511,13 @@ pfUI_translation["koKR"] = { ["Name | Health Missing"] = nil, ["Name (Linebreak) -Health Missing"] = nil, ["Nameplate Border Size"] = nil, - ["Nameplates"] = "상바", - ["Nameplate Width"] = "상바 넓이", + ["Nameplates"] = "상바", ["Nameplate Width"] = "상바 넓이", + ["Name Position"] = "이름 위치", + ["Name X-Offset"] = "이름 X 오프셋", + ["Name Y-Offset"] = "이름 Y 오프셋", + ["Level Position"] = "레벨 위치", + ["Level X-Offset"] = "레벨 X 오프셋", + ["Level Y-Offset"] = "레벨 Y 오프셋", ["Name (Short)"] = nil, ["Name (Short) | Health Missing"] = nil, ["Native"] = nil, diff --git a/env/translations_ruRU.lua b/env/translations_ruRU.lua index 5eca8fd1e..2232618cc 100644 --- a/env/translations_ruRU.lua +++ b/env/translations_ruRU.lua @@ -511,8 +511,13 @@ pfUI_translation["ruRU"] = { ["Name | Health Missing"] = "Имя | Отсутствующее здоровье", ["Name (Linebreak) -Health Missing"] = "Имя (разрыв линии) -Отсутствует здоровье", ["Nameplate Border Size"] = "Размер границы индикатора здоровья", - ["Nameplates"] = "Индикаторы здоровья", - ["Nameplate Width"] = "Ширина индикатора здоровья", + ["Nameplates"] = "Индикаторы здоровья", ["Nameplate Width"] = "Ширина индикатора здоровья", + ["Name Position"] = "Позиция имени", + ["Name X-Offset"] = "Смещение имени по X", + ["Name Y-Offset"] = "Смещение имени по Y", + ["Level Position"] = "Позиция уровня", + ["Level X-Offset"] = "Смещение уровня по X", + ["Level Y-Offset"] = "Смещение уровня по Y", ["Name (Short)"] = "Короткое имя", ["Name (Short) | Health Missing"] = "Короткое имя | Отсутствующее здоровье", ["Native"] = "Родная", diff --git a/env/translations_zhCN.lua b/env/translations_zhCN.lua index 765382cc9..2d34056dd 100644 --- a/env/translations_zhCN.lua +++ b/env/translations_zhCN.lua @@ -511,8 +511,13 @@ pfUI_translation["zhCN"] = { ["Name | Health Missing"] = "名字 | 失去的生命值", ["Name (Linebreak) -Health Missing"] = "名字 (换行符) -失去的生命值", ["Nameplate Border Size"] = "姓名板边框尺寸", - ["Nameplates"] = "姓名板", - ["Nameplate Width"] = "姓名板宽度", + ["Nameplates"] = "姓名板", ["Nameplate Width"] = "姓名板宽度", + ["Name Position"] = "名字位置", + ["Name X-Offset"] = "名字水平偏移", + ["Name Y-Offset"] = "名字垂直偏移", + ["Level Position"] = "等级位置", + ["Level X-Offset"] = "等级水平偏移", + ["Level Y-Offset"] = "等级垂直偏移", ["Name (Short)"] = "名字 (短)", ["Name (Short) | Health Missing"] = "名字 (短) | 失去的生命值", ["Native"] = "本地", diff --git a/env/translations_zhTW.lua b/env/translations_zhTW.lua index b563cc325..46f79ab33 100644 --- a/env/translations_zhTW.lua +++ b/env/translations_zhTW.lua @@ -511,8 +511,13 @@ pfUI_translation["zhTW"] = { ["Name | Health Missing"] = nil, ["Name (Linebreak) -Health Missing"] = nil, ["Nameplate Border Size"] = nil, - ["Nameplates"] = "姓名板", - ["Nameplate Width"] = "姓名板高度", + ["Nameplates"] = "姓名板", ["Nameplate Width"] = "姓名板高度", + ["Name Position"] = "名字位置", + ["Name X-Offset"] = "名字水平偏移", + ["Name Y-Offset"] = "名字垂直偏移", + ["Level Position"] = "等級位置", + ["Level X-Offset"] = "等級水平偏移", + ["Level Y-Offset"] = "等級垂直偏移", ["Name (Short)"] = "名字 (短)", ["Name (Short) | Health Missing"] = nil, ["Native"] = "本地", diff --git a/modules/gui.lua b/modules/gui.lua index 1c7a46ed4..fd8b2625b 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2295,6 +2295,14 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U["nameplates"], T["Replace Totems With Icons"], C.nameplates, "totemicons", "checkbox") CreateConfig(U["nameplates"], T["Show Guild Name"], C.nameplates, "showguildname", "checkbox") + CreateConfig(nil, T["Name Position"], nil, nil, "header") + CreateConfig(U["nameplates"], T["Name X-Offset"], C.nameplates, "nameoffsetx") + CreateConfig(U["nameplates"], T["Name Y-Offset"], C.nameplates, "nameoffsety") + + CreateConfig(nil, T["Level Position"], nil, nil, "header") + CreateConfig(U["nameplates"], T["Level X-Offset"], C.nameplates, "leveloffsetx") + CreateConfig(U["nameplates"], T["Level Y-Offset"], C.nameplates, "leveloffsety") + CreateConfig(nil, T["Raid Icon"], nil, nil, "header") CreateConfig(U["nameplates"], T["Raid Icon Position"], C.nameplates, "raidiconpos", "dropdown", pfUI.gui.dropdowns.positions) CreateConfig(U["nameplates"], T["Raid Icon X-Offset"], C.nameplates, "raidiconoffx") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index 59785b17a..92cf518b0 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -395,7 +395,6 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () nameplate.health.text:SetTextColor(1,1,1,1) nameplate.name = nameplate:CreateFontString(nil, "OVERLAY") - nameplate.name:SetPoint("TOP", nameplate, "TOP", 0, 0) nameplate.glow = nameplate:CreateTexture(nil, "BACKGROUND") nameplate.glow:SetPoint("CENTER", nameplate.health, "CENTER", 0, 0) @@ -406,7 +405,6 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () nameplate.guild:SetPoint("BOTTOM", nameplate.health, "BOTTOM", 0, 0) nameplate.level = nameplate:CreateFontString(nil, "OVERLAY") - nameplate.level:SetPoint("RIGHT", nameplate.health, "LEFT", -3, 0) nameplate.raidicon:SetParent(nameplate.health) nameplate.raidicon:SetDrawLayer("OVERLAY") @@ -515,19 +513,30 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () c.NOTHREAT.r, c.NOTHREAT.g, c.NOTHREAT.b, c.NOTHREAT.a = GetStringColor(C.nameplates.combatnothreat) c.STUN.r, c.STUN.g, c.STUN.b, c.STUN.a = GetStringColor(C.nameplates.combatstun) + -- Get name offset values from config + local nameOffsetX = tonumber(C.nameplates.nameoffsetx) or 0 + local nameOffsetY = tonumber(C.nameplates.nameoffsety) or 0 + local levelOffsetX = tonumber(C.nameplates.leveloffsetx) or 0 + local levelOffsetY = tonumber(C.nameplates.leveloffsety) or 0 + nameplate:SetWidth(plate_width) nameplate:SetHeight(plate_height) nameplate:SetPoint("TOP", parent, "TOP", 0, 0) - nameplate.name:SetFont(font, font_size, font_style) nameplate.health:SetOrientation(orientation) - nameplate.health:SetPoint("TOP", nameplate.name, "BOTTOM", 0, healthoffset) + nameplate.health:SetPoint("TOP", nameplate, "BOTTOM", 0, healthoffset) nameplate.health:SetStatusBarTexture(hptexture) nameplate.health:SetWidth(C.nameplates.width) nameplate.health:SetHeight(C.nameplates.heighthealth) nameplate.health.hlr, nameplate.health.hlg, nameplate.health.hlb, nameplate.health.hla = hlr, hlg, hlb, hla + nameplate.name:SetFont(font, font_size, font_style) + nameplate.name:SetPoint("TOP", nameplate.health, "TOP", nameOffsetX, nameOffsetY) + + nameplate.level:SetFont(font, font_size, font_style) + nameplate.level:ClearAllPoints() + nameplate.level:SetPoint("TOP", nameplate.health, "LEFT", levelOffsetX, levelOffsetY) CreateBackdrop(nameplate.health, default_border) nameplate.health.text:SetFont(font, font_size - 2, "OUTLINE") @@ -541,7 +550,6 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () nameplate.raidicon:ClearAllPoints() nameplate.raidicon:SetPoint(C.nameplates.raidiconpos, nameplate.health, C.nameplates.raidiconpos, C.nameplates.raidiconoffx, C.nameplates.raidiconoffy) - nameplate.level:SetFont(font, font_size, font_style) nameplate.raidicon:SetWidth(C.nameplates.raidiconsize) nameplate.raidicon:SetHeight(C.nameplates.raidiconsize) @@ -679,8 +687,8 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () plate.guild:Hide() plate.totem:Show() elseif HidePlate(unittype, name, (hpmax-hp == hpmin), target) then - plate.level:SetPoint("RIGHT", plate.name, "LEFT", -3, 0) plate.name:SetParent(plate) + plate.level:SetParent(plate) plate.guild:SetPoint("BOTTOM", plate.name, "BOTTOM", -2, -(font_size + 2)) plate.level:Show() @@ -693,8 +701,8 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function () end plate.totem:Hide() else - plate.level:SetPoint("RIGHT", plate.health, "LEFT", -5, 0) plate.name:SetParent(plate.health) + plate.level:SetParent(plate.health) plate.guild:SetPoint("BOTTOM", plate.health, "BOTTOM", 0, -(font_size + 4)) plate.level:Show()