Camera system YAY!!!

This commit is contained in:
2026-03-27 10:35:03 -07:00
parent a04d7699ae
commit 7ba95c5949
15 changed files with 281 additions and 53 deletions

View File

@@ -1,5 +1,6 @@
class_name hCamera
var cameras: Dictionary = {}
var name_to_id: Dictionary = {}
var id_to_name: Dictionary = {}
@@ -9,13 +10,15 @@ func setup(cameras_dict: Dictionary) -> void:
push_error("Cameras dictionary is null!")
return
name_to_id = cameras_dict.duplicate()
id_to_name.clear()
for name in name_to_id.keys():
id_to_name[int(name_to_id[name])] = name # ensure keys are ints
cameras = cameras_dict
id_to_name = cameras_dict.duplicate()
name_to_id.clear()
func getID(cameraName: String) -> int:
return 0
return name_to_id.get(cameraName.to_upper(), -1)
func getName(cam_id: int) -> String:
return "DISABLED"
return id_to_name.get(cam_id, "UNKNOWN")