Add bullet creation and viewer dialogs with 2D/3D support

- Implement BulletCreatorDialog for configuring bullet parameters.
- Introduce BulletViewer to display bullets in a grid format.
- Add filtering options for 2D and 3D bullets in the viewer.
- Enhance WeaponCreatorDock to include bullet creation functionality.
This commit is contained in:
MaddoScientisto 2026-02-08 18:10:19 +01:00
commit ac96dabf2e
8 changed files with 1045 additions and 76 deletions

View file

@ -72,8 +72,9 @@ func _ready() -> void:
var action_text = "Duplicate" if not prefill_data.is_empty() else "Create New"
title = action_text + " Weapon (" + mode_text + ")"
size = Vector2i(750, 950)
transient = true
exclusive = true
transient = false
exclusive = false
unresizable = false
# Connect close request (X button) to cancel action
close_requested.connect(_on_cancel_pressed)
@ -243,6 +244,7 @@ func _build_sprite_selector(parent: Control) -> void:
sprite_picker.editable = true
sprite_picker.size_flags_horizontal = Control.SIZE_EXPAND_FILL
sprite_picker.resource_changed.connect(_on_sprite_resource_changed)
sprite_picker.resource_selected.connect(_on_resource_picker_opening)
picker_hbox.add_child(sprite_picker)
# Setup editor integration if interface is available
@ -261,7 +263,6 @@ func _build_sprite_selector(parent: Control) -> void:
preview_container.add_child(sprite_preview)
func _on_sprite_resource_changed(resource: Resource) -> void:
# Update sprite resource and preview when changed via EditorResourcePicker
if resource is Texture2D:
sprite_resource = resource
sprite_preview.texture = resource
@ -272,6 +273,18 @@ func _on_sprite_resource_changed(resource: Resource) -> void:
print("Sprite resource cleared")
else:
push_warning("Selected resource is not a Texture2D")
# Restore window focus after resource picker closes
call_deferred("_restore_window_focus")
func _on_resource_picker_opening(_resource: Resource, _inspect: bool) -> void:
# Called when resource picker button is clicked
pass
func _restore_window_focus() -> void:
# Bring window back to front after file picker closes
if visible:
move_to_foreground()
func _setup_sprite_picker() -> void:
# Ensure sprite picker is properly integrated with editor