WoWInterface SVN StellarUF

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 122 to Rev 123
    Reverse comparison

Rev 122 → Rev 123

trunk/Stuf/Stuf.toc
2,7 → 2,7
## Title: Stuf Unit Frames
## Author: TotalPackage
## Notes: Main unitframes replacement. Assembly optional.
## Version: 5.4.002
## Version: 5.4.002a
 
## SavedVariables: StufDB
## SavedVariablesPerCharacter: StufCharDB
trunk/Stuf/core.lua
1305,81 → 1305,6
UpdateHealth(this.unit, this.uf)
end
 
local StufDD = CreateFrame("Frame", "StufDD", UIParent, "UIDropDownMenuTemplate")
StufDD:SetHeight(10)
StufDD:SetWidth(10)
StufDD:SetPoint("TOP")
tinsert(UnitPopupFrames, "StufDD")
local function StufDDInit()
local unitid = StufDD.unit or "player"
local menu, name, id
 
if UnitIsUnit(unitid, "player") then
menu = "SELF"
elseif UnitIsUnit(unitid, "pet") then
menu = "PET"
elseif UnitIsPlayer(unitid) then
id = UnitInRaid(unitid)
if id then
menu = "RAID_PLAYER"
elseif UnitInParty(unitid) then
menu = "PARTY"
else
menu = "PLAYER"
end
else
menu = "RAID_TARGET_ICON"
name = RAID_TARGET_ICON
end
if menu then
UnitPopup_ShowMenu(StufDD, menu, unitid, name, id)
end
end
local function ShowUnitMenu(self, unit, button, actionType)
unit = unit or SecureButton_GetUnit(self)
StufDD.unit = unit
 
if unit then
HideDropDownMenu(1)
StufDD.id = strmatch(unit, "(%d+)")
StufDD.displayMode = "MENU"
 
StufDD.initialize = StufDDInit
 
if not anchor then
if self.statsFrame then
anchor = self.statsFrame:GetName()
elseif self:GetParent().statsFrame then
anchor = self:GetParent().statsFrame:GetName()
end
end
 
local parent = self
if self:GetParent() and self:GetParent().nameFrame == self then
parent = self:GetParent()
end
 
ToggleDropDownMenu(1, nil, StufDD, parent, 0, 0)
end
end
local function postClick(self)
if UIDROPDOWNMENU_OPEN_MENU == self.dropdownMenu and DropDownList1:IsShown() then
local parent = self
if self:GetParent() and self:GetParent().nameFrame == self then
parent = self:GetParent()
end
local point, relativePoint
if (parent:GetTop() * parent:GetEffectiveScale() > UIParent:GetHeight() * UIParent:GetEffectiveScale() / 2) then
point, relativePoint = "TOPLEFT", "BOTTOMLEFT"
else
point, relativePoint = "BOTTOMLEFT", "TOPLEFT"
end
 
DropDownList1:ClearAllPoints()
DropDownList1:SetPoint(point, parent, relativePoint, 0, 0)
end
end
 
---------------------------------------------
function Stuf:CreateUnitFrame(unit, fromshow) -- creates entire unit frame and updates its settings
---------------------------------------------
1430,18 → 1355,6
 
uf:SetAttribute("unit", unit)
 
if dropdown[unit] and _G[ dropdown[unit] ] then
uf.dropdownMenu = _G[ dropdown[unit] ].menu
uf.menu = nil
uf:SetAttribute("_menu", ShowUnitMenu)
uf:SetScript("PostClick", postClick)
else
uf.dropdownMenu = nil
uf.menu = ShowUnitMenu
uf:SetAttribute("_menu", nil)
uf:SetScript("PostClick", postClick)
end
 
if notpla then
uf:SetScript("OnShow", MainOnShow)
if unit == "target" then