immersive-home/app/lib/stores/settings.gd

33 lines
729 B
GDScript3
Raw Normal View History

2024-01-25 17:29:33 +02:00
extends StoreClass
2024-03-17 01:14:31 +02:00
## Stores general settings for the app
2024-01-25 17:29:33 +02:00
const StoreClass = preload ("./store.gd")
2024-01-25 17:29:33 +02:00
2024-05-10 14:16:17 +03:00
enum CursorStyle {
DEFAULT,
RETRO
}
2024-01-25 17:29:33 +02:00
func _init():
_save_path = "user://settings.json"
2024-04-09 18:11:24 +03:00
self.state = R.store({
## The adapter to use for connecting with a backend
"type": "HASS_WS",
"url": "",
"token": "",
## If the voice assistant should be enabled
"voice_assistant": false,
## If the onboarding process has been completed
2024-05-10 14:16:17 +03:00
"onboarding_complete": false,
"cursor_style": CursorStyle.DEFAULT
2024-04-09 18:11:24 +03:00
})
2024-01-25 17:29:33 +02:00
func clear():
2024-04-09 18:11:24 +03:00
self.state.type = "HASS_WS"
self.state.url = ""
self.state.token = ""
self.state.voice_assistant = false
2024-04-09 18:46:59 +03:00
self.state.onboarding_complete = false
2024-05-10 14:16:17 +03:00
self.state.cursor_style = CursorStyle.DEFAULT