2022-05-17 00:48:22 +01:00
|
|
|
|
|
|
|
init offset = -1
|
|
|
|
|
|
|
|
screen mods():
|
2025-01-08 17:21:06 +00:00
|
|
|
default selection = next(iter(mods_list.keys()))
|
|
|
|
default mods_enabled_now = set(persistent.mods_enabled)
|
|
|
|
$ awaits_restart = bool(mods_enabled_now != persistent.mods_enabled)
|
|
|
|
|
|
|
|
frame style "navigation_page_left":
|
|
|
|
vbox:
|
|
|
|
label _("Mods")
|
|
|
|
|
|
|
|
viewport:
|
|
|
|
ypos 32
|
|
|
|
scrollbars "vertical"
|
|
|
|
mousewheel True
|
|
|
|
draggable "touch"
|
|
|
|
ymaximum 400
|
2025-01-08 17:54:32 +00:00
|
|
|
xmaximum 325
|
2025-01-08 17:21:06 +00:00
|
|
|
vbox:
|
|
|
|
for mod in mods_list.values():
|
|
|
|
$ name = mod["Name"]
|
|
|
|
$ desc = mod["Description"]
|
|
|
|
$ author = mod["Author"]
|
|
|
|
$ version = mod["Version"]
|
|
|
|
$ compat = version_float(mod["GameVer"])
|
|
|
|
#$ order = mod["LoadOrder"]
|
|
|
|
$ logo = mod["Logo"]
|
|
|
|
$ enabled = bool(name in persistent.mods_enabled)
|
|
|
|
$ selected = (name == selection)
|
|
|
|
|
|
|
|
if selected:
|
|
|
|
$ action = ToggleMod(name)
|
|
|
|
else:
|
|
|
|
$ action = SetLocalVariable("selection", name)
|
|
|
|
|
|
|
|
fixed:
|
|
|
|
fit_first True
|
2025-01-08 17:54:32 +00:00
|
|
|
if selected:
|
|
|
|
add "navigation_selected_background" ysize 58
|
2025-01-08 17:21:06 +00:00
|
|
|
button:
|
|
|
|
style "navigation_checkbox_button"
|
|
|
|
hbox:
|
|
|
|
xpos 29
|
|
|
|
add logo xysize (70, 50)
|
|
|
|
null width 5
|
|
|
|
vbox:
|
|
|
|
yalign 0.5
|
|
|
|
text "[name]":
|
|
|
|
if not compat >= mods_compatible:
|
|
|
|
color "#ff8000"
|
2025-01-08 17:54:32 +00:00
|
|
|
size 14
|
|
|
|
text "[version]" size 14
|
2025-01-08 17:21:06 +00:00
|
|
|
action action
|
|
|
|
selected enabled
|
|
|
|
add "frame_spacer_book" xalign 0.5 xsize 300
|
|
|
|
|
|
|
|
frame style "navigation_page_right":
|
|
|
|
$ name = mods_list[selection]["Name"]
|
|
|
|
$ desc = mods_list[selection]["Description"]
|
|
|
|
$ author = mods_list[selection]["Author"]
|
|
|
|
$ version = mods_list[selection]["Version"]
|
|
|
|
$ compat = version_float(mods_list[selection]["GameVer"])
|
|
|
|
#$ order = mods_list[selection]["LoadOrder"]
|
|
|
|
$ logo = mods_list[selection]["Logo"]
|
|
|
|
vbox:
|
|
|
|
xmaximum 300
|
|
|
|
add logo xalign 0.5 size (320, 240)
|
|
|
|
text "[name]\n[version]" offset (6, 6)
|
|
|
|
|
|
|
|
if not compat >= mods_compatible:
|
|
|
|
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}"
|
|
|
|
text "Description:\n{size=-4}[desc]{/size}"
|