diff --git a/api/config.lua b/api/config.lua index d480579f..493f85a0 100644 --- a/api/config.lua +++ b/api/config.lua @@ -381,11 +381,14 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("unitframes", unit, "looticon", "1") pfUI:UpdateConfig("unitframes", unit, "raidiconsize", "24") pfUI:UpdateConfig("unitframes", unit, "portrait", "bar") + pfUI:UpdateConfig("unitframes", unit, "portraitsize", "0") pfUI:UpdateConfig("unitframes", unit, "bartexture", "Interface\\AddOns\\pfUI\\img\\bar") pfUI:UpdateConfig("unitframes", unit, "width", "200") pfUI:UpdateConfig("unitframes", unit, "height", "46") pfUI:UpdateConfig("unitframes", unit, "pheight", "10") pfUI:UpdateConfig("unitframes", unit, "pwidth", "-1") + pfUI:UpdateConfig("unitframes", unit, "portraitheight", "-1") + pfUI:UpdateConfig("unitframes", unit, "portraitwidth", "-1") pfUI:UpdateConfig("unitframes", unit, "panchor", "TOP") pfUI:UpdateConfig("unitframes", unit, "pspace", "-3") pfUI:UpdateConfig("unitframes", unit, "cooldown_text", "1") diff --git a/api/unitframes.lua b/api/unitframes.lua index 7d68f854..992af5e7 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -336,10 +336,18 @@ function pfUI.uf:UpdateFrameSize() end local portrait = 0 + local ptwidth = self.config.portraitwidth + local ptheight = self.config.portraitheight + if self.config.portrait == "left" or self.config.portrait == "right" then + if self.config.portraitsize == "0" then self.portrait:SetWidth(real_height) self.portrait:SetHeight(real_height) portrait = real_height + spacing + 2*default_border + else + self.portrait:SetWidth(ptwidth) + self.portrait:SetHeight(ptheight) + end end self:SetWidth(width + portrait) @@ -447,6 +455,7 @@ function pfUI.uf:UpdateConfig() f.portrait.model:SetFrameStrata("LOW") f.portrait.model:SetAllPoints(f.portrait) + local pspacing = self.config.portraitwidth if f.config.portrait == "bar" then f.portrait:SetParent(f.hp.bar) f.portrait:SetAllPoints(f.hp.bar) @@ -463,7 +472,11 @@ function pfUI.uf:UpdateConfig() elseif f.config.portrait == "left" then f.portrait:SetParent(f) f.portrait:ClearAllPoints() + if self.config.portraitsize == "0" then f.portrait:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0) + else + f.portrait:SetPoint("LEFT", f, "LEFT", -pspacing, 0) + end f.hp:ClearAllPoints() f.hp:SetPoint("TOPRIGHT", f, "TOPRIGHT", 0, 0) @@ -481,7 +494,11 @@ function pfUI.uf:UpdateConfig() elseif f.config.portrait == "right" then f.portrait:SetParent(f) f.portrait:ClearAllPoints() + if self.config.portraitsize == "0" then f.portrait:SetPoint("TOPRIGHT", f, "TOPRIGHT", 0, 0) + else + f.portrait:SetPoint("RIGHT", f, "RIGHT", pspacing, 0) + end f.hp:ClearAllPoints() f.hp:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0) diff --git a/env/translations_deDE.lua b/env/translations_deDE.lua index d23d588b..e413bf34 100644 --- a/env/translations_deDE.lua +++ b/env/translations_deDE.lua @@ -525,6 +525,9 @@ pfUI_translation["deDE"] = { ["Please enter a name of a character who should receive your whispers:"] = nil, ["Portrait Alpha"] = nil, ["Portrait Position"] = nil, + ["Enable Custom Portrait Size"] = nil, + ["Portrait Height"] = nil, + ["Portrait Width"] = nil, ["Powerbar"] = nil, ["Power Bar Anchor"] = nil, ["Power Bar Height"] = nil, diff --git a/env/translations_enUS.lua b/env/translations_enUS.lua index 526495ea..6371b2de 100644 --- a/env/translations_enUS.lua +++ b/env/translations_enUS.lua @@ -525,6 +525,9 @@ pfUI_translation["enUS"] = { ["Please enter a name of a character who should receive your whispers:"] = nil, ["Portrait Alpha"] = nil, ["Portrait Position"] = nil, + ["Enable Custom Portrait Size"] = nil, + ["Portrait Height"] = nil, + ["Portrait Width"] = nil, ["Powerbar"] = nil, ["Power Bar Anchor"] = nil, ["Power Bar Height"] = nil, diff --git a/env/translations_esES.lua b/env/translations_esES.lua index 25389137..39d1d91e 100644 --- a/env/translations_esES.lua +++ b/env/translations_esES.lua @@ -525,6 +525,9 @@ pfUI_translation["esES"] = { ["Please enter a name of a character who should receive your whispers:"] = "Mete el nombre del personaje que debe recibir tus susurros", ["Portrait Alpha"] = "Transparencia del retrato", ["Portrait Position"] = "Posición del retrato", + ["Enable Custom Portrait Size"] = "Habilitar tamaño de retrato personalizado", + ["Portrait Height"] = "Altura Retrato", + ["Portrait Width"] = "Ancho Retrato", ["Powerbar"] = "Barra de poder", ["Power Bar Anchor"] = "Ancla de la barra de poder", ["Power Bar Height"] = "Altura de la barra de poder", diff --git a/env/translations_frFR.lua b/env/translations_frFR.lua index 0a5b98cc..0fbfb30f 100644 --- a/env/translations_frFR.lua +++ b/env/translations_frFR.lua @@ -525,6 +525,9 @@ pfUI_translation["frFR"] = { ["Please enter a name of a character who should receive your whispers:"] = "Entrez un nom de joueur qui pourrait recevoir vos chuchotements :", ["Portrait Alpha"] = "Transparence du portrait", ["Portrait Position"] = "Position du portrait", + ["Enable Custom Portrait Size"] = "Activer la dimension de portrait personnalisée", + ["Portrait Height"] = "Hauteur du portrait", + ["Portrait Width"] = "Largeur du portrait", ["Powerbar"] = "Barre des ressources", ["Power Bar Anchor"] = "Ancrage de la Barre des ressources", ["Power Bar Height"] = "Taille de la barre des ressources", diff --git a/env/translations_koKR.lua b/env/translations_koKR.lua index 9838dd27..0c1b7195 100644 --- a/env/translations_koKR.lua +++ b/env/translations_koKR.lua @@ -525,6 +525,9 @@ pfUI_translation["koKR"] = { ["Please enter a name of a character who should receive your whispers:"] = nil, ["Portrait Alpha"] = "초상화 투명도", ["Portrait Position"] = "초상화 위치", + ["Enable Custom Portrait Size"] = "사용자 정의 세로 크기 활성화", + ["Portrait Height"] = "세로 높이", + ["Portrait Width"] = "세로 너비", ["Powerbar"] = nil, ["Power Bar Anchor"] = nil, ["Power Bar Height"] = "마나(기력)바 높이", diff --git a/env/translations_ruRU.lua b/env/translations_ruRU.lua index 2905e15c..81740055 100644 --- a/env/translations_ruRU.lua +++ b/env/translations_ruRU.lua @@ -525,6 +525,9 @@ pfUI_translation["ruRU"] = { ["Please enter a name of a character who should receive your whispers:"] = "Пожалуйста, введите имя персонажа, который должен получить ваш шепот:", ["Portrait Alpha"] = "Прозрачность портрета", ["Portrait Position"] = "Расположение портрета", + ["Enable Custom Portrait Size"] = "Включить нестандартный размер книжной ориентации", + ["Portrait Height"] = "Рост портрета", + ["Portrait Width"] = "Ширина портрета", ["Powerbar"] = "Панель силы (мана, ярость, энергия, фокус)", ["Power Bar Anchor"] = "Привязка панели силы", ["Power Bar Height"] = "Высота панели силы", diff --git a/env/translations_zhCN.lua b/env/translations_zhCN.lua index 2315a2a2..cce3218b 100644 --- a/env/translations_zhCN.lua +++ b/env/translations_zhCN.lua @@ -525,6 +525,9 @@ pfUI_translation["zhCN"] = { ["Please enter a name of a character who should receive your whispers:"] = "请输入一个接收你的私聊的角色的名称:", ["Portrait Alpha"] = "人偶透明度", ["Portrait Position"] = "人偶头像位置", + ["Enable Custom Portrait Size"] = "启用自定义人像尺寸", + ["Portrait Height"] = "纵向高度", + ["Portrait Width"] = "纵向宽度", ["Powerbar"] = "能量(蓝)条", ["Power Bar Anchor"] = "能量条对齐方式(以血条为锚点)", ["Power Bar Height"] = "能量条高度", diff --git a/env/translations_zhTW.lua b/env/translations_zhTW.lua index 8dad8eb2..edd557da 100644 --- a/env/translations_zhTW.lua +++ b/env/translations_zhTW.lua @@ -525,6 +525,9 @@ pfUI_translation["zhTW"] = { ["Please enter a name of a character who should receive your whispers:"] = nil, ["Portrait Alpha"] = "人偶透明度", ["Portrait Position"] = "人偶頭像位置", + ["Enable Custom Portrait Size"] = "启用自定义人像尺寸", + ["Portrait Height"] = "纵向高度", + ["Portrait Width"] = "纵向宽度", ["Powerbar"] = "能量(藍)條", ["Power Bar Anchor"] = "能量條對齊方式(以血條為錨點)", ["Power Bar Height"] = "能量值高度", diff --git a/modules/gui.lua b/modules/gui.lua index e29b200e..c43407f9 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1687,6 +1687,9 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function () CreateConfig(U[c], T["Enable Aggro Glow"], C.unitframes[c], "glowaggro", "checkbox") CreateConfig(U[c], T["Enable Combat Glow"], C.unitframes[c], "glowcombat", "checkbox") CreateConfig(U[c], T["Portrait Position"], C.unitframes[c], "portrait", "dropdown", pfUI.gui.dropdowns.uf_portrait_position) + CreateConfig(U[c], T["Enable Custom Portrait Size"], C.unitframes[c], "portraitsize", "checkbox") + CreateConfig(U[c], T["Portrait Height"], C.unitframes[c], "portraitheight") + CreateConfig(U[c], T["Portrait Width"], C.unitframes[c], "portraitwidth") CreateConfig(U[c], T["Status Bar Texture"], C.unitframes[c], "bartexture", "dropdown", pfUI.gui.dropdowns.uf_bartexture) CreateConfig(U[c], T["UnitFrame Spacing"], C.unitframes[c], "pspace") CreateConfig(U[c], T["Show PvP-Flag"], C.unitframes[c], "showPVP", "checkbox")