Selection tool shows no icon for selected entity
Posted: Fri Jul 22, 2022 6:55 pm
If you use a selection tool, you usually see icons of the selected entities. I've found that a selection tool I made will select a certain entity, but will not display its icon:
Directional Movement Vehicles. That mod changes data.raw["item-with-entity-data"].car.place_result to DMV's own prototype.
The prototype browser shows that "items to place this" (I suppose that would be entity.prototype.placed_by) is nil for the vanilla car: Am I correct in supposing that no icon is shown for the selection because there is no item that can place the entity? Apparently, the car entity has an icon sprite -- why isn't that used instead? Is there anything I could do to get an icon of the vanilla car when it's selected with my tool? Having no visual feedback certainly is confusing, so I'd like to get it back.
The only solution I can think of is to make a copy of the item prototype (without a recipe to craft it, it should be hidden), and set its place_result to the vanilla entity. Is there a better way?
Both entities look like the vanilla car (data.raw.car.car), but only the one on the left really is -- the other one is a "spider-vehicle" under the hood, created by The prototype browser shows that "items to place this" (I suppose that would be entity.prototype.placed_by) is nil for the vanilla car: Am I correct in supposing that no icon is shown for the selection because there is no item that can place the entity? Apparently, the car entity has an icon sprite -- why isn't that used instead? Is there anything I could do to get an icon of the vanilla car when it's selected with my tool? Having no visual feedback certainly is confusing, so I'd like to get it back.
The only solution I can think of is to make a copy of the item prototype (without a recipe to craft it, it should be hidden), and set its place_result to the vanilla entity. Is there a better way?