mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-29 02:36:02 +00:00
unitframes: option to always use 2d portraits
This commit is contained in:
@@ -76,6 +76,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", nil, "custombgcolor", ".5,.2,.2,1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "animation_speed", "5")
|
||||
pfUI:UpdateConfig("unitframes", nil, "portraitalpha", "0.1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "always2dportrait", "0")
|
||||
pfUI:UpdateConfig("unitframes", nil, "portraittexture", "1")
|
||||
pfUI:UpdateConfig("unitframes", nil, "layout", "default")
|
||||
pfUI:UpdateConfig("unitframes", nil, "rangecheck", "0")
|
||||
|
||||
+35
-30
@@ -717,40 +717,45 @@ function pfUI.uf:RefreshUnit(unit, component)
|
||||
|
||||
-- portrait
|
||||
if unit.portrait and ( component == "all" or component == "portrait" ) then
|
||||
if not UnitIsVisible(unit.label .. unit.id) or not UnitIsConnected(unit.label .. unit.id) then
|
||||
if unit.config.portrait == "bar" then
|
||||
unit.portrait.tex:Hide()
|
||||
unit.portrait.model:Hide()
|
||||
elseif pfUI_config.unitframes.portraittexture == "1" then
|
||||
unit.portrait.tex:Show()
|
||||
unit.portrait.model:Hide()
|
||||
SetPortraitTexture(unit.portrait.tex, unit.label .. unit.id)
|
||||
else
|
||||
unit.portrait.tex:Hide()
|
||||
unit.portrait.model:Show()
|
||||
unit.portrait.model:SetModelScale(4.25)
|
||||
unit.portrait.model:SetPosition(0, 0, -1)
|
||||
unit.portrait.model:SetModel("Interface\\Buttons\\talktomequestionmark.mdx")
|
||||
end
|
||||
if pfUI_config.unitframes.always2dportrait == "1" then
|
||||
unit.portrait.tex:Show()
|
||||
unit.portrait.model:Hide()
|
||||
SetPortraitTexture(unit.portrait.tex, unit.label .. unit.id)
|
||||
else
|
||||
if unit.config.portrait == "bar" then
|
||||
unit.portrait:SetAlpha(pfUI_config.unitframes.portraitalpha)
|
||||
end
|
||||
unit.portrait.tex:Hide()
|
||||
unit.portrait.model:Show()
|
||||
|
||||
if unit.tick then
|
||||
unit.portrait.model.next:SetUnit(unit.label .. unit.id)
|
||||
if unit.portrait.model.lastUnit ~= UnitName(unit.label .. unit.id) or unit.portrait.model:GetModel() ~= unit.portrait.model.next:GetModel() then
|
||||
unit.portrait.model:SetUnit(unit.label .. unit.id)
|
||||
unit.portrait.model.lastUnit = UnitName(unit.label .. unit.id)
|
||||
unit.portrait.model:SetCamera(0)
|
||||
if not UnitIsVisible(unit.label .. unit.id) or not UnitIsConnected(unit.label .. unit.id) then
|
||||
if unit.config.portrait == "bar" then
|
||||
unit.portrait.tex:Hide()
|
||||
unit.portrait.model:Hide()
|
||||
elseif pfUI_config.unitframes.portraittexture == "1" then
|
||||
unit.portrait.tex:Show()
|
||||
unit.portrait.model:Hide()
|
||||
SetPortraitTexture(unit.portrait.tex, unit.label .. unit.id)
|
||||
else
|
||||
unit.portrait.tex:Hide()
|
||||
unit.portrait.model:Show()
|
||||
unit.portrait.model:SetModelScale(4.25)
|
||||
unit.portrait.model:SetPosition(0, 0, -1)
|
||||
unit.portrait.model:SetModel("Interface\\Buttons\\talktomequestionmark.mdx")
|
||||
end
|
||||
else
|
||||
unit.portrait.model:SetUnit(unit.label .. unit.id)
|
||||
unit.portrait.model:SetCamera(0)
|
||||
end
|
||||
if unit.config.portrait == "bar" then
|
||||
unit.portrait:SetAlpha(pfUI_config.unitframes.portraitalpha)
|
||||
end
|
||||
unit.portrait.tex:Hide()
|
||||
unit.portrait.model:Show()
|
||||
|
||||
if unit.tick then
|
||||
unit.portrait.model.next:SetUnit(unit.label .. unit.id)
|
||||
if unit.portrait.model.lastUnit ~= UnitName(unit.label .. unit.id) or unit.portrait.model:GetModel() ~= unit.portrait.model.next:GetModel() then
|
||||
unit.portrait.model:SetUnit(unit.label .. unit.id)
|
||||
unit.portrait.model.lastUnit = UnitName(unit.label .. unit.id)
|
||||
unit.portrait.model:SetCamera(0)
|
||||
end
|
||||
else
|
||||
unit.portrait.model:SetUnit(unit.label .. unit.id)
|
||||
unit.portrait.model:SetCamera(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+2
-1
@@ -765,6 +765,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(this, "Custom Health Bar Background Color", C.unitframes, "custombgcolor", "color")
|
||||
CreateConfig(this, "Healthbar Animation Speed", C.unitframes, "animation_speed")
|
||||
CreateConfig(this, "Portrait Alpha", C.unitframes, "portraitalpha")
|
||||
CreateConfig(this, "Always Use 2D Portraits", C.unitframes, "always2dportrait", "checkbox")
|
||||
CreateConfig(this, "Enable 2D Portraits As Fallback", C.unitframes, "portraittexture", "checkbox")
|
||||
CreateConfig(this, "Unit Frame Layout", C.unitframes, "layout", "dropdown", { "default", "tukui" })
|
||||
CreateConfig(this, "Aggressive 40y-Range Check (Will break stuff)", C.unitframes, "rangecheck", "checkbox")
|
||||
@@ -1411,4 +1412,4 @@ pfUI:RegisterModule("gui", function ()
|
||||
end)
|
||||
|
||||
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user