diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..16e839d
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,31 @@
+name: Build project
+
+on: [ push ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - run: git fetch --prune --unshallow
+
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 5.0.x
+
+ - name: Install dependencies
+ run: dotnet restore src/
+
+ - name: Build
+ run: dotnet build src/ --configuration Release --no-restore
+
+ - name: Package
+ run: bash thunderstore/make_package.sh
+
+ - name: Upload artifacts
+ uses: actions/upload-artifact@v2
+ with:
+ name: Thunderstore Package
+ path: thunderstore/BetterHands.zip
\ No newline at end of file
diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml
deleted file mode 100644
index 2731a8e..0000000
--- a/.github/workflows/makefile.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: makefile
-
-on:
- push:
- pull_request:
- branches:
- - master
-
-jobs:
- makefile:
- name: Run Makefile
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
-
- - name: Setup .NET Core
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: 3.1.x
-
- - name: Execute make
- shell: bash
- run: make
-
- - name: Upload artifacts
- uses: actions/upload-artifact@v2
- with:
- name: BetterHands
- path: BetterHands.deli
diff --git a/BetterHands/hookgen.conf b/BetterHands/hookgen.conf
deleted file mode 100644
index 8f8ff48..0000000
--- a/BetterHands/hookgen.conf
+++ /dev/null
@@ -1 +0,0 @@
-Assembly-CSharp.dll
\ No newline at end of file
diff --git a/BetterHands/manifest.json b/BetterHands/manifest.json
deleted file mode 100644
index 86875f7..0000000
--- a/BetterHands/manifest.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "guid": "maiq.betterhands",
- "version": "1.3.0",
- "require": "0.4.1",
- "name": "BetterHands",
- "description": "Recolor controller geo, resize interaction spheres, and add mag palming.",
- "authors": [ "M'aiq" ],
- "source_url": "https://github.com/Maiq-The-Dude/BetterHands/",
- "assets": {
- "patcher": {
- "hookgen.conf": "deli:monomod.hookgen"
- },
- "setup": {
- "BetterHands.dll": "deli:assembly"
- }
- }
-}
diff --git a/README.md b/README.md
index 1a44f97..164767d 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# BetterHands
[](https://github.com/Maiq-The-Dude/BetterHands/releases/latest) [](https://discord.gg/g8xeFyt42j)
-A Deli mod to recolor controller geo, resize interaction spheres, and add mag palming.
+A mod to recolor controller geo, resize interaction spheres, and add mag palming.
All features are optional and configured via the config file. Configs can be edited mid-game, but will require a scene reload to take effect.
## Mag Palming
@@ -32,7 +32,10 @@ Mag palming allows you to carry two small sized magazines in one hand. To do thi
## Manual Installation
Requires
-- [Deli 0.4+](https://github.com/Deli-Collective/Deli/releases)
-- [Sodalite](https://github.com/H3VR-Modding/Sodalite/releases)
+- [BepInEx 5.4.x](https://github.com/BepInEx/BepInEx)
+- [BepInEx.Monomod.Loader](https://github.com/BepInEx/BepInEx.MonoMod.Loader)
+- [BepInEx.Monomod.HookGenPatcher](https://github.com/harbingerofme/Bepinex.Monomod.HookGenPatcher)
+- [Sodalite](https://github.com/H3VR-Modding/Sodalite)
-Extract the BetterHands `.zip` into the BepInEx plugins folder
+
+Download and open [BetterHands.zip](https://github.com/Maiq-The-Dude/BetterHands/releases/latest), then drag `BetterHands.dll` within into the `h3vr/bepinex/plugins/` directory
diff --git a/makefile b/makefile
deleted file mode 100644
index aaf6c63..0000000
--- a/makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-SHELL = /bin/bash
-
-GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
-GIT_HASH = $(shell git rev-parse HEAD)
-
-PROJECT = BetterHands
-PACKAGE = BetterHands.deli
-CONTENTS = manifest.json hookgen.conf BetterHands.dll
-
-CONFIG = Release
-FRAMEWORK = net35
-BUILD_PROPERTIES = /p:RepositoryBranch="$(GIT_BRANCH)" /p:RepositoryCommit="$(GIT_HASH)"
-
-.PHONY: all build clean
-
-all: clean $(PACKAGE)
-
-build:
- dotnet build --configuration $(CONFIG) --framework $(FRAMEWORK) $(BUILD_PROPERTIES)
-
-$(PACKAGE): build
- zip -9j $@ $(addprefix $(PROJECT)/bin/$(CONFIG)/$(FRAMEWORK)/,$(CONTENTS))
-
-clean:
- rm -f $(PACKAGE)
diff --git a/BetterHands.sln b/src/BetterHands.sln
similarity index 100%
rename from BetterHands.sln
rename to src/BetterHands.sln
diff --git a/BetterHands/BetterHands.csproj b/src/BetterHands/BetterHands.csproj
similarity index 73%
rename from BetterHands/BetterHands.csproj
rename to src/BetterHands/BetterHands.csproj
index f288ad4..4ee4235 100644
--- a/BetterHands/BetterHands.csproj
+++ b/src/BetterHands/BetterHands.csproj
@@ -7,7 +7,6 @@
-
@@ -22,13 +21,4 @@
-
-
- Always
-
-
- Always
-
-
-
diff --git a/BetterHands/Configs/Customization.cs b/src/BetterHands/Configs/Customization.cs
similarity index 100%
rename from BetterHands/Configs/Customization.cs
rename to src/BetterHands/Configs/Customization.cs
diff --git a/BetterHands/Configs/MagPalm.cs b/src/BetterHands/Configs/MagPalm.cs
similarity index 100%
rename from BetterHands/Configs/MagPalm.cs
rename to src/BetterHands/Configs/MagPalm.cs
diff --git a/BetterHands/Configs/MagPalmControls.cs b/src/BetterHands/Configs/MagPalmControls.cs
similarity index 100%
rename from BetterHands/Configs/MagPalmControls.cs
rename to src/BetterHands/Configs/MagPalmControls.cs
diff --git a/BetterHands/Configs/Root.cs b/src/BetterHands/Configs/Root.cs
similarity index 100%
rename from BetterHands/Configs/Root.cs
rename to src/BetterHands/Configs/Root.cs
diff --git a/BetterHands/Configs/zCheat.cs b/src/BetterHands/Configs/zCheat.cs
similarity index 100%
rename from BetterHands/Configs/zCheat.cs
rename to src/BetterHands/Configs/zCheat.cs
diff --git a/BetterHands/Customization/HandsRecolor.cs b/src/BetterHands/Customization/HandsRecolor.cs
similarity index 100%
rename from BetterHands/Customization/HandsRecolor.cs
rename to src/BetterHands/Customization/HandsRecolor.cs
diff --git a/BetterHands/MagPalming/Functionality.cs b/src/BetterHands/MagPalming/Functionality.cs
similarity index 92%
rename from BetterHands/MagPalming/Functionality.cs
rename to src/BetterHands/MagPalming/Functionality.cs
index bbc42da..4e6d3d3 100644
--- a/BetterHands/MagPalming/Functionality.cs
+++ b/src/BetterHands/MagPalming/Functionality.cs
@@ -45,7 +45,7 @@ private void FVRFireArmReloadTriggerMag_OnTriggerEnter(On.FistVR.FVRFireArmReloa
{
var triggerWell = collider.GetComponent();
var firearm = triggerWell.FireArm;
- if (mag.MagazineType == triggerWell.TypeOverride || mag.MagazineType == firearm.MagazineType && (firearm.EjectDelay <= 0f || mag != firearm.LastEjectedMag) && firearm.Magazine == null)
+ if (mag.MagazineType == triggerWell.TypeOverride || (mag.MagazineType == firearm.MagazineType && (firearm.EjectDelay <= 0f || mag != firearm.LastEjectedMag) && firearm.Magazine == null))
{
// Remove mag from qb, load, buzz loading hand, and unhide controller geo
mag.SetQuickBeltSlot(null);
@@ -65,7 +65,7 @@ private void FVRFireArmClipTriggerClip_OnTriggerEnter(On.FistVR.FVRFireArmClipTr
{
var triggerWell = collider.gameObject.GetComponent();
var firearm = triggerWell.FireArm;
- if (triggerWell != null && triggerWell.FireArm != null && firearm.ClipType == clip.ClipType && firearm.ClipEjectDelay <= 0f && firearm.Clip == null)
+ if (triggerWell?.FireArm != null && firearm.ClipType == clip.ClipType && firearm.ClipEjectDelay <= 0f && firearm.Clip == null)
{
// Remove from qb, load, buzz loading hand, and unhide controller geo
clip.SetQuickBeltSlot(null);
@@ -93,7 +93,7 @@ private bool FirearmLoadCheck(FVRPhysicalObject obj, Collider col, string layer)
if (fvrObj != null && MP.ObjInPalmSlot(fvrObj.QuickbeltSlot))
{
- return (col.gameObject.CompareTag(layer));
+ return col.gameObject.CompareTag(layer);
}
}
@@ -140,7 +140,7 @@ private void PhysicalMagazineReleaseLatch_OnCollisionStay(On.FistVR.PhysicalMaga
if (GM.CurrentSceneSettings.AreQuickbeltSlotsEnabled)
{
- if (col.collider.attachedRigidbody != null && col.collider.attachedRigidbody.gameObject.GetComponent() != null)
+ if (col.collider.attachedRigidbody?.gameObject.GetComponent() != null)
{
self.timeSinceLastCollision = 0f;
}
diff --git a/BetterHands/MagPalming/Input.cs b/src/BetterHands/MagPalming/Input.cs
similarity index 94%
rename from BetterHands/MagPalming/Input.cs
rename to src/BetterHands/MagPalming/Input.cs
index e41a7e8..a5da83a 100644
--- a/BetterHands/MagPalming/Input.cs
+++ b/src/BetterHands/MagPalming/Input.cs
@@ -169,10 +169,10 @@ private bool AllowPalming(FVRPhysicalObject item)
{
var cheatCfg = _config.zCheat;
- return (item is FVRFireArmMagazine mag && mag.Size <= cheatCfg.SizeLimit.Value ||
+ return (item is FVRFireArmMagazine mag && mag.Size <= cheatCfg.SizeLimit.Value) ||
item is FVRFireArmClip ||
- item is FVRFireArmRound && _config.MagPalm.RoundPalm.Value ||
- cheatCfg.CursedPalms.Value && !item.m_isHardnessed);
+ (item is FVRFireArmRound && _config.MagPalm.RoundPalm.Value) ||
+ (cheatCfg.CursedPalms.Value && !item.m_isHardnessed);
}
// If mag palm keybind matches grabbity keybind, suppress mag palm input if grabbity sphere is on an item
@@ -181,8 +181,8 @@ private bool GrabbityProtection(FVRViveHand hand, MagPalmControlsConfig.Keybind
if (_config.MagPalm.Controls.GrabbityProtection.Value)
{
var grabbityState = GM.Options.ControlOptions.WIPGrabbityButtonState;
- var grabbityConflict = (grabbityState == ControlOptions.WIPGrabbityButton.Trigger && (keybind == MagPalmControlsConfig.Keybind.Trigger)
- || grabbityState == ControlOptions.WIPGrabbityButton.Grab && (keybind == MagPalmControlsConfig.Keybind.Grip));
+ var grabbityConflict = ((grabbityState == ControlOptions.WIPGrabbityButton.Trigger && (keybind == MagPalmControlsConfig.Keybind.Trigger))
+ || (grabbityState == ControlOptions.WIPGrabbityButton.Grab && (keybind == MagPalmControlsConfig.Keybind.Grip)));
if (grabbityConflict)
{
return !hand.Grabbity_HoverSphere.gameObject.activeSelf;
diff --git a/BetterHands/MagPalming/MagPalm.cs b/src/BetterHands/MagPalming/MagPalm.cs
similarity index 96%
rename from BetterHands/MagPalming/MagPalm.cs
rename to src/BetterHands/MagPalming/MagPalm.cs
index c59ecbf..38ca4aa 100644
--- a/BetterHands/MagPalming/MagPalm.cs
+++ b/src/BetterHands/MagPalming/MagPalm.cs
@@ -130,14 +130,14 @@ private void ConfigMagPalming(Transform hand)
// Is object in any magpalm slot
public bool ObjInPalmSlot(FVRQuickBeltSlot slot)
{
- return (slot != null && (slot == QBList[HandSlots[0]] || slot == QBList[HandSlots[1]]));
+ return slot != null && (slot == QBList[HandSlots[0]] || slot == QBList[HandSlots[1]]);
}
public bool IsSpecificPalmSlotEmpty(FVRViveHand hand)
{
var qbSlot = hand.IsThisTheRightHand ? QBList[HandSlots[0]] : QBList[HandSlots[1]];
- return (qbSlot.CurObject == null);
+ return qbSlot.CurObject == null;
}
public FVRViveHand GetHandFromSlot(FVRQuickBeltSlot slot)
diff --git a/BetterHands/MagPalming/Visual.cs b/src/BetterHands/MagPalming/Visual.cs
similarity index 100%
rename from BetterHands/MagPalming/Visual.cs
rename to src/BetterHands/MagPalming/Visual.cs
diff --git a/BetterHands/Plugin.cs b/src/BetterHands/Plugin.cs
similarity index 85%
rename from BetterHands/Plugin.cs
rename to src/BetterHands/Plugin.cs
index e1d631f..2db6983 100644
--- a/BetterHands/Plugin.cs
+++ b/src/BetterHands/Plugin.cs
@@ -1,16 +1,18 @@
-using BetterHands.Configs;
+using BepInEx;
+using BetterHands.Configs;
using BetterHands.Customization;
using BetterHands.MagPalming;
-using Deli.Setup;
using FistVR;
using Sodalite.Api;
using System;
-using System.Linq;
using UnityEngine;
namespace BetterHands
{
- public class Plugin : DeliBehaviour
+ [BepInPlugin("maiq.BetterHands", "BetterHands", "1.4.0")]
+ [BepInDependency("nrgill28.Sodalite")]
+ [BepInProcess("h3vr.exe")]
+ public class Plugin : BaseUnityPlugin
{
private readonly RootConfig _config;
@@ -62,7 +64,7 @@ private void OnDestroy()
private void ScoreSubmissionManager()
{
var cfg = _config.zCheat;
- if (_config.MagPalm.Enable.Value && cfg.CursedPalms.Value || cfg.SizeLimit.Value > FVRPhysicalObject.FVRPhysicalObjectSize.Medium)
+ if ((_config.MagPalm.Enable.Value && cfg.CursedPalms.Value) || cfg.SizeLimit.Value > FVRPhysicalObject.FVRPhysicalObjectSize.Medium)
{
Logger.LogDebug("TNH scoring is disabled");
_leaderboardLock ??= LeaderboardAPI.GetLeaderboardDisableLock();
@@ -113,7 +115,7 @@ public static GameObject GetControllerFrom(FVRViveHand hand)
hand.Display_Controller_WMR
};
- var geo = controllerGeos.FirstOrDefault(g => g.activeSelf);
+ var geo = Array.Find(controllerGeos, g => g.activeSelf);
return geo ?? hand.Display_Controller;
}
diff --git a/libs/Assembly-CSharp_publicized.dll b/src/libs/Assembly-CSharp_publicized.dll
similarity index 100%
rename from libs/Assembly-CSharp_publicized.dll
rename to src/libs/Assembly-CSharp_publicized.dll
diff --git a/libs/MMHOOK_Assembly-CSharp.dll b/src/libs/MMHOOK_Assembly-CSharp.dll
similarity index 100%
rename from libs/MMHOOK_Assembly-CSharp.dll
rename to src/libs/MMHOOK_Assembly-CSharp.dll
diff --git a/libs/README.md b/src/libs/README.md
similarity index 100%
rename from libs/README.md
rename to src/libs/README.md
diff --git a/nuget.config b/src/nuget.config
similarity index 100%
rename from nuget.config
rename to src/nuget.config
diff --git a/thunderstore/.gitignore b/thunderstore/.gitignore
new file mode 100644
index 0000000..b1fdf51
--- /dev/null
+++ b/thunderstore/.gitignore
@@ -0,0 +1,2 @@
+TEMP/
+BetterHands.zip
\ No newline at end of file
diff --git a/thunderstore/icon.png b/thunderstore/icon.png
new file mode 100644
index 0000000..f23ddae
Binary files /dev/null and b/thunderstore/icon.png differ
diff --git a/thunderstore/make_package.sh b/thunderstore/make_package.sh
new file mode 100644
index 0000000..8a00669
--- /dev/null
+++ b/thunderstore/make_package.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+export TS_DIR="$(dirname "${BASH_SOURCE[0]}")"
+export VERSION=$(git describe --tags --abbrev=0 | sed -n 's/v\(.\+\)/\1/p')
+cd $TS_DIR
+
+# Delete the existing build if it exists
+rm BetterHands.zip
+
+# Create our temp folders
+mkdir -p TEMP/
+
+# Copy the files into them
+cp manifest.json TEMP/manifest.json
+cp icon.png TEMP/icon.png
+cp ../README.md TEMP/README.md
+cp ../src/BetterHands/bin/Release/net35/BetterHands.dll TEMP/BetterHands.dll
+
+# Modify the version number
+sed -i "s/{VERSION}/$VERSION/g" TEMP/manifest.json
+
+# Zip the folder
+cd TEMP
+zip -9r ../BetterHands.zip *
+
+# Delete the temp dir
+cd ..
+rm -r TEMP
diff --git a/thunderstore/manifest.json b/thunderstore/manifest.json
new file mode 100644
index 0000000..4fdd026
--- /dev/null
+++ b/thunderstore/manifest.json
@@ -0,0 +1,9 @@
+{
+ "name": "BetterHands",
+ "version_number": "1.4.0",
+ "dependencies": [
+ "nrgill28-Sodalite-1.0.0"
+ ],
+ "description": "Adds mag palming and controller color customization.",
+ "website_url": "https://github.com/Maiq-The-Dude/BetterHands"
+}