Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Umbra/i18n/*.json linguist-generated=true
* text=auto
14 changes: 9 additions & 5 deletions Umbra/i18n/de.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions Umbra/i18n/en.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions Umbra/i18n/fr.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions Umbra/i18n/ja.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions Umbra/i18n/zh.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions Umbra/src/Markers/System/WorldMarkerCategoryDefinitions.cs
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"
]
};

Copy link
Copy Markdown
Contributor

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.


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}");
}
}
Loading