unitframes: adjust custom portrait code

* align indentation to codestyle
* remove option to enable custom size
* remove obsolete translations
This commit is contained in:
shagu
2021-10-24 14:19:42 +02:00
parent c957fbe638
commit ef3af4bc56
11 changed files with 17 additions and 25 deletions
-1
View File
@@ -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")
+17 -15
View File
@@ -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()
-1
View File
@@ -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,
-1
View File
@@ -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,
-1
View File
@@ -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",
-1
View File
@@ -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",
-1
View File
@@ -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,
-1
View File
@@ -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"] = "Панель силы (мана, ярость, энергия, фокус)",
-1
View File
@@ -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"] = "能量(蓝)条",
-1
View File
@@ -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"] = "能量(藍)條",
-1
View File
@@ -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)