feat(editor): add bundled 3D prop models and sample picker in Creator Studio
checkpoint / checkpoint (push) Failing after 3h14m9s
checkpoint / checkpoint (push) Failing after 3h14m9s
This commit is contained in:
@@ -92,11 +92,40 @@ func _setup_import_ui() -> void:
|
||||
path_row.add_child(_model_path_edit)
|
||||
|
||||
_btn_browse = Button.new()
|
||||
_btn_browse.text = "..."
|
||||
_btn_browse.text = "Browse..."
|
||||
_btn_browse.pressed.connect(_on_browse_pressed)
|
||||
path_row.add_child(_btn_browse)
|
||||
_import_panel.add_child(path_row)
|
||||
|
||||
var sample_row := HBoxContainer.new()
|
||||
var sample_lbl := Label.new()
|
||||
sample_lbl.text = "Sample:"
|
||||
sample_lbl.custom_minimum_size = Vector2(50, 0)
|
||||
sample_row.add_child(sample_lbl)
|
||||
|
||||
var sample_option := OptionButton.new()
|
||||
sample_option.add_item("— Pick a sample model —", 0)
|
||||
sample_option.add_item("Treasure Chest", 1)
|
||||
sample_option.set_item_metadata(1, {"path": "res://assets/props/chest.glb", "name": "Treasure Chest"})
|
||||
sample_option.add_item("Pine Tree", 2)
|
||||
sample_option.set_item_metadata(2, {"path": "res://assets/props/tree_pine_01.glb", "name": "Pine Tree"})
|
||||
sample_option.add_item("Lamp Post", 3)
|
||||
sample_option.set_item_metadata(3, {"path": "res://assets/props/lamp_post_01.glb", "name": "Lamp Post"})
|
||||
sample_option.add_item("Buffalo Chip Coin", 4)
|
||||
sample_option.set_item_metadata(4, {"path": "res://assets/props/buffalo_chip_coin.glb", "name": "Buffalo Chip Coin"})
|
||||
sample_option.add_item("Small Crate", 5)
|
||||
sample_option.set_item_metadata(5, {"path": "res://assets/props/crate_small.glb", "name": "Small Crate"})
|
||||
sample_option.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
sample_option.item_selected.connect(func(idx: int):
|
||||
if idx > 0:
|
||||
var meta: Dictionary = sample_option.get_item_metadata(idx)
|
||||
_model_path_edit.text = meta.get("path", "")
|
||||
if _model_name_edit.text.strip_edges().is_empty():
|
||||
_model_name_edit.text = meta.get("name", "")
|
||||
)
|
||||
sample_row.add_child(sample_option)
|
||||
_import_panel.add_child(sample_row)
|
||||
|
||||
_import_status_label = Label.new()
|
||||
_import_status_label.text = ""
|
||||
_import_status_label.add_theme_font_size_override("font_size", 10)
|
||||
|
||||
Reference in New Issue
Block a user