ID:1883342
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Hi, we have a suffix var for atom already. Can we please get a prefix?

I think it would make a lot more sense to have both and it would help me with some of what I'm doing. There are workarounds to make your own prefix var but it's really ugly.
What would be the purpose for this?
In response to Super Saiyan X
The same purpose suffix has...
The suffix var has a special place to appear in statpanels; that's literally its only purpose. The prefix in a statpanel has always been determined by the stat() call.
In response to Lummox JR
How about the situation where you have 15 units of an item and you would like to display it as (15x) Arrows instead of Arrows (15x).

You can of course use stat("([arrows.amount]x)",arrows) but that puts a big gap between the two.

It just seems to make sense that if suffix is important which it is, then prefix should also be important and in fact I'd like to use prefix in my current project.
Statpanels only traditionally support 3 columns, and the prefix always comes from the user. (The gap would also be present regardless, if a 4th column were created.) I think what you actually want is just something that would appear next to the name. In which case, it makes the most sense to modify the name.
In response to Lummox JR
Wait, that's not what I mean. What I mean is appending it to the front of the name of the object. Not putting it in a column.

Same column as name but name = [prefix][name][suffix] all in the same column.
In response to Zecronious
The suffix variable is displayed only in stat panels, and in a separate column to the right of the name. It doesn't change how names are displayed. This is how it's always been, as far as I can remember.

You're asking for the prefix variable to behave like the suffix variable without knowing what suffix does.
In response to Kaiochao
Looks like I'll have to quote the reference.



Notice how it says "follows the object's name", like this:



Yes it does use a separate column but it makes complete sense to me that you might want your inventory to look like this:



And how would you do that Kaiochao? Well you'd do that by adding it to the front of the name and not creating a new column of course!



Kaochaio, I don't think your last sentence was really necessary. Seems pretty rude. Yes I do know and yes my way makes complete logical sense.
Prefix would never be able to work like that.

In the statpanel, the icon/name are one entity - suffix works as a suffix to the whole entity, nor just to the name. A prefix would act as a prefix to the whole entity as well.
In response to Super Saiyan X
"A prefix would act as a prefix to the whole entity as well."

Explain that to me. We're talking to the developer. He can design it any way he chooses and it makes sense to append it cosmetically to the front of the name.

It's simple concatenation 101.
In response to Zecronious
Thanks for mentioning the icon. This thread was very confusing until then.

What you're asking for is a column between the icon and the name.
In response to Super Saiyan X
When I look in my bag I might say "I have 6 apples" not "I have apples 6". Suffixes aren't the best way to do this in my opinion. From a human computer interaction standpoint it makes more sense to place them in logical order.

~ Using a prefix
From the way the statpanel is designed - it makes no sense. what you're asking for is not anything like how suffix works.



if you insert a prefix *before* the name, but after the icon - will prefix be part of the src entity in the panel, or will it be independent, like suffix?

The simplest thing to do was already mentioned in this thread - rename the object. Insert your own prefix before the actual name, and it'll appear exact the way you want it - before the name, after the icon.
My confusion comes from:

1. Want a new "prefix" variable to work like "suffix".
2. Prefix shouldn't be in a new column.
3. "It's simple concatenation."

It didn't sound right, the way you said it before, because #2 and #3 contradict #1. In fact, your new "prefix" variable doesn't work like "suffix" at all, aside from being visible only in statpanels.

I still think this is an interesting feature request. There's currently no way to insert text between the icon and the name without modifying the name itself. You wouldn't be able to do this in a grid control either.

The problem is that since the suffix is just text in a separate column, it isn't part of the object in that row; i.e. you can't click or right-click the suffix for a context menu on the object.

If a prefix were implemented as a new column, it also wouldn't respond to the mouse, but the icon and the name still should? That might not even be possible, and if it was, it'd be awkward.

If the prefix were instead implemented through concatenation, such as when \the is automatically added in place of [src] where src.name is an improper noun, then you'd expect the mouse to be able to interact with it. But the mouse doesn't interact with suffix because it's simply text in a separate grid cell, so you get inconsistency, unless suffix was also changed this way. Then, the prefixes and suffixes might not always line up anymore, so there's still inconsistency either way.

This is what SSX means by the icon and name being one entity. The icon and the name go together in grid cells and even when outputted to an output control. Putting something between them would be either awkward or inconsistent.

Either way, statpanels are pretty much built using the Tab and Grid controls. If you can't do it in a Grid, then you wouldn't be able to do it in an Info control.
To address you both and put this in plain terms.

Suffix currently works by placing extra text after the name. It would look bad if this text was jagged because of different sized names. Therefore it goes into a separate column to keep them aligned. Simple right?

Prefix does exactly what the name describes and puts text before the name. It's automatically aligned so there's no need for any new column. It can simply be appended to the front of the name. Simple right?

So prefix/suffix, before/after, doesn't need an extra column/does need an extra column.
Having a prefix var that works nothing like the suffix var would be hugely inconsistent.
In response to Lummox JR
Nothing like? Really? The only difference is that it doesn't have an extra coloumn because it doesn't need one. Apart from that it works exactly the same as suffix.
This makes complete sense to me. I'm so confused as to why I've been ineffective at communicating it.
Including the prefix as part of the name instead of making it a separate column would be a very big departure indeed.

Implementing this in a statpanel in the way you describe, and even adding it to appearance info, would be straightforward. The real problems are:

1) The inconsistency vs. the behavior of suffix is huge. This would confuse users. They'd wonder if atom.prefix got inlined with the name, why does atom.suffix get its own column? And why inline when another column could be added?

2) The statpanel effectively has a prefix column already, and the info control has the prefix-color option to go with it. Having two entities both called a prefix (the column and the inline name) would be even more confusing.

3) This advances the var soup problem, without being a compelling feature that would potentially impact many games.

4) There's a trivial workaround.
Page: 1 2