Merge branch 'main' into PlayerController

This commit is contained in:
Glence 2023-02-23 19:45:38 +08:00
commit 86b662c7dc
17 changed files with 709 additions and 10 deletions

View File

@ -11,8 +11,9 @@ public class ChangeSceneButton : Script
UIElement ui = GetComponent<UIElement>(); UIElement ui = GetComponent<UIElement>();
if (ui != null) if (ui != null)
{ {
ui.OnClick.RegisterAction(() => ui.OnRelease.RegisterAction(() =>
{ {
if (sceneID != 0) if (sceneID != 0)
{ {
Audio.PlaySFXOnce2D("event:/UI/success"); Audio.PlaySFXOnce2D("event:/UI/success");

View File

@ -37,11 +37,12 @@ layout(location = 1) out uint outEntityID;
void main() void main()
{ {
fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv); fragColor = texture(textures[nonuniformEXT(MatProp.data[In2.materialIndex].textureIndex)], In.uv);
fragColor.a = MatProp.data[In2.materialIndex].alpha;
if (fragColor.a < 0.01f) if (fragColor.a < 0.01f)
{ {
discard; fragColor = vec4(1.0f, 0.0f, 0.0f, 1.0f);
// discard;
} }
fragColor.a = MatProp.data[In2.materialIndex].alpha;
// fragColor.a = 1.0f; // fragColor.a = 1.0f;
outEntityID = In2.eid; outEntityID = In2.eid;

Binary file not shown.

View File

@ -132,16 +132,19 @@ namespace Sandbox
SHSystemManager::RegisterRoutine<SHTransformSystem, SHTransformSystem::TransformPostPhysicsUpdate>(); SHSystemManager::RegisterRoutine<SHTransformSystem, SHTransformSystem::TransformPostPhysicsUpdate>();
SHSystemManager::RegisterRoutine<SHDebugDrawSystem, SHDebugDrawSystem::ProcessPointsRoutine>(); SHSystemManager::RegisterRoutine<SHDebugDrawSystem, SHDebugDrawSystem::ProcessPointsRoutine>();
SHSystemManager::RegisterRoutine<SHScriptEngine, SHScriptEngine::GizmosDrawRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::PrepareRenderRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::BatcherDispatcherRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::BeginRoutine>();
//SHSystemManager::RegisterRoutine<SHCameraSystem, SHCameraSystem::EditorCameraUpdate>(); //SHSystemManager::RegisterRoutine<SHCameraSystem, SHCameraSystem::EditorCameraUpdate>();
SHSystemManager::RegisterRoutine<SHUISystem, SHUISystem::AddUIComponentRoutine>(); SHSystemManager::RegisterRoutine<SHUISystem, SHUISystem::AddUIComponentRoutine>();
SHSystemManager::RegisterRoutine<SHUISystem, SHUISystem::UpdateCanvasMatrixRoutine>(); SHSystemManager::RegisterRoutine<SHUISystem, SHUISystem::UpdateCanvasMatrixRoutine>();
SHSystemManager::RegisterRoutine<SHUISystem, SHUISystem::UpdateUIMatrixRoutine>(); SHSystemManager::RegisterRoutine<SHUISystem, SHUISystem::UpdateUIMatrixRoutine>();
SHSystemManager::RegisterRoutine<SHUISystem, SHUISystem::UpdateButtonsRoutine>(); SHSystemManager::RegisterRoutine<SHUISystem, SHUISystem::UpdateButtonsRoutine>();
SHSystemManager::RegisterRoutine<SHScriptEngine, SHScriptEngine::GizmosDrawRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::PrepareRenderRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::BatcherDispatcherRoutine>();
SHSystemManager::RegisterRoutine<SHGraphicsSystem, SHGraphicsSystem::BeginRoutine>();
SHSystemManager::RegisterRoutine<SHCameraSystem, SHCameraSystem::CameraSystemUpdate>(); SHSystemManager::RegisterRoutine<SHCameraSystem, SHCameraSystem::CameraSystemUpdate>();
#ifdef SHEDITOR #ifdef SHEDITOR

View File

@ -47,6 +47,8 @@ namespace SHADE
if (SHEditorWindow::Begin()) if (SHEditorWindow::Begin())
{ {
//ImGui::ShowDemoWindow(); //ImGui::ShowDemoWindow();
if (bindingRenames.size() != SHInputManager::CountBindings())
resizeVectors(SHInputManager::CountBindings());
//Binding count //Binding count
ImGui::Text("Binding Count: %d", SHInputManager::CountBindings()); ImGui::Text("Binding Count: %d", SHInputManager::CountBindings());
@ -127,6 +129,8 @@ namespace SHADE
{ {
SHInputManager::RenameBinding(binding.first, bindingRenames[entryNumber]); SHInputManager::RenameBinding(binding.first, bindingRenames[entryNumber]);
bindingRenames[entryNumber].clear(); bindingRenames[entryNumber].clear();
ImGui::End();
return;
} }
if (ImGui::Button(labelConcat("Delete Binding##", entryNumber).c_str())) if (ImGui::Button(labelConcat("Delete Binding##", entryNumber).c_str()))

View File

@ -14,6 +14,9 @@
#include <fstream> #include <fstream>
#include "SHInputManager.h" #include "SHInputManager.h"
#include "../Tools/SHException.h" #include "../Tools/SHException.h"
#include <Graphics/Windowing/SHWindow.h>
#include <Graphics/MiddleEnd/Interface/SHGraphicsSystem.h>
#include <Graphics/MiddleEnd/Interface/SHGraphicsSystemInterface.h>
namespace SHADE namespace SHADE
{ {
@ -21,6 +24,7 @@ namespace SHADE
/* Static defines */ /* Static defines */
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
bool SHInputManager::mouseCentering = false;
bool SHInputManager::controllerInUse = false; bool SHInputManager::controllerInUse = false;
std::map<std::string, SHInputManager::SHLogicalBindingData> SHInputManager::bindings; std::map<std::string, SHInputManager::SHLogicalBindingData> SHInputManager::bindings;
@ -751,6 +755,7 @@ namespace SHADE
{ {
++keyCount; ++keyCount;
keys[i] = true; keys[i] = true;
controllerInUse = false;
} }
else keys[i] = false; else keys[i] = false;
@ -801,6 +806,25 @@ namespace SHADE
mouseVelocityX = static_cast<double>(mouseScreenX - mouseScreenXLast) / dt; mouseVelocityX = static_cast<double>(mouseScreenX - mouseScreenXLast) / dt;
mouseVelocityY = static_cast<double>(mouseScreenY - mouseScreenYLast) / dt; mouseVelocityY = static_cast<double>(mouseScreenY - mouseScreenYLast) / dt;
//Mouse Centering
if (mouseCentering)
{
uint32_t width = SHADE::SHGraphicsSystemInterface::GetWindowWidth();
uint32_t height = SHADE::SHGraphicsSystemInterface::GetWindowHeight();
SetMouseWindowPosition(width / 2, height / 2);
//These four lines help a lot
POINT p;
GetCursorPos(&p);
mouseVelocityX -= static_cast<double>(p.x - mouseScreenX) / dt;
mouseVelocityY -= static_cast<double>(p.y - mouseScreenY) / dt;
}
if (mouseVelocityX != 0.0 || mouseVelocityY != 0.0)
controllerInUse = false;
//Mouse wheel vertical delta updating //Mouse wheel vertical delta updating
mouseWheelVerticalDelta = 0; mouseWheelVerticalDelta = 0;
mouseWheelVerticalDelta = mouseWheelVerticalDeltaPoll; mouseWheelVerticalDelta = mouseWheelVerticalDeltaPoll;

View File

@ -1074,6 +1074,18 @@ namespace SHADE
SetCursorPos(p.x, p.y); SetCursorPos(p.x, p.y);
} }
//Call to set the flag to start mouse centering every frame
static inline void SetMouseCentering(bool state) noexcept
{
mouseCentering = state;
}
//Get the flag whether mouse centering is on or not
static inline bool GetMouseCentering() noexcept
{
return mouseCentering;
}
private: private:
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
/* Constants */ /* Constants */
@ -1097,6 +1109,9 @@ namespace SHADE
/* Data Members */ /* Data Members */
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
//Whether mouse centering will be called every frame or not
static bool mouseCentering;
//If the last input is from controller(s) or KB/M //If the last input is from controller(s) or KB/M
//True if from controller(s), False if from KB/M //True if from controller(s), False if from KB/M
//Useful for switching control hints between controllers and KB/M //Useful for switching control hints between controllers and KB/M

View File

@ -369,6 +369,27 @@ namespace SHADE
return eventData->handle; return eventData->handle;
} }
SHEventHandle SHScriptEngine::onUIElementReleased(SHEventPtr eventPtr)
{
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
csUIElementOnReleased(eventData->data->EID);
return eventData->handle;
}
SHEventHandle SHScriptEngine::onUIElementOnHoverEntered(SHEventPtr eventPtr)
{
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
csUIElementOnHoverEntered(eventData->data->EID);
return eventData->handle;
}
SHEventHandle SHScriptEngine::onUIElementOnHoverExited(SHEventPtr eventPtr)
{
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
csUIElementOnHoverExited(eventData->data->EID);
return eventData->handle;
}
SHEventHandle SHScriptEngine::onSceneNodeChildrenAdded(SHEventPtr eventPtr) SHEventHandle SHScriptEngine::onSceneNodeChildrenAdded(SHEventPtr eventPtr)
{ {
auto eventData = reinterpret_cast<const SHEventSpec<SHSceneGraphAddChildEvent>*>(eventPtr.get()); auto eventData = reinterpret_cast<const SHEventSpec<SHSceneGraphAddChildEvent>*>(eventPtr.get());
@ -539,6 +560,24 @@ namespace SHADE
DEFAULT_CSHARP_NAMESPACE + ".UIElement", DEFAULT_CSHARP_NAMESPACE + ".UIElement",
"OnClicked" "OnClicked"
); );
csUIElementOnReleased = dotNet.GetFunctionPtr<CsEventRelayFuncPtr>
(
DEFAULT_CSHARP_LIB_NAME,
DEFAULT_CSHARP_NAMESPACE + ".UIElement",
"OnReleased"
);
csUIElementOnHoverEntered = dotNet.GetFunctionPtr<CsEventRelayFuncPtr>
(
DEFAULT_CSHARP_LIB_NAME,
DEFAULT_CSHARP_NAMESPACE + ".UIElement",
"OnHoverEntered"
);
csUIElementOnHoverExited = dotNet.GetFunctionPtr<CsEventRelayFuncPtr>
(
DEFAULT_CSHARP_LIB_NAME,
DEFAULT_CSHARP_NAMESPACE + ".UIElement",
"OnHoverExited"
);
csEditorRenderScripts = dotNet.GetFunctionPtr<CsScriptEditorFuncPtr> csEditorRenderScripts = dotNet.GetFunctionPtr<CsScriptEditorFuncPtr>
( (
DEFAULT_CSHARP_LIB_NAME, DEFAULT_CSHARP_LIB_NAME,
@ -608,6 +647,21 @@ namespace SHADE
std::make_shared<SHEventReceiverSpec<SHScriptEngine>>(this, &SHScriptEngine::onUIElementClicked) std::make_shared<SHEventReceiverSpec<SHScriptEngine>>(this, &SHScriptEngine::onUIElementClicked)
}; };
SHEventManager::SubscribeTo(SH_BUTTON_CLICK_EVENT, std::dynamic_pointer_cast<SHEventReceiver>(clickedUIElementEventReceiver)); SHEventManager::SubscribeTo(SH_BUTTON_CLICK_EVENT, std::dynamic_pointer_cast<SHEventReceiver>(clickedUIElementEventReceiver));
std::shared_ptr<SHEventReceiverSpec<SHScriptEngine>> releasedUIElementEventReceiver
{
std::make_shared<SHEventReceiverSpec<SHScriptEngine>>(this, &SHScriptEngine::onUIElementReleased)
};
SHEventManager::SubscribeTo(SH_BUTTON_RELEASE_EVENT, std::dynamic_pointer_cast<SHEventReceiver>(releasedUIElementEventReceiver));
std::shared_ptr<SHEventReceiverSpec<SHScriptEngine>> hoverEnterUIElementEventReceiver
{
std::make_shared<SHEventReceiverSpec<SHScriptEngine>>(this, &SHScriptEngine::onUIElementOnHoverEntered)
};
SHEventManager::SubscribeTo(SH_BUTTON_HOVER_ENTER_EVENT, std::dynamic_pointer_cast<SHEventReceiver>(hoverEnterUIElementEventReceiver));
std::shared_ptr<SHEventReceiverSpec<SHScriptEngine>> hoverExitedUIElementEventReceiver
{
std::make_shared<SHEventReceiverSpec<SHScriptEngine>>(this, &SHScriptEngine::onUIElementOnHoverExited)
};
SHEventManager::SubscribeTo(SH_BUTTON_HOVER_EXIT_EVENT, std::dynamic_pointer_cast<SHEventReceiver>(hoverExitedUIElementEventReceiver));
/* SceneGraph */ /* SceneGraph */
// Register for SceneNode child added event // Register for SceneNode child added event

View File

@ -292,6 +292,9 @@ namespace SHADE
CsEventRelayFuncPtr csSceneNodeChildrenChanged = nullptr; CsEventRelayFuncPtr csSceneNodeChildrenChanged = nullptr;
CsEventRelayFuncPtr csUIElementOnRemoved = nullptr; CsEventRelayFuncPtr csUIElementOnRemoved = nullptr;
CsEventRelayFuncPtr csUIElementOnClicked = nullptr; CsEventRelayFuncPtr csUIElementOnClicked = nullptr;
CsEventRelayFuncPtr csUIElementOnReleased = nullptr;
CsEventRelayFuncPtr csUIElementOnHoverEntered = nullptr;
CsEventRelayFuncPtr csUIElementOnHoverExited = nullptr;
// - Editor // - Editor
CsScriptEditorFuncPtr csEditorRenderScripts = nullptr; CsScriptEditorFuncPtr csEditorRenderScripts = nullptr;
CsFuncPtr csEditorUndo = nullptr; CsFuncPtr csEditorUndo = nullptr;
@ -306,6 +309,9 @@ namespace SHADE
SHEventHandle onColliderComponentRemoved(SHEventPtr eventPtr); SHEventHandle onColliderComponentRemoved(SHEventPtr eventPtr);
SHEventHandle onUIElementRemoved(SHEventPtr eventPtr); SHEventHandle onUIElementRemoved(SHEventPtr eventPtr);
SHEventHandle onUIElementClicked(SHEventPtr eventPtr); SHEventHandle onUIElementClicked(SHEventPtr eventPtr);
SHEventHandle onUIElementReleased(SHEventPtr eventPtr);
SHEventHandle onUIElementOnHoverEntered(SHEventPtr eventPtr);
SHEventHandle onUIElementOnHoverExited(SHEventPtr eventPtr);
SHEventHandle onSceneNodeChildrenAdded(SHEventPtr eventPtr); SHEventHandle onSceneNodeChildrenAdded(SHEventPtr eventPtr);
SHEventHandle onSceneNodeChildrenRemoved(SHEventPtr eventPtr); SHEventHandle onSceneNodeChildrenRemoved(SHEventPtr eventPtr);
SHEventHandle onSceneDestroyed(SHEventPtr eventPtr); SHEventHandle onSceneDestroyed(SHEventPtr eventPtr);

View File

@ -204,6 +204,7 @@ namespace SHADE
SHButtonClickEvent clickEvent; SHButtonClickEvent clickEvent;
clickEvent.EID = comp.GetEID(); clickEvent.EID = comp.GetEID();
SHEventManager::BroadcastEvent(clickEvent, SH_BUTTON_HOVER_ENTER_EVENT); SHEventManager::BroadcastEvent(clickEvent, SH_BUTTON_HOVER_ENTER_EVENT);
//SHLOG_INFO("C++ BROADCASTED HOVER ENTER EVENT EID: {}", clickEvent.EID);
} }
comp.isHovered = true; comp.isHovered = true;
@ -313,6 +314,7 @@ namespace SHADE
auto material = renderable->GetModifiableMaterial(); auto material = renderable->GetModifiableMaterial();
comp.currentTexture = textureID; comp.currentTexture = textureID;
material->SetProperty("data.textureIndex", SHResourceManager::LoadOrGet<SHTexture>(textureID)->TextureArrayIndex); material->SetProperty("data.textureIndex", SHResourceManager::LoadOrGet<SHTexture>(textureID)->TextureArrayIndex);
loadTexture = true;
} }
@ -367,6 +369,7 @@ namespace SHADE
auto material = renderable->GetModifiableMaterial(); auto material = renderable->GetModifiableMaterial();
comp.currentTexture = textureID; comp.currentTexture = textureID;
material->SetProperty("data.textureIndex", SHResourceManager::LoadOrGet<SHTexture>(textureID)); material->SetProperty("data.textureIndex", SHResourceManager::LoadOrGet<SHTexture>(textureID));
loadTexture = true;
} }
@ -390,6 +393,11 @@ namespace SHADE
if (SHSceneManager::CheckNodeAndComponentsActive<SHToggleButtonComponent>(comp.GetEID())) if (SHSceneManager::CheckNodeAndComponentsActive<SHToggleButtonComponent>(comp.GetEID()))
system->UpdateToggleButtonComponent(comp); system->UpdateToggleButtonComponent(comp);
} }
if (system->loadTexture == true)
{
system->loadTexture = false;
SHResourceManager::FinaliseChanges();
}
} }
SHVec2 SHUISystem::CanvasToScreenPoint(SHVec2& const canvasPoint, bool normalized) noexcept SHVec2 SHUISystem::CanvasToScreenPoint(SHVec2& const canvasPoint, bool normalized) noexcept

View File

@ -68,6 +68,8 @@ namespace SHADE
private: private:
bool loadTexture{false};
void UpdateUIComponent(SHUIComponent& comp) noexcept; void UpdateUIComponent(SHUIComponent& comp) noexcept;
void UpdateButtonComponent(SHButtonComponent& comp) noexcept; void UpdateButtonComponent(SHButtonComponent& comp) noexcept;
void UpdateToggleButtonComponent(SHToggleButtonComponent& comp) noexcept; void UpdateToggleButtonComponent(SHToggleButtonComponent& comp) noexcept;

View File

@ -28,6 +28,18 @@ namespace SHADE
: Component(entity) : Component(entity)
{} {}
void UIElement::ClearStaticEventData()
{
if (onClickEventMap != nullptr)
onClickEventMap->Clear();
if (onReleasedEventMap != nullptr)
onReleasedEventMap->Clear();
if (onHoverEnterEventMap != nullptr)
onHoverEnterEventMap->Clear();
if (onHoverExitEventMap != nullptr)
onHoverExitEventMap->Clear();
}
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Properties */ /* Properties */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -48,6 +60,57 @@ namespace SHADE
// Return the event // Return the event
return onClickEventMap[owner.EntityId]; return onClickEventMap[owner.EntityId];
} }
CallbackEvent^ UIElement::OnRelease::get()
{
// Create map if it wasn't before
if (onReleasedEventMap == nullptr)
{
onReleasedEventMap = gcnew System::Collections::Generic::Dictionary<Entity, CallbackEvent ^>();
}
// Create event if it wasn't before
if (!onReleasedEventMap->ContainsKey(owner.EntityId))
{
onReleasedEventMap->Add(owner.EntityId, gcnew CallbackEvent());
}
// Return the event
return onReleasedEventMap[owner.EntityId];
}
CallbackEvent^ UIElement::OnHoverEnter::get()
{
// Create map if it wasn't before
if (onHoverEnterEventMap == nullptr)
{
onHoverEnterEventMap = gcnew System::Collections::Generic::Dictionary<Entity, CallbackEvent ^>();
}
// Create event if it wasn't before
if (!onHoverEnterEventMap->ContainsKey(owner.EntityId))
{
onHoverEnterEventMap->Add(owner.EntityId, gcnew CallbackEvent());
}
// Return the event
return onHoverEnterEventMap[owner.EntityId];
}
CallbackEvent^ UIElement::OnHoverExit::get()
{
// Create map if it wasn't before
if (onHoverExitEventMap == nullptr)
{
onHoverExitEventMap = gcnew System::Collections::Generic::Dictionary<Entity, CallbackEvent ^>();
}
// Create event if it wasn't before
if (!onHoverExitEventMap->ContainsKey(owner.EntityId))
{
onHoverExitEventMap->Add(owner.EntityId, gcnew CallbackEvent());
}
// Return the event
return onHoverExitEventMap[owner.EntityId];
}
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Event Handling Functions */ /* Event Handling Functions */
@ -60,6 +123,18 @@ namespace SHADE
{ {
onClickEventMap->Remove(entity); onClickEventMap->Remove(entity);
} }
if (onReleasedEventMap != nullptr && onReleasedEventMap->ContainsKey(entity))
{
onReleasedEventMap->Remove(entity);
}
if (onHoverEnterEventMap != nullptr && onHoverEnterEventMap->ContainsKey(entity))
{
onHoverEnterEventMap->Remove(entity);
}
if (onHoverExitEventMap != nullptr && onHoverExitEventMap->ContainsKey(entity))
{
onHoverExitEventMap->Remove(entity);
}
SAFE_NATIVE_CALL_END("UIElement.OnComponentRemoved") SAFE_NATIVE_CALL_END("UIElement.OnComponentRemoved")
} }
void UIElement::OnClicked(EntityID entity) void UIElement::OnClicked(EntityID entity)
@ -72,4 +147,34 @@ namespace SHADE
} }
SAFE_NATIVE_CALL_END("UIElement.OnClicked") SAFE_NATIVE_CALL_END("UIElement.OnClicked")
} }
void UIElement::OnReleased(EntityID entity)
{
SAFE_NATIVE_CALL_BEGIN
// Remove the event if it contained an event
if (onReleasedEventMap != nullptr && onReleasedEventMap->ContainsKey(entity))
{
onReleasedEventMap[entity]->Invoke();
}
SAFE_NATIVE_CALL_END("UIElement.OnReleased")
}
void UIElement::OnHoverEntered(EntityID entity)
{
SAFE_NATIVE_CALL_BEGIN
// Remove the event if it contained an event
if (onHoverEnterEventMap != nullptr && onHoverEnterEventMap->ContainsKey(entity))
{
onHoverEnterEventMap[entity]->Invoke();
}
SAFE_NATIVE_CALL_END("UIElement.OnHoverEntered")
}
void UIElement::OnHoverExited(EntityID entity)
{
SAFE_NATIVE_CALL_BEGIN
// Remove the event if it contained an event
if (onHoverExitEventMap != nullptr && onHoverExitEventMap->ContainsKey(entity))
{
onHoverExitEventMap[entity]->Invoke();
}
SAFE_NATIVE_CALL_END("UIElement.OnHoverExited")
}
} }

View File

@ -50,6 +50,37 @@ namespace SHADE
{ {
CallbackEvent^ get(); CallbackEvent^ get();
} }
/// <summary>
/// Event that is raised when this UIElement is released.
/// </summary>
property CallbackEvent^ OnRelease
{
CallbackEvent^ get();
}
/// <summary>
/// Event that is raised on the first frame when this UIElement is hovered over.
/// </summary>
property CallbackEvent^ OnHoverEnter
{
CallbackEvent^ get();
}
/// <summary>
/// Event that is raised on the first frame when this UIElement is no longer
/// hovered over.
/// </summary>
property CallbackEvent^ OnHoverExit
{
CallbackEvent^ get();
}
internal:
/*-----------------------------------------------------------------------------*/
/* Static Clear Functions */
/*-----------------------------------------------------------------------------*/
/// <summary>
/// Disposes static event data which may contains data from SHADE_Scripting.
/// </summary>
static void ClearStaticEventData();
private: private:
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
@ -65,11 +96,32 @@ namespace SHADE
/// </summary> /// </summary>
/// <param name="entity">The entity which was clicked.</param> /// <param name="entity">The entity which was clicked.</param>
static void OnClicked(EntityID entity); static void OnClicked(EntityID entity);
/// <summary>
/// To be called from native code when this component is released from clicking.
/// </summary>
/// <param name="entity">The entity which was clicked.</param>
static void OnReleased(EntityID entity);
/// <summary>
/// To be called from native code on the first frame that this component is
/// hovered on.
/// </summary>
/// <param name="entity">The entity which was clicked.</param>
static void OnHoverEntered(EntityID entity);
/// <summary>
/// To be called from native code on the first frame that this component is
/// no longer hovered on.
/// </summary>
/// <param name="entity">The entity which was clicked.</param>
static void OnHoverExited(EntityID entity);
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
/* Static Data Members */ /* Static Data Members */
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
// As these hold references to code in SHADE_Scripting, we must remember to dispose of them when changing scenes
static System::Collections::Generic::Dictionary<Entity, CallbackEvent^>^ onClickEventMap; static System::Collections::Generic::Dictionary<Entity, CallbackEvent^>^ onClickEventMap;
static System::Collections::Generic::Dictionary<Entity, CallbackEvent^>^ onReleasedEventMap;
static System::Collections::Generic::Dictionary<Entity, CallbackEvent^>^ onHoverEnterEventMap;
static System::Collections::Generic::Dictionary<Entity, CallbackEvent^>^ onHoverExitEventMap;
}; };
} }

View File

@ -21,6 +21,7 @@ of DigiPen Institute of Technology is prohibited.
#include "Utility/Convert.hxx" #include "Utility/Convert.hxx"
#include "Utility/Debug.hxx" #include "Utility/Debug.hxx"
#include "Scripts/ScriptStore.hxx" #include "Scripts/ScriptStore.hxx"
#include "Components/UIElement.hxx"
namespace SHADE namespace SHADE
{ {
@ -43,6 +44,9 @@ namespace SHADE
oss << "[EngineInterface] Unloading " << Convert::ToNative(ManagedLibraryName) << ".dll"; oss << "[EngineInterface] Unloading " << Convert::ToNative(ManagedLibraryName) << ".dll";
ScriptStore::Exit(); ScriptStore::Exit();
// Unload static data of components that have access to the assembly
UIElement::ClearStaticEventData();
// Unload the script // Unload the script
scriptContext->Unload(); scriptContext->Unload();
scriptContext = nullptr; scriptContext = nullptr;

View File

@ -30,10 +30,29 @@ namespace SHADE
{ {
return SHInputManager::GetMouseWheelVerticalDelta(); return SHInputManager::GetMouseWheelVerticalDelta();
} }
bool Input::ControllerInUse::get()
{
return SHInputManager::GetControllerInUse();
}
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Usage Functions */ /* Usage Functions */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
bool Input::AnyKey()
{
return SHInputManager::AnyKey();
}
bool Input::AnyKeyDown()
{
return SHInputManager::AnyKeyDown();
}
bool Input::AnyKeyUp()
{
return SHInputManager::AnyKeyUp();
}
bool Input::GetKey(KeyCode key) bool Input::GetKey(KeyCode key)
{ {
return SHInputManager::GetKey(static_cast<SHInputManager::SH_KEYCODE>(key)); return SHInputManager::GetKey(static_cast<SHInputManager::SH_KEYCODE>(key));
@ -64,6 +83,50 @@ namespace SHADE
return SHInputManager::GetKeyUp(static_cast<SHInputManager::SH_KEYCODE>(mouseButton)); return SHInputManager::GetKeyUp(static_cast<SHInputManager::SH_KEYCODE>(mouseButton));
} }
bool Input::AnyControllerInput()
{
return SHInputManager::AnyControllerInput();
}
bool Input::AnyControllerInputDown()
{
return SHInputManager::AnyControllerInputDown();
}
bool Input::AnyControllerInputUp()
{
return SHInputManager::AnyControllerInputUp();
}
bool Input::AnyControllerButton()
{
return SHInputManager::AnyControllerButton();
}
bool Input::AnyControllerButtonDown()
{
return SHInputManager::AnyControllerButtonDown();
}
bool Input::AnyControllerButtonUp()
{
return SHInputManager::AnyControllerButtonUp();
}
bool Input::GetControllerInput(Input::ControllerCode code)
{
return SHInputManager::GetControllerInput(static_cast<SHInputManager::SH_CONTROLLERCODE>(code));
}
double Input::GetControllerInputNormalisedValue(Input::ControllerCode code)
{
double toReturn = 0.0;
SHInputManager::GetControllerInput(static_cast<SHInputManager::SH_CONTROLLERCODE>(code), &toReturn);
return toReturn;
}
bool Input::GetControllerInputDown(Input::ControllerCode code)
{
return SHInputManager::GetControllerInputDown(static_cast<SHInputManager::SH_CONTROLLERCODE>(code));
}
bool Input::GetControllerInputUp(Input::ControllerCode code)
{
return SHInputManager::GetControllerInputUp(static_cast<SHInputManager::SH_CONTROLLERCODE>(code));
}
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Cursor Functions */ /* Cursor Functions */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -76,6 +139,24 @@ namespace SHADE
); );
} }
Vector2 Input::GetMousePosition()
{
int x = 0;
int y = 0;
SHInputManager::GetMouseWindowPosition(&x, &y);
return Convert::ToCLI(SHVec2{ (float)x,(float)y });
}
void Input::SetMouseCentering(bool state)
{
SHInputManager::SetMouseCentering(state);
}
bool Input::GetMouseCentering()
{
return SHInputManager::GetMouseCentering();
}
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
/* Time Functions */ /* Time Functions */
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/
@ -106,4 +187,220 @@ namespace SHADE
return Convert::ToCLI(SHVec2{ (float)velX,(float)velY }); return Convert::ToCLI(SHVec2{ (float)velX,(float)velY });
} }
double Input::GetControllerInputHeldTime(Input::ControllerCode code)
{
return SHInputManager::GetControllerInputHeldTime(static_cast<SHInputManager::SH_CONTROLLERCODE>(code));
}
double Input::GetControllerInputReleasedTime(Input::ControllerCode code)
{
return SHInputManager::GetControllerInputReleasedTime(static_cast<SHInputManager::SH_CONTROLLERCODE>(code));
}
/*-----------------------------------------------------------------------------*/
/* Binding Functions */
/*-----------------------------------------------------------------------------*/
void Input::SaveBindings()
{
SHInputManager::SaveBindings();
}
void Input::SaveBindings(System::String^ targetFile)
{
SHInputManager::SaveBindings(Convert::ToNative(targetFile));
}
void Input::LoadBindings()
{
SHInputManager::LoadBindings();
}
void Input::LoadBindings(System::String^ sourceFile)
{
SHInputManager::LoadBindings(Convert::ToNative(sourceFile));
}
bool Input::GetBindingInverted(System::String^ bindingName)
{
return SHInputManager::GetBindingInverted(Convert::ToNative(bindingName));
}
void Input::SetBindingInverted(System::String^ bindingName, bool newValue)
{
SHInputManager::SetBindingInverted(Convert::ToNative(bindingName), newValue);
}
double Input::GetBindingGravity(System::String^ bindingName)
{
return SHInputManager::GetBindingGravity(Convert::ToNative(bindingName));
}
void Input::SetBindingGravity(System::String^ bindingName, double newValue)
{
SHInputManager::SetBindingGravity(Convert::ToNative(bindingName), newValue);
}
double Input::GetBindingDead(System::String^ bindingName)
{
return SHInputManager::GetBindingDead(Convert::ToNative(bindingName));
}
void Input::SetBindingDead(System::String^ bindingName, double newValue)
{
SHInputManager::SetBindingDead(Convert::ToNative(bindingName), newValue);
}
double Input::GetBindingSensitivity(System::String^ bindingName)
{
return SHInputManager::GetBindingSensitivity(Convert::ToNative(bindingName));
}
void Input::SetBindingSensitivity(System::String^ bindingName, double newValue)
{
SHInputManager::SetBindingSensitivity(Convert::ToNative(bindingName), newValue);
}
bool Input::GetBindingSnap(System::String^ bindingName)
{
return SHInputManager::GetBindingSnap(Convert::ToNative(bindingName));
}
void Input::SetBindingSnap(System::String^ bindingName, bool newValue)
{
SHInputManager::SetBindingSnap(Convert::ToNative(bindingName), newValue);
}
System::Collections::Generic::HashSet<Input::KeyCode>^ Input::GetBindingPositiveKeyCodes(System::String^ bindingName)
{
System::Collections::Generic::HashSet<Input::KeyCode>^ toReturn = gcnew System::Collections::Generic::HashSet<Input::KeyCode>();
std::set<SHInputManager::SH_KEYCODE> list = SHInputManager::GetBindingPositiveKeyCodes(Convert::ToNative(bindingName));
for (auto kc : list)
{
toReturn->Add(static_cast<Input::KeyCode>(kc));
}
return toReturn;
}
void Input::AddBindingPositiveKeyCode(System::String^ bindingName, Input::KeyCode toAdd)
{
SHInputManager::AddBindingPositiveKeyCode(Convert::ToNative(bindingName), static_cast<SHInputManager::SH_KEYCODE>(toAdd));
}
void Input::RemoveBindingPositiveKeyCode(System::String^ bindingName, Input::KeyCode toRemove)
{
SHInputManager::RemoveBindingPositiveKeyCode(Convert::ToNative(bindingName), static_cast<SHInputManager::SH_KEYCODE>(toRemove));
}
void Input::ClearBindingPositiveKeyCodes(System::String^ bindingName)
{
SHInputManager::ClearBindingPositiveKeyCodes(Convert::ToNative(bindingName));
}
System::Collections::Generic::HashSet<Input::KeyCode>^ Input::GetBindingNegativeKeyCodes(System::String^ bindingName)
{
System::Collections::Generic::HashSet<Input::KeyCode>^ toReturn = gcnew System::Collections::Generic::HashSet<Input::KeyCode>();
std::set<SHInputManager::SH_KEYCODE> list = SHInputManager::GetBindingNegativeKeyCodes(Convert::ToNative(bindingName));
for (auto kc : list)
{
toReturn->Add(static_cast<Input::KeyCode>(kc));
}
return toReturn;
}
void Input::AddBindingNegativeKeyCode(System::String^ bindingName, Input::KeyCode toAdd)
{
SHInputManager::AddBindingNegativeKeyCode(Convert::ToNative(bindingName), static_cast<SHInputManager::SH_KEYCODE>(toAdd));
}
void Input::RemoveBindingNegativeKeyCode(System::String^ bindingName, Input::KeyCode toRemove)
{
SHInputManager::RemoveBindingNegativeKeyCode(Convert::ToNative(bindingName), static_cast<SHInputManager::SH_KEYCODE>(toRemove));
}
void Input::ClearBindingNegativeKeyCodes(System::String^ bindingName)
{
SHInputManager::ClearBindingNegativeKeyCodes(Convert::ToNative(bindingName));
}
System::Collections::Generic::HashSet<Input::ControllerCode>^ Input::GetBindingPositiveControllerCodes(System::String^ bindingName)
{
System::Collections::Generic::HashSet<Input::ControllerCode>^ toReturn = gcnew System::Collections::Generic::HashSet<Input::ControllerCode>();
std::set<SHInputManager::SH_CONTROLLERCODE> list = SHInputManager::GetBindingPositiveControllerCodes(Convert::ToNative(bindingName));
for (auto kc : list)
{
toReturn->Add(static_cast<Input::ControllerCode>(kc));
}
return toReturn;
}
void Input::AddBindingPositiveControllerCode(System::String^ bindingName, Input::ControllerCode toAdd)
{
SHInputManager::AddBindingPositiveControllerCode(Convert::ToNative(bindingName), static_cast<SHInputManager::SH_CONTROLLERCODE>(toAdd));
}
void Input::RemoveBindingPositiveControllerCode(System::String^ bindingName, Input::ControllerCode toRemove)
{
SHInputManager::RemoveBindingPositiveControllerCode(Convert::ToNative(bindingName), static_cast<SHInputManager::SH_CONTROLLERCODE>(toRemove));
}
void Input::ClearBindingPositiveControllerCodes(System::String^ bindingName)
{
SHInputManager::ClearBindingPositiveControllerCodes(Convert::ToNative(bindingName));
}
System::Collections::Generic::HashSet<Input::ControllerCode>^ Input::GetBindingNegativeControllerCodes(System::String^ bindingName)
{
System::Collections::Generic::HashSet<Input::ControllerCode>^ toReturn = gcnew System::Collections::Generic::HashSet<Input::ControllerCode>();
std::set<SHInputManager::SH_CONTROLLERCODE> list = SHInputManager::GetBindingNegativeControllerCodes(Convert::ToNative(bindingName));
for (auto kc : list)
{
toReturn->Add(static_cast<Input::ControllerCode>(kc));
}
return toReturn;
}
void Input::AddBindingNegativeControllerCode(System::String^ bindingName, Input::ControllerCode toAdd)
{
SHInputManager::AddBindingNegativeControllerCode(Convert::ToNative(bindingName), static_cast<SHInputManager::SH_CONTROLLERCODE>(toAdd));
}
void Input::RemoveBindingNegativeControllerCode(System::String^ bindingName, Input::ControllerCode toRemove)
{
SHInputManager::RemoveBindingNegativeControllerCode(Convert::ToNative(bindingName), static_cast<SHInputManager::SH_CONTROLLERCODE>(toRemove));
}
void Input::ClearBindingNegativeControllerCodes(System::String^ bindingName)
{
SHInputManager::ClearBindingNegativeControllerCodes(Convert::ToNative(bindingName));
}
double Input::GetBindingAxis(System::String^ bindingName)
{
return SHInputManager::GetBindingAxis(Convert::ToNative(bindingName));
}
double Input::GetBindingAxisRaw(System::String^ bindingName)
{
return SHInputManager::GetBindingAxisRaw(Convert::ToNative(bindingName));
}
bool Input::GetBindingPositiveButton(System::String^ bindingName)
{
return SHInputManager::GetBindingPositiveButton(Convert::ToNative(bindingName));
}
bool Input::GetBindingNegativeButton(System::String^ bindingName)
{
return SHInputManager::GetBindingNegativeButton(Convert::ToNative(bindingName));
}
bool Input::GetBindingPositiveButtonDown(System::String^ bindingName)
{
return SHInputManager::GetBindingPositiveButtonDown(Convert::ToNative(bindingName));
}
bool Input::GetBindingNegativeButtonDown(System::String^ bindingName)
{
return SHInputManager::GetBindingNegativeButtonDown(Convert::ToNative(bindingName));
}
bool Input::GetBindingPositiveButtonUp(System::String^ bindingName)
{
return SHInputManager::GetBindingPositiveButtonUp(Convert::ToNative(bindingName));
}
bool Input::GetBindingNegativeButtonUp(System::String^ bindingName)
{
return SHInputManager::GetBindingNegativeButtonUp(Convert::ToNative(bindingName));
}
double Input::GetBindingPositiveHeldTime(System::String^ bindingName)
{
return SHInputManager::GetBindingPositiveHeldTime(Convert::ToNative(bindingName));
}
double Input::GetBindingNegativeHeldTime(System::String^ bindingName)
{
return SHInputManager::GetBindingNegativeHeldTime(Convert::ToNative(bindingName));
}
double Input::GetBindingPositiveReleasedTime(System::String^ bindingName)
{
return SHInputManager::GetBindingPositiveReleasedTime(Convert::ToNative(bindingName));
}
double Input::GetBindingNegativeReleasedTime(System::String^ bindingName)
{
return SHInputManager::GetBindingNegativeReleasedTime(Convert::ToNative(bindingName));
}
} }

View File

@ -181,7 +181,6 @@ namespace SHADE
//Break //Break
//Menu //Menu
//Mouse buttons use mouse codes, which are enums declared later //Mouse buttons use mouse codes, which are enums declared later
//TODO Controller input
#if 0 #if 0
Space = static_cast<int>(SHInputManager::SH_KEYCODE::SPACE), Space = static_cast<int>(SHInputManager::SH_KEYCODE::SPACE),
//Apostrophe = static_cast<int>(SHInputManager::SH_KEYCODE::APOSTROPHE), //Apostrophe = static_cast<int>(SHInputManager::SH_KEYCODE::APOSTROPHE),
@ -355,6 +354,35 @@ namespace SHADE
Button3 = static_cast<int>(SHInputManager::SH_KEYCODE::XMB1), Button3 = static_cast<int>(SHInputManager::SH_KEYCODE::XMB1),
Button4 = static_cast<int>(SHInputManager::SH_KEYCODE::XMB2) Button4 = static_cast<int>(SHInputManager::SH_KEYCODE::XMB2)
}; };
enum class ControllerCode : int
{
DpadUp = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::DPAD_UP),
DpadDown = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::DPAD_DOWN),
DpadLeft = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::DPAD_LEFT),
DpadRight = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::DPAD_RIGHT),
Start = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::START),
Back = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::BACK),
LeftThumbstickButton = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::LEFT_THUMBSTICK),
RightThumbstickButton = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::RIGHT_THUMBSTICK),
LeftShoulder = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::LEFT_SHOULDER),
RightShoulder = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::RIGHT_SHOULDER),
AButton = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::A),
BButton = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::B),
XButton = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::X),
YButton = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::Y),
LeftTrigger = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::LEFT_TRIGGER),
RightTrigger = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::RIGHT_TRIGGER),
LeftThumbStickX = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::LEFT_THUMBSTICK_X),
LeftThumbStickY = static_cast<int>(SHInputManager::SH_CONTROLLERCODE::LEFT_THUMBSTICK_Y)
};
enum class BindingType : int
{
KbMbController = static_cast<int>(SHInputManager::SH_BINDINGTYPE::KB_MB_CONTROLLER),
mouseX = static_cast<int>(SHInputManager::SH_BINDINGTYPE::MOUSE_X),
mouseY = static_cast<int>(SHInputManager::SH_BINDINGTYPE::MOUSE_Y),
mouseScroll = static_cast<int>(SHInputManager::SH_BINDINGTYPE::MOUSE_SCROLL)
};
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
/* Properites */ /* Properites */
@ -376,9 +404,25 @@ namespace SHADE
int get(); int get();
} }
static property bool ControllerInUse
{
bool get();
}
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
/* Usage Functions */ /* Usage Functions */
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
/// <summary>
/// Checks if any key is being held down.
/// This will also be true if GetKeyDown() is true.
/// </summary>
/// <param name="firstKey">KeyCode of the first key that was detected to be pressed.</param>
/// <returns>True while the user holds down the key specified.</returns>
static bool AnyKey();
static bool AnyKeyDown();
static bool AnyKeyUp();
/// <summary> /// <summary>
/// Checks if a specified key is being held down. /// Checks if a specified key is being held down.
/// This will also be true if GetKeyDown() is true. /// This will also be true if GetKeyDown() is true.
@ -428,6 +472,20 @@ namespace SHADE
/// </returns> /// </returns>
static bool GetMouseButtonUp(MouseCode mouseButton); static bool GetMouseButtonUp(MouseCode mouseButton);
//For controller
static bool AnyControllerInput();
static bool AnyControllerInputDown();
static bool AnyControllerInputUp();
static bool AnyControllerButton();
static bool AnyControllerButtonDown();
static bool AnyControllerButtonUp();
static bool GetControllerInput(ControllerCode code);
static double GetControllerInputNormalisedValue(ControllerCode code);
static bool GetControllerInputDown(ControllerCode code);
static bool GetControllerInputUp(ControllerCode code);
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
/* Cursor Functions */ /* Cursor Functions */
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
@ -440,6 +498,11 @@ namespace SHADE
/// </param> /// </param>
static void SetMousePosition(Vector2 pos); static void SetMousePosition(Vector2 pos);
static Vector2 GetMousePosition();
static void SetMouseCentering(bool state);
static bool GetMouseCentering();
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
/* Timing Functions */ /* Timing Functions */
/*-----------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------*/
@ -472,6 +535,66 @@ namespace SHADE
/// <returns>Time in seconds that the key was held.</returns> /// <returns>Time in seconds that the key was held.</returns>
static double GetMouseReleasedTime(MouseCode mouseButton); static double GetMouseReleasedTime(MouseCode mouseButton);
static double GetControllerInputHeldTime(ControllerCode code);
static double GetControllerInputReleasedTime(ControllerCode code);
static Vector2 GetMouseVelocity(); static Vector2 GetMouseVelocity();
/*-----------------------------------------------------------------------------*/
/* Binding Functions */
/*-----------------------------------------------------------------------------*/
static void SaveBindings(); //To default file
static void SaveBindings(System::String^ targetFile);
static void LoadBindings(); //From default file
static void LoadBindings(System::String^ sourceFile);
static bool GetBindingInverted(System::String^ bindingName);
static void SetBindingInverted(System::String^ bindingName, bool newValue);
static double GetBindingGravity(System::String^ bindingName);
static void SetBindingGravity(System::String^ bindingName, double newValue);
static double GetBindingDead(System::String^ bindingName);
static void SetBindingDead(System::String^ bindingName, double newValue);
static double GetBindingSensitivity(System::String^ bindingName);
static void SetBindingSensitivity(System::String^ bindingName, double newValue);
static bool GetBindingSnap(System::String^ bindingName);
static void SetBindingSnap(System::String^ bindingName, bool newValue);
static System::Collections::Generic::HashSet<KeyCode>^ GetBindingPositiveKeyCodes(System::String^ bindingName);
static void AddBindingPositiveKeyCode(System::String^ bindingName, Input::KeyCode toAdd);
static void RemoveBindingPositiveKeyCode(System::String^ bindingName, Input::KeyCode toRemove);
static void ClearBindingPositiveKeyCodes(System::String^ bindingName);
static System::Collections::Generic::HashSet<KeyCode>^ GetBindingNegativeKeyCodes(System::String^ bindingName);
static void AddBindingNegativeKeyCode(System::String^ bindingName, Input::KeyCode toAdd);
static void RemoveBindingNegativeKeyCode(System::String^ bindingName, Input::KeyCode toRemove);
static void ClearBindingNegativeKeyCodes(System::String^ bindingName);
static System::Collections::Generic::HashSet<ControllerCode>^ GetBindingPositiveControllerCodes(System::String^ bindingName);
static void AddBindingPositiveControllerCode(System::String^ bindingName, Input::ControllerCode toAdd);
static void RemoveBindingPositiveControllerCode(System::String^ bindingName, Input::ControllerCode toRemove);
static void ClearBindingPositiveControllerCodes(System::String^ bindingName);
static System::Collections::Generic::HashSet<ControllerCode>^ GetBindingNegativeControllerCodes(System::String^ bindingName);
static void AddBindingNegativeControllerCode(System::String^ bindingName, Input::ControllerCode toAdd);
static void RemoveBindingNegativeControllerCode(System::String^ bindingName, Input::ControllerCode toRemove);
static void ClearBindingNegativeControllerCodes(System::String^ bindingName);
//Binding states
static double GetBindingAxis(System::String^ bindingName);
static double GetBindingAxisRaw(System::String^ bindingName);
static bool GetBindingPositiveButton(System::String^ bindingName);
static bool GetBindingNegativeButton(System::String^ bindingName);
static bool GetBindingPositiveButtonDown(System::String^ bindingName);
static bool GetBindingNegativeButtonDown(System::String^ bindingName);
static bool GetBindingPositiveButtonUp(System::String^ bindingName);
static bool GetBindingNegativeButtonUp(System::String^ bindingName);
//Binding times
static double GetBindingPositiveHeldTime(System::String^ bindingName);
static double GetBindingNegativeHeldTime(System::String^ bindingName);
static double GetBindingPositiveReleasedTime(System::String^ bindingName);
static double GetBindingNegativeReleasedTime(System::String^ bindingName);
}; };
} }