Skip to content

Make Feathers only add InputDispatchPlugin when it's not already added #21111

@janhohenheim

Description

@janhohenheim

What problem does this solve or what need does it fill?

InputDispatchPlugin is not a default plugin, but plenty of plugins need it. So naturally, FeathersPlugins adds it, as it doesn't work without it. But the popular and soon-to-be upstreamed bevy_ui_text_input also adds it!. Combining both thus means you get a runtime panic because of duplicate plugins.
Fortunately, FeathersPlugins is a plugin group, so we can work around this:

FeathersPlugins
    .build()
    // InputDispatchPlugin is also added by TextInputPlugin
    .disable::<InputDispatchPlugin>()
    // Breaks input focus for some reason?
    .disable::<TabNavigationPlugin>(),

but that's not very user friendly

What solution would you like?

Use plugin dependencies at home: check if the plugin already exists before adding it

What alternative(s) have you considered?

  • Leave it
  • Document this better maybe?
  • Wait for real plugin deps
  • Tell bevy_ui_text_input to do this instead

Additional context

As requested by Alice ;)

Metadata

Metadata

Labels

A-UIGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possibleC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions