Skip to content

WebHost/Options Creator: Make player name caps aware of replaced tags - #6377

Open
duckboycool wants to merge 4 commits into
ArchipelagoMW:mainfrom
duckboycool:player_name_loosen
Open

WebHost/Options Creator: Make player name caps aware of replaced tags#6377
duckboycool wants to merge 4 commits into
ArchipelagoMW:mainfrom
duckboycool:player_name_loosen

Conversation

@duckboycool

Copy link
Copy Markdown
Collaborator

What is this fixing or adding?

The options page on WebHost has for a while prevented the user from entering valid names due to the length cap, even when after replacing tags like {player} it'd actually be below 16 characters. The Options Creator also opted to match WebHost behavior here. This changes both so that they'll handle this case more specifically.

You can't know how long exactly these tags will become given multiple players, but this assumes the best case of 1 character where it may work sometimes. I also kept the handling simple and ignored things like the handling of % chars. (I originally intended on calling out to handle_name in the Options Creator directly, but it only returns the truncated output which isn't very helpful).

On the players page with no JS, it'll retain the current behavior. I decided to remove the cap entirely on the weighted options page since it's advanced, these names are technically still valid, and it already handles an empty name differently, but it could be ported there too if wanted.

How was this tested?

On local webhost and with the options creator by trying some names that should and shouldn't be valid given this check.

If this makes graphical changes, please attach screenshots.

image

@github-actions github-actions Bot added affects: core Issues/PRs that touch core and may need additional validation. affects: webhost Issues/PRs that touch webhost and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Aug 4, 2026
evt.preventDefault();
window.scrollTo(0, 0);
showUserMessage('You must enter a player name!');
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could refuse to submit with a name too long, but I think it's probably good enough for the user to still see the warning.

#player-options #name-warning {
font-weight: bold;
color: #ffd642;
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't love how this looks really, but I suppose it should suffice.

Comment thread OptionsCreator.py
return super().insert_text(re.sub(self.pat, "", substring), from_undo=from_undo)


class ComputedLengthTextField(ResizableTextField):

@duckboycool duckboycool Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not a fan of copying over these methods like this, but I couldn't really see another way to adjust the behvaior. Because it's kivy, temporarily changing the text value itself causes it to re-call the same listeners and die.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects: core Issues/PRs that touch core and may need additional validation. affects: webhost Issues/PRs that touch webhost and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant