Compare commits

...

2 Commits

Author SHA1 Message Date
fb5fe8e977 Bug fix
* Fixed regression introduced by #52b9c50c7bcfe549d9b45f91b1098710d8c72250
2023-03-07 19:30:15 +00:00
7819207253 Mods loader
* Simplified and improved mods loading process by utilising the newly added include_module method
* Added sanity checks for mods toggles
* Added scripts list to mods list dict
* Added ToggleMod action
* Require restart to load mods
* Fixed mods not loading at certain times
2023-03-07 19:29:29 +00:00
3 changed files with 67 additions and 154 deletions

View File

@ -168,7 +168,7 @@ init python:
except IndexError:
print(f"Missing textures:\n{self.__repr__()}")
return Text(f"TexErr\n{{color=#00ffff}}{{size=-6}}ID:{self.id}{{/size}}{{/color}}", color="#ff0000")
sprites.extend(self.char.body.build_image(self.char.body._hash, matrix=matrix))
sprites.sort(key=itemgetter(2))
wmax, hmax = self.sizes

View File

@ -9,12 +9,15 @@ screen mods():
default selection = next(iter(mods_list.keys()))
default checkbox_enabled = gui.theme("check_true")
default checkbox_disabled = gui.theme("check_false")
default mods_enabled_now = set(persistent.mods_enabled)
$ awaits_restart = bool(mods_enabled_now != persistent.mods_enabled)
fixed:
## The grid of file slots.
hbox:
spacing 5
vpgrid:
cols 1
scrollbars "vertical"
@ -37,8 +40,9 @@ screen mods():
$ enabled = bool(name in persistent.mods_enabled)
$ selected = (name == selection)
if selected:
$ action = Function(toggle_mod, name)
$ action = ToggleMod(name)
else:
$ action = SetScreenVariable("selection", name)
@ -70,6 +74,8 @@ screen mods():
else:
add checkbox_disabled align (0.95, 0.5)
if awaits_restart:
text "Awaiting game restart to apply changes..."
frame:
style gui.theme("frame")

File diff suppressed because it is too large Load Diff