svelte-gamepad-virtual-joystick
Advanced tools
Comparing version
@@ -10,3 +10,4 @@ import InputComponent from "../input_handling/InputComponent.js"; | ||
}; | ||
export declare const addActiveComponent: (component: InputComponent) => void; | ||
export declare const registerComponent: (context: string[], component: InputComponent) => void; | ||
export declare const unregisterComponent: (context: string[], component: InputComponent) => void; |
@@ -9,2 +9,7 @@ import InputComponent from "../input_handling/InputComponent.js"; | ||
}); | ||
export const addActiveComponent = (component) => { | ||
if (!component_state.activeComponents.includes(component)) { | ||
component_state.activeComponents.push(component); | ||
} | ||
}; | ||
export const registerComponent = (context, component) => { | ||
@@ -21,3 +26,3 @@ context.forEach((ctx) => { | ||
if (!component.requiresFocus && context.includes('default')) { | ||
component_state.activeComponents.push(component); | ||
addActiveComponent(component); | ||
} | ||
@@ -27,3 +32,3 @@ if (component.focusElement && component.requiresFocus) { | ||
if (context.includes(component_state.context)) { | ||
component_state.activeComponents.push(component); | ||
addActiveComponent(component); | ||
} | ||
@@ -30,0 +35,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"license": "BSD-3-Clause", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"publishConfig": { | ||
@@ -8,0 +8,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
277721
0.08%892
0.68%