diff --git a/Main.tscn b/Main.tscn index 3f21a7129..a9159b6b4 100644 --- a/Main.tscn +++ b/Main.tscn @@ -770,6 +770,7 @@ mouse_default_cursor_shape = 2 text = "Vertical" [node name="CanvasAndTimeline" type="VBoxContainer" parent="MenuAndUI/UI"] +editor/display_folded = true margin_left = 224.0 margin_right = 928.0 margin_bottom = 620.0 @@ -803,6 +804,7 @@ enabled_focus_mode = 0 script = ExtResource( 13 ) [node name="ViewportandVerticalRuler" type="HBoxContainer" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers"] +editor/display_folded = true margin_top = 16.0 margin_right = 704.0 margin_bottom = 478.0 @@ -1434,8 +1436,8 @@ resizable = true mode = 0 access = 2 filters = PoolStringArray( "*.pxo ; Pixelorama Project" ) -current_dir = "D:/GitHub/Pixelorama" -current_path = "D:/GitHub/Pixelorama/" +current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama" +current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/" [node name="SaveSprite" type="FileDialog" parent="."] anchor_left = 0.5 @@ -1450,8 +1452,8 @@ window_title = "Save Sprite as .pxo" resizable = true access = 2 filters = PoolStringArray( "*.pxo ; Pixelorama Project" ) -current_dir = "D:/GitHub/Pixelorama" -current_path = "D:/GitHub/Pixelorama/" +current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama" +current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/" [node name="ImportSprites" type="FileDialog" parent="."] margin_right = 515.0 @@ -1461,8 +1463,8 @@ resizable = true mode = 1 access = 2 filters = PoolStringArray( "*.bmp ; BMP Image", "*.hdr ; Radiance HDR Image", "*.jpg,*.jpeg ; JPEG Image", "*.png ; PNG Image", "*.svg ; SVG Image", "*.tga ; TGA Image", "*.webp ; WebP Image" ) -current_dir = "D:/GitHub/Pixelorama" -current_path = "D:/GitHub/Pixelorama/" +current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama" +current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/" [node name="ExportSprites" type="FileDialog" parent="."] anchor_left = 0.5 @@ -1477,8 +1479,8 @@ window_title = "Export Sprite" resizable = true access = 2 filters = PoolStringArray( "*.png ; PNG Image" ) -current_dir = "D:/GitHub/Pixelorama" -current_path = "D:/GitHub/Pixelorama/" +current_dir = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama" +current_path = "C:/Users/Overloaded/Dropbox/Orama Founding Members/εταιρικα αρχεια/Godot Projects/Pixelorama/" [node name="ScaleImage" type="ConfirmationDialog" parent="."] editor/display_folded = true @@ -1559,13 +1561,13 @@ resizable = true [node name="VBoxContainer" type="VBoxContainer" parent="PreferencesDialog"] anchor_left = 0.5 anchor_right = 0.5 -margin_left = -92.0 +margin_left = -97.5 margin_top = 8.0 -margin_right = 92.0 -margin_bottom = 33.0 +margin_right = 97.5 +margin_bottom = 123.0 [node name="OptionsContainer" type="GridContainer" parent="PreferencesDialog/VBoxContainer"] -margin_right = 184.0 +margin_right = 195.0 margin_bottom = 21.0 columns = 2 @@ -1576,23 +1578,23 @@ margin_bottom = 18.0 text = "Language:" [node name="LanguageOption" type="OptionButton" parent="PreferencesDialog/VBoxContainer/OptionsContainer"] -margin_left = 61.0 -margin_right = 142.0 +margin_left = 57.0 +margin_right = 195.0 margin_bottom = 21.0 text = "System Language" -items = [ "System Language", null, false, 0, null, "Greek [el]", null, false, 1, null, "English [en]", null, false, 2, null ] +items = [ "System Language", null, false, 0, null, "Greek [el]", null, false, 1, null, "English [en]", null, false, 2, null, "French [fr]", null, false, 3, null ] selected = 0 [node name="GridOptionsLabel" type="Label" parent="PreferencesDialog/VBoxContainer"] margin_top = 25.0 -margin_right = 184.0 +margin_right = 195.0 margin_bottom = 40.0 text = "Grid options" [node name="GridOptions" type="GridContainer" parent="PreferencesDialog/VBoxContainer"] margin_top = 44.0 -margin_right = 184.0 -margin_bottom = 123.0 +margin_right = 195.0 +margin_bottom = 115.0 columns = 2 [node name="WidthLabel" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"] @@ -1602,8 +1604,8 @@ margin_bottom = 20.0 text = "Width:" [node name="GridWidthValue" type="SpinBox" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_left = 43.0 -margin_right = 107.0 +margin_left = 39.0 +margin_right = 103.0 margin_bottom = 25.0 min_value = 1.0 max_value = 16384.0 @@ -1611,32 +1613,32 @@ value = 1.0 suffix = "px" [node name="Height" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_top = 34.0 +margin_top = 30.0 margin_right = 39.0 -margin_bottom = 49.0 +margin_bottom = 45.0 text = "Height:" [node name="GridHeightValue" type="SpinBox" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_left = 43.0 -margin_top = 29.0 -margin_right = 107.0 -margin_bottom = 54.0 +margin_left = 39.0 +margin_top = 25.0 +margin_right = 103.0 +margin_bottom = 50.0 min_value = 1.0 max_value = 16384.0 value = 1.0 suffix = "px" [node name="GridColorLabel" type="Label" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_top = 61.0 +margin_top = 53.0 margin_right = 39.0 -margin_bottom = 76.0 +margin_bottom = 68.0 text = "Color:" [node name="GridColor" type="ColorPickerButton" parent="PreferencesDialog/VBoxContainer/GridOptions"] -margin_left = 43.0 -margin_top = 58.0 -margin_right = 107.0 -margin_bottom = 79.0 +margin_left = 39.0 +margin_top = 50.0 +margin_right = 103.0 +margin_bottom = 71.0 rect_min_size = Vector2( 64, 20 ) [node name="AboutDialog" type="AcceptDialog" parent="."] diff --git a/Prefabs/PaletteButton.tscn b/Prefabs/PaletteButton.tscn index 99213e419..81c6fc731 100644 --- a/Prefabs/PaletteButton.tscn +++ b/Prefabs/PaletteButton.tscn @@ -15,6 +15,7 @@ hint_tooltip = "Color Name" custom_styles/hover = ExtResource( 1 ) custom_styles/pressed = ExtResource( 2 ) custom_styles/normal = ExtResource( 3 ) +button_mask = 3 icon = SubResource( 1 ) [node name="NinePatchRect" type="NinePatchRect" parent="."] diff --git a/Scripts/PaletteContainer.gd b/Scripts/PaletteContainer.gd index aa95f4409..3577cdcc7 100644 --- a/Scripts/PaletteContainer.gd +++ b/Scripts/PaletteContainer.gd @@ -1,10 +1,6 @@ extends GridContainer -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - -var palette_button = load("res://Prefabs/PaletteButton.tscn"); +var palette_button = preload("res://Prefabs/PaletteButton.tscn"); var current_palette = "Default" @@ -44,7 +40,7 @@ var default_palette = [ ] # Called when the node enters the scene tree for the first time. -func _ready(): +func _ready() -> void: #Global.palettes["Default"] = default_palette _load_palettes() @@ -52,14 +48,14 @@ func _ready(): on_palette_select(current_palette) pass # Replace with function body. -func _clear_swatches(): +func _clear_swatches() -> void: for child in get_children(): if child is BaseButton: child.disconnect("pressed", self, "on_color_select") child.queue_free() pass -func on_palette_select(palette_name): +func on_palette_select(palette_name) -> void: _clear_swatches() if Global.palettes.has(palette_name): _display_palette(Global.palettes[palette_name]) @@ -67,8 +63,8 @@ func on_palette_select(palette_name): _display_palette(Global.palettes["Default"]) pass -func _display_palette(palette): - var index = 0 +func _display_palette(palette) -> void: + var index := 0 for color_data in palette: var color = Color(color_data.data) var new_button = palette_button.instance() @@ -79,11 +75,16 @@ func _display_palette(palette): index += 1 pass -func on_color_select(index): - Global.left_color_picker.color = default_palette[index] +func on_color_select(index : int) -> void: + if Input.is_action_just_released("left_mouse"): + Global.left_color_picker.color = default_palette[index] + Global.update_left_custom_brush() + elif Input.is_action_just_released("right_mouse"): + Global.right_color_picker.color = default_palette[index] + Global.update_right_custom_brush() pass -func _load_palettes(): +func _load_palettes() -> void: var files := [] var dir := Directory.new() @@ -110,7 +111,7 @@ func _load_palettes(): Global.palette_option_button.add_item(success) pass -func _load_palette(path): +func _load_palette(path) -> String: var file := File.new() file.open(path, File.READ)