mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 09:56:03 +00:00
unitframes: option to always use 2d portraits
This commit is contained in:
+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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user