StatefulUI icon indicating copy to clipboard operation
StatefulUI copied to clipboard

StatefulComponent "unlink nested children" option

Open nosenfield opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. When working with nested StatefulComponents, parent components often end up grabbing references to textfields that are managed by child components and applying its own "localize" logic, overwriting textfield content which has been already marked as non-localized by the nested StatefulComponent.

This feature would allow users to easily rebuild the list of managed fields for auto-managed components (Textfields, Buttons, etc.) to remove duplicate references, adding clarity of component management and bypassing competing localization flags.

Describe the solution you'd like I'd like to be able to:

  1. Add an ignore flag (checkbox) to the editor window of the StatefulComponent which tells parent components to ignore fields managed by this nested component when the parents are building their component lists. Only lists that are auto-populated via an "Update" button (Textfields, Buttons, etc.) would be affected. The nested component itself would still show up in the InnerComps list of the parent component.
  2. Clicking the "Update" field on an auto-managed list of a parent component (eg. Texts) causes it to reassess its list of managed fields and remove any fields managed by an inner component with an ignore flag set.
  3. Have the StatefulComponent's ignore flag be respected even if the game object it is attached to is inactive.

Describe alternatives you've considered

  • Manual removal of overlapping textfields via a "Drop Link" option.
  • Marking nested inner components as ignored via an option for any component in the "Inner Comps" tab
  • Marking component lists (Textfields, Buttons) in child components as ignored so as to not be picked up by parent components.

Additional context The existing "Drop Link" option does not work as intended if the child gameobjects with the nested components are inactive. Dropped linked are immediately re-added to the list. Marking individual components with an ignore option and being able to ask parents to manually redo their component lists via the "Update" button would allow for fine-tuned management of fields via nested StatefulComponents. If components are not marked as ignored by default that would be equivalent to the current functionality to allow for backward compatibility.

nosenfield avatar Aug 24 '24 02:08 nosenfield