mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
[OriginShift] Initial Fuckup
This commit is contained in:
parent
14ab184db7
commit
2375678a59
33 changed files with 2107 additions and 29 deletions
41
OriginShift/ModSettings.cs
Normal file
41
OriginShift/ModSettings.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
using MelonLoader;
|
||||
|
||||
namespace NAK.OriginShift;
|
||||
|
||||
internal static class ModSettings
|
||||
{
|
||||
#region Constants
|
||||
|
||||
internal const string ModName = nameof(OriginShift);
|
||||
internal const string OSM_SettingsCategory = "Origin Shift Mod";
|
||||
|
||||
#endregion Constants
|
||||
|
||||
#region Melon Preferences
|
||||
|
||||
private static readonly MelonPreferences_Category Category =
|
||||
MelonPreferences.CreateCategory(ModName);
|
||||
|
||||
internal static readonly MelonPreferences_Entry<bool> EntryCompatibilityMode =
|
||||
Category.CreateEntry("EntryCompatibilityMode", true,
|
||||
"Compatibility Mode", description: "Origin Shifts locally, but modifies outbound network messages to be compatible with non-Origin Shifted clients.");
|
||||
|
||||
#endregion Melon Preferences
|
||||
|
||||
#region Settings Managment
|
||||
|
||||
internal static void Initialize()
|
||||
{
|
||||
foreach (MelonPreferences_Entry setting in Category.Entries)
|
||||
setting.OnEntryValueChangedUntyped.Subscribe(OnSettingsChanged);
|
||||
|
||||
OnSettingsChanged();
|
||||
}
|
||||
|
||||
private static void OnSettingsChanged(object oldValue = null, object newValue = null)
|
||||
{
|
||||
OriginShiftManager.CompatibilityMode = EntryCompatibilityMode.Value;
|
||||
}
|
||||
|
||||
#endregion Settings Managment
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue