Actor support

This commit is contained in:
2024-02-21 13:23:23 -05:00
parent ff16d8ceb3
commit e5f1a546b1
21 changed files with 284 additions and 73 deletions

View File

@@ -15,14 +15,14 @@ export type InputEnded = RBXScriptConnection
type CallbackFunction = () -> ()
function BindLink.constructor() --Allow multiple bindings of the same keys, no overwrites
function BindLink.constructor(gameProcessing: boolean) --Allow multiple bindings of the same keys, no overwrites
type BindConstructor = {
BindMap: KeyBindMap,
InputBegan: InputBegan,
InputEnded: InputEnded
}
local self: BindConstructor = {}
local self = {} :: BindConstructor
self.BindMap = {
Began = {},
Ended = {}
@@ -30,7 +30,7 @@ function BindLink.constructor() --Allow multiple bindings of the same keys, no o
--Return these for convenience
self.InputBegan = UIS.InputBegan:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if gameProcessing and gameProcessedEvent or not gameProcessedEvent then
local switch = self.BindMap.Began[input.KeyCode]
if switch then
switch()
@@ -40,7 +40,7 @@ function BindLink.constructor() --Allow multiple bindings of the same keys, no o
end
end)
self.InputEnded = UIS.InputEnded:Connect(function(input, gameProcessedEvent)
if not gameProcessedEvent then
if gameProcessing and gameProcessedEvent or not gameProcessedEvent then
local switch = self.BindMap.Ended[input.KeyCode]
if switch then
switch()