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

Impossible to select first variant if there are 10 or more #12

Closed
sebamarynissen opened this issue Nov 18, 2024 · 1 comment
Closed

Comments

@sebamarynissen
Copy link
Contributor

While working on memo33/sc4pac#42, I've noticed that sc4pac interactive interface doesn't support 10 or more variants. If I run sc4pac update after adding 11241036:modular-plaza-system, then it refuses to accept 1 as valid option:

Choose a variant for 11241036:modular-plaza-system:

  (1) 11241036:modular-plaza-system:textures = maxis-white
  (2) 11241036:modular-plaza-system:textures = maxis-concrete
  (3) 11241036:modular-plaza-system:textures = bsc-diagonal-brick
  (4) 11241036:modular-plaza-system:textures = bsc-mediterranean-red-cobblestone
  (5) 11241036:modular-plaza-system:textures = bsc-pink-pavement
  (6) 11241036:modular-plaza-system:textures = mtp-red-sandstone
  (7) 11241036:modular-plaza-system:textures = nam-cobblestone
  (8) 11241036:modular-plaza-system:textures = nam-industrial
  (9) 11241036:modular-plaza-system:textures = nam-pink-pavement
  (10) 11241036:modular-plaza-system:textures = nam-red-brick
  (11) 11241036:modular-plaza-system:textures = nam-sandstone
  (12) 11241036:modular-plaza-system:textures = vortexture-cobblestone-1
  (13) 11241036:modular-plaza-system:textures = vortexture-cobblestone-2

Enter a number [1-13]: 1
Enter a number [1-13]: 1
Enter a number [1-13]: 1
Enter a number [1-13]: 01
Enter a number [1-13]: 0001
Enter a number [1-13]: 1,
Enter a number [1-13]: 1;
Enter a number [1-13]: 2
Everything is up-to-date.

As soon as there are only 9 variants, it works again.

I'm on Windows, not sure if this is happens on Linux or Mac as well. Manually updating the variant in sc4pac-plugins.json and then running sc4pac update works as expected.

@memo33 memo33 closed this as completed in 259d4ef Nov 18, 2024
@memo33
Copy link
Owner

memo33 commented Nov 18, 2024

Good catch. The problem was that the prompt only checked for a matching prefix (so that y can answer yes), but in your case 1 matches both 1 and 10, so the answer wasn't understood as unique.

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

No branches or pull requests

2 participants