feat: Archipelago demo stack (lightweight)
This commit is contained in:
23
neode-ui/src/stores/controller.ts
Normal file
23
neode-ui/src/stores/controller.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const useControllerStore = defineStore('controller', () => {
|
||||
const isActive = ref(false)
|
||||
const gamepadCount = ref(0)
|
||||
|
||||
function setActive(active: boolean) {
|
||||
isActive.value = active
|
||||
}
|
||||
|
||||
function setGamepadCount(count: number) {
|
||||
gamepadCount.value = count
|
||||
isActive.value = count > 0
|
||||
}
|
||||
|
||||
return {
|
||||
isActive,
|
||||
gamepadCount,
|
||||
setActive,
|
||||
setGamepadCount,
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user