mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
Ability to import an image file as a brush
Works only for file brushes at the moment. The image files gets copied into the "pixelorama/Brushes" directory.
This commit is contained in:
parent
31fae924bf
commit
a8de56ed68
|
@ -160,6 +160,12 @@ msgstr ""
|
|||
msgid "New palette"
|
||||
msgstr ""
|
||||
|
||||
msgid "New brush"
|
||||
msgstr ""
|
||||
|
||||
msgid "New pattern"
|
||||
msgstr ""
|
||||
|
||||
msgid "Horizontal frames:"
|
||||
msgstr ""
|
||||
|
||||
|
@ -473,6 +479,12 @@ msgstr ""
|
|||
msgid "Turkish"
|
||||
msgstr ""
|
||||
|
||||
msgid "Norwegian"
|
||||
msgstr ""
|
||||
|
||||
msgid "Korean"
|
||||
msgstr ""
|
||||
|
||||
msgid "Development Team"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -42,9 +42,18 @@ func _on_PreviewDialog_confirmed() -> void:
|
|||
OpenSave.open_image_as_new_frame(image, layer_index)
|
||||
elif current_import_option == ImageImportOptions.NEW_LAYER:
|
||||
var frame_index : int = new_layer_options.get_node("AtFrameSpinbox").value - 1
|
||||
OpenSave.open_image_as_new_layer(image, path.get_file(), frame_index)
|
||||
OpenSave.open_image_as_new_layer(image, path.get_basename().get_file(), frame_index)
|
||||
elif current_import_option == ImageImportOptions.PALETTE:
|
||||
Global.palette_container.on_palette_import_file_selected(path)
|
||||
elif current_import_option == ImageImportOptions.BRUSH:
|
||||
var file_name : String = path.get_basename().get_file()
|
||||
Global.file_brushes.append(image)
|
||||
Global.create_brush_button(image, Global.Brush_Types.FILE, file_name)
|
||||
|
||||
# Copy the image file into the "pixelorama/Brushes" directory
|
||||
var location := "Brushes".plus_file(path.get_file())
|
||||
var dir = Directory.new()
|
||||
dir.copy(path, Global.directory_module.xdg_data_home.plus_file(location))
|
||||
|
||||
|
||||
func _on_ImportOption_item_selected(id : int) -> void:
|
||||
|
|
|
@ -64,7 +64,7 @@ margin_right = 151.0
|
|||
margin_bottom = 20.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "New tab"
|
||||
items = [ "New tab", null, false, 0, null, "Spritesheet (new tab)", null, false, 1, null, "New frame", null, false, 2, null, "New layer", null, false, 3, null, "New palette", null, false, 4, null, "New brush", null, true, 5, null, "New pattern", null, true, 6, null ]
|
||||
items = [ "New tab", null, false, 0, null, "Spritesheet (new tab)", null, false, 1, null, "New frame", null, false, 2, null, "New layer", null, false, 3, null, "New palette", null, false, 4, null, "New brush", null, false, 5, null, "New pattern", null, true, 6, null ]
|
||||
selected = 0
|
||||
|
||||
[node name="SpritesheetOptions" type="HBoxContainer" parent="VBoxContainer/HBoxContainer"]
|
||||
|
|
Loading…
Reference in a new issue