Skip to content

Conversation

@nealetw
Copy link

@nealetw nealetw commented Feb 21, 2025

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.

@codergautam
Copy link
Owner

Thank you for your contribution! I will review this soon and push if it seems safe. This is a feature I wanted to implement as well but didn't have time.

@nealetw
Copy link
Author

nealetw commented Mar 8, 2025

Whenever you may get to this, I saw a bug in the #bug-reports channel on the discord about being able to move during nomove modes, and made a commit to fix that as well. Here's a link to that thread on discord below

https://discord.com/channels/1229957469116301412/1345341180614803497

@codergautam
Copy link
Owner

Problem with that approach is it will break the chat when people type those keys

@codergautam
Copy link
Owner

Sorry about how this hasnt been merged for so long, in the middle of AP season and need to grind. Will try to get it to this asap!

@nealetw
Copy link
Author

nealetw commented Mar 9, 2025

Its all good! Priorities are important and this should still be here whenever you get to it (so long as it doesnt get stale compared to the master branch!)

@nealetw
Copy link
Author

nealetw commented Mar 9, 2025

I also got a bit more time to test and found that typing into the chatbox was actually fine with the eventListener approach to stop keydown on the streetview component. Or at least in my testing.

I enabled the chatbox manually and had two instances open to make sure both instances (firefox and chrome) could still type S and W into the chat while not being able to use those keys to move in the streetview embed.

If you dont want this approach, its still understandable, but if you'd like to even just take just those changes and apply them to master separate from this PR, thats fair!

@codergautam
Copy link
Owner

That is interesting, could you make a new PR with just that change? That is actually a lot more high priority so would merge faster if it works out.

@nealetw
Copy link
Author

nealetw commented Mar 9, 2025

Heres the other PR #56

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.

2 participants