Generate a legend for manually added markers #753
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Markers added by procedural generation have custom notes depending on
the type of marker (e.g. dungeons have a procedurally generated map);
however, the notes for markers manually added by the user are empty.
This patch separates the cell selection logic from the legend and name
generation logic in markers-generator.js, so that the latter can be
shared with manually added markers. There is some additional
simplifications such as storing the dx/dy/px/min/each values directly in
the markers table to simplify the writing of the generic "list and add"
loop in
generateTypes()
.Currently, the legend is only generated when adding a marker of the same
type as an existing marker, and only when a legend generation function
is available for that type. To generate a marker of a type that is not
currently present on the map, one must first change the type field of an
existing marker (which will not get a procedural note), then use "Add
additional marker of that type". The UI for this can be improved later.