{"id":14961526,"url":"https://github.com/alecsouthward/switch-manager","last_synced_at":"2025-10-24T20:32:02.416Z","repository":{"id":224600854,"uuid":"763700321","full_name":"AlecSouthward/Switch-Manager","owner":"AlecSouthward","description":"Godot 'Switch' Manager, used for keeping track of multiple small one-off events.","archived":false,"fork":false,"pushed_at":"2024-03-01T10:02:25.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T04:25:27.330Z","etag":null,"topics":["gdscript","gdscript-language","godot","godot-4","godot-addon","godot-engine","godot-module","godot-plugin","godot4-2","godotengine"],"latest_commit_sha":null,"homepage":"https://godotengine.org/asset-library/asset/2634","language":"GDScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlecSouthward.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-26T19:07:17.000Z","updated_at":"2024-03-20T16:43:42.000Z","dependencies_parsed_at":"2024-03-06T17:46:21.631Z","dependency_job_id":null,"html_url":"https://github.com/AlecSouthward/Switch-Manager","commit_stats":null,"previous_names":["alecsouthward/switch-manager"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecSouthward%2FSwitch-Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecSouthward%2FSwitch-Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecSouthward%2FSwitch-Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlecSouthward%2FSwitch-Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlecSouthward","download_url":"https://codeload.github.com/AlecSouthward/Switch-Manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238035385,"owners_count":19405682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gdscript","gdscript-language","godot","godot-4","godot-addon","godot-engine","godot-module","godot-plugin","godot4-2","godotengine"],"created_at":"2024-09-24T13:25:31.653Z","updated_at":"2025-10-24T20:31:55.092Z","avatar_url":"https://github.com/AlecSouthward.png","language":"GDScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Switch Manager\n\nThis is a simple tool used for helping manage small one-time events. For example, enemy encounters, dialogue that disappears after interaction, etc.\n\n## Usage\n\n\u003e [!WARNING]\n\u003e The Switch Manager will not work unless you [autoload](https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html) the `state_machine.tscn`!\u003cbr/\u003e\n\u003e As it will only work if it is a `Singleton`.\n\nIf you need to change/add/remove switches outside of runtime, you can change them in `state_machine.tscn`'s scene.\u003cbr/\u003e\nYou can also change the **Save Path** there.\n\nTo use the Switch Manager is quite easy, there are easy to use and expand upon functions inside `state_machine.gd`.\n\nHere is a list of functions and their use...\n\n| Function | Arguments | Usage |\n|----------|-----------|-------|\n| `save_switches()` | None | Saves the current list of switches to a file specified in **SAVE_PATH**. |\n| `load_switches()` | None | Loads a list of switches from a file specified in **SAVE_PATH**. |\n| `erase_switches()` | None | Erases the current list of switches and clear the file specified in **SAVE_PATH**. |\n| `create_switch(..)` | Switch Name, and Switch State (default state is false) | Adds a new switch to the switches list with the specified name and state. |\n| `toggle_switch(.)` | Switch Name | Toggles a switch's state, returns the new state. (Flips a `False` state into a `True` one and vice versa) |\n| `set_switch_state(..)` | Switch Name, and Switch State (default state is false) | Sets a switch's state to the one specifed.  |\n| `get_switch(.)` | Switch Name | Returns a switch's current state, if the switch is unable to be found it will return `null`. |\n| `delete_switch(.)` | Switch Name | Deletes a switch from the switches list. |\n| `get_switches()` | None | Returns an Array containing the switches. |\n\n\u003e [!WARNING]\n\u003e If the `create_switch(..)` recieves a switch name that *already* exists, it will instead set the switch's state to the one specified.\n\n# Support\n\nIf you have any issues, create an [Issue](https://github.com/AlecSouthward/Switch-Manager/issues/new) or message me on Discord at `itsmealec`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecsouthward%2Fswitch-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecsouthward%2Fswitch-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecsouthward%2Fswitch-manager/lists"}