1.0.39
This commit is contained in:
parent
ec7ad5845c
commit
8534a3c865
3 changed files with 11 additions and 7 deletions
|
@ -1,6 +1,8 @@
|
||||||
# Firepup650
|
# Firepup650
|
||||||
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:
|
||||||
|
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.
|
||||||
#### v.1.0.37:
|
#### v.1.0.37:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "firepup650"
|
name = "firepup650"
|
||||||
version = "1.0.38"
|
version = "1.0.39"
|
||||||
authors = ["Firepup650 <firepyp650@gmail.com>"]
|
authors = ["Firepup650 <firepyp650@gmail.com>"]
|
||||||
description = "Package containing various shorthand things I use, and a few imports I almost always use"
|
description = "Package containing various shorthand things I use, and a few imports I almost always use"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
|
@ -882,18 +882,20 @@ def menu(options: dict, title: str = "") -> object:
|
||||||
indicatorSize = len(str(limit)) * 2 + 1
|
indicatorSize = len(str(limit)) * 2 + 1
|
||||||
indicatorOffset = 999
|
indicatorOffset = 999
|
||||||
match indicatorSize:
|
match indicatorSize:
|
||||||
case 3: # 1-9 options
|
case 3: # 1-9 options (Ten rolls over)
|
||||||
indicatorOffset = 1
|
indicatorOffset = 1
|
||||||
case 5: # 10-99 options
|
case 5: # 10-99 options (One Hundered rolls over)
|
||||||
indicatorOffset = 0
|
indicatorOffset = 0
|
||||||
case 7: # 100-999 options
|
case 7: # 100-999 options (One Thousand rolls over)
|
||||||
indicatorOffset = -1
|
indicatorOffset = -1
|
||||||
case 9: # 1000-9999 options
|
case 9: # 1000-9999 options (Ten Thousand rolls over)
|
||||||
indicatorOffset = -2
|
indicatorOffset = -2
|
||||||
case 11: # 10000-99999 options
|
case 11: # 10000-99999 options (One Hundred Thousand rolls over)
|
||||||
indicatorOffset = -3
|
indicatorOffset = -3
|
||||||
case 13: # 100000-999999 options
|
case 13: # 100000-999999 options (One Million rolls over)
|
||||||
indicatorOffset = -4
|
indicatorOffset = -4
|
||||||
|
case 15: # 1000000-9999999 options (Ten Million rolls over)
|
||||||
|
indicatorOffset = -5
|
||||||
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}."
|
||||||
|
|
Loading…
Reference in a new issue