w00kien00kie
New member
This is a new mod aimed at modders so they can easily add new Custom Game Options to their overhauls without having to write any C# code (well very little anyway). The game options are just added via a standard 7days XML patch file and then the variables can be used in any other Harmony patch (this is the only C# you need to do).
All you need to do to use is download the Compiled mod, add your own <gameoptions .../> xml to the windows.xml and then use the variables anywhere in your Harmony patches.
Compiled Mod
https://gitlab.com/wookienookie/customgameoptionsmod/-/archive/main/customgameoptionsmod-main.zip
Source Code (if you want to poke around the actual code, this is not need to run the mod)
https://gitlab.com/wookienookie/CustomGameOptions
Example of Custom Options in game :

I've included an example windows.xml config patch in /XUi_Menu/windows.xml
NOTE : The 'name' parameter in the <gameoption> xml MUST start with the work 'Custom' otherwise the code will treat it as a normal vanilla gameoption and everything will error!
(Highly advise to set a value for the new xml parameter default_value="" for each <gameoption> you add )

You will need to add Localization as well, ive included a Localisation.txt example but you dont have to use that location for your own text changes.
Note : Localization in <GameOptions/> is a bit odd but not hard, ill write some notes up with examples later.
There is also an example of how to use the variables within your Harmony patches (commented out by default) in the source code :

I have tested this in SP, MP and on a dedicated server BUT this is still a new approach and i am expecting some issues. Please thoroughly test within your own mods/overhauls. Any problems let me know.
This mod is just using standard C# code and supported Harmony patches (i.e. doesnt need BepInEx).
Im sure ive forgotten to add all the notes i needed to so will update this first post as and when i remember what ive missed.
Wookie Nookie
All you need to do to use is download the Compiled mod, add your own <gameoptions .../> xml to the windows.xml and then use the variables anywhere in your Harmony patches.
Compiled Mod
https://gitlab.com/wookienookie/customgameoptionsmod/-/archive/main/customgameoptionsmod-main.zip
Source Code (if you want to poke around the actual code, this is not need to run the mod)
https://gitlab.com/wookienookie/CustomGameOptions
Example of Custom Options in game :

I've included an example windows.xml config patch in /XUi_Menu/windows.xml
NOTE : The 'name' parameter in the <gameoption> xml MUST start with the work 'Custom' otherwise the code will treat it as a normal vanilla gameoption and everything will error!
(Highly advise to set a value for the new xml parameter default_value="" for each <gameoption> you add )

You will need to add Localization as well, ive included a Localisation.txt example but you dont have to use that location for your own text changes.
Note : Localization in <GameOptions/> is a bit odd but not hard, ill write some notes up with examples later.
There is also an example of how to use the variables within your Harmony patches (commented out by default) in the source code :

I have tested this in SP, MP and on a dedicated server BUT this is still a new approach and i am expecting some issues. Please thoroughly test within your own mods/overhauls. Any problems let me know.
This mod is just using standard C# code and supported Harmony patches (i.e. doesnt need BepInEx).
Im sure ive forgotten to add all the notes i needed to so will update this first post as and when i remember what ive missed.
Wookie Nookie
Last edited by a moderator: