Decompiled source of UIShortcuts v1.1.0

AtlyssItemTweaks.dll

Decompiled a week ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
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("AtlyssItemTweaks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AtlyssItemTweaks")]
[assembly: AssemblyCopyright("Copyright © crpz1 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("66fa1810-9987-4b06-aeee-7ed34abe5e0d")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
[assembly: AssemblyVersion("1.1.0.7")]
namespace AtlyssUIShortcuts;

[BepInPlugin("crpz.AtlyssUIShortcuts", "AtlyssUIShortcuts", "1.1.0")]
public class AtlyssUIShortcuts : BaseUnityPlugin
{
	public static bool unlockedByUs;

	internal static ManualLogSource Logger { get; private set; }

	private void Awake()
	{
		Logger = ((BaseUnityPlugin)this).Logger;
		Logger.Log((LogLevel)8, (object)"hii :3");
	}

	private void Update()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Invalid comparison between Unknown and I4
		if ((Object)(object)Player._mainPlayer == (Object)null || (int)Player._mainPlayer._currentGameCondition != 1 || (Object)(object)CameraFunction._current == (Object)null)
		{
			return;
		}
		if (unlockedByUs && !CameraFunction._current._unlockedCamera)
		{
			Logger.Log((LogLevel)8, (object)"unlocking because we were forced to");
			unlockedByUs = false;
		}
		if (Input.GetKeyDown((KeyCode)308) && !CameraFunction._current._unlockedCamera)
		{
			Logger.Log((LogLevel)8, (object)"KeyDownEvent: LeftAlt");
			CameraFunction._current._unlockedCamera = true;
			unlockedByUs = true;
		}
		else if (Input.GetKeyUp((KeyCode)308) && unlockedByUs)
		{
			Logger.Log((LogLevel)8, (object)"KeyUpEvent: LeftAlt");
			CameraFunction._current._unlockedCamera = false;
			unlockedByUs = false;
		}
		HandleWorldPortalScroll();
		if (!((Object)(object)AtlyssNetworkManager._current == (Object)null) && !((Object)(object)PartyUIManager._current == (Object)null) && !AtlyssNetworkManager._current._soloMode && !((Object)(object)PartyUIManager._current._partyObject != (Object)null) && PartyUIManager._current._partyInviteElement.isEnabled)
		{
			if (Input.GetKeyDown((KeyCode)121))
			{
				Player._mainPlayer.Cmd_SetPartyInviteCondition((PartyInviteStatus)3);
			}
			if (Input.GetKeyDown((KeyCode)110))
			{
				Player._mainPlayer.Cmd_SetPartyInviteCondition((PartyInviteStatus)4);
			}
		}
	}

	private void HandleWorldPortalScroll()
	{
		//IL_002d: 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)
		if ((Object)(object)ZoneSelectionManager._current == (Object)null)
		{
			return;
		}
		ZoneSelectionManager current = ZoneSelectionManager._current;
		if (!current._isOpen)
		{
			return;
		}
		if (Input.mouseScrollDelta.y < 0f)
		{
			int num = current._worldPortal._selectedPortalEntry + 1;
			if (num <= current._worldPortal._worldPortalSlots.Length - 1 && Player._mainPlayer._waypointAttunements.Contains(current._worldPortal._worldPortalSlots[num]._mapLockID))
			{
				current._zoneSelectPrefabs[num].GetComponent<ZoneSelectionEntry>().Select_Entry();
			}
		}
		else if (Input.mouseScrollDelta.y > 0f && current._worldPortal._selectedPortalEntry != 0)
		{
			current._zoneSelectPrefabs[current._worldPortal._selectedPortalEntry - 1].GetComponent<ZoneSelectionEntry>().Select_Entry();
		}
	}
}