2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
init offset = -1
|
|
|
|
|
|
|
|
screen mods():
|
|
|
|
tag menu
|
|
|
|
|
|
|
|
use game_menu("Mods"):
|
|
|
|
|
2022-09-29 21:19:55 +00:00
|
|
|
default selection = next(iter(mods_list.keys()))
|
2022-05-16 23:48:22 +00:00
|
|
|
default checkbox_enabled = gui.theme("check_true")
|
|
|
|
default checkbox_disabled = gui.theme("check_false")
|
2023-03-07 19:29:29 +00:00
|
|
|
default mods_enabled_now = set(persistent.mods_enabled)
|
|
|
|
$ awaits_restart = bool(mods_enabled_now != persistent.mods_enabled)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
fixed:
|
|
|
|
|
|
|
|
## The grid of file slots.
|
|
|
|
hbox:
|
|
|
|
spacing 5
|
2023-03-07 19:29:29 +00:00
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
vpgrid:
|
|
|
|
cols 1
|
|
|
|
scrollbars "vertical"
|
|
|
|
mousewheel True
|
|
|
|
draggable True
|
|
|
|
pagekeys True
|
|
|
|
side_yfill True
|
|
|
|
spacing gui.slot_spacing
|
|
|
|
|
|
|
|
style_prefix gui.theme("slot")
|
|
|
|
|
2022-09-29 21:19:55 +00:00
|
|
|
for mod in mods_list.values():
|
2022-05-16 23:48:22 +00:00
|
|
|
$ name = mod["Name"]
|
|
|
|
$ desc = mod["Description"]
|
|
|
|
$ author = mod["Author"]
|
|
|
|
$ version = mod["Version"]
|
2023-07-15 17:02:01 +00:00
|
|
|
$ compat = version_float(mod["GameVer"])
|
2022-05-16 23:48:22 +00:00
|
|
|
#$ order = mod["LoadOrder"]
|
|
|
|
$ logo = mod["Logo"]
|
|
|
|
$ enabled = bool(name in persistent.mods_enabled)
|
|
|
|
$ selected = (name == selection)
|
|
|
|
|
2023-03-07 19:29:29 +00:00
|
|
|
|
2022-05-16 23:48:22 +00:00
|
|
|
if selected:
|
2023-03-07 19:29:29 +00:00
|
|
|
$ action = ToggleMod(name)
|
2022-05-16 23:48:22 +00:00
|
|
|
else:
|
|
|
|
$ action = SetScreenVariable("selection", name)
|
|
|
|
|
|
|
|
button:
|
|
|
|
action action
|
|
|
|
selected selected
|
|
|
|
sensitive main_menu
|
|
|
|
|
|
|
|
has fixed
|
|
|
|
|
|
|
|
add logo pos (0, 0) size (70, 50)
|
|
|
|
|
|
|
|
vbox:
|
|
|
|
xpos config.thumbnail_width
|
|
|
|
xsize gui.slot_width - config.thumbnail_width - gui.slot_height
|
|
|
|
yalign 0.5
|
|
|
|
|
|
|
|
text "[name]":
|
|
|
|
style "mods_text"
|
|
|
|
size 16
|
2023-07-19 16:49:51 +00:00
|
|
|
if not compat >= mods_compatible:
|
2022-05-16 23:48:22 +00:00
|
|
|
color "#ff8000"
|
|
|
|
|
|
|
|
text "[version]":
|
|
|
|
style "mods_text"
|
|
|
|
|
|
|
|
if enabled:
|
|
|
|
add checkbox_enabled align (0.95, 0.5)
|
|
|
|
else:
|
|
|
|
add checkbox_disabled align (0.95, 0.5)
|
|
|
|
|
2023-03-07 19:29:29 +00:00
|
|
|
if awaits_restart:
|
|
|
|
text "Awaiting game restart to apply changes..."
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
frame:
|
|
|
|
style gui.theme("frame")
|
|
|
|
xfill True
|
|
|
|
ymaximum 400
|
|
|
|
|
|
|
|
$ name = mods_list[selection]["Name"]
|
|
|
|
$ desc = mods_list[selection]["Description"]
|
|
|
|
$ author = mods_list[selection]["Author"]
|
|
|
|
$ version = mods_list[selection]["Version"]
|
2023-07-15 17:02:01 +00:00
|
|
|
$ compat = version_float(mods_list[selection]["GameVer"])
|
2022-05-16 23:48:22 +00:00
|
|
|
#$ order = mods_list[selection]["LoadOrder"]
|
|
|
|
$ logo = mods_list[selection]["Logo"]
|
|
|
|
|
|
|
|
vbox:
|
|
|
|
spacing 3
|
|
|
|
xpos 3
|
|
|
|
|
|
|
|
frame:
|
|
|
|
style gui.theme("frame")
|
|
|
|
xoffset -3
|
|
|
|
ysize 252
|
|
|
|
add logo xalign 0.5 size (320, 240)
|
|
|
|
text "[name]\n[version]" offset (6, 6)
|
|
|
|
|
2023-07-19 16:49:51 +00:00
|
|
|
if not compat >= mods_compatible:
|
2022-05-16 23:48:22 +00:00
|
|
|
text "{color=#ff8000}[compat]{/color}" align (1.0, 1.0) offset (-6, -3)
|
|
|
|
else:
|
|
|
|
text "{color=#228B22}[compat]{/color}" align (1.0, 1.0) offset (-6, -3)
|
|
|
|
|
|
|
|
text "Author:\n{size=-4}[author]{/size}" size 14
|
|
|
|
text "Description:\n{size=-4}[desc]{/size}" size 14
|
|
|
|
|
|
|
|
style mods_text is slot_button_text:
|
|
|
|
selected_color "#000"
|
|
|
|
|
|
|
|
style mods_text_desc:
|
|
|
|
xalign 0.5
|