Decompiled source of Better FPS Low Spec GPU v0.1.2

BetterFPSLowSpecGPU.dll

Decompiled a year ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using AdvancedTerrainGrass;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppInterop.Runtime.Injection;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("BetterFPSLowSpecGPU")]
[assembly: AssemblyDescription("Plugin to disable graphical rendering of in-game elements (example trees)")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("LvKA95")]
[assembly: AssemblyProduct("BetterFPSLowSpecGPU")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("RainFire Games")]
[assembly: ComVisible(false)]
[assembly: Guid("683cfd9f-62eb-4fcb-a98c-9402bd695054")]
[assembly: AssemblyFileVersion("0.0.1.2")]
[assembly: NeutralResourcesLanguage("it")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.1.2")]
namespace BetterFPSLowSpecGPU;

[BepInPlugin("LvKA95.BetterFPSLowSpecsGPU", "BetterFPSLowSpecsGPU", "0.1.2")]
public class Plugin : BasePlugin
{
	public class Impostazioni : MonoBehaviour
	{
		public bool attivamenu;

		public bool attivamenufps;

		private bool fixoggettilog;

		private bool infoombratorcia;

		private bool infodisattiva1;

		private bool infofps;

		public SceneManager scenamain;

		private GameObject g1;

		private GameObject g2;

		private GameObject g3;

		private GameObject g4;

		private GameObject g5;

		private GameObject g6;

		private GameObject g7;

		private GameObject g8;

		private GameObject g9;

		private GameObject g10;

		private GameObject g11;

		private GameObject g12;

		private GameObject g13;

		private float fpsshow;

		private float timerfps = 1f;

		private float fpsattuali;

		private float fpsaccumulatore;

		private float fpstotali;

		private float fpsmedi;

		private float fpsmediacalc;

		private float fpsminimi = 999f;

		private void FixOggetti()
		{
			if (!renderingoceano.Value)
			{
				GameObject.Find("Ocean").SetActive(false);
			}
			fpsminimi = 999f;
		}

		private void ApplicaImpostazioni1()
		{
			if ((float)cameradistanza.Value > 2970f)
			{
				cameradistanza.Value = 12000;
			}
			Camera.main.farClipPlane = cameradistanza.Value;
			GameObject.Find("Site02Terrain Tess").GetComponent<Terrain>().heightmapMaximumLOD = qualitaterreno.Value;
			GameObject.Find("Site02Terrain Tess").GetComponent<Terrain>().heightmapPixelError = 12f;
			if (ombresole.Value)
			{
				GameObject.Find("SunLight").GetComponent<Light>().cullingMask = -1;
			}
			if (!ombresole.Value)
			{
				GameObject.Find("SunLight").GetComponent<Light>().cullingMask = 2;
			}
			if (ombreluna.Value)
			{
				GameObject.Find("MoonLight").GetComponent<Light>().cullingMask = -1;
			}
			if (!ombreluna.Value)
			{
				GameObject.Find("MoonLight").GetComponent<Light>().cullingMask = 2;
			}
		}

		private void ApplicaImpostazioni2()
		{
			if (Object.op_Implicit((Object)(object)(g1 = GameObject.Find("_Billboards_"))) && !billboards.Value)
			{
				g1.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g2 = GameObject.Find("HLODLayers"))) && !hlodlayers.Value)
			{
				g2.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g3 = GameObject.Find("Ocean"))) && !renderingoceano.Value)
			{
				g3.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g4 = GameObject.Find("TreeLodGrid"))) && !treelodgrid.Value)
			{
				g4.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g5 = GameObject.Find("Pool_SmallBush"))) && !smallbush.Value)
			{
				g5.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g6 = GameObject.Find("Pool_Moss"))) && !muschio.Value)
			{
				g6.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g7 = GameObject.Find("Pool_WoodChips"))) && !truciolilegno.Value)
			{
				g7.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g8 = GameObject.Find("Pool_BeachWaves"))) && !ondespiaggia.Value)
			{
				g8.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g9 = GameObject.Find("Pool_SmallTree"))) && !piccolialberi.Value)
			{
				g9.SetActive(false);
			}
			if (!erbaterreno.Value)
			{
				((Behaviour)GameObject.Find("Site02Terrain Tess").GetComponent<GrassManager>()).enabled = false;
			}
			if (Object.op_Implicit((Object)(object)(g10 = GameObject.Find("OceanWaterFX"))) && !particellariplayer.Value)
			{
				g10.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g10 = GameObject.Find("WaterRipplesNormalProjector"))) && !particellariplayer.Value)
			{
				g10.SetActive(false);
			}
			if (Object.op_Implicit((Object)(object)(g10 = GameObject.Find("EnvironmentWWFX"))) && !particellariplayer.Value)
			{
				g10.SetActive(false);
			}
		}

		private void ApplicaImpostazioni3()
		{
			if (Object.op_Implicit((Object)(object)(g11 = GameObject.Find("LocalPlayerPlasmaLight"))) && !ombratorcia.Value)
			{
				g11.GetComponent<Light>().cullingMask = 2;
			}
			if (Object.op_Implicit((Object)(object)(g12 = GameObject.Find("FireLight"))) && !ombratorcia.Value)
			{
				g12.GetComponent<Light>().cullingMask = 2;
			}
			if (Object.op_Implicit((Object)(object)(g13 = GameObject.Find("SpotLight"))) && !ombratorcia.Value)
			{
				g13.GetComponent<Light>().cullingMask = 2;
			}
			if (Object.op_Implicit((Object)(object)(g11 = GameObject.Find("LocalPlayerPlasmaLight"))) && ombratorcia.Value)
			{
				g11.GetComponent<Light>().cullingMask = -1;
			}
			if (Object.op_Implicit((Object)(object)(g12 = GameObject.Find("FireLight"))) && ombratorcia.Value)
			{
				g12.GetComponent<Light>().cullingMask = -1;
			}
			if (Object.op_Implicit((Object)(object)(g13 = GameObject.Find("SpotLight"))) && ombratorcia.Value)
			{
				g13.GetComponent<Light>().cullingMask = -1;
			}
		}

		private void Update()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			Scene sceneByName = SceneManager.GetSceneByName("SonsMain");
			if (((Scene)(ref sceneByName)).IsValid())
			{
				if (Input.GetKeyDown(aprimenu.Value))
				{
					if (attivamenu)
					{
						attivamenu = false;
						attivamenufps = false;
					}
					else if (!attivamenu)
					{
						attivamenu = true;
						attivamenufps = false;
					}
					if (qualitaterreno.Value > 2)
					{
						qualitaterreno.Value = 2;
					}
				}
				if (Input.GetKeyUp((KeyCode)107))
				{
					ombratorcia.Value = !ombratorcia.Value;
					ApplicaImpostazioni3();
				}
			}
			sceneByName = SceneManager.GetSceneByName("SonsMainLoading");
			if (((Scene)(ref sceneByName)).IsValid())
			{
				attivamenu = false;
				fixoggettilog = true;
			}
			sceneByName = SceneManager.GetSceneByName("SonsTitleScene");
			if (((Scene)(ref sceneByName)).IsValid())
			{
				attivamenu = false;
			}
			if (attivamenu && fixoggettilog)
			{
				FixOggetti();
				fixoggettilog = false;
			}
			timerfps -= Time.unscaledDeltaTime;
			if (timerfps <= 0f)
			{
				timerfps = 1f;
				fpsattuali = (int)(fpsaccumulatore / 1f);
				fpsmediacalc += 1f;
				fpsaccumulatore = 0f;
				fpsmedi = fpstotali / fpsmediacalc;
				if (fpsattuali <= fpsminimi + 1f)
				{
					fpsminimi = fpsattuali;
				}
			}
			fpsaccumulatore += 1f;
			fpstotali += 1f;
		}

		private void OnGUI()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0445: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_0490: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_097f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0529: Unknown result type (might be due to invalid IL or missing references)
			//IL_054c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_156d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1117: Unknown result type (might be due to invalid IL or missing references)
			//IL_113a: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b34: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0636: Unknown result type (might be due to invalid IL or missing references)
			//IL_0659: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_15a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_15c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_15ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_1612: Unknown result type (might be due to invalid IL or missing references)
			//IL_164f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1677: Unknown result type (might be due to invalid IL or missing references)
			//IL_16b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_16f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1722: Unknown result type (might be due to invalid IL or missing references)
			//IL_1166: Unknown result type (might be due to invalid IL or missing references)
			//IL_1189: Unknown result type (might be due to invalid IL or missing references)
			//IL_11c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1224: Unknown result type (might be due to invalid IL or missing references)
			//IL_1247: Unknown result type (might be due to invalid IL or missing references)
			//IL_127f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b5f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0baa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0703: Unknown result type (might be due to invalid IL or missing references)
			//IL_0726: Unknown result type (might be due to invalid IL or missing references)
			//IL_0749: Unknown result type (might be due to invalid IL or missing references)
			//IL_174d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1770: Unknown result type (might be due to invalid IL or missing references)
			//IL_1798: Unknown result type (might be due to invalid IL or missing references)
			//IL_12f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_1314: Unknown result type (might be due to invalid IL or missing references)
			//IL_1337: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0779: Unknown result type (might be due to invalid IL or missing references)
			//IL_17d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1367: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c91: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_187f: Unknown result type (might be due to invalid IL or missing references)
			//IL_180d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1397: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cbc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c4b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_18aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1839: Unknown result type (might be due to invalid IL or missing references)
			//IL_185c: Unknown result type (might be due to invalid IL or missing references)
			//IL_13c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0809: Unknown result type (might be due to invalid IL or missing references)
			//IL_18d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_13f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ee3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fbf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d22: Unknown result type (might be due to invalid IL or missing references)
			//IL_1987: Unknown result type (might be due to invalid IL or missing references)
			//IL_19be: Unknown result type (might be due to invalid IL or missing references)
			//IL_19f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a63: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ad1: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b08: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b76: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bad: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bdf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1910: Unknown result type (might be due to invalid IL or missing references)
			//IL_101c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0846: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_193c: Unknown result type (might be due to invalid IL or missing references)
			//IL_195f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_1464: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1494: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_14e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0939: Unknown result type (might be due to invalid IL or missing references)
			//IL_095c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1527: Unknown result type (might be due to invalid IL or missing references)
			//IL_154a: Unknown result type (might be due to invalid IL or missing references)
			Scene sceneByName = SceneManager.GetSceneByName("SonsTitleScene");
			if (((Scene)(ref sceneByName)).IsValid())
			{
				if (linguaggio.Value == 0)
				{
					GUI.Box(new Rect(0f, 0f, 465f, 30f), "");
					GUI.Label(new Rect(6f, -2f, 465f, 40f), "<size=12><b><color=red>                                         Better FPS Low Spec GPU 0.1.2</color>\nPer Aprire il menu Premi F9 (Funziona Solo quando entri in una qualsiasi partita)</b></size>");
				}
				if (linguaggio.Value == 1)
				{
					GUI.Box(new Rect(0f, 0f, 380f, 30f), "");
					GUI.Label(new Rect(6f, -2f, 380f, 40f), "<size=12><b><color=red>                             Better FPS Low Spec GPU 0.1.2</color>\nTo open the menu press F9 (Only works when you load any save)</b></size>");
				}
			}
			if (attivamenufps)
			{
				if (fpsshow == 0f)
				{
					GUI.Box(new Rect(0f, 0f, 80f, 20f), "");
					if (GUI.Button(new Rect(0f, 0f, 20f, 20f), "<size=12><b>X</b></size>"))
					{
						attivamenufps = false;
						attivamenu = true;
					}
					GUI.Label(new Rect(23f, 0f, 160f, 20f), "<size=14><b>FPS</b></size>");
					GUI.Label(new Rect(55f, 0f, 30f, 20f), "<b>" + fpsattuali + "</b>");
				}
				if (fpsshow == 1f)
				{
					GUI.Box(new Rect((float)(Screen.width - 80), 0f, 80f, 20f), "");
					if (GUI.Button(new Rect((float)(Screen.width - 20), 0f, 20f, 20f), "<size=12><b>X</b></size>"))
					{
						attivamenufps = false;
						attivamenu = true;
					}
					GUI.Label(new Rect((float)(Screen.width - 50), 0f, 160f, 20f), "<size=14><b>FPS</b></size>");
					GUI.Label(new Rect((float)(Screen.width - 75), 0f, 30f, 20f), "<b>" + fpsattuali + "</b>");
				}
				if (fpsshow == 2f)
				{
					GUI.Box(new Rect((float)(Screen.width - 80), (float)(Screen.height - 20), 80f, 20f), "");
					if (GUI.Button(new Rect((float)(Screen.width - 20), (float)(Screen.height - 20), 20f, 20f), "<size=12><b>X</b></size>"))
					{
						attivamenufps = false;
						attivamenu = true;
					}
					GUI.Label(new Rect((float)(Screen.width - 50), (float)(Screen.height - 20), 160f, 20f), "<size=14><b>FPS</b></size>");
					GUI.Label(new Rect((float)(Screen.width - 75), (float)(Screen.height - 20), 30f, 20f), "<b>" + fpsattuali + "</b>");
				}
				if (fpsshow == 3f)
				{
					GUI.Box(new Rect(0f, (float)(Screen.height - 20), 80f, 20f), "");
					if (GUI.Button(new Rect(0f, (float)(Screen.height - 20), 20f, 20f), "<size=12><b>X</b></size>"))
					{
						attivamenufps = false;
						attivamenu = true;
					}
					GUI.Label(new Rect(23f, (float)(Screen.height - 20), 160f, 20f), "<size=14><b>FPS</b></size>");
					GUI.Label(new Rect(55f, (float)(Screen.height - 20), 30f, 20f), "<b>" + fpsattuali + "</b>");
				}
				if (fpsshow == 4f)
				{
					attivamenu = true;
					attivamenufps = false;
				}
			}
			if (!attivamenu)
			{
				return;
			}
			GUI.Box(new Rect(0f, 0f, 340f, 30f), "");
			GUI.Label(new Rect(8f, 3f, 220f, 40f), "<size=13><b>Language  ITA        ENG</b></size>");
			linguaggio.Value = Mathf.RoundToInt(GUI.HorizontalSlider(new Rect(100f, 8f, 26f, 30f), (float)linguaggio.Value, 0f, 1f));
			if (linguaggio.Value == 0)
			{
				if (!infofps && GUI.Button(new Rect(340f, 0f, 120f, 20f), "<b>Contatore FPS</b>"))
				{
					infofps = true;
				}
				if (infofps)
				{
					infodisattiva1 = false;
					infoombratorcia = false;
					GUI.Box(new Rect(340f, 0f, 120f, 250f), "");
					if (GUI.Button(new Rect(340f, 0f, 120f, 20f), "<b>Contatore FPS</b>"))
					{
						infofps = false;
					}
					GUI.Label(new Rect(350f, 20f, 160f, 40f), "<size=12><b>FPS Attuali</b></size>");
					GUI.Label(new Rect(430f, 20f, 30f, 40f), "<b>" + fpsattuali + "</b>");
					GUI.Label(new Rect(350f, 35f, 160f, 40f), "<size=12><b>FPS Medi</b></size>");
					GUI.Label(new Rect(430f, 35f, 30f, 40f), "<b>" + Mathf.RoundToInt(fpsmedi) + "</b>");
					GUI.Label(new Rect(350f, 50f, 160f, 40f), "<size=12><b>FPS Minimi</b></size>");
					GUI.Label(new Rect(430f, 50f, 60f, 40f), "<b>" + fpsminimi + "</b>");
					if (GUI.Button(new Rect(340f, 70f, 120f, 20f), "<b><size=12>Azzera Contatore</size></b>"))
					{
						timerfps = 1f;
						fpsattuali = 0f;
						fpsaccumulatore = 0f;
						fpstotali = 0f;
						fpsmedi = 0f;
						fpsmediacalc = 0f;
						fpsminimi = 999f;
					}
					GUI.Box(new Rect(345f, 128f, 110f, 72f), "");
					GUI.Label(new Rect(345f, 94f, 120f, 40f), "<size=12><b>Posizione Schermo\n   Soli FPS Attuali</b></size>");
					if (GUI.Button(new Rect(345f, 128f, 20f, 20f), ""))
					{
						fpsshow = 0f;
					}
					if (GUI.Button(new Rect(435f, 128f, 20f, 20f), ""))
					{
						fpsshow = 1f;
					}
					if (GUI.Button(new Rect(435f, 180f, 20f, 20f), ""))
					{
						fpsshow = 2f;
					}
					if (GUI.Button(new Rect(345f, 180f, 20f, 20f), ""))
					{
						fpsshow = 3f;
					}
					if (GUI.Button(new Rect(382f, 150f, 35f, 30f), "<b><size=16>NO</size></b>"))
					{
						fpsshow = 4f;
					}
					if (fpsshow == 0f)
					{
						GUI.Label(new Rect(349f, 126f, 40f, 40f), "<b><size=18><color=red>X</color></size></b>");
					}
					if (fpsshow == 1f)
					{
						GUI.Label(new Rect(439f, 126f, 40f, 40f), "<b><size=18><color=red>X</color></size></b>");
					}
					if (fpsshow == 2f)
					{
						GUI.Label(new Rect(439f, 178f, 40f, 40f), "<b><size=18><color=red>X</color></size></b>");
					}
					if (fpsshow == 3f)
					{
						GUI.Label(new Rect(349f, 178f, 40f, 40f), "<b><size=18><color=red>X</color></size></b>");
					}
					if (GUI.Button(new Rect(345f, 205f, 110f, 40f), "<b><size=14>Mostra Solo\nFPS Attuali</size></b>"))
					{
						attivamenu = false;
						attivamenufps = true;
					}
					if (fpsshow == 4f)
					{
						GUI.Label(new Rect(359f, 206f, 110f, 40f), "<b><size=14><color=red>Mostra Solo \n<size=10> </size>FPS Attuali</color></size></b>");
						GUI.Label(new Rect(387f, 154f, 35f, 30f), "<b><size=16><color=red>NO</color></size></b>");
					}
				}
				if (GUI.Button(new Rect(165f, 3f, 170f, 25f), "<size=11><b>Applica Tutte le Impostazioni</b></size>"))
				{
					ApplicaImpostazioni1();
					ApplicaImpostazioni2();
					ApplicaImpostazioni3();
				}
				GUI.Box(new Rect(0f, 30f, 340f, 100f), "");
				GUI.Label(new Rect(30f, 27f, 380f, 80f), "<size=12><b>Better FPS Low Spec GPU By LvKA95      v0.1.2</b></size>");
				GUI.Label(new Rect(10f, 43f, 380f, 40f), "<size=12><b>Distanza Visiva Camera</b></size>");
				cameradistanza.Value = Mathf.RoundToInt(GUI.HorizontalSlider(new Rect(158f, 49f, 175f, 19f), (float)cameradistanza.Value, 15f, 3000f));
				GUI.Label(new Rect(10f, 60f, 380f, 40f), "<size=12><b>Dettagli Geometria Terreno      Bassa                     Massima</b></size>");
				qualitaterreno.Value = Mathf.RoundToInt(GUI.HorizontalSlider(new Rect(225f, 66f, 50f, 19f), (float)qualitaterreno.Value, 2f, 0f));
				ombresole.Value = GUI.Toggle(new Rect(15f, 85f, 160f, 16f), ombresole.Value, "<size=14><b> Ombre Luce Solare</b></size>");
				ombreluna.Value = GUI.Toggle(new Rect(15f, 102f, 160f, 16f), ombreluna.Value, "<size=14><b> Ombre Luce Lunare</b></size>");
				if (GUI.Button(new Rect(190f, 100f, 145f, 25f), "<b>Applica Impostazioni</b>"))
				{
					ApplicaImpostazioni1();
				}
				GUI.Box(new Rect(0f, 130f, 340f, 70f), "");
				GUI.Label(new Rect(130f, 127f, 380f, 80f), "<size=14><b>Strumenti</b></size>");
				ombratorcia.Value = GUI.Toggle(new Rect(15f, 145f, 200f, 19f), ombratorcia.Value, "<size=14><b> Ombre Accendino / Torcia</b></size>");
				if (!infoombratorcia && GUI.Button(new Rect(270f, 145f, 45f, 25f), "<b>Info</b>"))
				{
					infoombratorcia = true;
				}
				if (infoombratorcia)
				{
					infofps = false;
					if (GUI.Button(new Rect(270f, 145f, 45f, 25f), "<b>Info</b>"))
					{
						infoombratorcia = false;
					}
					GUI.Box(new Rect(340f, 135f, 310f, 60f), "");
					GUI.Label(new Rect(350f, 135f, 300f, 80f), "<size=14><color=red><b>Importante</b></color>: Ogni volta che lo prendi, le ombre si riattivano, Premi K per disattivarle nuovamente senza aprire il menu</size>");
				}
				if (GUI.Button(new Rect(90f, 170f, 145f, 25f), "<b>Applica Impostazioni</b>"))
				{
					ApplicaImpostazioni3();
				}
				GUI.Box(new Rect(0f, 200f, 340f, 230f), "");
				if (!infodisattiva1 && GUI.Button(new Rect(270f, 210f, 45f, 25f), "<b>Info</b>"))
				{
					infodisattiva1 = true;
				}
				if (infodisattiva1)
				{
					infofps = false;
					if (GUI.Button(new Rect(270f, 210f, 45f, 25f), "<b>Info</b>"))
					{
						infodisattiva1 = false;
					}
					GUI.Box(new Rect(340f, 200f, 320f, 55f), "");
					GUI.Label(new Rect(345f, 200f, 320f, 80f), "<size=14><color=red><b>Importante</b></color>: Queste Opzioni si applicano <b>solo</b> ad un nuovo caricamento della partita\nMentre sei in partita puoi solo disattivarle</size>");
				}
				billboards.Value = GUI.Toggle(new Rect(15f, 205f, 280f, 19f), billboards.Value, "<size=14><b> Mostra Texture2D Molto Distanti</b></size>");
				renderingoceano.Value = GUI.Toggle(new Rect(15f, 222f, 170f, 19f), renderingoceano.Value, "<size=14><b> Mostra Oceano</b></size>");
				hlodlayers.Value = GUI.Toggle(new Rect(15f, 239f, 280f, 19f), hlodlayers.Value, "<size=14><b> Mostra Vari Elementi Distanti</b></size>");
				treelodgrid.Value = GUI.Toggle(new Rect(15f, 256f, 280f, 19f), treelodgrid.Value, "<size=14><b> Mostra Alberi Molto Distanti</b></size>");
				smallbush.Value = GUI.Toggle(new Rect(15f, 273f, 300f, 19f), smallbush.Value, "<size=14><b> Mostra Vetazione Piccole Piante</b></size>");
				muschio.Value = GUI.Toggle(new Rect(15f, 290f, 300f, 19f), muschio.Value, "<size=14><b> Mostra Muschio</b></size>");
				truciolilegno.Value = GUI.Toggle(new Rect(15f, 307f, 300f, 19f), truciolilegno.Value, "<size=14><b> Mostra Particellare pezzi di Legno</b></size>");
				ondespiaggia.Value = GUI.Toggle(new Rect(15f, 324f, 300f, 19f), ondespiaggia.Value, "<size=14><b> Mostra Onde Spiaggia</b></size>");
				piccolialberi.Value = GUI.Toggle(new Rect(15f, 341f, 300f, 19f), piccolialberi.Value, "<size=14><b> Mostra Piccoli Alberi</b></size>");
				particellariplayer.Value = GUI.Toggle(new Rect(15f, 358f, 300f, 19f), particellariplayer.Value, "<size=14><b> Mostra Particellari Giocatore</b></size>");
				erbaterreno.Value = GUI.Toggle(new Rect(15f, 375f, 300f, 19f), erbaterreno.Value, "<size=14><b> Mostra Erba Del Terreno</b></size>");
				if (GUI.Button(new Rect(30f, 398f, 145f, 25f), "<b>Applica Impostazioni</b>"))
				{
					ApplicaImpostazioni2();
				}
				if (GUI.Button(new Rect(205f, 398f, 105f, 25f), "<b>Disattiva Tutto</b>"))
				{
					billboards.Value = false;
					renderingoceano.Value = false;
					hlodlayers.Value = false;
					treelodgrid.Value = false;
					smallbush.Value = false;
					muschio.Value = false;
					truciolilegno.Value = false;
					ondespiaggia.Value = false;
					piccolialberi.Value = false;
					particellariplayer.Value = false;
					erbaterreno.Value = false;
				}
			}
			if (linguaggio.Value != 1)
			{
				return;
			}
			if (!infofps && GUI.Button(new Rect(340f, 0f, 120f, 20f), "<b>FPS Counter</b>"))
			{
				infofps = true;
			}
			if (infofps)
			{
				infodisattiva1 = false;
				infoombratorcia = false;
				GUI.Box(new Rect(340f, 0f, 120f, 250f), "");
				if (GUI.Button(new Rect(340f, 0f, 120f, 20f), "<b>FPS Counter</b>"))
				{
					infofps = false;
				}
				GUI.Label(new Rect(350f, 20f, 160f, 40f), "<size=12><b>FPS Current</b></size>");
				GUI.Label(new Rect(430f, 20f, 30f, 40f), "<b>" + fpsattuali + "</b>");
				GUI.Label(new Rect(350f, 35f, 160f, 40f), "<size=12><b>FPS Average</b></size>");
				GUI.Label(new Rect(430f, 35f, 30f, 40f), "<b>" + Mathf.RoundToInt(fpsmedi) + "</b>");
				GUI.Label(new Rect(350f, 50f, 160f, 40f), "<size=12><b>FPS Minimum</b></size>");
				GUI.Label(new Rect(430f, 50f, 60f, 40f), "<b>" + fpsminimi + "</b>");
				if (GUI.Button(new Rect(340f, 70f, 120f, 20f), "<b><size=12>Reset Counter</size></b>"))
				{
					timerfps = 1f;
					fpsattuali = 0f;
					fpsaccumulatore = 0f;
					fpstotali = 0f;
					fpsmedi = 0f;
					fpsmediacalc = 0f;
					fpsminimi = 999f;
				}
				GUI.Box(new Rect(345f, 128f, 110f, 72f), "");
				GUI.Label(new Rect(345f, 94f, 120f, 40f), "<size=12><b>    Screen Position\n  Only Current FPS</b></size>");
				if (GUI.Button(new Rect(345f, 128f, 20f, 20f), ""))
				{
					fpsshow = 0f;
				}
				if (GUI.Button(new Rect(435f, 128f, 20f, 20f), ""))
				{
					fpsshow = 1f;
				}
				if (GUI.Button(new Rect(435f, 180f, 20f, 20f), ""))
				{
					fpsshow = 2f;
				}
				if (GUI.Button(new Rect(345f, 180f, 20f, 20f), ""))
				{
					fpsshow = 3f;
				}
				if (GUI.Button(new Rect(382f, 150f, 35f, 30f), "<b><size=16>NO</size></b>"))
				{
					fpsshow = 4f;
				}
				if (fpsshow == 0f)
				{
					GUI.Label(new Rect(349f, 126f, 40f, 40f), "<b><size=18><color=red>X</color></size></b>");
				}
				if (fpsshow == 1f)
				{
					GUI.Label(new Rect(439f, 126f, 40f, 40f), "<b><size=18><color=red>X</color></size></b>");
				}
				if (fpsshow == 2f)
				{
					GUI.Label(new Rect(439f, 178f, 40f, 40f), "<b><size=18><color=red>X</color></size></b>");
				}
				if (fpsshow == 3f)
				{
					GUI.Label(new Rect(349f, 178f, 40f, 40f), "<b><size=18><color=red>X</color></size></b>");
				}
				if (GUI.Button(new Rect(345f, 205f, 110f, 40f), "<b><size=14>Show Only\nCurrent FPS</size></b>"))
				{
					attivamenu = false;
					attivamenufps = true;
				}
				if (fpsshow == 4f)
				{
					GUI.Label(new Rect(359f, 206f, 110f, 40f), "<b><size=14><color=red> Show Only\nCurrent FPS</color></size></b>");
					GUI.Label(new Rect(387f, 154f, 35f, 30f), "<b><size=16><color=red>NO</color></size></b>");
				}
			}
			if (GUI.Button(new Rect(165f, 3f, 170f, 25f), "<size=12><b>Apply All Settings</b></size>"))
			{
				ApplicaImpostazioni1();
				ApplicaImpostazioni2();
				ApplicaImpostazioni3();
			}
			GUI.Box(new Rect(0f, 30f, 340f, 100f), "");
			GUI.Label(new Rect(30f, 27f, 380f, 80f), "<size=12><b>Better FPS Low Spec GPU By LvKA95      v0.1.2</b></size>");
			GUI.Label(new Rect(10f, 43f, 380f, 40f), "<size=12><b>Camera Viewing Distance</b></size>");
			cameradistanza.Value = Mathf.RoundToInt(GUI.HorizontalSlider(new Rect(158f, 49f, 175f, 19f), (float)cameradistanza.Value, 15f, 3000f));
			GUI.Label(new Rect(10f, 60f, 380f, 40f), "<size=12><b>Terrain Geometry Details              Low                     Max</b></size>");
			qualitaterreno.Value = Mathf.RoundToInt(GUI.HorizontalSlider(new Rect(225f, 66f, 50f, 19f), (float)qualitaterreno.Value, 2f, 0f));
			ombresole.Value = GUI.Toggle(new Rect(15f, 85f, 160f, 19f), ombresole.Value, "<size=14><b> Sun Light Shadows</b></size>");
			ombreluna.Value = GUI.Toggle(new Rect(15f, 102f, 160f, 19f), ombreluna.Value, "<size=14><b> Moon light Shadows</b></size>");
			if (GUI.Button(new Rect(190f, 100f, 145f, 25f), "<b>Apply Settings</b>"))
			{
				ApplicaImpostazioni1();
			}
			GUI.Box(new Rect(0f, 130f, 340f, 70f), "");
			GUI.Label(new Rect(130f, 127f, 380f, 80f), "<size=14><b>Utility</b></size>");
			ombratorcia.Value = GUI.Toggle(new Rect(15f, 145f, 200f, 19f), ombratorcia.Value, "<size=14><b> Shadow Lighter / Torch</b></size>");
			if (!infoombratorcia && GUI.Button(new Rect(270f, 145f, 45f, 25f), "<b>Info</b>"))
			{
				infoombratorcia = true;
			}
			if (infoombratorcia)
			{
				infofps = false;
				if (GUI.Button(new Rect(270f, 145f, 45f, 25f), "<b>Info</b>"))
				{
					infoombratorcia = false;
				}
				GUI.Box(new Rect(340f, 135f, 310f, 60f), "");
				GUI.Label(new Rect(350f, 135f, 300f, 80f), "<size=14><color=red><b>Warning</b></color>: Every time you take it, the shadows activate, Press K to deactivate them again without opening the menu</size>");
			}
			if (GUI.Button(new Rect(90f, 170f, 145f, 25f), "<b>Apply Settings</b>"))
			{
				ApplicaImpostazioni3();
			}
			GUI.Box(new Rect(0f, 200f, 340f, 230f), "");
			if (!infodisattiva1 && GUI.Button(new Rect(270f, 210f, 45f, 25f), "<b>Info</b>"))
			{
				infodisattiva1 = true;
			}
			if (infodisattiva1)
			{
				infofps = false;
				if (GUI.Button(new Rect(270f, 210f, 45f, 25f), "<b>Info</b>"))
				{
					infodisattiva1 = false;
				}
				GUI.Box(new Rect(340f, 200f, 320f, 55f), "");
				GUI.Label(new Rect(345f, 200f, 320f, 80f), "<size=14><color=red><b>Warning</b></color>: These Options <b>only</b> Apply to a New Game Load\nWhile in the Game You can Only Disable them</size>");
			}
			billboards.Value = GUI.Toggle(new Rect(15f, 205f, 280f, 19f), billboards.Value, "<size=14><b> Render Texture 2D Far Distance</b></size>");
			renderingoceano.Value = GUI.Toggle(new Rect(15f, 222f, 170f, 19f), renderingoceano.Value, "<size=14><b> Render Ocean Waves</b></size>");
			hlodlayers.Value = GUI.Toggle(new Rect(15f, 239f, 280f, 19f), hlodlayers.Value, "<size=14><b> Render Some Distant Elements</b></size>");
			treelodgrid.Value = GUI.Toggle(new Rect(15f, 256f, 280f, 19f), treelodgrid.Value, "<size=14><b> Render Distant Trees</b></size>");
			smallbush.Value = GUI.Toggle(new Rect(15f, 273f, 300f, 19f), smallbush.Value, "<size=14><b> Render Small Bush</b></size>");
			muschio.Value = GUI.Toggle(new Rect(15f, 290f, 300f, 19f), muschio.Value, "<size=14><b> Render Moss</b></size>");
			truciolilegno.Value = GUI.Toggle(new Rect(15f, 307f, 300f, 19f), truciolilegno.Value, "<size=14><b> Render Wood Chips Particle</b></size>");
			ondespiaggia.Value = GUI.Toggle(new Rect(15f, 324f, 300f, 19f), ondespiaggia.Value, "<size=14><b> Render Beach Waves</b></size>");
			piccolialberi.Value = GUI.Toggle(new Rect(15f, 341f, 300f, 19f), piccolialberi.Value, "<size=14><b> Render Small Trees</b></size>");
			particellariplayer.Value = GUI.Toggle(new Rect(15f, 358f, 300f, 19f), particellariplayer.Value, "<size=14><b> Render Player Particles</b></size>");
			erbaterreno.Value = GUI.Toggle(new Rect(15f, 375f, 300f, 19f), erbaterreno.Value, "<size=14><b> Render Terrain Grass</b></size>");
			if (GUI.Button(new Rect(30f, 398f, 145f, 25f), "<b>Apply Setting</b>"))
			{
				ApplicaImpostazioni2();
			}
			if (GUI.Button(new Rect(205f, 398f, 105f, 25f), "<b>Disable All</b>"))
			{
				billboards.Value = false;
				renderingoceano.Value = false;
				hlodlayers.Value = false;
				treelodgrid.Value = false;
				smallbush.Value = false;
				muschio.Value = false;
				truciolilegno.Value = false;
				ondespiaggia.Value = false;
				piccolialberi.Value = false;
				particellariplayer.Value = false;
				erbaterreno.Value = false;
			}
		}
	}

	public const string GUID = "LvKA95.BetterFPSLowSpecsGPU";

	public const string NAME = "BetterFPSLowSpecsGPU";

	public const string VERSION = "0.1.2";

	public const string AUTHOR = "LvKA95";

	public static ConfigFile configFile = new ConfigFile(Path.Combine(Paths.ConfigPath, "BetterFPSLowSpecGPU.cfg"), true);

	public static ConfigEntry<KeyCode> aprimenu = configFile.Bind<KeyCode>("- Toggle Open Menu", "", (KeyCode)290, "Choose the key that is most convenient for you to use to open the menu");

	public static ConfigEntry<KeyCode> lightershadow = configFile.Bind<KeyCode>("- HotKey Apply Lighter / Torch Shadow", "", (KeyCode)107, "Choose the button that is most convenient for you to use to deactivate/activate the shadows of the torch or lighter");

	public static ConfigEntry<int> linguaggio = configFile.Bind<int>("Menu Language", "", 1, "1 English or 0 Italian");

	public static ConfigEntry<int> cameradistanza = configFile.Bind<int>("Camera Viewing Distance", "", 12000, "Change the rendering distance of the camera in the game scene, allowing an excellent performance boost");

	public static ConfigEntry<int> qualitaterreno = configFile.Bind<int>("Terrain Geometry Details", "", 0, "Change the quality of the terrain geometry (0 Better Quality 2 Low Quality)");

	public static ConfigEntry<bool> erbaterreno = configFile.Bind<bool>("Terrain Grass", "", true, "Disable rendering of tufts of grass in the ground");

	public static ConfigEntry<bool> ombresole = configFile.Bind<bool>("Sun Light Shadows", "", true, "Removes shadows from SunLight");

	public static ConfigEntry<bool> ombreluna = configFile.Bind<bool>("Moon Light Shadows", "", true, "Removes shadows from MoonLight");

	public static ConfigEntry<bool> ombratorcia = configFile.Bind<bool>("Lighter / Torch Shadow", "", true, "Deactivate/Activate the shadows of the torch or lighter");

	public static ConfigEntry<bool> billboards = configFile.Bind<bool>("Render Texture 2D Far Distance", "", true, "Disable rendering of 2D elements far from the player (many trees but also rocks and plants)");

	public static ConfigEntry<bool> renderingoceano = configFile.Bind<bool>("Render Ocean Waves", "", true, "Disable Ocean rendering");

	public static ConfigEntry<bool> hlodlayers = configFile.Bind<bool>("Render Some Distant Elements", "", true, "Disable rendering of some distant elements");

	public static ConfigEntry<bool> treelodgrid = configFile.Bind<bool>("Render Distant Trees", "", true, "Disable rendering of trees far from the player");

	public static ConfigEntry<bool> smallbush = configFile.Bind<bool>("Render Small Bush", "", true, "//Disable rendering some small bush (where you can collect leaves)");

	public static ConfigEntry<bool> muschio = configFile.Bind<bool>("Render Moss", "", true, "Disable rendering Moss");

	public static ConfigEntry<bool> truciolilegno = configFile.Bind<bool>("Render Wood Chips Particle", "", true, "Disables particle rendering when destroying a tree trunk");

	public static ConfigEntry<bool> ondespiaggia = configFile.Bind<bool>("Render Beach Waves", "", true, "Disable rendering of waves in the ocean on the beach");

	public static ConfigEntry<bool> piccolialberi = configFile.Bind<bool>("Rendering Small Trees", "", true, "Disabled rendering small trees");

	public static ConfigEntry<bool> particellariplayer = configFile.Bind<bool>("Rendering Player Particles", "", true, "Disable Particles that players create with their movements or actions");

	public override void Load()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
		ClassInjector.RegisterTypeInIl2Cpp<Impostazioni>();
		GameObject val = new GameObject("BetterFPSLowSpecGPU_script")
		{
			hideFlags = (HideFlags)61
		};
		val.AddComponent<Impostazioni>();
		Object.DontDestroyOnLoad((Object)val);
		((BasePlugin)this).Log.LogInfo((object)"Loaded BetterFPSLowSpecsGPU 0.1.2 by LvKA95");
	}
}
public static class PluginInfo
{
	public const string PLUGIN_GUID = "BetterFPSLowSpecsGPU";

	public const string PLUGIN_NAME = "BetterFPSLowSpecsGPU";

	public const string PLUGIN_VERSION = "0.1.2";
}