-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
After setting up an SMAPI mod there are a few quick steps to adding your mod to the Mod Config tab.
First, we need to allow your project to reference the necessary classes. There are 2 methods:
NOTE: These images are of the Mac client, although Windows has a similar process.
The NuGet package makes it quick and easy to add the framework in Visual Studio.
1. Open the project Solution in Visual Studio
2. Right click the References option in the Solution Explorer, usually on the left side, and select Edit References.

3. Select the .Net Assembly tab and browse for the downloaded StardewConfigFramework.dll. Download here. Ensure the assembly file is selected with a check by the name.

4. That's it! Hit OK, and you now have a reference to the Framework.
For the Framework to be accessed it must be loaded before your mod, to ensure this, we will add StardewConfigFramework as a dependency. Add the following lines to your manifest.json file.
"Dependencies": [
{ "UniqueID": "Juice805.StardewConfigMenu" }
]For Example, your manifest may look like this:
{
"Name": "Framework Example",
"Authour": "Juice805",
"Version": {
"MajorVersion": 1,
"MinorVersion": 0,
"PatchVersion": 0,
"Build": ""
},
"Description": "A short description of your app.",
"UniqueID": "You.ModID",
"EntryDll": "Example.dll",
"Dependencies": [
{ "UniqueID": "Juice805.StardewConfigMenu" }
]
}Congratulations! You have setup your project and are ready to do some actual work. To begin we will modify your ModEntry class by adding a few lines; if you used the SMAPI template your file will look similar to the following.
using System;
using Microsoft.Xna.Framework;
using StardewModdingAPI;
using StardewModdingAPI.Events;
using StardewValley;
using StardewConfigFramework; // Add the framework
namespace YourMod
{
public class ModEntry: Mod
{
internal static ModOptions Options; // Static property for easy access
/*********
** Public methods
*********/
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
/// <param name="helper">Provides simplified APIs for writing mods.</param>
public override void Entry(IModHelper helper)
{
var Settings = IModSettingsFramework.Instance; // Access the menu shared instance
ModEntry.Options = new ModOptions(this); // Create a ModOptions object
Settings.AddModOptions(ModEntry.Options); // Add it to the menu
// Your Code goes here
}
}
}That's it! Your mod has a options menu! Check out other pages on the Wiki for detailed instructions on how to use the ModOptions object and each option individually