This commit is contained in:
Firepup Sixfifty 2024-06-03 15:35:05 -05:00
parent 8534a3c865
commit 969446bed6
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA
2 changed files with 10 additions and 0 deletions

View file

@ -2,6 +2,8 @@
Package containing various shorthand things I use, and a few imports I almost always use Package containing various shorthand things I use, and a few imports I almost always use
### Change log: ### Change log:
#### v.1.0.39: #### v.1.0.39:
Add offset mapping all the way up to 10 Billion, which exceeds the integer limit.
#### v.1.0.39:
Add offset mappings for exceeding 1 Million options, new limit is 10 Million options Add offset mappings for exceeding 1 Million options, new limit is 10 Million options
#### v.1.0.38: #### v.1.0.38:
Mappings for much larger menu sizes, hopefully no one should ever hit that limit. Mappings for much larger menu sizes, hopefully no one should ever hit that limit.

View file

@ -896,6 +896,14 @@ def menu(options: dict, title: str = "") -> object:
indicatorOffset = -4 indicatorOffset = -4
case 15: # 1000000-9999999 options (Ten Million rolls over) case 15: # 1000000-9999999 options (Ten Million rolls over)
indicatorOffset = -5 indicatorOffset = -5
case 17: # 10000000-99999999 options (One Hundred Million rolls over)
indicatorOffset = -6
case 19: # 100000000-999999999 options (One Billion rolls over)
indicatorOffset = -7
case (
21
): # 1000000000=9999999999 options (Ten Billion rolls over) (This exceeds integer limits, so if we get over this I've got no clue how.)
indicatorOffset = -8
case _: case _:
raise ValueError( raise ValueError(
f"You have more menu options than was ever expected to be used, please notify the package author to add a offset mappting for an indicator size of {indicatorSize}." f"You have more menu options than was ever expected to be used, please notify the package author to add a offset mappting for an indicator size of {indicatorSize}."