how do i hide the pack tab if i have nothing in my pack? here is my coding:
statpanel("Pack")
stat("Armor")
for(var/obj/Armor/O in src.contents)
stat(O)
stat("Shields")
for(var/obj/Shields/O in src.contents)
stat(O)
stat("Weapons")
for(var/obj/Weapons/O in src.contents)
stat(O)
if(src.PackWeight > 0)
stat("Weight:","[src.PackWeight]")
ID:173164
![]() Feb 9 2004, 11:59 am
|
|
Lummox JR wrote:
All you have to do is put if(!contents.len) first, and put all that code within that block. or how about just leaving the pack tab there, and display "Your pack is empty" text when (doh!) your pack is empty! :) |
Go with mouse here. "Your pack is empty" will actually show that it's empty. If the statpanel suddenly disappears new users will get shocked. But it's your game. But my bets to mouse.
Thanks for your time, Casey - Siientx |
digitalmouse wrote:
or how about just leaving the pack tab there, and display "Your pack is empty" text when (doh!) your pack is empty! :) Well, he asked not to show the tab. But I like your way better. Lummox JR |
yeah! thanks rock on guys! it hides my pack tab entirely now, but would there be a way so that if i have no shields it hides the shield stat but if i have armor it displays the armor stat...? and then if you equip it move the equipped item to the top of the section (maybe) or to an equipped stat section.... i dunno im obsessive compulsive and i like my things to be neat.....
|
Its much common sence that if you dont have a Pack tab, then you dont have anything. Either way, just makeing it have no tab is just a much more time saver, for you could make a typo or something and then you would have to go back and then might forget something you were doing before, some people are like that, its just easier to make it "destroy" the Tab and save alot of space for typos or other problems.
|
All you have to do is put if(!contents.len) first, and put all that code within that block.
Lummox JR