Thread Tools Display Modes
09-14-19, 02:54 AM   #1
glupikreten
A Theradrim Guardian
Join Date: Apr 2009
Posts: 60
Default Blizz frames

Hi,

1.
Im trying to do some basic modifications to some default blizz frames... and while some of the frames i have no problem with for some others im getting error that frames are not found.

For example if i would want to change scale of CharacterFrame it would work to do just :SetScale(X).. but that will not work for TalentFrame, MacroFrame, CraftFrame etc... because those frames are apparenty not existant.

Now i am noob at this... i just want to modify frames a bit to fit them into my UI.

2.
Is there easy way to remove default border (red, green, blue... ) from targets buffs/debuffs?

3.
Id like to be able to see in my buffs/debuffs the source of that buff... is that possible in classic? i have this script that worked perfectly before... for the love of god i dont remember in what version of wow tho

Code:
local _, config = ...

if not config.auraSource then return end

local function addAuraSource(self, func, unit, index, filter)
    local srcUnit = select(8, func(unit, index, filter))
    if srcUnit then
        self:AddLine(' ')

        local src = GetUnitName(srcUnit, true)
        if srcUnit == 'pet' or srcUnit == 'vehicle' then
            local color = RAID_CLASS_COLORS[select(2, UnitClass('player'))]
            src = format('%s (|cff%02x%02x%02x%s|r)', src, color.r*255, color.g*255, color.b*255, GetUnitName('player', true))
        else
            local partypet = srcUnit:match('^partypet(%d+)$')
            local raidpet = srcUnit:match('^raidpet(%d+)$')
            if partypet then
                src = format('%s (%s)', src, GetUnitName('party'..partypet, true))
            elseif raidpet then
                src = format('%s (%s)', src, GetUnitName('raid'..raidpet, true))
            end
        end

        if (UnitIsPlayer(srcUnit)) then
            local color = RAID_CLASS_COLORS[select(2, UnitClass(srcUnit))]
            if (color) then
                src = format('|cff%02x%02x%02x%s|r', color.r*255, color.g*255, color.b*255, src)
            end
        end

        self:AddLine(src)
        self:Show()
    end
end


local funcs = {
    SetUnitAura = UnitAura,
    SetUnitBuff = UnitBuff,
    SetUnitDebuff = UnitDebuff,
}

for k, v in pairs(funcs) do
    hooksecurefunc(GameTooltip, k, function(self, unit, index, filter)
        addAuraSource(self, v, unit, index, filter)
    end)
end
  Reply With Quote
09-14-19, 02:23 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Originally Posted by glupikreten View Post
1.
Im trying to do some basic modifications to some default blizz frames... and while some of the frames i have no problem with for some others im getting error that frames are not found.
Some parts of the UI are contained in Load-on-Demand code. These are loaded like any other addon with their names prefixed with "Blizzard_". You can either force-load these using LoadAddOn() or listen for ADDON_LOADED to fire with their name.

For example:
Code:
LoadAddOn("Blizzard_CraftUI");
LoadAddOn("Blizzard_MacroUI");
LoadAddOn("Blizzard_TalentUI");
LoadAddOn("Blizzard_TradeSkillUI");
- or -
Lua Code:
  1. local LoDMap={--    Maps Blizzard addon names to frame list
  2.     Blizzard_CraftUI={"CraftFrame"};
  3.     Blizzard_MacroUI={"MacroFrame"};
  4.     Blizzard_TalentUI={"TalentFrame"};
  5.     Blizzard_TradeSkillUI={"TradeSkillFrame"};
  6. };
  7.  
  8. local EventFrame=CreateFrame("Frame");--    Event Listener Frame
  9. EventFrame:RegisterEvent("ADDON_LOADED");
  10. EventFrame:SetScript("OnEvent",function(self,event,...)--   OnEvent Script
  11.     if event=="ADDON_LOADED" then
  12.         local framelist=LoDMap[(...)]-- Loads list from map using addon name
  13.         if framelist then-- Check if one of the LoD addons in our list
  14.             for _,name in ipairs(framelist) do
  15.                 local frame=_G[name];-- Get our frame from the global table
  16.  
  17. --              Do stuff
  18.                 frame:SetScale(1);--    Set scale of the frame
  19.             end
  20.         end
  21.     end
  22. end);



Originally Posted by glupikreten View Post
2.
Is there easy way to remove default border (red, green, blue... ) from targets buffs/debuffs?
Probably the easiest way would be to overwrite entries in the DebuffTypeColor table.
Code:
DebuffTypeColor.Magic=DebuffTypeColor.none;
DebuffTypeColor.Curse=DebuffTypeColor.none;
DebuffTypeColor.Disease=DebuffTypeColor.none;
DebuffTypeColor.Poison=DebuffTypeColor.none;


Originally Posted by glupikreten View Post
3.
Id like to be able to see in my buffs/debuffs the source of that buff... is that possible in classic? i have this script that worked perfectly before... for the love of god i dont remember in what version of wow tho
Aura sources weren't available in Vanilla and as such, were removed from Classic.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 09-14-19 at 02:26 PM.
  Reply With Quote
09-15-19, 05:39 AM   #3
glupikreten
A Theradrim Guardian
Join Date: Apr 2009
Posts: 60
Thank you do much for explaining and helping...

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Default Blizz frames

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off