From 32907cef54d6395308527e832af5926663f37abc Mon Sep 17 00:00:00 2001
From: Nameless <85962933+Misfiy@users.noreply.github.com>
Date: Thu, 12 Dec 2024 15:44:24 +0100
Subject: [PATCH] input
---
ContentAPI/API/Components/CustomInputHandler.cs | 5 +++--
ContentAPI/API/Components/CustomKeybind.cs | 17 -----------------
.../API/Features/{Input.cs => CustomInput.cs} | 4 ++--
...{InputShowcase.cs => CustomInputShowcase.cs} | 4 ++--
4 files changed, 7 insertions(+), 23 deletions(-)
delete mode 100644 ContentAPI/API/Components/CustomKeybind.cs
rename ContentAPI/API/Features/{Input.cs => CustomInput.cs} (89%)
rename ContentAPI/Example/{InputShowcase.cs => CustomInputShowcase.cs} (81%)
diff --git a/ContentAPI/API/Components/CustomInputHandler.cs b/ContentAPI/API/Components/CustomInputHandler.cs
index 636f414..cc3ed29 100644
--- a/ContentAPI/API/Components/CustomInputHandler.cs
+++ b/ContentAPI/API/Components/CustomInputHandler.cs
@@ -1,15 +1,16 @@
namespace ContentAPI.API.Components
{
+ using ContentAPI.API.Features;
using UnityEngine;
///
- /// CustomKeybind controller.
+ /// Custom input handler.
///
public class CustomInputHandler : MonoBehaviour
{
private void Update()
{
- foreach (Features.Input input in Features.Input.Registered)
+ foreach (CustomInput input in CustomInput.Registered)
{
if (!Input.GetKeyDown(input.Key))
continue;
diff --git a/ContentAPI/API/Components/CustomKeybind.cs b/ContentAPI/API/Components/CustomKeybind.cs
deleted file mode 100644
index 1c6179e..0000000
--- a/ContentAPI/API/Components/CustomKeybind.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace ContentAPI.API.Monobehavior
-{
- using System.Linq;
- using UnityEngine;
-
- ///
- /// CustomKeybind controller.
- ///
- public class CustomKeybind : MonoBehaviour
- {
- private void Update()
- {
- foreach (Features.Input input in Features.Input.Registered.Where(input => Input.GetKeyDown(input.Key)))
- input.ProcessInput();
- }
- }
-}
\ No newline at end of file
diff --git a/ContentAPI/API/Features/Input.cs b/ContentAPI/API/Features/CustomInput.cs
similarity index 89%
rename from ContentAPI/API/Features/Input.cs
rename to ContentAPI/API/Features/CustomInput.cs
index 28ffc27..4f15b84 100644
--- a/ContentAPI/API/Features/Input.cs
+++ b/ContentAPI/API/Features/CustomInput.cs
@@ -6,12 +6,12 @@ namespace ContentAPI.API.Features
///
/// Input base class.
///
- public abstract class Input
+ public abstract class CustomInput
{
///
/// Gets the list of current Item Managers.
///
- public static HashSet Registered { get; } = new();
+ public static HashSet Registered { get; } = new();
///
/// Gets or sets the button to press.
diff --git a/ContentAPI/Example/InputShowcase.cs b/ContentAPI/Example/CustomInputShowcase.cs
similarity index 81%
rename from ContentAPI/Example/InputShowcase.cs
rename to ContentAPI/Example/CustomInputShowcase.cs
index 30fe54a..38e4587 100644
--- a/ContentAPI/Example/InputShowcase.cs
+++ b/ContentAPI/Example/CustomInputShowcase.cs
@@ -1,12 +1,12 @@
namespace ContentAPI.Example
{
+ using ContentAPI.API.Features;
using UnityEngine;
- using Input = ContentAPI.API.Features.Input;
///
/// KeyBind Showcase.
///
- public class InputShowcase : Input
+ public class CustomInputShowcase : CustomInput
{
///
public override KeyCode Key { get; set; } = KeyCode.Backspace;