Quantcast Simulating Boss fight (frames) in ouF - WoWInterface
 
Thread Tools Display Modes
09-25-14, 12:52 AM   #1
Danielps1
Guest
Posts: n/a
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?
  Reply With Quote
09-25-14, 01:14 AM   #2
Wimpface
A Molten Giant
 
Wimpface's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 648
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"
__________________
All I see is strobe lights blinding me in my hindsight.
  Reply With Quote
09-25-14, 01:57 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Simulating Boss fight (frames) in ouF

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