Allows modders to expose their mod's options/parameters via a generic presentation "MOD option" accessible from "Camp" menu.
The basic presentation is adapted from rubik's Custom Commander which is a toy-store of excellent features.
mod_options = [
# sample checkbox to switch the in-game cheat mode. Comment out this if you don't want it.
( "op_cheatmode", xgm_ov_checkbox , [],
"Enable cheat mode:", 0,
"This sets the in-game cheat mode", 0,
[ # initialization block (set value in reg1)
(assign, reg1, "$cheat_mode"),
],
[ # update block (value is in reg1)
(assign, "$cheat_mode", reg1),
],
),
( "op_line_cc_battle_minimap", xgm_ov_line ),
# checkbox for minimap
( "op_cc_show_battle_minimap", xgm_ov_checkbox , [],
"Show battle minimap:", 0,
"This sets whether the minimap will always be shown during battle.", 0,
[ # initialization block (set value in reg1)
(try_begin),
(gt, "$g_show_minimap", 1),
(assign, "$g_show_minimap", 1),
(else_try),
(ge, 0, "$g_show_minimap"),
(assign, "$g_show_minimap", 0),
(try_end),
(assign, reg1, "$g_show_minimap"),
],
[ # update block (value is in reg1)
(assign, "$g_show_minimap", reg1),
],
"cc", # custom commander page
),
# number box for minimap size
( "op_cc_battle_minimap_size", xgm_ov_numberbox , [cc_minimap_min_ratio, cc_minimap_max_ratio + 1],
"Size of battle minimap (%):", 0,
"This percentage modifies the size of battle minimap", 0,
[ # initialization block (set value in reg1)
(try_begin),
(gt, "$g_minimap_ratio", cc_minimap_max_ratio),
(assign, "$g_minimap_ratio", cc_minimap_max_ratio ),
(else_try),
(gt, cc_minimap_min_ratio, "$g_minimap_ratio"),
(assign, "$g_minimap_ratio", cc_minimap_min_ratio),
(try_end),
(assign, reg1, "$g_minimap_ratio"),
],
[ # update block (value is in reg1)
(assign, "$g_minimap_ratio", reg1),
],
"cc", # custom commander page
),
] # mod_options
The width of the pane/size of controls etc can be adjusted via xgm_mod_options_header.py for advanced users.
The space on the right is intended for selecting option pages in the future (categorize options into pages)