Skip to content

Commit

Permalink
Merge pull request #129 from whateverusername0/bleeding-edge
Browse files Browse the repository at this point in the history
0.18 update
  • Loading branch information
whateverusername0 authored Dec 21, 2023
2 parents 31b98dd + a53b3b0 commit 0e643e8
Show file tree
Hide file tree
Showing 46 changed files with 334 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,22 @@ public virtual SteamVR_Action_Vector2 WeaponWheelScroll
}
}

public virtual SteamVR_Action_Boolean NextWeapon
{
get
{
return SteamVR_Actions.default_NextWeapon;
}
}

public virtual SteamVR_Action_Boolean PrevWeapon
{
get
{
return SteamVR_Actions.default_PrevWeapon;
}
}

public virtual SteamVR_Action_Vibration Haptic
{
get
Expand Down
36 changes: 33 additions & 3 deletions New Unity Project/Assets/SteamVR_Input/SteamVR_Input_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ public partial class SteamVR_Actions

private static SteamVR_Action_Vector2 p_default_WeaponWheelScroll;

private static SteamVR_Action_Boolean p_default_NextWeapon;

private static SteamVR_Action_Boolean p_default_PrevWeapon;

private static SteamVR_Action_Vibration p_default_Haptic;

public static SteamVR_Action_Vector2 default_Movement
Expand Down Expand Up @@ -289,6 +293,22 @@ public static SteamVR_Action_Vector2 default_WeaponWheelScroll
}
}

public static SteamVR_Action_Boolean default_NextWeapon
{
get
{
return SteamVR_Actions.p_default_NextWeapon.GetCopy<SteamVR_Action_Boolean>();
}
}

public static SteamVR_Action_Boolean default_PrevWeapon
{
get
{
return SteamVR_Actions.p_default_PrevWeapon.GetCopy<SteamVR_Action_Boolean>();
}
}

public static SteamVR_Action_Vibration default_Haptic
{
get
Expand Down Expand Up @@ -327,6 +347,8 @@ private static void InitializeActionArrays()
SteamVR_Actions.default_LeftPose,
SteamVR_Actions.default_RightPose,
SteamVR_Actions.default_WeaponWheelScroll,
SteamVR_Actions.default_NextWeapon,
SteamVR_Actions.default_PrevWeapon,
SteamVR_Actions.default_Haptic};
Valve.VR.SteamVR_Input.actionsIn = new Valve.VR.ISteamVR_Action_In[] {
SteamVR_Actions.default_Movement,
Expand Down Expand Up @@ -355,7 +377,9 @@ private static void InitializeActionArrays()
SteamVR_Actions.default_Punch,
SteamVR_Actions.default_LeftPose,
SteamVR_Actions.default_RightPose,
SteamVR_Actions.default_WeaponWheelScroll};
SteamVR_Actions.default_WeaponWheelScroll,
SteamVR_Actions.default_NextWeapon,
SteamVR_Actions.default_PrevWeapon};
Valve.VR.SteamVR_Input.actionsOut = new Valve.VR.ISteamVR_Action_Out[] {
SteamVR_Actions.default_Haptic};
Valve.VR.SteamVR_Input.actionsVibration = new Valve.VR.SteamVR_Action_Vibration[] {
Expand Down Expand Up @@ -384,7 +408,9 @@ private static void InitializeActionArrays()
SteamVR_Actions.default_Slot9,
SteamVR_Actions.default_Slot0,
SteamVR_Actions.default_Whiplash,
SteamVR_Actions.default_Punch};
SteamVR_Actions.default_Punch,
SteamVR_Actions.default_NextWeapon,
SteamVR_Actions.default_PrevWeapon};
Valve.VR.SteamVR_Input.actionsSingle = new Valve.VR.SteamVR_Action_Single[0];
Valve.VR.SteamVR_Input.actionsVector2 = new Valve.VR.SteamVR_Action_Vector2[] {
SteamVR_Actions.default_Movement,
Expand Down Expand Up @@ -418,7 +444,9 @@ private static void InitializeActionArrays()
SteamVR_Actions.default_Slot0,
SteamVR_Actions.default_Whiplash,
SteamVR_Actions.default_Punch,
SteamVR_Actions.default_WeaponWheelScroll};
SteamVR_Actions.default_WeaponWheelScroll,
SteamVR_Actions.default_NextWeapon,
SteamVR_Actions.default_PrevWeapon};
}

private static void PreInitActions()
Expand Down Expand Up @@ -450,6 +478,8 @@ private static void PreInitActions()
SteamVR_Actions.p_default_LeftPose = ((SteamVR_Action_Pose)(SteamVR_Action.Create<SteamVR_Action_Pose>("/actions/default/in/LeftPose")));
SteamVR_Actions.p_default_RightPose = ((SteamVR_Action_Pose)(SteamVR_Action.Create<SteamVR_Action_Pose>("/actions/default/in/RightPose")));
SteamVR_Actions.p_default_WeaponWheelScroll = ((SteamVR_Action_Vector2)(SteamVR_Action.Create<SteamVR_Action_Vector2>("/actions/default/in/WeaponWheelScroll")));
SteamVR_Actions.p_default_NextWeapon = ((SteamVR_Action_Boolean)(SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/NextWeapon")));
SteamVR_Actions.p_default_PrevWeapon = ((SteamVR_Action_Boolean)(SteamVR_Action.Create<SteamVR_Action_Boolean>("/actions/default/in/PrevWeapon")));
SteamVR_Actions.p_default_Haptic = ((SteamVR_Action_Vibration)(SteamVR_Action.Create<SteamVR_Action_Vibration>("/actions/default/out/Haptic")));
}
}
Expand Down
10 changes: 10 additions & 0 deletions New Unity Project/Assets/StreamingAssets/SteamVR/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@
"name": "/actions/default/in/WeaponWheelScroll",
"type": "vector2"
},
{
"name": "/actions/default/in/NextWeapon",
"type": "boolean",
"requirement": "optional"
},
{
"name": "/actions/default/in/PrevWeapon",
"type": "boolean",
"requirement": "optional"
},
{
"name": "/actions/default/out/Haptic",
"type": "vibration",
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@
"name": "/actions/default/in/WeaponWheelScroll",
"type": "vector2"
},
{
"name": "/actions/default/in/NextWeapon",
"type": "boolean",
"requirement": "optional"
},
{
"name": "/actions/default/in/PrevWeapon",
"type": "boolean",
"requirement": "optional"
},
{
"name": "/actions/default/out/Haptic",
"type": "vibration",
Expand Down
Binary file modified Plugin/Libraries/Assembly-CSharp.dll
Binary file not shown.
Binary file modified Plugin/Libraries/Assembly-CSharp_nonpublicized.dll
Binary file not shown.
Binary file modified Plugin/Libraries/SteamVR/SteamVR.dll
Binary file not shown.
Binary file modified Plugin/Libraries/SteamVR/SteamVR_Actions.dll
Binary file not shown.
8 changes: 6 additions & 2 deletions Plugin/Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</Reference>
<Reference Include="SteamVR, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Plugin\Libraries\SteamVR\SteamVR.dll</HintPath>
<HintPath>Libraries\SteamVR\SteamVR.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SteamVR_Actions, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down Expand Up @@ -159,6 +159,8 @@
<Compile Include="Util\Libraries\EZSoftBone.cs" />
<Compile Include="Util\Versioning.cs" />
<Compile Include="VRTRAKILL\Assets.cs" />
<Compile Include="VRTRAKILL\Compatibility\JAKET.cs" />
<Compile Include="VRTRAKILL\Compatibility\UltraFunGuns.cs" />
<Compile Include="VRTRAKILL\Config\NewConfig.cs" />
<Compile Include="VRTRAKILL\Input\ControlMessages\MessageContainer.cs" />
<Compile Include="VRTRAKILL\Input\ControlMessages\Patches.cs" />
Expand All @@ -176,7 +178,7 @@
<Compile Include="VRTRAKILL\VRPlayer\Patches\A.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRAvatar\Armature\Finger.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRAvatar\Armature\Hand.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRAvatar\AvatarSizeCalibrator.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRAvatar\AvatarSizeAdjustor.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRAvatar\IKChain.cs" />
<Compile Include="Util\Libraries\WindowsInput\IInputDeviceStateAdaptor.cs" />
<Compile Include="Util\Libraries\WindowsInput\IInputMessageDispatcher.cs" />
Expand Down Expand Up @@ -254,6 +256,7 @@
<Compile Include="VRTRAKILL\VRPlayer\VRCamera\DesktopCamera.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRCamera\DesktopUICamera.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRCamera\Patches\A.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRCamera\Patches\CrashBandicrootCCP.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRCamera\ThirdPersonCamera.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRCamera\VRCameraController.cs" />
<Compile Include="VRTRAKILL\Config\ConfigJSON.cs" />
Expand All @@ -263,6 +266,7 @@
<Compile Include="VRTRAKILL\VRPlayer\VRCamera\Patches\CameraConverterP.cs" />
<Compile Include="VRTRAKILL\Vars.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRKeybindsController.cs" />
<Compile Include="VRTRAKILL\VRPlayer\VRPlayerController.cs" />
</ItemGroup>
<ItemGroup>
<None Include="CopyToGameRoot\ULTRAKILL\BepInEx\config\BepInEx.cfg">
Expand Down
9 changes: 2 additions & 7 deletions Plugin/PluginInfo.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Plugin
{
Expand All @@ -14,7 +9,7 @@ public static class PluginInfo
public const string
PLUGIN_GUID = "com.whateverusername0.vrtrakill", // do not change this string EVER
PLUGIN_NAME = "VRTRAKILL",
PLUGIN_VERSION = "0.16.0"; // never use spaces
PLUGIN_VERSION = "0.18.0"; // never use spaces

public static readonly string
PluginPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), // ".../BepInEx/plugins/VRTRAKILL"
Expand Down
2 changes: 1 addition & 1 deletion Plugin/Util/Versioning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void CheckForUpdates()

/// <summary>
/// Reprenents a version of the mod.
/// Structure: <c>"Major.Minor.Patch-revision"</c>
/// Structure: <c>"Major.Minor.Patch"</c>
/// </summary>
public readonly struct Version
{
Expand Down
4 changes: 2 additions & 2 deletions Plugin/VRTRAKILL/Assets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public static T LoadAsset<T>(AssetBundle Bundle, string PrefabName, string PathT
}
public static AssetBundle LoadBundle(string BundleName, string Path = null)
{
if (Path == null) Path = $"{PluginInfo.PluginPath}\\";
return AssetBundle.LoadFromFile($"{Path}\\{BundleName}");
if (Path == null) Path = $"{PluginInfo.PluginPath}";
return AssetBundle.LoadFromFile(System.IO.Path.Combine(Path, BundleName));
}
}
}
8 changes: 5 additions & 3 deletions Plugin/VRTRAKILL/Compatibility/Initializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@ public static void Start()

private static void PluginConfigurator()
{
Vars.Log.LogInfo("Detected PluginConfigurator! Building settings UI...");
Vars.Log.LogInfo("Detected PluginConfigurator!");
Compatibility.PluginConfigurator.Init();
}
private static void JAKET()
{
Vars.Log.LogInfo("Detected JAKET! No funationality added yet. WIP!");
Vars.Log.LogInfo("Detected JAKET!");
Compatibility.JAKET.Init();
}
private static void UFG()
{
Vars.Log.LogInfo("Detected UFG! No functionality added yet. WIP!");
Vars.Log.LogInfo("Detected UFG!");
Compatibility.UltraFunGuns.Init();
}
}
}
12 changes: 12 additions & 0 deletions Plugin/VRTRAKILL/Compatibility/JAKET.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace Plugin.VRTRAKILL.Compatibility
{
internal static class JAKET
{
public static void Init()
{
Vars.Log.LogInfo("No funationality added yet. WIP!");
}
}
}
8 changes: 3 additions & 5 deletions Plugin/VRTRAKILL/Compatibility/PluginConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
using UnityEngine;
using UnityEngine.SceneManagement;
using System;
using Object = UnityEngine.Object;
using Plugin.Util;

namespace Plugin.VRTRAKILL.Compatibility
{
internal static class PluginConfigurator
{
// You gotta love pluginconfigurator for all the bloat you need to write :) (eternalUnion i fucking hate you)

private static PluginConfig.API.PluginConfigurator PC;

// this shit doesn't scale!
Expand Down Expand Up @@ -79,6 +77,7 @@ static KeyCodeField

public static void Init()
{
Vars.Log.LogInfo("Building settings UI...");
PC = PluginConfig.API.PluginConfigurator.Create(PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_GUID);
PC.SetIconWithURL($"file://{PluginInfo.PluginPath}\\icon.png");
PC.saveToFile = false;
Expand Down Expand Up @@ -163,8 +162,7 @@ private static void AddVRKeybindsPanel()
TPCamRight = new KeyCodeField(VRKeybinds, "TPCam Right", "TPCRight", Vars.Config.VRKeybinds.TPCamRight.ToKeyCode());
TPCamMoveMode = new KeyCodeField(VRKeybinds, "TPCam move mode", "", Vars.Config.VRKeybinds.TPCamMoveMode.ToKeyCode());

new ConfigHeader(VRKeybinds, "--- PLACEHOLDER ---");
ToggleAvatarCalibration = new KeyCodeField(VRKeybinds, "Toggle Avatar Calibration", "ToggleAvatarC", Vars.Config.VRKeybinds.ToggleAvatarCalibration.ToKeyCode());
ToggleAvatarCalibration = new KeyCodeField(VRKeybinds, "Toggle Size Adjustment", "ToggleSizeAdj", Vars.Config.VRKeybinds.ToggleAvatarSizeAdj.ToKeyCode());

ToggleDV.onValueChange += (o) => Vars.Config.ChangeWrite(o.value, v => Vars.Config.VRKeybinds.ToggleDV = Enum.GetName(typeof(KeyCode), v));
ToggleTPC.onValueChange += (o) => Vars.Config.ChangeWrite(o.value, v => Vars.Config.VRKeybinds.ToggleTPC = Enum.GetName(typeof(KeyCode), v));
Expand All @@ -174,7 +172,7 @@ private static void AddVRKeybindsPanel()
TPCamLeft.onValueChange += (o) => Vars.Config.ChangeWrite(o.value, v => Vars.Config.VRKeybinds.TPCamLeft = Enum.GetName(typeof(KeyCode), v));
TPCamRight.onValueChange += (o) => Vars.Config.ChangeWrite(o.value, v => Vars.Config.VRKeybinds.TPCamRight = Enum.GetName(typeof(KeyCode), v));
TPCamMoveMode.onValueChange += (o) => Vars.Config.ChangeWrite(o.value, v => Vars.Config.VRKeybinds.TPCamMoveMode = Enum.GetName(typeof(KeyCode), v));
ToggleAvatarCalibration.onValueChange += (o) => Vars.Config.ChangeWrite(o.value, v => Vars.Config.VRKeybinds.ToggleAvatarCalibration = Enum.GetName(typeof(KeyCode), v));
ToggleAvatarCalibration.onValueChange += (o) => Vars.Config.ChangeWrite(o.value, v => Vars.Config.VRKeybinds.ToggleAvatarSizeAdj = Enum.GetName(typeof(KeyCode), v));
}
private static void AddControllersPanel()
{
Expand Down
12 changes: 12 additions & 0 deletions Plugin/VRTRAKILL/Compatibility/UltraFunGuns.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace Plugin.VRTRAKILL.Compatibility
{
internal static class UltraFunGuns
{
public static void Init()
{
Vars.Log.LogInfo("No functionality added yet. WIP!");
}
}
}
20 changes: 10 additions & 10 deletions Plugin/VRTRAKILL/Config/ConfigMaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static UnityEngine.KeyCode?
TPCamRight = UnityEngine.KeyCode.Joystick8Button9,
TPCamHoldMoveMode = UnityEngine.KeyCode.Joystick8Button9,

ToggleAvatarCalibration = UnityEngine.KeyCode.Joystick8Button9;
ToggleAvatarSizeAdj = UnityEngine.KeyCode.Joystick8Button9;

public static void Init()
{
Expand Down Expand Up @@ -159,18 +159,18 @@ private static void ConvertJSONToKeys(NewConfig._VRKeybinds VRConfig)
private readonly PlayerInput PI = new PlayerInput();
public string GetBindingString(string action)
{
if (!PI.Actions.TryGetValue(action, out InputActionState value)) return null;
//if (!PI.Actions.TryGetValue(action, out InputActionState value)) return null;

ReadOnlyArray<InputBinding> Bindings = value.Action.bindings;
for (int i = 0; i < Bindings.Count; i++)
{
if (Bindings[i].isComposite) return null;
//ReadOnlyArray<InputBinding> Bindings = value.Action.bindings;
//for (int i = 0; i < Bindings.Count; i++)
//{
// if (Bindings[i].isComposite) return null;

InputControl inputControl = InputSystem.FindControl(Bindings[i].path);
if (inputControl == null && inputControl?.device is Keyboard) continue;
// InputControl inputControl = InputSystem.FindControl(Bindings[i].path);
// if (inputControl == null && inputControl?.device is Keyboard) continue;

return inputControl.displayName;
}
// return inputControl.displayName;
//}
return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Plugin/VRTRAKILL/Config/NewConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class NewConfig
[JsonProperty("Rotate/Move TPCam Right")] public string TPCamRight { get; set; } = "RightArrow";
[JsonProperty("Third Person Camera move mode")] public string TPCamMoveMode { get; set; } = "RightShift";

[JsonProperty("Toggle Avatar Calibration (PLACEHOLDER)")] public string ToggleAvatarCalibration { get; set; } = "J";
[JsonProperty("Toggle Avatar Calibration (PLACEHOLDER)")] public string ToggleAvatarSizeAdj { get; set; } = "J";
}

[JsonProperty("Movement multiplier")] public float MovementMultiplier { get; set; } = 0.575f;
Expand Down
Loading

0 comments on commit 0e643e8

Please sign in to comment.