Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Lareins CustomTorches v1.0.0
plugins\Lareins_CustomTorches\Lareins_CustomTorches.dll
Decompiled 2 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Lareins_Core; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Lareins_CustomTorches")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Lareins_CustomTorches")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("a2f90e9b-0bb0-41a3-8e44-885d28aef699")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace Lareins_CustomTorches; [BepInPlugin("com.lareins.customtorches", "Lareins_CustomTorches", "1.4.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class CustomTorchesPlugin : BaseUnityPlugin { public const string ModGUID = "com.lareins.customtorches"; public const string ModName = "Lareins_CustomTorches"; public const string ModVersion = "1.4.0"; public static ConfigEntry<bool> ModAktif; public static ConfigEntry<KeyCode> IsikAyarTusu; public static ConfigEntry<bool> OtoYakitAktif; public static ConfigEntry<int> YakitCekmeMenzili; public static ConfigEntry<KeyCode> OtoYakitToggleTusu; private static ZNetView seciliAtes = null; private static float hue = 0.08f; private static float sat = 0.85f; private static float val = 1f; private static float parlaklikYuzde = 100f; private static float menzilYuzde = 100f; private static Texture2D panelDoku; private static Texture2D ustBarDoku; private static Texture2D renkKaresiDoku; private static Texture2D hueCubuguDoku; private static Texture2D onizlemeDoku; private static Texture2D cerceveDoku; private static readonly List<Texture2D> hazirRenkDokulari = new List<Texture2D>(); private static float sonUretilenHue = -1f; private static readonly Color[] HazirRenkler = (Color[])(object)new Color[10] { new Color(1f, 0.55f, 0.15f), new Color(1f, 0.96f, 0.88f), new Color(0.2f, 0.75f, 1f), new Color(0.15f, 0.95f, 0.45f), new Color(0.75f, 0.25f, 1f), new Color(1f, 0.15f, 0.2f), new Color(1f, 0.82f, 0.15f), new Color(0.1f, 0.95f, 0.85f), new Color(1f, 0.35f, 0.75f), new Color(1f, 0.38f, 0.05f) }; private static readonly HashSet<Container> AktifSandiklar = new HashSet<Container>(); private static readonly Dictionary<int, float> SonKontrolZamani = new Dictionary<int, float>(); private static readonly Dictionary<int, float> OrijinalIntensity = new Dictionary<int, float>(); private static readonly Dictionary<int, float> OrijinalRange = new Dictionary<int, float>(); public static bool PencereAcik => (Object)(object)seciliAtes != (Object)null && seciliAtes.IsValid(); private void Awake() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) ModAktif = ((BaseUnityPlugin)this).Config.Bind<bool>("Genel", "ModAktif", true, "Mesale/Somine ozel isik rengi ve menzil penceresini acar/kapatir"); IsikAyarTusu = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Kontroller", "IsikAyarTusu", (KeyCode)107, "Baktiginiz isik kaynaginin renk ve menzil penceresini acma tusu"); OtoYakitAktif = ((BaseUnityPlugin)this).Config.Bind<bool>("Otomatik Yakit", "OtoYakitAktif", true, "Isik kaynaklarinin yakindaki sandiklardan otomatik yakit cekmesini saglar"); YakitCekmeMenzili = ((BaseUnityPlugin)this).Config.Bind<int>("Otomatik Yakit", "YakitCekmeMenzili", 15, "Yakit cekilecek maksimum sandik mesafesi (metre)"); OtoYakitToggleTusu = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Kontroller", "OtoYakitToggleTusu", (KeyCode)106, "Baktiginiz isik kaynagi icin oto yakit cekmeyi acma/kapatma tusu"); CorePlugin.AyarEkle("Ozel Mesale Isigi", "Mod Aktif", "Gelismis renk paletli mesale ve somine ayar penceresini acar.", ModAktif); CorePlugin.AyarEkle("Ozel Mesale Isigi", "Isik Penceresi Tusu", "Baktiginiz mesalede renk/menzil penceresini acar.", IsikAyarTusu); CorePlugin.AyarEkle("Ozel Mesale Isigi", "Oto Yakit Cekme", "Tum mesale ve ateslerin en yakin sandiktan otomatik yakit cekmesini acar.", OtoYakitAktif); CorePlugin.AyarEkle("Ozel Mesale Isigi", "Oto Yakit Tusu", "Baktiginiz atesin oto yakit ozelligini acip kapatir.", OtoYakitToggleTusu); new Harmony("com.lareins.customtorches").PatchAll(typeof(CustomTorchesPlugin)); } [HarmonyPatch(typeof(Container), "Awake")] [HarmonyPostfix] private static void SandikKaydet(Container __instance) { if ((Object)(object)__instance != (Object)null) { AktifSandiklar.Add(__instance); } } [HarmonyPatch(typeof(InventoryGui), "IsVisible")] [HarmonyPostfix] private static void ArayuzAcikBildir(ref bool __result) { if (PencereAcik) { __result = true; } } [HarmonyPatch(typeof(GameCamera), "UpdateCamera")] [HarmonyPrefix] private static bool KamerayiDondur() { return !PencereAcik; } [HarmonyPatch(typeof(GameCamera), "UpdateMouseCapture")] [HarmonyPrefix] private static bool ImlecKilidiniEngelle() { if (PencereAcik) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; return false; } return true; } [HarmonyPatch(typeof(Fireplace), "GetHoverText")] [HarmonyPostfix] private static void MesaleEtiketi(Fireplace __instance, ref string __result) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (ModAktif.Value) { __result += $"\n[<color=orange>{IsikAyarTusu.Value}</color>] Isik Rengi ve Menzil Ayarla"; if (OtoYakitAktif.Value && (Object)(object)__instance.m_fuelItem != (Object)null) { ZNetView component = ((Component)__instance).GetComponent<ZNetView>(); string arg = (((Object)(object)component == (Object)null || !component.IsValid() || component.GetZDO().GetBool("Lareins_OtoYakit", true)) ? "<color=green>ACIK</color>" : "<color=red>KAPALI</color>"); __result += $"\n[<color=yellow>{OtoYakitToggleTusu.Value}</color>] Sandiktan Oto Yakit: {arg}"; } } } [HarmonyPatch(typeof(Fireplace), "UpdateFireplace")] [HarmonyPostfix] private static void IsikVeYakitUygula(Fireplace __instance) { if (!ModAktif.Value) { return; } ZNetView component = ((Component)__instance).GetComponent<ZNetView>(); if ((Object)(object)component == (Object)null || !component.IsValid()) { return; } IsikDegerleriniUygula(__instance, component); if (!OtoYakitAktif.Value || !component.IsOwner() || !((Object)(object)__instance.m_fuelItem != (Object)null) || !(__instance.m_maxFuel > 0f) || !component.GetZDO().GetBool("Lareins_OtoYakit", true)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!SonKontrolZamani.TryGetValue(instanceID, out var value) || !(Time.time - value < 10f)) { float num = component.GetZDO().GetFloat("fuel", 0f); if (num <= __instance.m_maxFuel - 1f) { SonKontrolZamani[instanceID] = Time.time; SandiktanYakitCek(__instance, component, num); } } } private static void IsikDegerleriniUygula(Fireplace fp, ZNetView nv) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Invalid comparison between Unknown and I4 //IL_01ce: Unknown result type (might be due to invalid IL or missing references) bool flag = (Object)(object)seciliAtes != (Object)null && (Object)(object)seciliAtes == (Object)(object)nv; bool flag2 = flag || nv.GetZDO().GetBool("Lareins_OzelIsik", false); Color color = default(Color); float num; float num2; if (flag) { color = Color.HSVToRGB(hue, sat, CustomTorchesPlugin.val); num = parlaklikYuzde / 100f; num2 = menzilYuzde / 100f; } else { if (!flag2) { return; } float num3 = nv.GetZDO().GetFloat("Lareins_R", 1f); float num4 = nv.GetZDO().GetFloat("Lareins_G", 0.55f); float num5 = nv.GetZDO().GetFloat("Lareins_B", 0.15f); ((Color)(ref color))..ctor(num3, num4, num5); num = nv.GetZDO().GetFloat("Lareins_Parlaklik", 100f) / 100f; num2 = nv.GetZDO().GetFloat("Lareins_Menzil", 100f) / 100f; } Light[] componentsInChildren = ((Component)fp).GetComponentsInChildren<Light>(true); foreach (Light val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && (int)val.type == 2) { int instanceID = ((Object)val).GetInstanceID(); if (!OrijinalIntensity.ContainsKey(instanceID)) { OrijinalIntensity[instanceID] = Mathf.Max(0.8f, val.intensity); OrijinalRange[instanceID] = Mathf.Max(5f, val.range); } float num6 = OrijinalIntensity[instanceID] * num; float num7 = OrijinalRange[instanceID] * num2; val.color = color; val.intensity = num6; val.range = num7; LightFlicker component = ((Component)val).GetComponent<LightFlicker>(); if ((Object)(object)component != (Object)null) { Traverse.Create((object)component).Field("m_baseIntensity").SetValue((object)num6); Traverse.Create((object)component).Field("m_baseRange").SetValue((object)num7); } } } } private static void SandiktanYakitCek(Fireplace ates, ZNetView atesNv, float mevcutYakit) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) string gerekenYakitAdi = ates.m_fuelItem.m_itemData.m_shared.m_name; float num = YakitCekmeMenzili.Value; Vector3 position = ((Component)ates).transform.position; AktifSandiklar.RemoveWhere((Container c) => (Object)(object)c == (Object)null); Container val = null; float num2 = num; foreach (Container item in AktifSandiklar) { if (item.IsInUse() || item.GetInventory() == null) { continue; } float num3 = Vector3.Distance(position, ((Component)item).transform.position); if (!(num3 <= num2)) { continue; } List<ItemData> allItems = item.GetInventory().GetAllItems(); for (int num4 = 0; num4 != allItems.Count; num4++) { if (allItems[num4].m_shared.m_name == gerekenYakitAdi && allItems[num4].m_stack > 0) { num2 = num3; val = item; break; } } } if (!((Object)(object)val != (Object)null)) { return; } ZNetView component = ((Component)val).GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && component.IsValid()) { Inventory inventory = val.GetInventory(); ItemData val2 = ((IEnumerable<ItemData>)inventory.GetAllItems()).FirstOrDefault((Func<ItemData, bool>)((ItemData i) => i.m_shared.m_name == gerekenYakitAdi)); if (val2 != null && val2.m_stack > 0) { component.ClaimOwnership(); inventory.RemoveOneItem(val2); float num5 = Mathf.Min(ates.m_maxFuel, mevcutYakit + 1f); atesNv.GetZDO().Set("fuel", num5); } } } private void Update() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) if (!ModAktif.Value || (Object)(object)Player.m_localPlayer == (Object)null) { return; } if (PencereAcik) { Fireplace component = ((Component)seciliAtes).GetComponent<Fireplace>(); if ((Object)(object)component != (Object)null) { IsikDegerleriniUygula(component, seciliAtes); } if (Input.GetKeyDown((KeyCode)27) || Input.GetKeyDown(IsikAyarTusu.Value)) { PencereyiKapat(); } } else { if (TextInput.IsVisible() || Minimap.IsOpen() || InventoryGui.IsVisible()) { return; } if (Input.GetKeyDown(IsikAyarTusu.Value)) { GameObject hoverObject = ((Humanoid)Player.m_localPlayer).GetHoverObject(); Fireplace val = ((hoverObject != null) ? hoverObject.GetComponentInParent<Fireplace>() : null); ZNetView val2 = ((val != null) ? ((Component)val).GetComponentInParent<ZNetView>() : null); if ((Object)(object)val2 != (Object)null && val2.IsValid()) { seciliAtes = val2; float num = val2.GetZDO().GetFloat("Lareins_R", 1f); float num2 = val2.GetZDO().GetFloat("Lareins_G", 0.55f); float num3 = val2.GetZDO().GetFloat("Lareins_B", 0.15f); Color.RGBToHSV(new Color(num, num2, num3), ref hue, ref sat, ref CustomTorchesPlugin.val); if (CustomTorchesPlugin.val < 0.2f) { CustomTorchesPlugin.val = 1f; } parlaklikYuzde = val2.GetZDO().GetFloat("Lareins_Parlaklik", 100f); menzilYuzde = val2.GetZDO().GetFloat("Lareins_Menzil", 100f); Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; } } if (OtoYakitAktif.Value && Input.GetKeyDown(OtoYakitToggleTusu.Value)) { GameObject hoverObject2 = ((Humanoid)Player.m_localPlayer).GetHoverObject(); Fireplace val3 = ((hoverObject2 != null) ? hoverObject2.GetComponentInParent<Fireplace>() : null); ZNetView val4 = ((val3 != null) ? ((Component)val3).GetComponentInParent<ZNetView>() : null); if ((Object)(object)val4 != (Object)null && val4.IsValid() && (Object)(object)val3.m_fuelItem != (Object)null) { val4.ClaimOwnership(); bool flag = val4.GetZDO().GetBool("Lareins_OtoYakit", true); bool flag2 = !flag; val4.GetZDO().Set("Lareins_OtoYakit", flag2); ((Character)Player.m_localPlayer).Message((MessageType)2, "Sandiktan Oto Yakit: " + (flag2 ? "ACIK" : "KAPALI"), 0, (Sprite)null, false); } } } } private static void PencereyiKapat() { seciliAtes = null; Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; } private static void ArayuzDokulariniHazirla() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_003b: 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_005d: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_0147: 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) if ((Object)(object)panelDoku == (Object)null) { panelDoku = new Texture2D(1, 1); panelDoku.SetPixel(0, 0, new Color(0.09f, 0.1f, 0.13f, 0.97f)); panelDoku.Apply(); ustBarDoku = new Texture2D(1, 1); ustBarDoku.SetPixel(0, 0, new Color(0.15f, 0.17f, 0.22f, 1f)); ustBarDoku.Apply(); cerceveDoku = new Texture2D(1, 1); cerceveDoku.SetPixel(0, 0, new Color(0.78f, 0.6f, 0.25f, 0.9f)); cerceveDoku.Apply(); onizlemeDoku = new Texture2D(1, 1); hueCubuguDoku = new Texture2D(256, 1); for (int i = 0; i != 256; i++) { hueCubuguDoku.SetPixel(i, 0, Color.HSVToRGB((float)i / 255f, 1f, 1f)); } hueCubuguDoku.Apply(); for (int j = 0; j != HazirRenkler.Length; j++) { Texture2D val = new Texture2D(1, 1); val.SetPixel(0, 0, HazirRenkler[j]); val.Apply(); hazirRenkDokulari.Add(val); } } if (!((Object)(object)renkKaresiDoku == (Object)null) && !(Mathf.Abs(sonUretilenHue - hue) > 0.005f)) { return; } sonUretilenHue = hue; if ((Object)(object)renkKaresiDoku == (Object)null) { renkKaresiDoku = new Texture2D(64, 64); } for (int k = 0; k != 64; k++) { float num = (float)k / 63f; for (int l = 0; l != 64; l++) { float num2 = (float)l / 63f; renkKaresiDoku.SetPixel(l, k, Color.HSVToRGB(hue, num2, num)); } } renkKaresiDoku.Apply(); } private void OnGUI() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Invalid comparison between Unknown and I4 //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: 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) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Invalid comparison between Unknown and I4 //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) if (!PencereAcik) { seciliAtes = null; return; } ArayuzDokulariniHazirla(); Color val = Color.HSVToRGB(hue, sat, CustomTorchesPlugin.val); onizlemeDoku.SetPixel(0, 0, val); onizlemeDoku.Apply(); float num = 380f; float num2 = 435f; float num3 = ((float)Screen.width - num) / 2f; float num4 = ((float)Screen.height - num2) / 2f; GUI.DrawTexture(new Rect(num3 - 1f, num4 - 1f, num + 2f, num2 + 2f), (Texture)(object)cerceveDoku); GUI.DrawTexture(new Rect(num3, num4, num, num2), (Texture)(object)panelDoku); GUI.DrawTexture(new Rect(num3, num4, num, 34f), (Texture)(object)ustBarDoku); GUI.Label(new Rect(num3 + 14f, num4 + 7f, 260f, 24f), "LAREINS RENK PALETI & ISIK AYARI"); if (GUI.Button(new Rect(num3 + num - 68f, num4 + 5f, 58f, 24f), "KAPAT")) { PencereyiKapat(); return; } Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(num3 + 15f, num4 + 46f, 220f, 140f); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x - 1f, ((Rect)(ref val2)).y - 1f, ((Rect)(ref val2)).width + 2f, ((Rect)(ref val2)).height + 2f), (Texture)(object)cerceveDoku); GUI.DrawTexture(val2, (Texture)(object)renkKaresiDoku); Event current = Event.current; if (((int)current.type == 0 || (int)current.type == 3) && ((Rect)(ref val2)).Contains(current.mousePosition)) { sat = Mathf.Clamp01((current.mousePosition.x - ((Rect)(ref val2)).x) / ((Rect)(ref val2)).width); CustomTorchesPlugin.val = Mathf.Clamp01(1f - (current.mousePosition.y - ((Rect)(ref val2)).y) / ((Rect)(ref val2)).height); current.Use(); } float num5 = ((Rect)(ref val2)).x + sat * ((Rect)(ref val2)).width - 4f; float num6 = ((Rect)(ref val2)).y + (1f - CustomTorchesPlugin.val) * ((Rect)(ref val2)).height - 4f; GUI.Box(new Rect(num5, num6, 8f, 8f), ""); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(num3 + 248f, num4 + 46f, 117f, 72f); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x - 1f, ((Rect)(ref val3)).y - 1f, ((Rect)(ref val3)).width + 2f, ((Rect)(ref val3)).height + 2f), (Texture)(object)cerceveDoku); GUI.DrawTexture(val3, (Texture)(object)onizlemeDoku); GUI.Label(new Rect(num3 + 248f, num4 + 124f, 117f, 65f), $"R: {Mathf.RoundToInt(val.r * 255f)}\nG: {Mathf.RoundToInt(val.g * 255f)}\nB: {Mathf.RoundToInt(val.b * 255f)}"); Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(num3 + 15f, num4 + 198f, 350f, 20f); GUI.DrawTexture(new Rect(((Rect)(ref val4)).x - 1f, ((Rect)(ref val4)).y - 1f, ((Rect)(ref val4)).width + 2f, ((Rect)(ref val4)).height + 2f), (Texture)(object)cerceveDoku); GUI.DrawTexture(val4, (Texture)(object)hueCubuguDoku); if (((int)current.type == 0 || (int)current.type == 3) && ((Rect)(ref val4)).Contains(current.mousePosition)) { hue = Mathf.Clamp01((current.mousePosition.x - ((Rect)(ref val4)).x) / ((Rect)(ref val4)).width); current.Use(); } GUI.Box(new Rect(((Rect)(ref val4)).x + hue * ((Rect)(ref val4)).width - 3f, ((Rect)(ref val4)).y - 2f, 6f, 24f), ""); GUI.Label(new Rect(num3 + 15f, num4 + 224f, 200f, 20f), "Hazir Renk Paleti:"); Rect val5 = default(Rect); for (int i = 0; i != HazirRenkler.Length; i++) { ((Rect)(ref val5))..ctor(num3 + 15f + (float)i * 35.2f, num4 + 245f, 31f, 24f); GUI.DrawTexture(val5, (Texture)(object)hazirRenkDokulari[i]); if (GUI.Button(val5, "", GUIStyle.none)) { Color.RGBToHSV(HazirRenkler[i], ref hue, ref sat, ref CustomTorchesPlugin.val); } } GUI.Label(new Rect(num3 + 15f, num4 + 282f, 130f, 22f), $"Parlaklik: %{Mathf.RoundToInt(parlaklikYuzde)}"); parlaklikYuzde = GUI.HorizontalSlider(new Rect(num3 + 145f, num4 + 287f, 220f, 20f), parlaklikYuzde, 20f, 400f); GUI.Label(new Rect(num3 + 15f, num4 + 314f, 130f, 22f), $"Isik Menzili: %{Mathf.RoundToInt(menzilYuzde)}"); menzilYuzde = GUI.HorizontalSlider(new Rect(num3 + 145f, num4 + 319f, 220f, 20f), menzilYuzde, 25f, 400f); if (GUI.Button(new Rect(num3 + 15f, num4 + 352f, 170f, 32f), "BU ISIGA KAYDET")) { AyariKaydet(seciliAtes); Player localPlayer = Player.m_localPlayer; if (localPlayer != null) { ((Character)localPlayer).Message((MessageType)2, "Isik ayari kaydedildi!", 0, (Sprite)null, false); } } if (GUI.Button(new Rect(num3 + 195f, num4 + 352f, 170f, 32f), "25m TUMUNE UYGULA")) { foreach (Fireplace item in from f in Object.FindObjectsByType<Fireplace>((FindObjectsSortMode)0) where Vector3.Distance(((Component)f).transform.position, ((Component)seciliAtes).transform.position) <= 25f select f) { ZNetView component = ((Component)item).GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && component.IsValid()) { AyariKaydet(component); } } Player localPlayer2 = Player.m_localPlayer; if (localPlayer2 != null) { ((Character)localPlayer2).Message((MessageType)2, "25m icindeki tum isiklara uygulandi!", 0, (Sprite)null, false); } } if (GUI.Button(new Rect(num3 + 15f, num4 + 392f, 350f, 28f), "VARSAYILANA SIFIRLA")) { seciliAtes.ClaimOwnership(); seciliAtes.GetZDO().Set("Lareins_OzelIsik", false); PencereyiKapat(); } } private static void AyariKaydet(ZNetView nv) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Color val = Color.HSVToRGB(hue, sat, CustomTorchesPlugin.val); nv.ClaimOwnership(); nv.GetZDO().Set("Lareins_OzelIsik", true); nv.GetZDO().Set("Lareins_R", val.r); nv.GetZDO().Set("Lareins_G", val.g); nv.GetZDO().Set("Lareins_B", val.b); nv.GetZDO().Set("Lareins_Parlaklik", parlaklikYuzde); nv.GetZDO().Set("Lareins_Menzil", menzilYuzde); } }