

using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppScheduleOne.DevUtilities;
using Il2CppScheduleOne.PlayerScripts;
using Il2CppScheduleOne.UI;
using Il2CppScheduleOne.UI.Stations;
using Il2CppSystem.Collections.Generic;
using ItemSlotColorChanger;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using ModManagerPhoneApp;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "Item Slot Color Changer", "1.0.0", "Delassa", null)]
[assembly: MelonColor(1, 255, 0, 0)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: MelonOptionalDependencies(new string[] { "ModManager&PhoneApp" })]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ItemSlotColorChanger-IL2CPP")]
[assembly: AssemblyConfiguration("Release IL2CPP")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+bc3ba3b2c21d7631c4c46856803e25e41ab5393b")]
[assembly: AssemblyProduct("ItemSlotColorChanger-IL2CPP")]
[assembly: AssemblyTitle("ItemSlotColorChanger-IL2CPP")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ItemSlotColorChanger
{
public static class BuildInfo
{
public const string Name = "Item Slot Color Changer";
public const string Description = "Changes the background and highlight colors of item slots for better visibility.";
public const string Author = "Delassa";
public const string Version = "1.0.0";
}
public class Core : MelonMod
{
private bool _colorsModified = false;
private bool _modManagerFound = false;
private bool _mainSceneLoaded = false;
private static MelonPreferences_Category _category;
private static MelonPreferences_Entry<Color> _hotbarColorPref;
private static MelonPreferences_Entry<Color> _hotbarHighlightColorPref;
private static MelonPreferences_Entry<Color> _storageColorPref;
private static MelonPreferences_Entry<Color> _machineColorPref;
public override void OnInitializeMelon()
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
_category = MelonPreferences.CreateCategory("ItemSlotColorChanger_Colors", "Color Settings");
_hotbarColorPref = _category.CreateEntry<Color>("HotbarColor", new Color(0.392f, 0.392f, 0.392f, 0.392f), "Hotbar Slot Color", (string)null, false, false, (ValueValidator)null, (string)null);
_hotbarHighlightColorPref = _category.CreateEntry<Color>("HotbarHighlightColor", new Color(1f, 1f, 1f, 0.5f), "Hotbar Slot Highlight Color", (string)null, false, false, (ValueValidator)null, (string)null);
_storageColorPref = _category.CreateEntry<Color>("StorageColor", new Color(0.392f, 0.392f, 0.392f, 0.392f), "Storage Slot Color", (string)null, false, false, (ValueValidator)null, (string)null);
_machineColorPref = _category.CreateEntry<Color>("MachineColor", new Color(0.392f, 0.392f, 0.392f, 0.392f), "Machine Slot Color", (string)null, false, false, (ValueValidator)null, (string)null);
_colorsModified = true;
_modManagerFound = MelonBase.RegisteredMelons.Any((MelonBase mod) => ((mod != null) ? mod.Info.Name : null) == "Mod Manager & Phone App");
if (_modManagerFound)
{
MelonLogger.Msg(ConsoleColor.DarkCyan, "Mod Manager found. Attempting event subscription...");
SubscribeToModManagerEvents();
}
else
{
MelonLogger.Warning("Mod Manager not found. Skipping event subscription.");
}
}
public override void OnSceneWasInitialized(int buildIndex, string sceneName)
{
_mainSceneLoaded = sceneName == "Main";
}
public override void OnUpdate()
{
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_025a: Unknown result type (might be due to invalid IL or missing references)
//IL_0274: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_022a: Unknown result type (might be due to invalid IL or missing references)
//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
//IL_030b: Unknown result type (might be due to invalid IL or missing references)
if (!_mainSceneLoaded)
{
_colorsModified = true;
}
if (Singleton<StorageMenu>.InstanceExists && Singleton<StorageMenu>.instance.IsOpen)
{
foreach (ItemSlotUI item in (Il2CppArrayBase<ItemSlotUI>)(object)Singleton<StorageMenu>.Instance.SlotsUIs)
{
item.SetNormalColor(_storageColorPref.Value);
}
}
if (PlayerSingleton<PlayerInventory>.InstanceExists && PlayerSingleton<PlayerInventory>.Instance.HotbarEnabled && _colorsModified)
{
Enumerator<ItemSlotUI> enumerator2 = PlayerSingleton<PlayerInventory>.Instance.slotUIs.GetEnumerator();
while (enumerator2.MoveNext())
{
ItemSlotUI current2 = enumerator2.Current;
current2.SetNormalColor(_hotbarColorPref.Value);
current2.SetHighlightColor(_hotbarHighlightColorPref.Value);
}
_colorsModified = false;
}
if (Singleton<PackagingStationCanvas>.InstanceExists)
{
Singleton<PackagingStationCanvas>.instance.PackagingSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<PackagingStationCanvas>.instance.ProductSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<PackagingStationCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
}
if (Singleton<MixingStationCanvas>.InstanceExists)
{
Singleton<MixingStationCanvas>.instance.ProductSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<MixingStationCanvas>.instance.IngredientSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<MixingStationCanvas>.instance.PreviewSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<MixingStationCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
}
if (Singleton<CauldronCanvas>.InstanceExists)
{
Singleton<CauldronCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<CauldronCanvas>.instance.LiquidSlotUI.SetNormalColor(_machineColorPref.Value);
Enumerator<ItemSlotUI> enumerator3 = Singleton<CauldronCanvas>.instance.IngredientSlotUIs.GetEnumerator();
while (enumerator3.MoveNext())
{
ItemSlotUI current3 = enumerator3.Current;
current3.SetNormalColor(_machineColorPref.Value);
}
}
if (Singleton<DryingRackCanvas>.InstanceExists)
{
Singleton<DryingRackCanvas>.instance.InputSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<DryingRackCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
}
if (Singleton<LabOvenCanvas>.InstanceExists)
{
Singleton<LabOvenCanvas>.instance.IngredientSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<LabOvenCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
}
if (!Singleton<ChemistryStationCanvas>.InstanceExists)
{
return;
}
Singleton<ChemistryStationCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
foreach (ItemSlotUI item2 in (Il2CppArrayBase<ItemSlotUI>)(object)Singleton<ChemistryStationCanvas>.instance.InputSlotUIs)
{
item2.SetNormalColor(_machineColorPref.Value);
}
}
public override void OnDeinitializeMelon()
{
UnsubscribeFromModManagerEvents();
}
private void SubscribeToModManagerEvents()
{
try
{
ModSettingsEvents.OnPhonePreferencesSaved += HandleSettingsUpdate;
MelonLogger.Msg(ConsoleColor.DarkCyan, "Subscribed to OnPhonePreferencesSaved event.");
}
catch (Exception value)
{
MelonLogger.Error($"Failed to subscribe to OnPhonePreferencesSaved: {value}");
}
try
{
ModSettingsEvents.OnMenuPreferencesSaved += HandleSettingsUpdate;
MelonLogger.Msg(ConsoleColor.DarkCyan, "Subscribed to OnMenuPreferencesSaved event.");
}
catch (Exception value2)
{
MelonLogger.Error($"Failed to subscribe to OnPhonePreferencesSaved: {value2}");
}
}
private void UnsubscribeFromModManagerEvents()
{
try
{
ModSettingsEvents.OnPhonePreferencesSaved -= HandleSettingsUpdate;
MelonLogger.Msg(ConsoleColor.DarkCyan, "Unsubscribed from OnPhonePreferencesSaved event.");
}
catch (Exception value)
{
MelonLogger.Error($"Failed to unsubscribe from OnPhonePreferencesSaved: {value}");
}
try
{
ModSettingsEvents.OnMenuPreferencesSaved -= HandleSettingsUpdate;
MelonLogger.Msg(ConsoleColor.DarkCyan, "Unsubscribed from OnMenuPreferencesSaved event.");
}
catch (Exception value2)
{
MelonLogger.Error($"Failed to unsubscribe from OnMenuPreferencesSaved: {value2}");
}
}
private void HandleSettingsUpdate()
{
_hotbarColorPref = _category.GetEntry<Color>("HotbarColor");
_hotbarHighlightColorPref = _category.GetEntry<Color>("HotbarHighlightColor");
_storageColorPref = _category.GetEntry<Color>("StorageColor");
_machineColorPref = _category.GetEntry<Color>("MachineColor");
_colorsModified = true;
}
}
}
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using ItemSlotColorChanger;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using ModManagerPhoneApp;
using ScheduleOne.DevUtilities;
using ScheduleOne.PlayerScripts;
using ScheduleOne.UI;
using ScheduleOne.UI.Stations;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "Item Slot Color Changer", "1.0.0", "Delassa", null)]
[assembly: MelonColor(1, 255, 0, 0)]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: MelonOptionalDependencies(new string[] { "ModManager&PhoneApp" })]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ItemSlotColorChanger-Mono")]
[assembly: AssemblyConfiguration("Release Mono")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e99b33e0da577e86b6eabecff5c60c7856b5798a")]
[assembly: AssemblyProduct("ItemSlotColorChanger-Mono")]
[assembly: AssemblyTitle("ItemSlotColorChanger-Mono")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ItemSlotColorChanger
{
public static class BuildInfo
{
public const string Name = "Item Slot Color Changer";
public const string Description = "Changes the background and highlight colors of item slots for better visibility.";
public const string Author = "Delassa";
public const string Version = "1.0.0";
}
public class Core : MelonMod
{
private bool _colorsModified = false;
private bool _modManagerFound = false;
private bool _mainSceneLoaded = false;
private static MelonPreferences_Category _category;
private static MelonPreferences_Entry<Color> _hotbarColorPref;
private static MelonPreferences_Entry<Color> _hotbarHighlightColorPref;
private static MelonPreferences_Entry<Color> _storageColorPref;
private static MelonPreferences_Entry<Color> _machineColorPref;
public override void OnInitializeMelon()
{
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
_category = MelonPreferences.CreateCategory("ItemSlotColorChanger_Colors", "Color Settings");
_hotbarColorPref = _category.CreateEntry<Color>("HotbarColor", new Color(0.392f, 0.392f, 0.392f, 0.392f), "Hotbar Slot Color", (string)null, false, false, (ValueValidator)null, (string)null);
_hotbarHighlightColorPref = _category.CreateEntry<Color>("HotbarHighlightColor", new Color(1f, 1f, 1f, 0.5f), "Hotbar Slot Highlight Color", (string)null, false, false, (ValueValidator)null, (string)null);
_storageColorPref = _category.CreateEntry<Color>("StorageColor", new Color(0.392f, 0.392f, 0.392f, 0.392f), "Storage Slot Color", (string)null, false, false, (ValueValidator)null, (string)null);
_machineColorPref = _category.CreateEntry<Color>("MachineColor", new Color(0.392f, 0.392f, 0.392f, 0.392f), "Machine Slot Color", (string)null, false, false, (ValueValidator)null, (string)null);
_colorsModified = true;
}
public override void OnSceneWasInitialized(int buildIndex, string sceneName)
{
_mainSceneLoaded = sceneName == "Main";
}
public override void OnUpdate()
{
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0174: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_028d: Unknown result type (might be due to invalid IL or missing references)
//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0232: Unknown result type (might be due to invalid IL or missing references)
//IL_0320: Unknown result type (might be due to invalid IL or missing references)
if (!_mainSceneLoaded)
{
_colorsModified = true;
}
if (Singleton<StorageMenu>.InstanceExists && Singleton<StorageMenu>.instance.IsOpen)
{
ItemSlotUI[] slotsUIs = Singleton<StorageMenu>.Instance.SlotsUIs;
foreach (ItemSlotUI val in slotsUIs)
{
val.SetNormalColor(_storageColorPref.Value);
}
}
if (PlayerSingleton<PlayerInventory>.InstanceExists && PlayerSingleton<PlayerInventory>.Instance.HotbarEnabled && _colorsModified)
{
foreach (ItemSlotUI slotUI in PlayerSingleton<PlayerInventory>.Instance.slotUIs)
{
slotUI.SetNormalColor(_hotbarColorPref.Value);
slotUI.SetHighlightColor(_hotbarHighlightColorPref.Value);
}
_colorsModified = false;
}
if (Singleton<PackagingStationCanvas>.InstanceExists)
{
Singleton<PackagingStationCanvas>.instance.PackagingSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<PackagingStationCanvas>.instance.ProductSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<PackagingStationCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
}
if (Singleton<MixingStationCanvas>.InstanceExists)
{
Singleton<MixingStationCanvas>.instance.ProductSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<MixingStationCanvas>.instance.IngredientSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<MixingStationCanvas>.instance.PreviewSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<MixingStationCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
}
if (Singleton<CauldronCanvas>.InstanceExists)
{
Singleton<CauldronCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<CauldronCanvas>.instance.LiquidSlotUI.SetNormalColor(_machineColorPref.Value);
foreach (ItemSlotUI ingredientSlotUI in Singleton<CauldronCanvas>.instance.IngredientSlotUIs)
{
ingredientSlotUI.SetNormalColor(_machineColorPref.Value);
}
}
if (Singleton<DryingRackCanvas>.InstanceExists)
{
Singleton<DryingRackCanvas>.instance.InputSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<DryingRackCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
}
if (Singleton<LabOvenCanvas>.InstanceExists)
{
Singleton<LabOvenCanvas>.instance.IngredientSlotUI.SetNormalColor(_machineColorPref.Value);
Singleton<LabOvenCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
}
if (Singleton<ChemistryStationCanvas>.InstanceExists)
{
Singleton<ChemistryStationCanvas>.instance.OutputSlotUI.SetNormalColor(_machineColorPref.Value);
ItemSlotUI[] inputSlotUIs = Singleton<ChemistryStationCanvas>.instance.InputSlotUIs;
foreach (ItemSlotUI val2 in inputSlotUIs)
{
val2.SetNormalColor(_machineColorPref.Value);
}
}
}
public override void OnDeinitializeMelon()
{
}
private void SubscribeToModManagerEvents()
{
try
{
ModSettingsEvents.OnPhonePreferencesSaved += HandleSettingsUpdate;
MelonLogger.Msg(ConsoleColor.DarkCyan, "Subscribed to OnPhonePreferencesSaved event.");
}
catch (Exception arg)
{
MelonLogger.Error($"Failed to subscribe to OnPhonePreferencesSaved: {arg}");
}
try
{
ModSettingsEvents.OnMenuPreferencesSaved += HandleSettingsUpdate;
MelonLogger.Msg(ConsoleColor.DarkCyan, "Subscribed to OnMenuPreferencesSaved event.");
}
catch (Exception arg2)
{
MelonLogger.Error($"Failed to subscribe to OnPhonePreferencesSaved: {arg2}");
}
}
private void UnsubscribeFromModManagerEvents()
{
}
private void HandleSettingsUpdate()
{
_hotbarColorPref = _category.GetEntry<Color>("HotbarColor");
_hotbarHighlightColorPref = _category.GetEntry<Color>("HotbarHighlightColor");
_storageColorPref = _category.GetEntry<Color>("StorageColor");
_machineColorPref = _category.GetEntry<Color>("MachineColor");
_colorsModified = true;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}