-
-
Notifications
You must be signed in to change notification settings - Fork 43
World marker categories #437
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
base: main
Are you sure you want to change the base?
Changes from all commits
87517be
ba0e5f1
9becb9e
5ca018b
d99440b
c3177b3
e9d10d5
cf6fb48
f124ec1
bf8b907
9b93922
65454aa
3ec5aa5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| Umbra/i18n/*.json linguist-generated=true | ||
| * text=auto |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| using Umbra.Markers; | ||
|
|
||
| namespace Umbra.Markers.System; | ||
|
|
||
| internal static class WorldMarkerCategoryDefinitions | ||
| { | ||
| internal const string CategoryGeneral = "General"; | ||
| internal const string CategoryOpenWorld = "OpenWorld"; | ||
| internal const string CategoryEureka = "Eureka"; | ||
| internal const string CategoryOccultCrescent = "OccultCrescent"; | ||
|
|
||
| internal static readonly IReadOnlyList<string> CategoryOrder = [ | ||
| CategoryGeneral, | ||
| CategoryOpenWorld, | ||
| CategoryEureka, | ||
| CategoryOccultCrescent | ||
| ]; | ||
|
|
||
| private static readonly IReadOnlyDictionary<string, IReadOnlyList<string>> CategoryAssignments = | ||
| new Dictionary<string, IReadOnlyList<string>> { | ||
| [CategoryGeneral] = [ | ||
| "MapLinkMarkers", | ||
| "FlagMarker", | ||
| "PartyMembers", | ||
| "QuestMarkers", | ||
| "RelicMarkers", | ||
| "TreasureCoffers", | ||
| "WaymarkWorldMarker" | ||
| ], | ||
| [CategoryOpenWorld] = [ | ||
| "AetherCurrents", | ||
| "FateMarkers", | ||
| "GatheringNodeMarkers", | ||
| "HuntMarkers", | ||
| "TripleTriadMarkers", | ||
| "Vista" | ||
| ], | ||
| [CategoryEureka] = [ | ||
| "EurekaCoffers", | ||
| "EurekaElementals" | ||
| ], | ||
| [CategoryOccultCrescent] = [ | ||
| "OccultCarrots", | ||
| "OccultCoffers", | ||
| "OccultSurveyPointMarkers" | ||
| ] | ||
| }; | ||
|
|
||
| internal static IEnumerable<(string CategoryId, IReadOnlyList<WorldMarkerFactory> Factories)> GetCategorizedFactories( | ||
| WorldMarkerFactoryRegistry registry | ||
| ) | ||
| { | ||
| foreach (string categoryId in CategoryOrder) { | ||
| if (!CategoryAssignments.TryGetValue(categoryId, out var ids)) continue; | ||
|
|
||
| List<WorldMarkerFactory> factories = []; | ||
|
|
||
| foreach (string id in ids) { | ||
| factories.Add(registry.GetFactory(id)); | ||
| } | ||
|
|
||
| yield return (categoryId, factories); | ||
| } | ||
| } | ||
|
|
||
| internal static string GetCategoryLabel(string categoryId) | ||
| { | ||
| return I18N.Translate($"Markers.Category.{categoryId}"); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be really nice to have each marker put their own category in there. Maybe something like it is done with the toolbar widgets https://github.com/una-xiv/umbra/blob/main/Umbra/src/Toolbar/Widgets/Library/Accessibility/AccessibilityWidget.cs#L7
And if a Marker does not define a category, it goes in "General" automatically. This also solves the problem, that we cannot know what markers someone has installed via custom plugins.