Version: 1.02
Autor: eliseeff
Requirements: game version 4.0 or higher
Install: Subscribe to the mod on the Steam Workshop page
Uninstall: Unsubscribe from the mod and delete the mod folder
Savegame compatible: YES
XR VR-edition Steam Workshop page
Changelog:
1.01 - Added support for the legacy menu (Enter - 6 - 2)
1.02 - Fixed missing icons in the VR-version
Introduction:
It just so happened that I needed a setup menu for the three mods. I did not want to add them to the sidebar - it would clutter it up. And I decided to make one common menu for all the options of my mods. This can be used by someone else - I specifically made the addition of options as simple as possible.
Here's what happened as a result (click on images to enlage):
[ external image ] [ external image ]
The menu is called with Enter - 9 - 3 (Enter - 6 - 2 for Legacy menu). Options are scrolled by cursor keys, select - Enter. Also expandable sections are supported.
How to add your own option/options:
1. In your ui.xml file specify addon dependency:
Code: Select all
<dependency name="mo_in_mainmenu" />
2. In your lua file in init function you need to find the menu witn name="Mods_Options_Menu" in Menus table and add your option entry. Approximately so:
Code: Select all
local function init()
Menus = Menus or {}
for _, entry in ipairs(Menus) do
if entry.name == "Mods_Options_Menu" and type(entry.mods_list) == "table" then
table.insert(entry.mods_list, my_option)
break
end
end
end
3.
Code: Select all
my_option = {
name = "My mod name",
-- must be a string with lenght > 0
option = 1,
-- must be 1 or 2: 1 for "Options" or 2 for "Uninstall"
section = "gMain_my_section_name",
-- must be a string with lenght > 5
param = {0, 0}
-- (optional) section param
}
4.
Code: Select all
my_option = {
name = "My mod2 name",
-- still must be a string with lenght > 0
list = {
-- must be a table with at least 1 valid entry
-- entry is valid, if have correct 'option' and 'section' values
{
option = "My mod2 option1",
-- here 'option' must be a string with lenght > 0
section = "gMain_my_mod2_section1",
-- still must be a string with lenght > 5
param = {0, 0}
-- still optional
},
{
option = "My mod2 option2",
section = "gMain_my_mod2_section2",
param = "Hello world"
-- as above
},
{
option = "My mod2 option3",
section = "gMain_my_mod2_section3"
-- as above
}
}
}
I can also provide an archive with two demo mini-mods. The first one adds one option to the menu, the second adds a section with three options. You can download it here.
The mod itself you can download here.
... or subscribe to it in STEAM Workshop.