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

Generate a legend for manually added markers #753

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

Elarnon
Copy link
Contributor

@Elarnon Elarnon commented Feb 26, 2022

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.

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.
@Azgaar Azgaar self-requested a review February 26, 2022 16:42
@Azgaar
Copy link
Owner

Azgaar commented Feb 28, 2022

Looks good, sorry for the delay, but I need more time to analyze

@Elarnon
Copy link
Contributor Author

Elarnon commented Mar 1, 2022

That's fine, there's no rush. Thanks for this great tool, by the way :)

@Azgaar
Copy link
Owner

Azgaar commented Mar 7, 2022

Looks good, merging. Thanks!

@Azgaar Azgaar merged commit edfcad4 into Azgaar:master Mar 7, 2022
@Elarnon Elarnon deleted the elarnon/markers branch March 7, 2022 19:53
sofronaspe pushed a commit to sofronaspe/Fantasy-Map-Generator that referenced this pull request Nov 22, 2022
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.

Co-authored-by: Basile Clement <basile-github@clement.pm>
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.

None yet

2 participants