Stardew Valley

About this mod

Replaces the standard options tab, adding the function of editing the settings of installed modifications. Provides api for modders.

Requirements
Permissions and credits
Changelogs
How many modifications have you installed?
Installed a modification but the key bindings pre-installed by the developer do not suit you?
Many of the mods you install may have settings that you did not even suspect.

On the mod settings tab, you can change the modification settings in a user-friendly environment, cautioning against making configuration file errors.

It also provides api for modders, which allows you to change the settings of modifications without rebooting.
Integrations with popular modifications will be added with future updates.


Information for modders:

you can learn how to use integration on the wiki  Modder_Guide/APIs/Integrations

An example of how you can get any changes to your settings through the API:

Spoiler:  
Show

using ModSettingsTabApi.Framework.Interfaces;
using ModSettingsTabApi.Events;
public override void Entry(IModHelper helper)
{
helper.Events.GameLoop.GameLaunched += (sender, args) => {
var modSettingsTabApi = Helper.ModRegistry.GetApi<IModTabSettingsApi>("GilarF.ModSettingsTab");
var modTab = modSettingsTabApi?.GetMod(ModManifest.UniqueID);
if (modTab != null)
{
modTab.OptionsChanged += (o, eventArgs) =>
{
//here you can access the changed parameters,
//after the change by the user they are saved after ~ 3 seconds in your config.json
//the easiest way is to read the settings again
YourModConfig = helper.ReadConfig<YourModConfig>();
var oldValue = eventArgs["OptionName(JSON Path)"].oldValue;
var newValue = eventArgs["OptionName(JSON Path)"].NewValue;
};
}
};
};



you can override the type and add a description of your settings (as well as localization to them) by adding "settingsTab.json" to the root of your mod.

to facilitate the consciousness of settings add

"$ schema": "https://raw.githubusercontent.com/GilarF/SVM/develop/ModSettingsTab/schema.json",

at the beginning of your settingsTab.json
 
NOTE: each of your parameters must have a name that matches JSON Path


for example:

Spoiler:  
Show

{
"$schema": "https://raw.githubusercontent.com/GilarF/SVM/develop/ModSettingsTab/schema.json",
"Description": {
"en": "Replaces the standard settings tab",
"zh": "取代標准設定標籤",
"fr": "Remplace l'onglet des paramètres standard",
"de": "Ersetzt die Registerkarte Standardeinstellungen",
"hu": "Kicseréli a normál beállítások fület",
"it": "Sostituisce la scheda delle impostazioni standard",
"ja": "標準設定タブを置き換えます",
"ko": "표준 설정 탭을 대체합니다",
"pt": "Substitui a guia de configurações padrão",
"ru": "Заменяет стандартную вкладку настроек",
"es": "Reemplaza la pestaña de configuración estándar",
"tr": "Standart ayarlar sekmesini değiştirir",
"th": "แทนที่แท็บการตั้งค่ามาตรฐาน"
},
"Config": [
{
"Name": "ShowSavingNotify",
"Description":
{
"en": "Show successful save notifications",
"zh": "顯示成功的保存通知",
"fr": "Afficher les notifications de sauvegarde réussies",
"de": "Erfolgreiche Benachrichtigungen zum Speichern anzeigen",
"hu": "A sikeres mentési értesítések megjelenítése",
"it": "Mostra notifiche di salvataggio riuscite",
"ja": "成功した保存通知を表示する",
"ko": "성공적인 저장 알림 표시",
"pt": "Mostrar notificações de salvamento bem-sucedidas",
"ru": "Показ уведомлений об успешном сохранении",
"es": "Mostrar notificaciones de guardado exitosas",
"tr": "Başarılı kaydet bildirimlerini göster",
"th": "แสดงการแจ้งเตือนบันทึกที่ประสบความสำเร็จ"
},
"Type": "CheckBox",
"Label": {
"en": "Show successful save notifications",
"zh": "顯示成功的保存通知",
"fr": "Afficher les notifications de sauvegarde réussies",
"de": "Erfolgreiche Benachrichtigungen zum Speichern anzeigen",
"hu": "A sikeres mentési értesítések megjelenítése",
"it": "Mostra notifiche di salvataggio riuscite",
"ja": "成功した保存通知を表示する",
"ko": "성공적인 저장 알림 표시",
"pt": "Mostrar notificações de salvamento bem-sucedidas",
"ru": "Показ уведомлений об успешном сохранении",
"es": "Mostrar notificaciones de guardado exitosas",
"tr": "Başarılı kaydet bildirimlerini göster",
"th": "แสดงการแจ้งเตือนบันทึกที่ประสบความสำเร็จ"
}
},
{
"Name": "ShowReloadIcon",
"Description":
{
"en": "Shows an icon when a reboot is needed.",
"zh": "需要重啟時顯示圖標。",
"fr": "Affiche une icône lorsqu'un redémarrage est nécessaire.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist.",
"hu": "Ikonot jelenít meg, amikor újraindításra van szükség.",
"it": "Mostra un'icona quando è necessario un riavvio.",
"ja": "再起動が必要なときにアイコンを表示します。",
"ko": "재부팅이 필요할 때 아이콘을 표시합니다.",
"pt": "Mostra um ícone quando uma reinicialização é necessária.",
"ru": "Показывает иконку когда нужна перезагрузка",
"es": "Muestra un icono cuando se necesita reiniciar.",
"tr": "Yeniden başlatma gerektiğinde bir simge gösterir.",
"th": "แสดงไอคอนเมื่อจำเป็นต้องรีบูต"
},
"Type": "CheckBox",
"Label": {
"en": "Shows an icon when a reboot is needed.",
"zh": "需要重啟時顯示圖標。",
"fr": "Affiche une icône lorsqu'un redémarrage est nécessaire.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist.",
"hu": "Ikonot jelenít meg, amikor újraindításra van szükség.",
"it": "Mostra un'icona quando è necessario un riavvio.",
"ja": "再起動が必要なときにアイコンを表示します。",
"ko": "재부팅이 필요할 때 아이콘을 표시합니다.",
"pt": "Mostra um ícone quando uma reinicialização é necessária.",
"ru": "Показывает иконку когда нужна перезагрузка",
"es": "Muestra un icono cuando se necesita reiniciar.",
"tr": "Yeniden başlatma gerektiğinde bir simge gösterir.",
"th": "แสดงไอคอนเมื่อจำเป็นต้องรีบูต"
}
}
]
}


you can skip most options and translations.
currently available options are:
Spoiler:  
Show

DropDown


recommended when you want to provide a choice of several options (no more than seven)


Spoiler:  
Show

//  config.json
{
"Options":
{
"Name": "VALUE"
}
}
//  settingsTab.json
{
"Config":
{
"Name": "Options.Name",
"Description": 
{
"en": "Shows an icon when a reboot is needed.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist."
},
"Type": "DropDown",
"Label": {
"en": "some label"
},
"DropDownOptions": //<< must include all possible values
[
"VALUE",
"VALUE2"
]
}
}



PlusMinus


recommended if you want to provide a choice of several options


Spoiler:  
Show

//  config.json
{
"Options":
{
"Name": "VALUE"
}
}
//  settingsTab.json
{
"Config":
{
"Name": "Options.Name",
"Description": 
{
"en": "Shows an icon when a reboot is needed.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist."
},
"Type": "DropDown",
"Label": {
"en": "some label"
},
"PlusMinusOptions": //<< must include all possible values
[
"VALUE",
"VALUE2"
]
}
}


List


recommended when you have an array of values


Spoiler:  
Show

//config.json
{
"Options":
{
"Name": ["VALUE","VALUE2"]
}
}
//settingsTab.json
{
"Config":
{
"Name": "Options.Name",
"Description": 
{
"en": "Shows an icon when a reboot is needed.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist."
},
"Type": "List",
 "Label": {
"en": "some label"
}
}
}


InputListener


recommended when you have a button like "SButton"

Spoiler:  
Show

//config.json
{
"Options":
{
"Name": "OemTilde"
}
}
//settingsTab.json
{
"Config":
{
"Name": "Options.Name",
"Description": 
{
"en": "Shows an icon when a reboot is needed.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist."
},
"Type": "InputListener",
 "Label": {
"en": "some label"
}
}
}


Slider


recommended when you have a numerical value in a certain range

Spoiler:  
Show

//config.json
{
"Options":
{
"VALUE": 5
}
}
//settingsTab.json
{
"Config":
{
"Name": "Options.VALUE",
"Description": 
{
"en": "Shows an icon when a reboot is needed.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist."
},
"Type": "Slider",
 "Label": {
"en": "some label"
},
"SliderMaxValue" : 100,
"SliderMinValue" : 0,
"SliderStep":1
}
}


TextBox


suitable for most type values

Spoiler:  
Show

//config.json
{
"Options":
{
"VALUE": 5
}
}
//settingsTab.json
{
"Config":
{
"Name": "Options.VALUE",
"Description": 
{
"en": "Shows an icon when a reboot is needed.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist."
},
"Type": "TextBox",
 "Label": {
"en": "some label"
},
"TextBoxNumbersOnly" : false,
"TextBoxFloatOnly" : false
}
}


CheckBox


simple CheckBox

Spoiler:  
Show

//config.json
{
"Options":
{
"VALUE": true
}
}
//settingsTab.json
{
"Config":
{
"Name": "Options.VALUE",
"Description": 
{
"en": "Shows an icon when a reboot is needed.",
"de": "Zeigt ein Symbol an, wenn ein Neustart erforderlich ist."
},
"Type": "CheckBox",
"Label": {
"en": "some label"
}
}
}



source code available on github