If you have VSCode (maybe another text editors will do it as well), you can convert your options widgets relatively fast. This instruction works only for old widget definition style (["field"] = value):
-
Read README file of options mod example (and probably examine
_dataand_localizationfiles) to understand how new options definition system works. -
Move all localizable fields to localization file (
text,title,tooltip,unit_text) -
Convert
show_widget_conditionfields toshow_widgetsof parent dropdown's options. -
Now you need to open "replace" tool (
Ctrl+H) with regular expressions activated. Next steps will represent pairs of "replace" tool's textboxes. -
Remove
mod:localizeoccurrences, if you have any:
mod:localize\((".+?")\)
$1
- Remove unused fields
show_widget_conditionandtext
.*\["show_widget_condition"\].*\n
<NOTHING>
.*\["text"\].*\n
<NOTHING>
- Replace widget fields' names that were changed:
\["setting_name"\]
["setting_id"]
\["widget_type"\]
["type"]
\["action"\]
["function_name"]
- Completely remove ["this_type_of"] formatting for all fields:
([\t\s])\["([^\s]+)"\]
$1$2
- Add necessary fields for all keybinds
([\s\t]*)type[\s\t]*=[\s\t]*"keybind",
$1type = "keybind",\n$1keybind_trigger = "pressed",\n$1keybind_type = "function_call",