Add functionality to share single map plays #53
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.
The idea of this is to be able to share a single round play from a place you know.
Take a google maps streetview link, put it into this new modal, and then it will create a sharable link with the settings of the users choosing. Navigating to the link will take any user to a single play of that exact streeview place, with the selected settings.
I personally just wanted this feature, and figured i could just contribute it myself :)
Changes made:
created files
gameSettingsOptions.js
(to use the checkboxes in sharing modal),singleShareModal.js
(previously said sharing modal).New text is all in the common.js, and every different localization use the Cambridge Translator
Most logic is in home.js, in which it uses the router to interpret a new
?single-''
param in the sharable link to parse into the three selected settings and coords from the streeview link. Going back from this single-singleplayer screen clears the param and just goes back to/
(Also, a lot of the diff on home.js is formatting)Inside the share modal, the sharable URL is created just by changing each digit in the coordinate from the google maps link to its character integer, because I wanted it to not be very readable if a user knew how to find a location using the coordinate system.