-- Listen to every mouse buttons
btn:RegisterForClicks("AnyUp")
-- React to any click
btn:SetAttribute("type*", "item");
btn:SetAttribute("item*", "0 8");
This creates a button at the very topleft of the game corner to test interactions. This code uses item in BAG 0 ITEM 8 (Where my HearthStone is) it casts Heartstone when I Left Click it, but not right click it. Any ideas?
Also, if the code in your last post is your whole code, you are leaking tons of global variables, and "local string test = (i.." "..r)" is not valid Lua code.
If it's not your whole code, you really should post your whole code, because posting arbitrary snippets (whether as virtually unreadable images, or as text) is next to useless and makes it unnecessarily difficult to help you. If you post the whole code, we can see exactly what's going on, and what's wrong. If you don't, we have to guess, and that just wastes your time and ours.
Okay, I'm not trying to be mean or start anything, but I'm gonna say this...
I'm sorry about the 2 pictures, I didn't know [CODE] worked on the Forums and straight copy/paste wrecked the tab spacing. (BTW You would have to be running higher than 1920p Resolution for that to be small font).
I've been programming for 12 years... I know how to Isolate code. Those 2 pics were almost the complete build of a Mod in ALPHA (Build 1422 now btw). I know about Local/Global etc. I've even Modded for WoW during Lich King. I could care less about memory leaks in an ALPHA Build.
I know you were trying to help and all, but the answers I was getting were not even close to my question. Actually, Seerah helped me the most with his mention of SecureActionButtons (Props btw). I asked for a Tutorial about SecureActionButtonTemplates since Google yielded nothing, yet you all seemed to be more worried about seeing the whole file. I posted that section to demonstrate I was using a slightly altered method of Blizzard's ContainerFrame code. (Blizzard's arrays by items per bag, mine arrays items on all bags).
By the way... The problem was Blizzard's SecureActionButtonTemplates don't have the same Parameters as ItemButtonTemplates. SABTs have only On_Click functions and IBTs have the entire array of requirements for displaying a button. Plus, when the Mod would error out, the Lua Debugger built into the game wouldn't display anything but '?' and variables. So, instead of defining it as a SABT, I'm gonna try to overlay the IBT with SABT and see how that works out.
P.S. Phanx, | local string test = (i.." "..r); | is legitimate code. I don't know what language you script in, but WoW's Lua files are C oriented. I'll break it down for you:
'local' : Local Variable (Variable removed from memory after function runs) 'string' : Type of Variable (Variable able to hold text, to include integers) 'test' : Variable Name (Memory Address) 'i' 'r' : Variables (Commonly Integer Variables. These in particular for arrays) '..' : Operator (Attaches two strings together)
The 'i' and 'r' were arrays in a Do While Loop, (i=0 r=1 in this case since it crashed at the start). The complete definition was | (i.." "..r) | meaning the output would be "0 1" [Zero Space One]. Thanks for trying tho :)
Is there a Tutorial somewhere on how to do this... In the XML I switched it to <inherits="SecureActionButtonTemplate"> and it wrecks nearly everyline in the code.
So, prior to SecureMethod the mod works fine loads up, textures good etc. Post SecureMethod, the following methods error out saying it's trying to index the variables as a nil value. Here's the code for the Buttons in Frame_OnUpdate. Every variable errors in-game and I have no idea why...
I created new Container Windows and Buttons, but now when I use an item directly from the bag, I get the "Has been blocked from an action only available to the Blizzard UI" message. I tried SecureCall(), but nope. Is their a solution to this or am I going to have to scratch this one? Thanks in Advance!
Trying to figure out how to remove the ABANDON ED status from one of my AddOns. I thought Uploading a current release would do it, but its still marked as such. Any Help? Thx in Advance!
Hello,
Looking for an Addon that was out around Lich King that whenever you MouseOver a UI item, the tooltip would display the Frame Name, UIParent, Button Names, Etc. Anyone remember what its called?
Thanks in Advance!!
0
But... I want it just to right-click... :(
0
Okay, doing a quick LUA Test...
This creates a button at the very topleft of the game corner to test interactions. This code uses item in BAG 0 ITEM 8 (Where my HearthStone is) it casts Heartstone when I Left Click it, but not right click it. Any ideas?
0
Hmm... How does that work? Would you have an XML example I can see?
0
Okay, I'm not trying to be mean or start anything, but I'm gonna say this...
I'm sorry about the 2 pictures, I didn't know [CODE] worked on the Forums and straight copy/paste wrecked the tab spacing. (BTW You would have to be running higher than 1920p Resolution for that to be small font).
I've been programming for 12 years... I know how to Isolate code. Those 2 pics were almost the complete build of a Mod in ALPHA (Build 1422 now btw). I know about Local/Global etc. I've even Modded for WoW during Lich King. I could care less about memory leaks in an ALPHA Build.
I know you were trying to help and all, but the answers I was getting were not even close to my question. Actually, Seerah helped me the most with his mention of SecureActionButtons (Props btw). I asked for a Tutorial about SecureActionButtonTemplates since Google yielded nothing, yet you all seemed to be more worried about seeing the whole file. I posted that section to demonstrate I was using a slightly altered method of Blizzard's ContainerFrame code. (Blizzard's arrays by items per bag, mine arrays items on all bags).
By the way... The problem was Blizzard's SecureActionButtonTemplates don't have the same Parameters as ItemButtonTemplates. SABTs have only On_Click functions and IBTs have the entire array of requirements for displaying a button. Plus, when the Mod would error out, the Lua Debugger built into the game wouldn't display anything but '?' and variables. So, instead of defining it as a SABT, I'm gonna try to overlay the IBT with SABT and see how that works out.
P.S.
Phanx, | local string test = (i.." "..r); | is legitimate code. I don't know what language you script in, but WoW's Lua files are C oriented. I'll break it down for you:
'local' : Local Variable (Variable removed from memory after function runs)
'string' : Type of Variable (Variable able to hold text, to include integers)
'test' : Variable Name (Memory Address)
'i' 'r' : Variables (Commonly Integer Variables. These in particular for arrays)
'..' : Operator (Attaches two strings together)
The 'i' and 'r' were arrays in a Do While Loop, (i=0 r=1 in this case since it crashed at the start). The complete definition was | (i.." "..r) | meaning the output would be "0 1" [Zero Space One]. Thanks for trying tho :)
0
Is there a Tutorial somewhere on how to do this... In the XML I switched it to <inherits="SecureActionButtonTemplate"> and it wrecks nearly everyline in the code.
So, prior to SecureMethod the mod works fine loads up, textures good etc. Post SecureMethod, the following methods error out saying it's trying to index the variables as a nil value. Here's the code for the Buttons in Frame_OnUpdate. Every variable errors in-game and I have no idea why...
0
Its the EXACT same as the ConatinerFrame Code.
0
0
Nevermind... Figured it out (Overlooked it)
0
0
Looking for an Addon that was out around Lich King that whenever you MouseOver a UI item, the tooltip would display the Frame Name, UIParent, Button Names, Etc. Anyone remember what its called?
Thanks in Advance!!