Reply
 
Thread Tools Display Modes
Old 02-25-13, 10:41 AM   #1
Aryae21
A Deviate Faerie Dragon
Join Date: Jan 2013
Posts: 18
Hiding SexyCooldown when out of combat...

Title pretty much sums it up...
I know this option is not included in the add-on and dont see any hint of future implementation, there is a option where I can set its Inactive opacity, but it doesn't quite work as well as a OOC option. I basically want a set of action bars (Only 1 bar) from Bartender4 to show, in combat the bars are set to disappear. On these bars ill use for various things not typically used in combat situations. Once they disappear in the same exact position will be the cool down bar in its place. While the Inactivity opacity works, somewhat... if I have any sort of cool down it will show on the bar regardless of being out of combat and both my action bar and the cooldown bar will overlap each other, making it a bit of an eyesore. I attached a picture to show what I mean. Is there anyway I can make Sexycooldown disappear OOC? Either by some small code snip in the add on (Which I'd need instructions for my LUA skills are beginner at best.) or maybe even another similar add on without the bulk ForteXorcist/Raven provide but still the same customization for the bar (Which Coolline doesn't provide for me.) Or maybe even some method via another add on to disable showing the frame while the action bar is present, achieving the same effect in a round about way. Only add ons I think that could do this would be KGPanels or Bartender itself, both of which I have.
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_022513_092521.jpg
Views:	181
Size:	10.0 KB
ID:	7582  
Aryae21 is offline   Reply With Quote
Old 02-25-13, 08:56 PM   #2
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,977
This should work for SexyCooldown, and any other frames you want to hide or show only in or out of combat. Type "/fstack" and move the cursor over the SexyCooldown bar to check its name; if it's not "SexyCooldown", change the code below accordingly. Type "/fstack" again to hide the frame stack tooltip.

Code:
-- Add frames to hide in this table:
local FramesToHide = {
	["SexyCooldown"] = "PLAYER_REGEN_ENABLED", -- Show out of combat
	["SomeOtherFrame"] = "PLAYER_REGEN_DISABLED", -- Show in combat
}

local CombatHider = CreateFrame("Frame")
CombatHider:RegisterEvent("PLAYER_REGEN_DISABLED")
CombatHider:RegisterEvent("PLAYER_REGEN_ENABLED")
CombatHider:SetScript("OnEvent", function(self, event)
	for frameName, showEvent in pairs(FramesToHide) do
		local frame = _G[frameName]
		if frame then
			frame:SetShown(event == showEvent)
		end
	end
end)
If you need help turning the above code into an addon, paste it onto this page, enter a title, and click the green button: http://addon.ziuo.net/
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, 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!

Last edited by Phanx : 02-26-13 at 03:47 PM.
Phanx is offline   Reply With Quote
Old 02-26-13, 05:27 AM   #3
Aryae21
A Deviate Faerie Dragon
Join Date: Jan 2013
Posts: 18
Following the above instructions, I can't seem to get this to work. I made it into an add on, and it loads perfectly well using the site provided. Changed the name "SexyCooldown" to "SexyCooldown2Bar 1" As /fstack showed, and even tried tinkering with the code (Such as trying multiple frame names ect.) To try and get it to work, but nothing. The frame still shows out of combat. Not sure if I am doing something wrong or if the code itself is missing something specific to this add on.
Aryae21 is offline   Reply With Quote
Old 02-26-13, 05:48 AM   #4
Aryae21
A Deviate Faerie Dragon
Join Date: Jan 2013
Posts: 18
To be more specific I posted the code I edited according to your instructions, I simply copy and pasted the entire LUA file after using that website provided. On an additional note just to be as thorough as possible, I did check to see if the add-on created was actually loaded in wow multiple times. It is on, however the memory usage is 0. Not sure if that means anything, Id think it would use something no matter how small but that's just what i thought, doesn't necessarily mean anything.

Code:
-- This file is loaded from "SexyCooldownHideOOC.toc"

-- Add frames to hide in this table:
local FramesToHide = {
	["SexyCooldown2Bar 1"] = "PLAYER_REGEN_ENABLED", -- Show out of combat
	["SomeOtherFrame"] = "PLAYER_REGEN_DISABLED", -- Show in combat
}

local CombatHider = CreateFrame("Frame")
CombatHider:RegisterEvent("PLAYER_REGEN_DISABLED")
CombatHider:RegisterEvent("PLAYER_REGEN_ENABLED")
CombatHider:SetScript("OnEvent", function(self, event)
	for frameName, showEvent in pairs(FramesToHide)
		local frame = _G[frameName]
		if frame then
			frame:SetShown(event == showEvent)
		end
	end
end)
Aryae21 is offline   Reply With Quote
Old 02-26-13, 09:45 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,190
There's a chance SexyCooldown updates its visibility continuously in an OnUpdate or animation script.
Dridzt is offline   Reply With Quote
Old 02-26-13, 10:37 AM   #6
ravagernl
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,140
If you are still having trouble you can also try and install Aura Frames. If you make a container in it of the type "timeline", you can use it to display the buffs, cooldowns or anything you want; with your own visibility, filter and sorting options.
ravagernl is offline   Reply With Quote
Old 02-26-13, 03:47 PM   #7
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 3,977
Well, there is a typo in that code that I just noticed. I edited my previous post to fix it.

However, it looks like SexyCooldown re-shows its frames every time a cooldown starts, so that code won't work anyway. Rather than hiding and showing individual frames, it will probably work better to re-parent them all to the CombatHider frame and just hide and show that, so the hidden/shown state of the inidividual frames doesn't matter:

Code:
-- Add frames to hide in this table:
local FramesToHide = {
	"SexyCooldown2Bar1",
}

local CombatHider = CreateFrame("Frame", "MyCombatHider", UIParent, "SecureHandlerStateTemplate")
CombatHider:SetAllPoints(true)
RegisterStateDriver(CombatHider, "visibility", "[nocombat] hide; show")

CombatHider:RegisterEvent("PLAYER_ENTERING_WORLD")
CombatHider:SetScript("OnEvent", function(self, event)
	for i = #FramesToHide, 1, -1 do
		local frame = _G[FramesToHide[i]]
		if frame then
			frame:SetParent(self)
			tremove(FramesToHide, i)
		end
	end
end)
I chose the PLAYER_ENTERING_WORLD event because it happens *after* PLAYER_LOGIN so hopefully SexyCooldown has finished setting up its frames by then.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, 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!
Phanx is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Hiding SexyCooldown when out of combat...

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