ID:724742
 
(See the best response by DarkCampainger.)
Code:
mob
Stat()

statpanel("Inventory")

stat("Total Weight: ",weight)
stat("Maximum Weight: ",max_weight)

for(var/Items/I in contents)
if(I.equipped != 1)
stat(I)


Problem description:

So I like to show a little bit of text information in my stat panels. What I noticed though is that when I did this^ my items shown underneath were nudged to the right. I have two stat panels, inventory and equipment. What I realised is that the nudging distance was different in both panels and was based on the longest text field in the first parameter of any stat() in that panel.

What that means is that items are a more on the right in my inventory and a little less in my equipment panel.

If I could just get my items in the for()loop always aligned to the left, I could have the right unity in my interface.

Any ideas? Thanks heaps.
Best response
Stat panels are kind of limited in their options.

For your case, one option would be to put your stats all on the right:
stat("", "Total Weight: [weight]")
stat("", "Maximum Weight: [max_weight]")

And then they would line up with the item names.

The other option is to output your items as text, but then they can't be interacted with:
for(var/Items/I in contents)
if(I.equipped != 1)
stat(I.name, "")


Neither of those is ideal, so I would suggest you switch to a grid which gives you more control over the layout (and generally looks better).
Thanks. I actually worked out that the extra space on the left is great for writing ("# Equipped #", I) but now I know how to do the alignment if I ever want to.

Cheers.