Skip to content

feat: add FeatureFlags class to enable/disable features at start and runtime - #563

Open
ShadowApex wants to merge 1 commit into
mainfrom
shadowapex/feature-flags
Open

ShadowApex wants to merge 1 commit into
mainfrom
shadowapex/feature-flags

Conversation

@ShadowApex

Copy link
Copy Markdown
Collaborator

This change adds the new FeatureFlags class and Feature class to allow feature gating different behavior in OpenGamepadUI. Features can be turned on or off either through a command line argument, environment variable, or programmatically at runtime in a plugin or platform provider.

This change can also be used in #531 to more gracefully handle toggling features off when running things like SteamOS Manager with the OGUI overlay over Steam.

@ShadowApex
ShadowApex requested a review from pastaq October 6, 2026 02:15
@ShadowApex
ShadowApex force-pushed the shadowapex/feature-flags branch from a963ab0 to e3e2c39 Compare October 6, 2026 02:18

@pastaq pastaq left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are quite e few new fields in https://github.com/ShadowBlip/OpenGamepadUI/blob/e3e2c3931898ef68dd6670df193fb362e96fd592/docs/class-reference/FeatureFlags.md with the note: !!! note There is currently no description for this property. Please help us by contributing one!

## Command-line argument prefix for a single feature, e.g. --feature-no-updater.
const ARG_PREFIX := "--feature-"

const TRUTHY := ["1", "true", "yes", "on"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable/enabled|disable/disabled?

if not feature or feature.id == "":
logger.warn("Cannot register a feature without an id")
return Error.ERR_INVALID_PARAMETER
feature.id = Feature.normalize(feature.id)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check if the feature is valid somehow? If I send a non existent feature like -reboot-with-a-cupcake-in-your-pocket shouldn't that return Error.ERR_INVALID_PARAMETER? It seems it will pass and just return false with a soft ignore?



# Shows or hides the update section for the updater feature
func _update_update_section(enabled: bool) -> void:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇 name right there

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