Sprite Request: Make all existing toolbar/block sprites available to the Programmable Block

Brian Ronald shared this feedback 3 years ago
Submitted

As documented on the Sprite Listing on Malware's wiki, many sprites are available for use on Programmable Blocks, but not all. Please make the other sprites available (in particular, the ones used on toolbar actions and block placement slots). This should be fairly inexpensive to implement, since the assets are already present in the client.

Many thanks!

Replies (1)

photo
2

The block icons should be straightforward, TypeId/SubtypeId as the texture subtype.

One small thing though: Icons in definitions are an array, and some modders use that to overlay.

Additional LCD defs can be added per icon with a suffix from 2nd onward (like "TypeId/SubtypeId/Index", "OreDetector/SmallDetector/1" for 2nd icon and without /1 at all for first icon), but then PB would need a way to be informed how many icons a block has... maybe a IconsCount and GetIconSprite(index).


A few issues with implementing toolbar action icons with potential solutions:


Because actions don't exist until the block type spawns (and mods have to also obey this otherwise they break the existing ones), the LCD texture definitions would have to be added when the action is added, which should include the normal AddAction() way and also the CustomActionGetter event way too.

Also a modAPI call to add/update LCD definitions for when mod scripts modify action icons programmatically.


EDIT: another problem is PB scripts or TSS that want to use icons standalone, which will mean they work or don't work seemingly random, because they need the block type to spawn so that it generates actions so that it creates the definitions... maybe the vanilla ones can be pre-generated by making all terminal stuff be added at loading time instead of when block first spawns.


Another issue is name collisions, some blocks have the same action name as others but they're different actions (and likely different icons too), so maybe the sprite name should include block type (from TypeId not class name) like "OreDetector/OnOff_On".

Or the definitions could be named after the icon, "<ModId>\Path\To\File.dds" as the ID itself (which is used by faction logos as seen in the list above), but this requires a way to link that to the action so the ITerminalAction (accessible to PB) needs a IconSpriteId property (which gets assigned if/when the LCD texture is created for it, returning null if one doesn't exist, helps find missing ones via errors).

photo
1

That is a lot of extra complexity. I wasn't worried about the terminal actions, I just wanted to use some of the same pictures.

photo
Leave a Comment
 
Attach a file