WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Default Blizz frames (https://www.wowinterface.com/forums/showthread.php?t=57485)

glupikreten 09-14-19 02:54 AM

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


SDPhantom 09-14-19 02:23 PM

Quote:

Originally Posted by glupikreten (Post 333727)
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);



Quote:

Originally Posted by glupikreten (Post 333727)
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;



Quote:

Originally Posted by glupikreten (Post 333727)
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.

glupikreten 09-15-19 05:39 AM

Thank you do much for explaining and helping...

:banana::banana:


All times are GMT -6. The time now is 11:56 AM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI