Skip to content

Add a way to change player name#3

Open
Anhijkt wants to merge 6 commits intoguillaumebrunerie:mainfrom
Anhijkt:change-playername
Open

Add a way to change player name#3
Anhijkt wants to merge 6 commits intoguillaumebrunerie:mainfrom
Anhijkt:change-playername

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