Skip to content

Conversation

seriema
Copy link
Contributor

@seriema seriema commented Jul 11, 2022

Intention

Paths that match with StartWith requires us to add a new path for every plugin with content. The Modular Game Features plugin type in UE5 promotes a project structure with multiple plugins, and it quickly becomes cumbersome (and easy to forget) to configure new paths.

By also supporting EndsWith and Contains as path match conditions it's now easy to set up conditions that works across both game content and plugin content directories.

Demo

The match conditions path array is now two options instead of one path string. Unfortunately I had to remove the ContentDir meta. The default is one element of Contains /UI/:
image

This allows us to use one filter instead of multiple.
image

Backwards compatibility

Having created a config before making these changes I could validate that it plays nicely with previous versions of the plugin.

The default StartsWith lets the path match as expected:
image

The DefaultGame.ini only changes if something other than the pre-existing paths change. Here I added a new path with Contains to show how it diffs:
image

Questions

  1. I'm not happy with the naming, especially on the "Path" vs "Path segment" part. Any suggestions?
  2. Should I/we do the same change to the ValidationRule/Paths?
  3. I could probably make it so the config UI uses the ContentDir when selecting StartsWith, but it'd make the code much more complicated. Is it worth it?

seriema added 2 commits July 11, 2022 13:48
Paths that match with `StartWith` requires us to add a new path for
every plugin with content. The Modular Game Features plugin type in UE5
promotes a project structure with multiple plugins, and it quickly
becomes cumbersome (and easy to forget) to configure new paths.

By also supporting `EndsWith` and `Contains` as path match conditions
it's now easy to set up conditions that works across both game content
and plugin content directories.
`EndsWith` doesn't make much sense as most will have a directory
structure inside `/UI/`.
@seriema seriema changed the title Support multiple path filters Improve support for repeated content structures across game and plugins Jul 12, 2022
@seriema seriema marked this pull request as ready for review January 24, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant