Thread Tools Display Modes
02-25-13, 11: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:	405
Size:	10.0 KB
ID:	7582  
  Reply With Quote
02-25-13, 09:56 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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/
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 02-26-13 at 04:47 PM.
  Reply With Quote
02-26-13, 06: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.
  Reply With Quote
02-26-13, 06: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)
  Reply With Quote
02-26-13, 10:45 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
There's a chance SexyCooldown updates its visibility continuously in an OnUpdate or animation script.
  Reply With Quote
02-26-13, 11:37 AM   #6
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
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.
  Reply With Quote
02-26-13, 04:47 PM   #7
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » 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