Is it possible to automatically clear the character name?


Problems running or configuring the software, commands & options, compiling, different platforms, using the interface, documentation, etc.

User avatar

Dungeon Dilettante

Posts: 3

Joined: Tuesday, 5th November 2019, 14:22

Post Thursday, 7th November 2019, 00:55

Is it possible to automatically clear the character name?

As someone who only ever plays the offline game, I would not like the game to remember the previous character's name when creating a new character; I always want the new character's name to be random. For about a year and a half now, I have been hitting backspace on the main menu every time before I create a character, and now that backspace removes a single character instead of the whole name, clearing the name has become annoying enough that I am looking for a way to automate it. Is there a script I can add to init.txt that will automatically clear that name so I get a random character name each time I make a new character?

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Thursday, 7th November 2019, 01:00

Re: Is it possible to automatically clear the character name

The_Fireplace wrote:As someone who only ever plays the offline game, I would not like the game to remember the previous character's name when creating a new character; I always want the new character's name to be random. For about a year and a half now, I have been hitting backspace on the main menu every time before I create a character, and now that backspace removes a single character instead of the whole name, clearing the name has become annoying enough that I am looking for a way to automate it. Is there a script I can add to init.txt that will automatically clear that name so I get a random character name each time I make a new character?

It used to be that if you started typing (without even hitting backspace) it would clear the name, I start with a new name every time too, so I also find it very annoying. I filed a bug report here:

https://crawl.develz.org/mantis/view.php?id=12119

If you have any interest in following any progress made on fixing it.
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!
User avatar

Dungeon Dilettante

Posts: 3

Joined: Tuesday, 5th November 2019, 14:22

Post Thursday, 7th November 2019, 01:14

Re: Is it possible to automatically clear the character name

Siegurt wrote:
The_Fireplace wrote:As someone who only ever plays the offline game, I would not like the game to remember the previous character's name when creating a new character; I always want the new character's name to be random. For about a year and a half now, I have been hitting backspace on the main menu every time before I create a character, and now that backspace removes a single character instead of the whole name, clearing the name has become annoying enough that I am looking for a way to automate it. Is there a script I can add to init.txt that will automatically clear that name so I get a random character name each time I make a new character?

It used to be that if you started typing (without even hitting backspace) it would clear the name, I start with a new name every time too, so I also find it very annoying. I filed a bug report here:

https://crawl.develz.org/mantis/view.php?id=12119

If you have any interest in following any progress made on fixing it.

I'd prefer to not have to type anything extra at all, and just have it automatically generate a random name for each new character. Even if they change it back to the old behavior, I would still have to press backspace to clear it every time. I went ahead and followed the issue because I'm curious to see how they respond.

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Thursday, 7th November 2019, 06:08

Re: Is it possible to automatically clear the character name

The_Fireplace wrote:
Siegurt wrote:
The_Fireplace wrote:As someone who only ever plays the offline game, I would not like the game to remember the previous character's name when creating a new character; I always want the new character's name to be random. For about a year and a half now, I have been hitting backspace on the main menu every time before I create a character, and now that backspace removes a single character instead of the whole name, clearing the name has become annoying enough that I am looking for a way to automate it. Is there a script I can add to init.txt that will automatically clear that name so I get a random character name each time I make a new character?

It used to be that if you started typing (without even hitting backspace) it would clear the name, I start with a new name every time too, so I also find it very annoying. I filed a bug report here:

https://crawl.develz.org/mantis/view.php?id=12119

If you have any interest in following any progress made on fixing it.

I'd prefer to not have to type anything extra at all, and just have it automatically generate a random name for each new character. Even if they change it back to the old behavior, I would still have to press backspace to clear it every time. I went ahead and followed the issue because I'm curious to see how they respond.

Yeah, there's a couple relevant options, but they also don't seem to work in an expected way
  Code:
name = "something"
remember_name = true|false
name_bypasses_menu = true|false

Those don't seem to work as intended anymore
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!
User avatar

Dungeon Dilettante

Posts: 3

Joined: Tuesday, 5th November 2019, 14:22

Post Thursday, 7th November 2019, 14:42

Re: Is it possible to automatically clear the character name

Sure enough, the behavior didn't change when I added
  Code:
name = "*"
remember_name = false
name_bypasses_menu = true

To the init.txt.

Dungeon Master

Posts: 388

Joined: Monday, 18th August 2014, 20:04

Post Thursday, 7th November 2019, 19:09

Re: Is it possible to automatically clear the character name

It used to be that if you started typing (without even hitting backspace) it would clear the name,


This change was intentional, because the behavior of name-clearing (and backspace) was extremely unpredictable in general from how standard UI textboxes work. You can now use ctrl-u to clear the name textbox. (I'm not saying we won't continue to try to improve this use case, since there's been a surprising amount of response to this change, just that the exact old behavior probably won't come back.)

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Thursday, 7th November 2019, 21:52

Re: Is it possible to automatically clear the character name

advil wrote:
It used to be that if you started typing (without even hitting backspace) it would clear the name,


This change was intentional, because the behavior of name-clearing (and backspace) was extremely unpredictable in general from how standard UI textboxes work. You can now use ctrl-u to clear the name textbox. (I'm not saying we won't continue to try to improve this use case, since there's been a surprising amount of response to this change, just that the exact old behavior probably won't come back.)

Well "Append to the pre-loaded name" is pretty awful UX. What a standard text box would do is:

If your cursor is at end of text, typing appends backspace removes the last character, if you have the whole field highlighted, typing replaces, backspaces clears.

Typically such a text box would start empty.

What *this* change does is change the implicit assumption from "start with the text highlighted" to "start with the cursor at the end of the text, as if you'd just typed it in"

But you *did not* just type it in, it's come in pre-loaded from your prior game, there's plenty of examples of pre-loaded text boxes starting highlighted when the expectation is that you would want to type something new in altogether if you wanted to change it, but since there's no visual indicator of highlighting in DCSS's name field, you end up in this ambiguous situation, which someone arbitrarily decided should go the other way.

The new method is unfortunately *completely* useless to the user, there's almost never a situation where you just want to append to your prior character's name (or remove a couple characters from the end), you either want to take it as-is or replace or remove it)

So if you want to make it clear *and* useful, you either need to implement highlighting text in the name field, along with a proper visual indicator, and start with the pre-loaded name highlighted.
Which is probably too much work, next best option would be to revert the change to a useful, but possibly less-than-predictable outcome (which takes all of 2 seconds to get used to once, rather than the current overhead of backspacing over the character's name every time you want to change it).

A less optimal solution would be to fix it so that the options actually worked, and you could set an option for 'start with a blank name' although that's strictly worse than the old way (as it makes the default not "load from the last played character")

Control-U is also pretty odd as a 'clear this text field' shortcut, is that some kind of standard thing that I haven't come across? (it's not vim/emacs/anythingwindows/visual studio) nor do I see it in any help documentation (you'd want a hit for something esoteric like that on the menu, but that's a lot of clutter we probably don't want)

At least if there's going to be a 'clear this field' shortcut it probably should be something that someone could reasonably guess, probably involving backspace or delete (like shift-backspace or shift-delete or something)
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!

Dungeon Master

Posts: 388

Joined: Monday, 18th August 2014, 20:04

Post Thursday, 7th November 2019, 22:52

Re: Is it possible to automatically clear the character name

Siegurt wrote:If your cursor is at end of text, typing appends backspace removes the last character, if you have the whole field highlighted, typing replaces, backspaces clears.

Typically such a text box would start empty.


I do actually already know how a textbox works, thx.

For this message the author advil has received thanks: 2
duvessa, The_Fireplace

Ziggurat Zagger

Posts: 6454

Joined: Tuesday, 30th October 2012, 19:06

Post Friday, 8th November 2019, 05:24

Re: Is it possible to automatically clear the character name

advil wrote:
Siegurt wrote:If your cursor is at end of text, typing appends backspace removes the last character, if you have the whole field highlighted, typing replaces, backspaces clears.

Typically such a text box would start empty.


I do actually already know how a textbox works, thx.

Sorry, I wasn't trying to be snarky, there's other people who read this forum who don't have the context for the point I was making. The point wasn't to educate you, but rather to establish (for everyone) that the way it used to work *and* the way it works now could be interpreted as consistent with the way "a textbox works" which may or may not be obvious to people who are non-technical observers to the conversation.
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!

bel

Cocytus Succeeder

Posts: 2184

Joined: Tuesday, 3rd February 2015, 22:05

Post Friday, 8th November 2019, 08:27

Re: Is it possible to automatically clear the character name

Siegurt wrote:Control-U is also pretty odd as a 'clear this text field' shortcut, is that some kind of standard thing that I haven't come across? (it's not vim/emacs/anythingwindows/visual studio) nor do I see it in any help documentation (you'd want a hit for something esoteric like that on the menu, but that's a lot of clutter we probably don't want)

Ctrl-U is "backward kill line" in bash: it deletes everything from the cursor position backwards.

Anyway, I didn't have any problems with the earlier behaviour. As Siegurt mentioned, it's quite normal for textboxes to come "pre-highlighted" so that you can just start typing if you want to replace the text already there.

Dungeon Master

Posts: 388

Joined: Monday, 18th August 2014, 20:04

Post Friday, 8th November 2019, 14:52

Re: Is it possible to automatically clear the character name

bel wrote:
Siegurt wrote:Control-U is also pretty odd as a 'clear this text field' shortcut, is that some kind of standard thing that I haven't come across? (it's not vim/emacs/anythingwindows/visual studio) nor do I see it in any help documentation (you'd want a hit for something esoteric like that on the menu, but that's a lot of clutter we probably don't want)

Ctrl-U is "backward kill line" in bash: it deletes everything from the cursor position backwards.

Anyway, I didn't have any problems with the earlier behaviour. As Siegurt mentioned, it's quite normal for textboxes to come "pre-highlighted" so that you can just start typing if you want to replace the text already there.


Ctrl-u is also backwards line kill elsewhere in crawl. Anyways, the problem wasn't so much backspace's behavior (etc) when the game started, which we may restore, but that this behavior was a side effect of some mostly broken code that produced a mess of other weird cases. Re the original question in this thread, `remember_name = false` was fairly buggy and should work a lot better now in trunk; I also made * work at the main menu like it does in the name entry popup.

For this message the author advil has received thanks:
The_Fireplace

Dungeon Master

Posts: 14

Joined: Friday, 29th December 2017, 19:18

Post Sunday, 10th November 2019, 12:18

Re: Is it possible to automatically clear the character name

I've fixed the behaviour for backspace. Backspace will now clear the first time you press it, unless you've already typed part of a name; otherwise, it will delete one character as usual. This is not a perfect fix; as advil implied, it's surprisingly non-trivial to do properly, but this should make it easy to clear the initial name again.

Making the name pre-highlighted would be nice, but crawl doesn't even have textboxes (yet), and once it does adding text selection support is not going to be a top priority. It's much more likely that the starting screen will be simplified, with the name text field moved to a different screen (such as the existing "What is your name today?" prompt).

For this message the author aidanholm has received thanks:
Siegurt

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 9 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.