WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Simulating Boss fight (frames) in ouF (https://www.wowinterface.com/forums/showthread.php?t=49975)

Danielps1 09-25-14 12:52 AM

Simulating Boss fight (frames) in ouF
 
I'm looking for a way to simulate or show Boss frames so I can configure them in Lua.

I found this dicussion, but a very old discussion, and I guess these things don't work anymore.
http://www.wowinterface.com/forums/s...d.php?p=168652

Also AV doesn't have Boss Frames if I remember correctly so that won't help either.


So is there a way to get ouF to simulate a Bossfight at best with 2 or more Bosses and Castbars?

Wimpface 09-25-14 01:14 AM

Not sure where I found this but I've been using it for the last few months in various layouts and it seems to work fairly well.

Replace YourLayout with your layout name (who would've thought...)
Lua Code:
  1. local testui = TestUI or function() end
  2. TestUI = function( msg )
  3.     if( msg == "uf" or msg == "unitframes" ) then
  4.         oUF_YourLayoutTarget:Show(); oUF_YourLayoutTarget.Hide = function() end; oUF_YourLayoutTarget.unit = "player"
  5.     elseif( msg == "boss" or msg == "b" ) then
  6.         oUF_YourLayoutBoss1:Show(); oUF_YourLayoutBoss1.Hide = function() end; oUF_YourLayoutBoss1.unit = "player"
  7.         oUF_YourLayoutBoss2:Show(); oUF_YourLayoutBoss2.Hide = function() end; oUF_YourLayoutBoss2.unit = "player"
  8.         oUF_YourLayoutBoss3:Show(); oUF_YourLayoutBoss3.Hide = function() end; oUF_YourLayoutBoss3.unit = "player"
  9.     elseif( msg == "buffs" ) then
  10.         UnitAura = function()
  11.             return 139, "Rank 1", "Interface\\Icons\\Spell_Holy_Penance", 1, "Magic", 0, 0, "player"
  12.         end
  13.  
  14.         if( oUF ) then
  15.             for i, v in pairs( oUF.units ) do
  16.                 if( v.UNIT_AURA ) then
  17.                     v:UNIT_AURA( "UNIT_AURA", v.unit )
  18.                 end
  19.             end
  20.         end
  21.     end
  22. end
  23. SlashCmdList.TestUI = TestUI
  24. SLASH_TestUI1 = "/testui"

Phanx 09-25-14 01:57 AM

I use this for testing my layout. Rather than overwriting global functions and tainting your frames, it just tells the frames to display the player unit, so you can test with real health values, auras, etc. Just type the command again to put them back to their original state.

Code:

local frames = {
        "oUFPhanxBoss1",
        "oUFPhanxBoss2",
        "oUFPhanxBoss3",
        "oUFPhanxBoss4",
        "oUFPhanxBoss5",
}

local function toggle(f)
        if f.__realunit then
                f:SetAttribute("unit", f.__realunit)
                f.unit = f.__realunit
                f.__realunit = nil
                f:Hide()
        else
                f.__realunit = f:GetAttribute("unit") or f.unit
                f:SetAttribute("unit", "player")
                f.unit = "player"
                f:Show()
        end
end

SLASH_OUFPHANXTEST1 = "/otest"

SlashCmdList.OUFPHANXTEST = function()
        for i = 1, #frames do
                toggle(_G[frames[i]])
        end
end



All times are GMT -6. The time now is 11:19 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI