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

Add a way to change player name #3

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Anhijkt
Copy link

@Anhijkt Anhijkt commented Jan 6, 2025

I think that using localStorage for storing player name and game config might be better than rearranging current IDBFS tree. Also its might provide more flexibility options for using nethackweb as a lib alone.

@guillaumebrunerie
Copy link
Owner

Thank you for the pull request! I do agree it should be possible to change the player name, and that it should be stored in local storage.

However, I think that the layout of the page should stay the same when asking for the player’s name. So I think it should reuse the existing mechanism and keep all the other components visible (windows/mobile inputs/etc.). I guess the useNethack hook would then need a flag to know whether the game is started or not, and the copyright window would also need tweaking (we don’t have access to the copyright messages until the game is started, and we need the player name to start the game...).

A few other remarks:

  • no need to hard code "Fractal" anywhere (and it doesn’t seem to work anyway, as it still asks for a player name)
  • the prompt and the input field end up on two lines on mobile, it should be only one line if possible (I suspect it’s an existing problem with the CSS which can show up or not depending on the length of the prompt)

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