Shestak UI
Go Back   Shestak UI > Interface Forums > English Community > General Discussion

General Discussion The place for World of Warcraft discussions that don’t fit into any other forum.

Advertising

 
Thread Tools
Old 04.06.2011, 10:03   #1
 Senior Member User Information

anj's Avatar
Question Portrait on health

Is it possible to put the player portrait in the health bar?

I've been using this in Tukui but could not make it work for ShestakUI:

Code [Select]:
local portrait = CreateFrame("PlayerModel", nil, health)
			portrait.PostUpdate = function(self) self:SetAlpha(0) self:SetAlpha(0.25) end 
			portrait:SetAllPoints(health)
			table.insert(self.__elements, T.HidePortrait)
			self.Portrait = portrait
Old 04.06.2011, 10:03   #1.5 - Disable Ads

Advertise on this site

Old 04.06.2011, 10:14   #2
Shestak
 Junior Member User Information

Shestak's Avatar
health ==> self.Health
Say Thank:
anj (04.06.2011)
Old 04.06.2011, 10:43   #3
anj
 Senior Member User Information

anj's Avatar
Quote:
Originally Posted by Shestak View Post
health ==> self.Health
Thank you, that worked. One more thing, how can I fix SetAlpha?

Edit: answering my question, it's portrait:SetAlpha(0.25)
Old 10.09.2011, 18:38   #4
Nalkrien
 Member User Information

Nalkrien's Avatar
How would we do this with the current version of ShestakUi?
Thank You.
Old 10.09.2011, 20:52   #5
Shestak
 Junior Member User Information

Shestak's Avatar
In ShestakUI\Modules\UnitFrames\Layout.lua(~619 line) find:
lua Code [Select]:
if C.unitframe.portrait_enable == true then
    self.Portrait = CreateFrame("PlayerModel", self:GetName().."_Portrait", self)
    self.Portrait:Height(C.unitframe.portrait_height)
    self.Portrait:Width(C.unitframe.portrait_width)
    if unit == "player" then
        self.Portrait:Point(unpack(C.position.unitframes.player_portrait))
    elseif unit == "target" then
        self.Portrait:Point(unpack(C.position.unitframes.target_portrait))
    end

    self.PortraitOverlay = CreateFrame("Frame", self:GetName().."_PortraitOverlay", self.Portrait)
    self.PortraitOverlay:SetFrameLevel(self.PortraitOverlay:GetFrameLevel() - 1)
    self.PortraitOverlay:SetTemplate("Transparent")
    if C.unitframe.portrait_classcolor_border == true then
        if unit == "player" then
            self.PortraitOverlay:SetBackdropBorderColor(T.color.r, T.color.g, T.color.b)
        elseif unit == "target" then
            self.PortraitOverlay:RegisterEvent("PLAYER_TARGET_CHANGED")
            self.PortraitOverlay:SetScript("OnEvent", function(self)
                local _, class = UnitClass("target")
                local color = RAID_CLASS_COLORS[class]
                if color then
                    self:SetBackdropBorderColor(color.r, color.g, color.b)
                else
                    self:SetBackdropBorderColor(unpack(C.media.border_color))
                end
            end)
        end
    end
    self.PortraitOverlay:Point("TOPLEFT", -2 + T.mult, 2)
    self.PortraitOverlay:Point("BOTTOMRIGHT", 2 + T.mult, -2)
end
and change:
lua Code [Select]:
if C.unitframe.portrait_enable == true then
    self.Portrait = CreateFrame("PlayerModel", self:GetName().."_Portrait", self.Health)
    self.Portrait:SetAllPoints(self.Health)
    self.Portrait:SetAlpha(0.25)
end
Says Thank:
anj (11.09.2011), Nalkrien (12.09.2011)
Old 10.09.2011, 22:07   #6
Nalkrien
 Member User Information

Nalkrien's Avatar
It is working really good but is there anyway to zoom the picture out some, it show like part of head for the portrait.

Thank You so much.
Old 12.09.2011, 03:17   #7
Shestak
 Junior Member User Information

Shestak's Avatar
Yes. Because the health area is small. By this he did look.

Добавлено через 28 часов 33 минуты
Or "play" in ShestakUI\Libs\oUF\Elements\Portraits.lua(~22-23 lines) with:
lua Code [Select]:
portrait:SetCamDistanceScale(1)
portrait:SetPortraitZoom(1)
Say Thank:
Nalkrien (12.09.2011)

Tags
portrait

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
About font size of player/target 's health bar loveshestakui Technical Support 9 19.03.2013 07:53
[Embedded] Health Frames Alass Skinning 1 17.02.2012 00:16
[Unconfirmed] Unitframes Health Doesn't Update snigelmannen Bugs Reports 8 29.06.2011 13:27
Health points on raidframes toricelli12 General Discussion 0 22.08.2010 09:51
Target portrait and Dot/hot conflict Cranan Technical Support 3 08.07.2010 13:14


Mobile Style Русский English Deutsch Italian Chinese