using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using DisableParticleTextureDownscale;
using HarmonyLib;
using MelonLoader;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(Core), "Disable Particle Texture Downscale", "1.0.0", "YourName", null)]
[assembly: MelonGame(null, null)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("ParticleAccelerator")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ParticleAccelerator")]
[assembly: AssemblyTitle("ParticleAccelerator")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DisableParticleTextureDownscale;
public class Core : MelonMod
{
public override void OnInitializeMelon()
{
ApplyTextureSettings();
((MelonBase)this).LoggerInstance.Msg("Particle texture downscaling disabled (masterTextureLimit=0, streaming mips off).");
}
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
ApplyTextureSettings();
}
private void ApplyTextureSettings()
{
QualitySettings.masterTextureLimit = 0;
QualitySettings.streamingMipmapsActive = false;
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public static class ForceFullMipmapPatch
{
[HarmonyPrefix]
public static void Prefix(ref int value)
{
value = 0;
}
}