mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-22 12:10:48 +00:00
unitframes: adjust custom portrait code
* align indentation to codestyle * remove option to enable custom size * remove obsolete translations
This commit is contained in:
@@ -381,7 +381,6 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("unitframes", unit, "looticon", "1")
|
pfUI:UpdateConfig("unitframes", unit, "looticon", "1")
|
||||||
pfUI:UpdateConfig("unitframes", unit, "raidiconsize", "24")
|
pfUI:UpdateConfig("unitframes", unit, "raidiconsize", "24")
|
||||||
pfUI:UpdateConfig("unitframes", unit, "portrait", "bar")
|
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, "bartexture", "Interface\\AddOns\\pfUI\\img\\bar")
|
||||||
pfUI:UpdateConfig("unitframes", unit, "width", "200")
|
pfUI:UpdateConfig("unitframes", unit, "width", "200")
|
||||||
pfUI:UpdateConfig("unitframes", unit, "height", "46")
|
pfUI:UpdateConfig("unitframes", unit, "height", "46")
|
||||||
|
|||||||
+17
-15
@@ -329,6 +329,9 @@ function pfUI.uf:UpdateFrameSize()
|
|||||||
local width = self.config.width
|
local width = self.config.width
|
||||||
local height = self.config.height
|
local height = self.config.height
|
||||||
local pheight = self.config.pheight
|
local pheight = self.config.pheight
|
||||||
|
local ptwidth = self.config.portraitwidth
|
||||||
|
local ptheight = self.config.portraitheight
|
||||||
|
|
||||||
local real_height = height + spacing + pheight + 2*default_border
|
local real_height = height + spacing + pheight + 2*default_border
|
||||||
if spacing ~= abs(spacing) and abs(spacing) > tonumber(pheight) then
|
if spacing ~= abs(spacing) and abs(spacing) > tonumber(pheight) then
|
||||||
real_height = height
|
real_height = height
|
||||||
@@ -336,17 +339,17 @@ function pfUI.uf:UpdateFrameSize()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local portrait = 0
|
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.portrait == "left" or self.config.portrait == "right" then
|
||||||
if self.config.portraitsize == "0" then
|
if ptwidth == "-1" and ptheight == "-1" then
|
||||||
self.portrait:SetWidth(real_height)
|
-- align portrait size to frame
|
||||||
self.portrait:SetHeight(real_height)
|
self.portrait:SetWidth(real_height)
|
||||||
portrait = real_height + spacing + 2*default_border
|
self.portrait:SetHeight(real_height)
|
||||||
|
portrait = real_height + spacing + 2*default_border
|
||||||
else
|
else
|
||||||
self.portrait:SetWidth(ptwidth)
|
-- use custom portrait size
|
||||||
self.portrait:SetHeight(ptheight)
|
self.portrait:SetWidth(ptwidth)
|
||||||
|
self.portrait:SetHeight(ptheight)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -455,7 +458,6 @@ function pfUI.uf:UpdateConfig()
|
|||||||
f.portrait.model:SetFrameStrata("LOW")
|
f.portrait.model:SetFrameStrata("LOW")
|
||||||
f.portrait.model:SetAllPoints(f.portrait)
|
f.portrait.model:SetAllPoints(f.portrait)
|
||||||
|
|
||||||
local pspacing = self.config.portraitwidth
|
|
||||||
if f.config.portrait == "bar" then
|
if f.config.portrait == "bar" then
|
||||||
f.portrait:SetParent(f.hp.bar)
|
f.portrait:SetParent(f.hp.bar)
|
||||||
f.portrait:SetAllPoints(f.hp.bar)
|
f.portrait:SetAllPoints(f.hp.bar)
|
||||||
@@ -472,10 +474,10 @@ function pfUI.uf:UpdateConfig()
|
|||||||
elseif f.config.portrait == "left" then
|
elseif f.config.portrait == "left" then
|
||||||
f.portrait:SetParent(f)
|
f.portrait:SetParent(f)
|
||||||
f.portrait:ClearAllPoints()
|
f.portrait:ClearAllPoints()
|
||||||
if self.config.portraitsize == "0" then
|
if f.config.portraitwidth == "-1" and f.config.portraitheight == "-1" then
|
||||||
f.portrait:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0)
|
f.portrait:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0)
|
||||||
else
|
else
|
||||||
f.portrait:SetPoint("LEFT", f, "LEFT", -pspacing, 0)
|
f.portrait:SetPoint("LEFT", f, "LEFT", -f.config.portraitwidth, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
f.hp:ClearAllPoints()
|
f.hp:ClearAllPoints()
|
||||||
@@ -494,10 +496,10 @@ function pfUI.uf:UpdateConfig()
|
|||||||
elseif f.config.portrait == "right" then
|
elseif f.config.portrait == "right" then
|
||||||
f.portrait:SetParent(f)
|
f.portrait:SetParent(f)
|
||||||
f.portrait:ClearAllPoints()
|
f.portrait:ClearAllPoints()
|
||||||
if self.config.portraitsize == "0" then
|
if f.config.portraitwidth == "-1" and f.config.portraitheight == "-1" then
|
||||||
f.portrait:SetPoint("TOPRIGHT", f, "TOPRIGHT", 0, 0)
|
f.portrait:SetPoint("TOPRIGHT", f, "TOPRIGHT", 0, 0)
|
||||||
else
|
else
|
||||||
f.portrait:SetPoint("RIGHT", f, "RIGHT", pspacing, 0)
|
f.portrait:SetPoint("RIGHT", f, "RIGHT", f.config.portraitwidth, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
f.hp:ClearAllPoints()
|
f.hp:ClearAllPoints()
|
||||||
|
|||||||
Vendored
-1
@@ -525,7 +525,6 @@ pfUI_translation["deDE"] = {
|
|||||||
["Please enter a name of a character who should receive your whispers:"] = nil,
|
["Please enter a name of a character who should receive your whispers:"] = nil,
|
||||||
["Portrait Alpha"] = nil,
|
["Portrait Alpha"] = nil,
|
||||||
["Portrait Position"] = nil,
|
["Portrait Position"] = nil,
|
||||||
["Enable Custom Portrait Size"] = nil,
|
|
||||||
["Portrait Height"] = nil,
|
["Portrait Height"] = nil,
|
||||||
["Portrait Width"] = nil,
|
["Portrait Width"] = nil,
|
||||||
["Powerbar"] = nil,
|
["Powerbar"] = nil,
|
||||||
|
|||||||
Vendored
-1
@@ -525,7 +525,6 @@ pfUI_translation["enUS"] = {
|
|||||||
["Please enter a name of a character who should receive your whispers:"] = nil,
|
["Please enter a name of a character who should receive your whispers:"] = nil,
|
||||||
["Portrait Alpha"] = nil,
|
["Portrait Alpha"] = nil,
|
||||||
["Portrait Position"] = nil,
|
["Portrait Position"] = nil,
|
||||||
["Enable Custom Portrait Size"] = nil,
|
|
||||||
["Portrait Height"] = nil,
|
["Portrait Height"] = nil,
|
||||||
["Portrait Width"] = nil,
|
["Portrait Width"] = nil,
|
||||||
["Powerbar"] = nil,
|
["Powerbar"] = nil,
|
||||||
|
|||||||
Vendored
-1
@@ -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",
|
["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 Alpha"] = "Transparencia del retrato",
|
||||||
["Portrait Position"] = "Posición del retrato",
|
["Portrait Position"] = "Posición del retrato",
|
||||||
["Enable Custom Portrait Size"] = "Habilitar tamaño de retrato personalizado",
|
|
||||||
["Portrait Height"] = "Altura Retrato",
|
["Portrait Height"] = "Altura Retrato",
|
||||||
["Portrait Width"] = "Ancho Retrato",
|
["Portrait Width"] = "Ancho Retrato",
|
||||||
["Powerbar"] = "Barra de poder",
|
["Powerbar"] = "Barra de poder",
|
||||||
|
|||||||
Vendored
-1
@@ -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 :",
|
["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 Alpha"] = "Transparence du portrait",
|
||||||
["Portrait Position"] = "Position du portrait",
|
["Portrait Position"] = "Position du portrait",
|
||||||
["Enable Custom Portrait Size"] = "Activer la dimension de portrait personnalisée",
|
|
||||||
["Portrait Height"] = "Hauteur du portrait",
|
["Portrait Height"] = "Hauteur du portrait",
|
||||||
["Portrait Width"] = "Largeur du portrait",
|
["Portrait Width"] = "Largeur du portrait",
|
||||||
["Powerbar"] = "Barre des ressources",
|
["Powerbar"] = "Barre des ressources",
|
||||||
|
|||||||
Vendored
-1
@@ -525,7 +525,6 @@ pfUI_translation["koKR"] = {
|
|||||||
["Please enter a name of a character who should receive your whispers:"] = nil,
|
["Please enter a name of a character who should receive your whispers:"] = nil,
|
||||||
["Portrait Alpha"] = "초상화 투명도",
|
["Portrait Alpha"] = "초상화 투명도",
|
||||||
["Portrait Position"] = "초상화 위치",
|
["Portrait Position"] = "초상화 위치",
|
||||||
["Enable Custom Portrait Size"] = "사용자 정의 세로 크기 활성화",
|
|
||||||
["Portrait Height"] = "세로 높이",
|
["Portrait Height"] = "세로 높이",
|
||||||
["Portrait Width"] = "세로 너비",
|
["Portrait Width"] = "세로 너비",
|
||||||
["Powerbar"] = nil,
|
["Powerbar"] = nil,
|
||||||
|
|||||||
Vendored
-1
@@ -525,7 +525,6 @@ pfUI_translation["ruRU"] = {
|
|||||||
["Please enter a name of a character who should receive your whispers:"] = "Пожалуйста, введите имя персонажа, который должен получить ваш шепот:",
|
["Please enter a name of a character who should receive your whispers:"] = "Пожалуйста, введите имя персонажа, который должен получить ваш шепот:",
|
||||||
["Portrait Alpha"] = "Прозрачность портрета",
|
["Portrait Alpha"] = "Прозрачность портрета",
|
||||||
["Portrait Position"] = "Расположение портрета",
|
["Portrait Position"] = "Расположение портрета",
|
||||||
["Enable Custom Portrait Size"] = "Включить нестандартный размер книжной ориентации",
|
|
||||||
["Portrait Height"] = "Рост портрета",
|
["Portrait Height"] = "Рост портрета",
|
||||||
["Portrait Width"] = "Ширина портрета",
|
["Portrait Width"] = "Ширина портрета",
|
||||||
["Powerbar"] = "Панель силы (мана, ярость, энергия, фокус)",
|
["Powerbar"] = "Панель силы (мана, ярость, энергия, фокус)",
|
||||||
|
|||||||
Vendored
-1
@@ -525,7 +525,6 @@ pfUI_translation["zhCN"] = {
|
|||||||
["Please enter a name of a character who should receive your whispers:"] = "请输入一个接收你的私聊的角色的名称:",
|
["Please enter a name of a character who should receive your whispers:"] = "请输入一个接收你的私聊的角色的名称:",
|
||||||
["Portrait Alpha"] = "人偶透明度",
|
["Portrait Alpha"] = "人偶透明度",
|
||||||
["Portrait Position"] = "人偶头像位置",
|
["Portrait Position"] = "人偶头像位置",
|
||||||
["Enable Custom Portrait Size"] = "启用自定义人像尺寸",
|
|
||||||
["Portrait Height"] = "纵向高度",
|
["Portrait Height"] = "纵向高度",
|
||||||
["Portrait Width"] = "纵向宽度",
|
["Portrait Width"] = "纵向宽度",
|
||||||
["Powerbar"] = "能量(蓝)条",
|
["Powerbar"] = "能量(蓝)条",
|
||||||
|
|||||||
Vendored
-1
@@ -525,7 +525,6 @@ pfUI_translation["zhTW"] = {
|
|||||||
["Please enter a name of a character who should receive your whispers:"] = nil,
|
["Please enter a name of a character who should receive your whispers:"] = nil,
|
||||||
["Portrait Alpha"] = "人偶透明度",
|
["Portrait Alpha"] = "人偶透明度",
|
||||||
["Portrait Position"] = "人偶頭像位置",
|
["Portrait Position"] = "人偶頭像位置",
|
||||||
["Enable Custom Portrait Size"] = "启用自定义人像尺寸",
|
|
||||||
["Portrait Height"] = "纵向高度",
|
["Portrait Height"] = "纵向高度",
|
||||||
["Portrait Width"] = "纵向宽度",
|
["Portrait Width"] = "纵向宽度",
|
||||||
["Powerbar"] = "能量(藍)條",
|
["Powerbar"] = "能量(藍)條",
|
||||||
|
|||||||
@@ -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 Aggro Glow"], C.unitframes[c], "glowaggro", "checkbox")
|
||||||
CreateConfig(U[c], T["Enable Combat Glow"], C.unitframes[c], "glowcombat", "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["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 Height"], C.unitframes[c], "portraitheight")
|
||||||
CreateConfig(U[c], T["Portrait Width"], C.unitframes[c], "portraitwidth")
|
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["Status Bar Texture"], C.unitframes[c], "bartexture", "dropdown", pfUI.gui.dropdowns.uf_bartexture)
|
||||||
|
|||||||
Reference in New Issue
Block a user