Skip to content

Automatic profile and layer detection#1979

Merged
diogotr7 merged 7 commits intoantonpup:devfrom
Wibble199:feature/auto-app-and-layer-registration
May 7, 2020
Merged

Automatic profile and layer detection#1979
diogotr7 merged 7 commits intoantonpup:devfrom
Wibble199:feature/auto-app-and-layer-registration

Conversation

@Wibble199
Copy link
Copy Markdown
Collaborator

@Wibble199 Wibble199 commented Apr 24, 2020

This PR makes it so that application profiles and layers are automatically registered by the LightingStateManager instead of needing to be manually done.

  • Anything that extends Profiles.Application will be registered as a profile.
  • Anything that implements ILayerHandler will be registered as a layer.
  • Any layers without a LayerHandlerMeta attribute will automatically use the default settings:
    • If not provided, the name is the un-camelcased name of the class, with the "LayerHandler" removed.
    • A layer is a default layer (I.E. available to all application profiles) if it exists in the Aurora.Settings.Layers namespace. Anything not in the namespace is assumed to be a application-specific layer and will still be registered but will not be a default layer. Applications wishing to allow a non-default layer should now use the new AllowLayer<T> method in the application config.
  • Applications' "_ID" properties have been removed as it was only used for the UI (and there are better ways of achieving that).

…UI related purposes.

This means that a dummy layer does not have to be created to get the ID anymore.
Also changed how layer handlers are stored and therefore how an application's custom layers are registered. They are now automatically picked up, and added to the global registration but are set as non-default. In the application config, the line `AllowLayer<TypeOfLayerHandler>();` should be added.
Made default layer appear at the top of the list.
@diogotr7 diogotr7 merged commit f4b78f6 into antonpup:dev May 7, 2020
@Wibble199 Wibble199 deleted the feature/auto-app-and-layer-registration branch May 8, 2020 10:03
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.

2 participants