Thread Tools Display Modes
02-04-11, 01:38 PM   #1
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Trying to hide stuff, but i have no clue how this works!

Hello there, im trying to hide some bank stuff, but i have no clue how this works really,

with for i 1, 5 do etc etc. would be nice with an hand

thanks.

full LUA: http://pastebin.com/gu90vJsC

Last edited by Aftermathhqt : 02-04-11 at 01:55 PM.
  Reply With Quote
02-04-11, 01:50 PM   #2
Nobgul
A Molten Giant
 
Nobgul's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2009
Posts: 693
Please do not attach lua files, instead paste the code into pasty or even in a code box here.
__________________
[SIGPIC][/SIGPIC]
  Reply With Quote
02-04-11, 01:54 PM   #3
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Nobgul View Post
Please do not attach lua files, instead paste the code into pasty or even in a code box here.
Alright i will do asap.
  Reply With Quote
02-04-11, 01:59 PM   #4
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
I see you used some of my code still.

What part is it that you don't understand?

Edit: Skipping through the code, I notice this:

Code:
	for q = 1, 5 do
		select(q, _G["ContainerFrame11"]:GetRegions()):SetAlpha(0)
		select(q, _G["ContainerFrame12"]:GetRegions()):SetAlpha(0)
	end
	
	for r = 1, 5 do 
		select(r, _G["ContainerFrame7"]:GetRegions()):SetAlpha(0)
		select(r, _G["ContainerFrame8"]:GetRegions()):SetAlpha(0)
    end
	
	for w = 1, 5 do
		select(w, _G["ContainerFrame9"]:GetRegions()):SetAlpha(0)
		select(w, _G["ContainerFrame10"]:GetRegions()):SetAlpha(0)
	end
That's not needed. You should put them all in the same conditional.

Last edited by Haleth : 02-04-11 at 02:01 PM.
  Reply With Quote
02-04-11, 02:02 PM   #5
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Haleth View Post
I see you used some of my code still.

What part is it that you don't understand?
Jupp, i do, credits are there.

how this work for example

Code:
for q = 1, 5 do
	select(q, _G["ContainerFrame11"]:GetRegions()):SetAlpha(0)
	select(q, _G["ContainerFrame12"]:GetRegions()):SetAlpha(0)
end
so i make it like this?

Code:
	for q = 1, 5 do
		select(q, _G["ContainerFrame11"]:GetRegions()):SetAlpha(0)
		select(q, _G["ContainerFrame12"]:GetRegions()):SetAlpha(0)

		select(r, _G["ContainerFrame7"]:GetRegions()):SetAlpha(0)
		select(r, _G["ContainerFrame8"]:GetRegions()):SetAlpha(0)

		select(w, _G["ContainerFrame9"]:GetRegions()):SetAlpha(0)
		select(w, _G["ContainerFrame10"]:GetRegions()):SetAlpha(0)

		select(u, _G["ContainerFrame7PortraitButton"]:GetRegions()):SetAlpha(0)
	    select(u, _G["ContainerFrame8PortraitButton"]:GetRegions()):SetAlpha(0)

		select(o, _G["ContainerFrame9PortraitButton"]:GetRegions()):SetAlpha(0)
		select(o, _G["ContainerFrame10PortraitButton"]:GetRegions()):SetAlpha(0)

		select(o, _G["ContainerFrame6"]:GetRegions()):SetAlpha(0)
		select(o, _G["ContainerFrame6PortraitButton"]:GetRegions()):SetAlpha(0)	
		select(p, _G["ContainerFrame11PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame12PortraitButton"]:GetRegions()):SetAlpha(0)
	end

Last edited by Aftermathhqt : 02-04-11 at 02:06 PM.
  Reply With Quote
02-04-11, 02:08 PM   #6
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Should rather be like

Code:
for q = 1, 5 do
	select(q, _G["ContainerFrame11"]:GetRegions()):SetAlpha(0)
	select(q, _G["ContainerFrame12"]:GetRegions()):SetAlpha(0)
	select(q, _G["ContainerFrame7"]:GetRegions()):SetAlpha(0)
	select(q, _G["ContainerFrame8"]:GetRegions()):SetAlpha(0)
	select(q, _G["ContainerFrame9"]:GetRegions()):SetAlpha(0)
	select(q, _G["ContainerFrame10"]:GetRegions()):SetAlpha(0)
	
end
Since the conditional is exactly the same.

Edit: Yes. You hide a lot of stuff though, I think it could be more efficient.

Last edited by Haleth : 02-04-11 at 02:11 PM.
  Reply With Quote
02-04-11, 02:11 PM   #7
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
so,

Code:
	for p = 1, 5 do
		select(p, _G["ContainerFrame6PortraitButton"]:GetRegions()):SetAlpha(0)	
		select(p, _G["ContainerFrame11PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame12PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame7PortraitButton"]:GetRegions()):SetAlpha(0)
	    select(p, _G["ContainerFrame8PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame9PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame10PortraitButton"]:GetRegions()):SetAlpha(0)
	end	
	
for q = 1, 5 do
		select(q, _G["ContainerFrame11"]:GetRegions()):SetAlpha(0)
		select(q, _G["ContainerFrame12"]:GetRegions()):SetAlpha(0)
		select(q, _G["ContainerFrame7"]:GetRegions()):SetAlpha(0)
		select(q, _G["ContainerFrame8"]:GetRegions()):SetAlpha(0)
		select(q, _G["ContainerFrame9"]:GetRegions()):SetAlpha(0)
		select(q, _G["ContainerFrame10"]:GetRegions()):SetAlpha(0)
		select(q, _G["ContainerFrame6"]:GetRegions()):SetAlpha(0)
end
should do it?
  Reply With Quote
02-04-11, 02:12 PM   #8
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
No, you still have a double conditional that you could put together in one.
  Reply With Quote
02-04-11, 02:14 PM   #9
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
like this or?

Code:
	for p = 1, 5 do
		select(p, _G["ContainerFrame6PortraitButton"]:GetRegions()):SetAlpha(0)	
		select(p, _G["ContainerFrame11PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame12PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame7PortraitButton"]:GetRegions()):SetAlpha(0)
	    select(p, _G["ContainerFrame8PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame9PortraitButton"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame10PortraitButton"]:GetRegions()):SetAlpha(0)

		select(p, _G["ContainerFrame11"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame12"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame7"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame8"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame9"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame10"]:GetRegions()):SetAlpha(0)
		select(p, _G["ContainerFrame6"]:GetRegions()):SetAlpha(0)
	end
  Reply With Quote
02-04-11, 02:16 PM   #10
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
More or less, yes, but you could make it more efficient still. Instead of going through all the containers manually, add an other 'for' statement which goes through the number of containers. So you'll have, say, i for the regions, and j for the number of the container.
  Reply With Quote
02-04-11, 02:19 PM   #11
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Haleth View Post
More or less, yes, but you could make it more efficient still. Instead of going through all the containers manually, add an other 'for' statement which goes through the number of containers. So you'll have, say, i for the regions, and j for the number of the container.
Hmm okey, didn't work so well..

Code:
Message: Interface\AddOns\nBags\nBags.lua:45: attempt to index a nil value
Time: 02/04/11 21:17:31
Count: 1
Stack: Interface\AddOns\nBags\nBags.lua:45: in main chunk

Locals: maxbags = 32
dummy = <function> defined @Interface\AddOns\nBags\nBags.lua:6
(for index) = 1
(for limit) = 5
(for step) = 1
i = 1
ContainerFrame = ContainerFrame1 {
 0 = <userdata>
 bags = <table> {
 }
 bagsShown = 0
}
BankFrame = nil
(for index) = 1
(for limit) = 5
(for step) = 1
p = 1
(*temporary) = nil
(*temporary) = nil
(*temporary) = <function> defined =[C]:-1
(*temporary) = ContainerFrame6PortraitButton {
 0 = <userdata>
}
(*temporary) = <userdata>
(*temporary) = ContainerFrame1BackgroundMiddle2 {
 0 = <userdata>
 Show = <function> defined @Interface\AddOns\nBags\nBags.lua:6
}
(*temporary) = ContainerFrame1BackgroundBottom {
 0 = <userdata>
 Show = <function> defined @Interface\AddOns\nBags\nBags.lua:6
}
(*temporary) = ContainerFrame1Name {
 0 = <userdata>
 Show = <function> defined @Interface\AddOns\nBags\nBags.lua:6
}
(*temporary) = ContainerFrame1Background1Slot {
 0 = <userdata>
 Show = <function> defined @Interface\AddOns\nBags\nBags.lua:6
}
(*temporary) = ContainerFrame1Name {
 0 = <userdata>
 Show = <function> defined @Interface\AddOns\nBags\nBags.lua:6
}
(*temporary) = ContainerFrame1Background1Slot {
 0 = <userdata>
 Show = <function> defined @Interface\AddOns\nBags\nBags.lua:6
}
(*temporary) = "attempt to index a nil value"
  Reply With Quote
02-04-11, 02:30 PM   #12
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
Post the code?
  Reply With Quote
02-04-11, 02:33 PM   #13
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Haleth View Post
Post the code?
it's in the top too ;P

http://pastebin.com/gu90vJsC
  Reply With Quote
02-04-11, 02:35 PM   #14
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
I mean the updated code.
  Reply With Quote
02-04-11, 02:38 PM   #15
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
http://pastebin.com/sGPwCBED
  Reply With Quote
02-04-11, 02:41 PM   #16
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
I'm not sure what you're trying to do there. You're using 'i' out of the statement, so it's not defined.

P.S. I'd value it if this were just for personal use.
  Reply With Quote
02-04-11, 02:45 PM   #17
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Originally Posted by Haleth View Post
I'm not sure what you're trying to do there. You're using 'i' out of the statement, so it's not defined.

P.S. I'd value it if this were just for personal use.
Just saw that :P and yeah, im trying to find some "easier way to hide them"

sure, i will use it for personal use.

Manged to fix this.

now it's just those regions.. things..
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_020411_221447.jpg
Views:	702
Size:	1.66 MB
ID:	5687  

Last edited by Aftermathhqt : 02-04-11 at 03:16 PM.
  Reply With Quote
02-06-11, 08:34 AM   #18
Aftermathhqt
A Molten Giant
 
Aftermathhqt's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 784
Anyways.. kinda figured it out...
Attached Thumbnails
Click image for larger version

Name:	WoWScrnShot_020611_153351.jpg
Views:	693
Size:	1.81 MB
ID:	5705  
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Trying to hide stuff, but i have no clue how this works!


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