Added Glitch Room Source code to Gitty
This commit is contained in:
commit
1ac9eb5644
505 files changed
+28504
No files matched your search
@@ -0,0 +1,75 @@
|
||||
@tool
|
||||
class_name RoomDeviceDefinition
|
||||
extends Resource
|
||||
|
||||
|
||||
enum DeviceType {
|
||||
GENERIC,
|
||||
COIN_RELEASE,
|
||||
LIGHT,
|
||||
DOOR_LOCK,
|
||||
DRAWER_LOCK,
|
||||
BUZZER
|
||||
}
|
||||
|
||||
|
||||
enum Behavior {
|
||||
MOMENTARY,
|
||||
LATCHED
|
||||
}
|
||||
|
||||
|
||||
@export var device_id: StringName = &""
|
||||
@export var display_name: String = ""
|
||||
|
||||
@export var device_type: DeviceType = DeviceType.GENERIC
|
||||
@export var behavior: Behavior = Behavior.MOMENTARY
|
||||
|
||||
@export var initial_active: bool = false
|
||||
|
||||
|
||||
@export_group("Layout")
|
||||
@export var position: Vector2 = Vector2.ZERO
|
||||
|
||||
const FEET_TO_METERS: float = 0.3048
|
||||
const METERS_TO_FEET: float = 1.0 / FEET_TO_METERS
|
||||
|
||||
|
||||
#
|
||||
# Internal/storage representation.
|
||||
#
|
||||
@export_storage
|
||||
var physical_size_m: Vector2 = Vector2(
|
||||
0.25,
|
||||
0.25
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# Designer-facing representation.
|
||||
#
|
||||
@export_group("Physical Dimensions")
|
||||
|
||||
@export_custom(
|
||||
PROPERTY_HINT_NONE,
|
||||
"suffix: ft"
|
||||
)
|
||||
var physical_size_ft: Vector2:
|
||||
get:
|
||||
return (
|
||||
physical_size_m
|
||||
* METERS_TO_FEET
|
||||
)
|
||||
set(value):
|
||||
physical_size_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
|
||||
Reference in new issue
Block a user