Thread Tools Display Modes
10-06-14, 04:39 PM   #21
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by Phanx View Post
Code:
	print("Shift changed:", type(state), state)
	if state == 1 then
Do this anyway. You must've gotten the arguments mixed up somehow?
__________________
Grab your sword and fight the Horde!
  Reply With Quote
10-07-14, 04:12 AM   #22
Danielps1
Guest
Posts: n/a
Hmm,

This is what my chat looks like now.



It does the exact same thing when pressing shift/or not
  Reply With Quote
10-07-14, 05:16 AM   #23
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Can you post your whole OnEvent function?
__________________
Grab your sword and fight the Horde!
  Reply With Quote
10-07-14, 06:04 AM   #24
Danielps1
Guest
Posts: n/a
Originally Posted by Lombra View Post
Can you post your whole OnEvent function?
Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("MODIFIER_STATE_CHANGED")
  3. f:SetScript("OnEvent", function(f, event, key, state)
  4.     if key ~= "LSHIFT" and key ~= "RSHIFT" then
  5.         return
  6.     end
  7.     local a, b
  8.     if state == 1 then
  9.         a, b = "CustomFilter", "__CustomFilter"
  10.     else
  11.         a, b = "__CustomFilter", "CustomFilter"
  12.     end
  13.     for i = 1, #oUF.objects do
  14.         local object = oUF.objects[i]
  15.         local buffs = object.Auras or object.Buffs
  16.         if buffs and buffs[a] then
  17.             buffs[b] = buffs[a]
  18.             buffs[a] = nil
  19.             buffs:ForceUpdate()
  20.         end
  21.         local debuffs = object.Debuffs
  22.         if debuffs and debuffs[a] then
  23.             debuffs[b] = debuffs[a]
  24.             debuffs[a] = nil
  25.             debuffs:ForceUpdate()
  26.         end
  27.     end
  28. end)
  29.  
  30. print("Shift changed:", type(state), state)
  31.     if state == 1 then
  32.         print("Shift pressed, removing aura filters")
  33.         a, b = "CustomFilter", "__CustomFilter"
  34.     else
  35.         print("Shift released, restoring aura filters")
  36.         a, b = "__CustomFilter", "CustomFilter"
  37.     end
  Reply With Quote
10-07-14, 07:16 AM   #25
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Ok, you should've placed the bottom snippet inside the event handler, so that's probably working, after all. The problem will be in the oUF bit, but I have no idea what's going on there, nor how oUF works.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
10-07-14, 07:32 AM   #26
Danielps1
Guest
Posts: n/a
Originally Posted by Lombra View Post
Ok, you should've placed the bottom snippet inside the event handler, so that's probably working, after all. The problem will be in the oUF bit, but I have no idea what's going on there, nor how oUF works.
Ugh, I'm stupid. Yeah works fine now, but sadly that doesn't help with finding the solution to the Aura filter problem

  Reply With Quote
10-07-14, 07:42 AM   #27
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Well, then try to find out whats wrong. Just add a print(key, state) to you OnEvent handler. What does it print?
  Reply With Quote
10-07-14, 08:05 AM   #28
Danielps1
Guest
Posts: n/a
Originally Posted by Duugu View Post
Well, then try to find out whats wrong. Just add a print(key, state) to you OnEvent handler. What does it print?
I don't get what i would accomplish that way. the state is fine, it knows when shift is pressed and released. The Problem is the filter doesn't get removed
  Reply With Quote
10-07-14, 08:07 AM   #29
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Originally Posted by Danielps1 View Post
I don't get what i would accomplish that way. the state is fine, it knows when shift is pressed and released. The Problem is the filter doesn't get removed
Ah. Sorry. Then I've mixed up something. Thought "if state == 1 then" still does not trigger.
  Reply With Quote
10-07-14, 07:53 PM   #30
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Post your entire addon.
__________________
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
10-07-14, 11:16 PM   #31
Danielps1
Guest
Posts: n/a
Originally Posted by Phanx View Post
Post your entire addon.
That's a lot of code, I zipped it since there are over 40 files or so in that Addon.

I really appreciate the help. I know that's a lot of work.

oUF_Skaarj: https://www.mediafire.com/?ust166y91ht5k2h


If you actually need to run the Addon and you probably need my other folder too which includes the media for oUF_Skaarj

https://www.mediafire.com/?cscjvjvdbp6jo7b
  Reply With Quote
10-09-14, 03:41 AM   #32
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Well, as written, your player frame only has a Debuffs element, which is not filtered, and your target frame's Buffs and Debuffs elements are not filtered either, so while the code I posted works just fine and does what it should do, there's no visible result because there are no filters to remove and restore. What exactly are you hoping to do?
__________________
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 : 10-09-14 at 03:43 AM.
  Reply With Quote
10-09-14, 04:57 AM   #33
Danielps1
Guest
Posts: n/a
Originally Posted by Phanx View Post
Well, as written, your player frame only has a Debuffs element, which is not filtered, and your target frame's Buffs and Debuffs elements are not filtered either, so while the code I posted works just fine and does what it should do, there's no visible result because there are no filters to remove and restore. What exactly are you hoping to do?
But the Target frame has a filter for only showing personal debuffs. Normally it shows them in color and shows the other Debuff in b/w.

But there is also an option to ONLY show my own debuffs, which is exactly what I am looking for.
  Reply With Quote
10-09-14, 07:32 PM   #34
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Danielps1 View Post
But the Target frame has a filter for only showing personal debuffs. Normally it shows them in color and shows the other Debuff in b/w.
No, it doesn't. If there ever was such code, it's commented out. You can verify in-game that the target frame debuffs are not filtered; put the mouse over the target frame and type:

/dump GetMouseFocus().Debuffs.CustomFilter
"empty result"
__________________
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
10-10-14, 02:12 AM   #35
Danielps1
Guest
Posts: n/a
Originally Posted by Phanx View Post
No, it doesn't. If there ever was such code, it's commented out. You can verify in-game that the target frame debuffs are not filtered; put the mouse over the target frame and type:

/dump GetMouseFocus().Debuffs.CustomFilter
"empty result"
Yeah I get empty result aswell. But some filter is going on, since not all enemy Debuffs are beeing displayed. I tested it in raid and on training dummy's, only my own Debuffs are shown. I don't know where that filter is coming from.
  Reply With Quote
10-10-14, 02:28 AM   #36
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
That's an option in the default UI.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
10-10-14, 02:58 AM   #37
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Filter options for the default UI do not affect oUF.

However, on further investigation, oUF itself applies a filter if you don't supply one, and if you set certain properties on the Debuffs element:

Code:
local customFilter = function(icons, unit, icon, name, rank, texture, count, dtype, duration, timeLeft, caster)
	if((icons.onlyShowPlayer and icon.isPlayer) or (not icons.onlyShowPlayer and name)) then
		return true
	end
end
If you want to use this default filter instead of supplying your own, then I'd suggest that rather than removing the filter, you replace it with a dummy one that lets everything through:

Code:
local showall = function() return true end

local f = CreateFrame("Frame")
f:RegisterEvent("MODIFIER_STATE_CHANGED")
f:SetScript("OnEvent", function(f, event, key, state)
	if key ~= "LSHIFT" and key ~= "RSHIFT" then
		return
	end
	local a, b
	if state == 1 then
		a, b = "CustomFilter", "__CustomFilter"
	else
		a, b = "__CustomFilter", "CustomFilter"
	end
	for i = 1, #oUF.objects do
		local object = oUF.objects[i]
		local buffs = object.Auras or object.Buffs
		if buffs and buffs[a] then
			buffs[b] = buffs[a]
			buffs[a] = showall
			buffs:ForceUpdate()
		end
		local debuffs = object.Debuffs
		if debuffs and debuffs[a] then
			debuffs[b] = debuffs[a]
			debuffs[a] = showall
			debuffs:ForceUpdate()
		end
	end
end)
__________________
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 : 10-10-14 at 03:06 AM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » frame replacing

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