- Added support for custom props in the sandbox, including loading, saving, and rendering. - Implemented `PropLibrary` for managing custom prop entries and scanning for `.prop` files. - Introduced `PropVisuals` for shared visual and collision representation of custom props. - Enhanced `StageSpawner` to handle spawning of custom props with layered visuals and collision hulls. - Created `MissingPropPlaceholder` to manage missing custom props during scene reloads. - Updated thumbnail generation to support custom props with unique keys based on file paths. - Added tests for custom prop lifecycle, authored visual values, and missing prop handling. - Refactored existing code to accommodate new prop functionalities and ensure backward compatibility.
22 lines
782 B
GDScript
22 lines
782 B
GDScript
class_name MissingPropPlaceholder
|
|
extends Node2D
|
|
|
|
var original_entry: Dictionary = {}
|
|
var missing_prop_path: String = ""
|
|
const MARKER_SIZE := Vector2(180.0, 54.0)
|
|
|
|
func configure(entry: Dictionary) -> void:
|
|
original_entry = entry.duplicate(true)
|
|
missing_prop_path = String(entry.get("asset_id", ""))
|
|
queue_redraw()
|
|
|
|
func get_area_rect() -> Rect2:
|
|
return Rect2(-MARKER_SIZE * 0.5, MARKER_SIZE)
|
|
|
|
func _draw() -> void:
|
|
var rect := get_area_rect()
|
|
draw_rect(rect, Color(0.76, 0.10, 0.10, 0.95), true)
|
|
draw_rect(rect, Color(1.0, 0.78, 0.78, 1.0), false, 2.0)
|
|
var asset_name := missing_prop_path.get_file()
|
|
draw_string(ThemeDB.fallback_font, rect.position + Vector2(10.0, 33.0), "Missing prop - %s" % asset_name, HORIZONTAL_ALIGNMENT_CENTER, rect.size.x - 20.0, 16, Color.WHITE)
|