Skip to content

Commit bd8ec56

Browse files
authored
Merge pull request #9 from apple1417/master
fix not setting `.mod` on grouped/nested option children
2 parents d37570b + 5beedc3 commit bd8ec56

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ game specific things:
1919

2020
# Changelog
2121

22+
### v1.8
23+
- Fixed that nested and grouped options' children would not get their `.mod` attribute set.
24+
2225
### v1.7
2326
- The "Update Available" notification should now immediately go away upon updating, instead of
2427
waiting a day for the next check.

__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .dot_sdkmod import open_in_mod_dir
99

1010
# Need to define a few things first to avoid circular imports
11-
__version_info__: tuple[int, int] = (1, 7)
11+
__version_info__: tuple[int, int] = (1, 8)
1212
__version__: str = f"{__version_info__[0]}.{__version_info__[1]}"
1313
__author__: str = "bl-sdk"
1414

mod.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,16 @@ def __post_init__(self) -> None: # noqa: C901 - difficult to split up
200200
case _:
201201
pass
202202

203-
for option in self.options:
204-
option.mod = self
205-
206203
self.enabling_locked = Game.get_current() not in self.supported_games
207204

205+
def associate_options(options: Sequence[BaseOption]) -> None:
206+
for option in options:
207+
if isinstance(option, GroupedOption | NestedOption):
208+
associate_options(option.children)
209+
option.mod = self
210+
211+
associate_options(self.options)
212+
208213
def enable(self) -> None:
209214
"""Called to enable the mod."""
210215
if self.enabling_locked:

0 commit comments

Comments
 (0)