Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(settings): allow computed pos property for settings sections #210

Merged

Conversation

MeguminSama
Copy link
Contributor

This PR allows you to dynamically calculate the position of your settings items (dividers, headers, sections).

Example:

settings.addDivider((sections) => {
  return sections.findIndex((section) => section.section === UserSettingsSections.DEVELOPER_OPTIONS);
});

settings.addHeader("Cool Header", (sections) => {
  return sections.findIndex((section) => section.section === UserSettingsSections.DEVELOPER_OPTIONS);
});

settings.addSection("SectionName", "Section Label",  SectionComponent, null, (sections) => {
  return sections.findIndex((section) => section.section === UserSettingsSections.DEVELOPER_OPTIONS);
});

@MeguminSama MeguminSama changed the base branch from main to develop February 3, 2025 17:03
@Cynosphere Cynosphere merged commit fe3b188 into moonlight-mod:develop Feb 3, 2025
1 check passed
@MeguminSama MeguminSama deleted the feat/computedSettingsPositions branch February 3, 2025 17:57
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