diff --git a/api/config.lua b/api/config.lua index 493f85a0..22df6a77 100644 --- a/api/config.lua +++ b/api/config.lua @@ -381,7 +381,6 @@ 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") diff --git a/api/unitframes.lua b/api/unitframes.lua index 992af5e7..4ef6fa82 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -329,6 +329,9 @@ function pfUI.uf:UpdateFrameSize() local width = self.config.width local height = self.config.height local pheight = self.config.pheight + local ptwidth = self.config.portraitwidth + local ptheight = self.config.portraitheight + local real_height = height + spacing + pheight + 2*default_border if spacing ~= abs(spacing) and abs(spacing) > tonumber(pheight) then real_height = height @@ -336,17 +339,17 @@ 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 + if ptwidth == "-1" and ptheight == "-1" then + -- align portrait size to frame + 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) + -- use custom portrait size + self.portrait:SetWidth(ptwidth) + self.portrait:SetHeight(ptheight) end end @@ -455,7 +458,6 @@ 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) @@ -472,10 +474,10 @@ 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) + if f.config.portraitwidth == "-1" and f.config.portraitheight == "-1" then + f.portrait:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0) else - f.portrait:SetPoint("LEFT", f, "LEFT", -pspacing, 0) + f.portrait:SetPoint("LEFT", f, "LEFT", -f.config.portraitwidth, 0) end f.hp:ClearAllPoints() @@ -494,10 +496,10 @@ 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) + if f.config.portraitwidth == "-1" and f.config.portraitheight == "-1" then + f.portrait:SetPoint("TOPRIGHT", f, "TOPRIGHT", 0, 0) else - f.portrait:SetPoint("RIGHT", f, "RIGHT", pspacing, 0) + f.portrait:SetPoint("RIGHT", f, "RIGHT", f.config.portraitwidth, 0) end f.hp:ClearAllPoints() diff --git a/env/translations_deDE.lua b/env/translations_deDE.lua index e413bf34..f79debd9 100644 --- a/env/translations_deDE.lua +++ b/env/translations_deDE.lua @@ -525,7 +525,6 @@ 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, diff --git a/env/translations_enUS.lua b/env/translations_enUS.lua index 6371b2de..148950ab 100644 --- a/env/translations_enUS.lua +++ b/env/translations_enUS.lua @@ -525,7 +525,6 @@ 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, diff --git a/env/translations_esES.lua b/env/translations_esES.lua index 39d1d91e..9a48f2d3 100644 --- a/env/translations_esES.lua +++ b/env/translations_esES.lua @@ -525,7 +525,6 @@ 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", diff --git a/env/translations_frFR.lua b/env/translations_frFR.lua index 0fbfb30f..91fe6461 100644 --- a/env/translations_frFR.lua +++ b/env/translations_frFR.lua @@ -525,7 +525,6 @@ 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", diff --git a/env/translations_koKR.lua b/env/translations_koKR.lua index 0c1b7195..04048341 100644 --- a/env/translations_koKR.lua +++ b/env/translations_koKR.lua @@ -525,7 +525,6 @@ 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, diff --git a/env/translations_ruRU.lua b/env/translations_ruRU.lua index 81740055..f312ec4f 100644 --- a/env/translations_ruRU.lua +++ b/env/translations_ruRU.lua @@ -525,7 +525,6 @@ 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"] = "Панель силы (мана, ярость, энергия, фокус)", diff --git a/env/translations_zhCN.lua b/env/translations_zhCN.lua index cce3218b..f79edd0c 100644 --- a/env/translations_zhCN.lua +++ b/env/translations_zhCN.lua @@ -525,7 +525,6 @@ 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"] = "能量(蓝)条", diff --git a/env/translations_zhTW.lua b/env/translations_zhTW.lua index edd557da..ef1dfe4a 100644 --- a/env/translations_zhTW.lua +++ b/env/translations_zhTW.lua @@ -525,7 +525,6 @@ 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"] = "能量(藍)條", diff --git a/modules/gui.lua b/modules/gui.lua index c43407f9..5e628df9 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1687,7 +1687,6 @@ 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)