Some modular decorations would require a bunch of separate entities just for the sake of changing the model. I’d like to have one entity instead and choose the model before placing. There’s
stonehearth:customization component which allows changing predefined styles, which may be colour palettes or model variants. Expected result is:
- model variants are stored as
- while placing an item pressing slash ( / ) increments style index so the model changes,
- in item movement mode: starting style is the style of root entity,
- in building mode: if an entity being placed is of the same type as the last one, start from the style of the last entity, not from the default.
If you have any ideas how to do that please post here. Right now I have no idea how to communicate between root, ghost an cursor entities so style change is applied to all of them.
I wanted to add new functionality to item placement so in addition to rotating (default: comma and dot) it would be possible to toggle between model variants listed in a separate
pawel_API:model_variants component. I’ve already figured out how to add a new hotkey and mapped
build:toggle_model to so-far-unused slash key.
Files I think may be involved are:
services/client/selection/entity_or_location_selector.lua: at least
_on_keyboard_event()must be modified to add reaction to the new hotkey, also a function to switch to the next model from the list is needed;
- services/client/build_editor/item_placer.lua: prepares everything for placement so reading the model variant of existing entity seems a minimum to add here.
The thing is I’m not sure how should the data from cursor entity be passed to
render_info component of the new entity.