ID:2336679
 
BYOND Version:512.1402
Operating System:Windows 10 Pro
Web Browser:Firefox 57.0
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
The icons provided to the context menus (the small ones) for each atom present when right-clicking on turfs don't seem to respect several things, some of which are probably by design, but others I'm less sure about:

- Alpha variable: Atoms have their alpha var ignored (incl any overlays on the atom), and are always rendered opaque at all times. Maybe this is to make the icon easier to see, but does cause 'hidden' parts of a composited icon (where several overlays are alpha 0 until needed) to be displayed even when they should be hidden. It seems per-pixel alpha is fine (since I don't see every atom as a huge square), but the var itself is not.

- Color variable: Atoms recolored appear unblended in the context menu icon, whether this recoloring was by a PLANE_MASTER or the var on the atom or image. As a gameplay example, if I were to simulate colorblindness using a PLANE_MASTER on 0 with a color matrix, it would be pointless because anyone could simply look at the context menu icons to see the 'true' colors of all objects.

- Planes: Context menu icon does not respect whether or not the client can see the image based on the image's PLANE_MASTER handling. For example, if an atom has an overlay that is an image on another plane, the image is handled fine (affected by alpha, color, etc) by the PLANE_MASTER in the client's screen, but the context menu ignores this. Makes it difficult to use PLANE_MASTERS to hide 'secret' things from certain clients on icons this way.

- Invisibility (on images/overlays): If an atom has an icon, and you overlay things with invisibility 101 on them, the client cannot see the overlays in the game world, but they appear in the context menu icon nonetheless.

My original thought was that this was just a win32 problem and the context menu icons don't support alpha, but they obviously do since icons with alpha pixels appear fine, and I think this is probably more an issue with compositing the image before passing it to win32.

Numbered Steps to Reproduce Problem:
Just adjust any of the vars above on an atom and compare differences between the game world and the context menu icon.

Expected Results:
Context menu icons to be the same as what is seen in the game world.

Actual Results:
Context menu icons can be drastically different.

Does the problem occur:
Every time? Or how often? Always
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur?
Always occurs

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Happens in every version I've tested.

Workarounds:
None, just can't use planes, alpha, or color to affect things in 'secret' ways that shouldn't be known to clients (aka can't add a 'health bar' that only shows up for medics using a PLANE_MASTER to adjust whether a mob can see health bars, because all users can right-click on the mob and see the health bar in the context menu icon)
This is one of those things that could be either a bug report or a feature request. Context menus (and dmf grids and statpanels) have never supported those things. I suspect any improvement would use the same stuff that a GetAppearanceIcon() would require.
I thought about the differences between bug and feature when posting and wondered that myself, and I'd call it more of a bug since I'd assert the expected behavior is for the context menu icons to be accurate and representative, which they are not in some cases.
On the balance I think you're right; it's more bug report than feature request. It's an old one--in fact if you count the fact that it didn't use to support pixel_x/y, very old--but still worth shoring up at some point.
I'll add one more comment for the record if you come back here and look at this when you tackle it:

Underlays appear to be drawn as overlays in the icon, too. If I add a full grey square with alpha = 0 as an underlay, looks fine ingame, but entire icon becomes a grey square in context menu.