From 8e13e7e2874adc8982e16d1d2ed2e28d7480b45f Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sun, 19 May 2024 16:05:58 +0800 Subject: +1.57 --- .../Decompile/Rewired.Utils/ExternalTools.cs | 171 +++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 Thronefall_1_57/Decompile/Rewired.Utils/ExternalTools.cs (limited to 'Thronefall_1_57/Decompile/Rewired.Utils') diff --git a/Thronefall_1_57/Decompile/Rewired.Utils/ExternalTools.cs b/Thronefall_1_57/Decompile/Rewired.Utils/ExternalTools.cs new file mode 100644 index 0000000..d22fdd5 --- /dev/null +++ b/Thronefall_1_57/Decompile/Rewired.Utils/ExternalTools.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Rewired.Internal; +using Rewired.Utils.Interfaces; +using Rewired.Utils.Platforms.Windows; +using UnityEngine; +using UnityEngine.UI; +using UnityEngine.Windows; + +namespace Rewired.Utils; + +[EditorBrowsable(EditorBrowsableState.Never)] +public class ExternalTools : IExternalTools +{ + private static Func _getPlatformInitializerDelegate; + + private bool _isEditorPaused; + + private Action _EditorPausedStateChangedEvent; + + public static Func getPlatformInitializerDelegate + { + get + { + return _getPlatformInitializerDelegate; + } + set + { + _getPlatformInitializerDelegate = value; + } + } + + public bool isEditorPaused => _isEditorPaused; + + public bool UnityInput_IsTouchPressureSupported => UnityEngine.Input.touchPressureSupported; + + public event Action EditorPausedStateChangedEvent + { + add + { + _EditorPausedStateChangedEvent = (Action)Delegate.Combine(_EditorPausedStateChangedEvent, value); + } + remove + { + _EditorPausedStateChangedEvent = (Action)Delegate.Remove(_EditorPausedStateChangedEvent, value); + } + } + + public event Action XboxOneInput_OnGamepadStateChange; + + public void Destroy() + { + } + + public object GetPlatformInitializer() + { + return Main.GetPlatformInitializer(); + } + + public string GetFocusedEditorWindowTitle() + { + return string.Empty; + } + + public bool IsEditorSceneViewFocused() + { + return false; + } + + public bool LinuxInput_IsJoystickPreconfigured(string name) + { + return false; + } + + public int XboxOneInput_GetUserIdForGamepad(uint id) + { + return 0; + } + + public ulong XboxOneInput_GetControllerId(uint unityJoystickId) + { + return 0uL; + } + + public bool XboxOneInput_IsGamepadActive(uint unityJoystickId) + { + return false; + } + + public string XboxOneInput_GetControllerType(ulong xboxControllerId) + { + return string.Empty; + } + + public uint XboxOneInput_GetJoystickId(ulong xboxControllerId) + { + return 0u; + } + + public void XboxOne_Gamepad_UpdatePlugin() + { + } + + public bool XboxOne_Gamepad_SetGamepadVibration(ulong xboxOneJoystickId, float leftMotor, float rightMotor, float leftTriggerLevel, float rightTriggerLevel) + { + return false; + } + + public void XboxOne_Gamepad_PulseVibrateMotor(ulong xboxOneJoystickId, int motorInt, float startLevel, float endLevel, ulong durationMS) + { + } + + public void GetDeviceVIDPIDs(out List vids, out List pids) + { + vids = new List(); + pids = new List(); + } + + public int GetAndroidAPILevel() + { + return -1; + } + + public void WindowsStandalone_ForwardRawInput(IntPtr rawInputHeaderIndices, IntPtr rawInputDataIndices, uint indicesCount, IntPtr rawInputData, uint rawInputDataSize) + { + UnityEngine.Windows.Input.ForwardRawInput(rawInputHeaderIndices, rawInputDataIndices, indicesCount, rawInputData, rawInputDataSize); + } + + public bool UnityUI_Graphic_GetRaycastTarget(object graphic) + { + if (graphic as Graphic == null) + { + return false; + } + return (graphic as Graphic).raycastTarget; + } + + public void UnityUI_Graphic_SetRaycastTarget(object graphic, bool value) + { + if (!(graphic as Graphic == null)) + { + (graphic as Graphic).raycastTarget = value; + } + } + + public float UnityInput_GetTouchPressure(ref Touch touch) + { + return touch.pressure; + } + + public float UnityInput_GetTouchMaximumPossiblePressure(ref Touch touch) + { + return touch.maximumPossiblePressure; + } + + public IControllerTemplate CreateControllerTemplate(Guid typeGuid, object payload) + { + return ControllerTemplateFactory.Create(typeGuid, payload); + } + + public Type[] GetControllerTemplateTypes() + { + return ControllerTemplateFactory.templateTypes; + } + + public Type[] GetControllerTemplateInterfaceTypes() + { + return ControllerTemplateFactory.templateInterfaceTypes; + } +} -- cgit v1.1-26-g67d0