Skip to content

Commit

Permalink
remove keybind option warnings
Browse files Browse the repository at this point in the history
there are valid reasons to put a non-keybind keybind option in the options list
  • Loading branch information
apple1417 committed Jan 7, 2024
1 parent 9046f7d commit 4f2e17c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
13 changes: 0 additions & 13 deletions src/mods_base/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ def load_options_dict(options: Sequence[BaseOption], settings: MutableMapping[st
f" with the default",
)
case KeybindOption():
logging.dev_warning(
f"Found a keybind option '{option.identifier}' in the options list. You should"
f" define a standard keybind instead, and only convert it into an option in"
f" `iter_display_options` (which is the default behaviour).",
)

if value is None:
option.value = None
else:
Expand Down Expand Up @@ -153,13 +147,6 @@ def create_options_dict(options: Sequence[BaseOption]) -> dict[str, JSON]:
for option in options:
match option:
case ValueOption():
if isinstance(option, KeybindOption):
logging.dev_warning(
f"Found a keybind option '{option.identifier}' in the options list. You"
f" should define a standard keybind instead, and only convert it into an"
f" option in `iter_display_options` (which is the default behaviour).",
)

# The generics mean the type of value is technically unknown here
value = cast(JSON, option.value) # type: ignore
settings[option.identifier] = value
Expand Down
3 changes: 2 additions & 1 deletion src/settings/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.json
*
!.gitignore

0 comments on commit 4f2e17c

Please sign in to comment.