Added Glitch Room Source code to Gitty

This commit is contained in:
Jeff Luke committed 2026-10-04 11:31:17 -07:00
commit 1ac9eb5644
505 files changed
+28504

No files matched your search

+85
View File
@@ -0,0 +1,85 @@
@tool
class_name CabinetProfile
extends Resource
@export var cabinet_id: StringName = &""
@export var display_name: String = ""
@export var capabilities: Array[StringName] = []
@export var hardware_config: HardwareConfig
const FEET_TO_METERS: float = 0.3048
const METERS_TO_FEET: float = 1.0 / FEET_TO_METERS
#
# Stored internally in meters for compatibility with the
# existing room/layout system.
#
@export_storage
var footprint_width_m: float = 0.80
@export_storage
var footprint_depth_m: float = 0.75
@export_storage
var height_m: float = 1.80
#
# Designer-facing dimensions.
#
@export_group("Physical Dimensions")
@export_range(0.25, 12.0, 0.01, "suffix: ft")
var footprint_width_ft: float:
get:
return (
footprint_width_m
* METERS_TO_FEET
)
set(value):
footprint_width_m = (
value
* FEET_TO_METERS
)
@export_range(0.25, 12.0, 0.01, "suffix: ft")
var footprint_depth_ft: float:
get:
return (
footprint_depth_m
* METERS_TO_FEET
)
set(value):
footprint_depth_m = (
value
* FEET_TO_METERS
)
@export_range(0.25, 20.0, 0.01, "suffix: ft")
var height_ft: float:
get:
return (
height_m
* METERS_TO_FEET
)
set(value):
height_m = (
value
* FEET_TO_METERS
)
@export_group("Physical Appearance")
@export var editor_texture: Texture2D = null
@export_range(0.1, 4.0, 0.05)
var editor_texture_scale: float = 1.0
func has_capability(capability: StringName) -> bool:
return capabilities.has(capability)
+1
View File
@@ -0,0 +1 @@
uid://c0jj5j5loqsma
+23
View File
@@ -0,0 +1,23 @@
@tool
class_name HardwareAction
extends Resource
enum ActionType {
DIGITAL_OUTPUT,
PULSE_OUTPUT,
}
@export var action_id: StringName = &""
@export var display_name: String = ""
@export var action_type: ActionType = ActionType.PULSE_OUTPUT
@export_range(0, 1000, 1)
var gpio_pin: int = 17
@export_range(1, 10000, 1)
var pulse_duration_ms: int = 250
@export var active_high: bool = true
+1
View File
@@ -0,0 +1 @@
uid://c7eu1n5yey1x4
+18
View File
@@ -0,0 +1,18 @@
@tool
class_name HardwareConfig
extends Resource
@export var controller_id: StringName = &""
@export var actions: Array[HardwareAction] = []
func get_action(action_id: StringName) -> HardwareAction:
for action in actions:
if action.action_id == action_id:
return action
return null
func has_action(action_id: StringName) -> bool:
return get_action(action_id) != null
+1
View File
@@ -0,0 +1 @@
uid://60whm57itpjb