1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Removed left and right brush arrows

- Removed left and right brush arrow indicators completely.
- Fixed bug when removing custom project brushes.
This commit is contained in:
OverloadedOrama 2019-11-30 02:45:45 +02:00
parent 4721a01f2e
commit 3312b8064f
10 changed files with 32 additions and 117 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

View file

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/left.png-a0857f5581a7224bc4706f5b5b072c04.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Graphics/left.png"
dest_files=[ "res://.import/left.png-a0857f5581a7224bc4706f5b5b072c04.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 B

View file

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/right.png-e081bdade321da1277a90c4dc43840cc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Graphics/right.png"
dest_files=[ "res://.import/right.png-e081bdade321da1277a90c4dc43840cc.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

File diff suppressed because one or more lines are too long

View file

@ -4,12 +4,11 @@ var brush_type = Global.BRUSH_TYPES.PIXEL
var custom_brush_index := -1
func _on_BrushButton_pressed() -> void:
#Change left brush
if Global.brushes_popup.rect_global_position == Global.left_brush_type_button.rect_global_position:
Global.current_left_brush_type = brush_type
Global.left_brush_indicator.get_parent().remove_child(Global.left_brush_indicator)
add_child(Global.left_brush_indicator)
Global.custom_left_brush_index = custom_brush_index
if custom_brush_index > -1: #Custom brush
Global.custom_left_brush_index = custom_brush_index
if hint_tooltip == "":
Global.left_brush_type_label.text = "Custom brush"
else:
@ -19,12 +18,10 @@ func _on_BrushButton_pressed() -> void:
Global.update_left_custom_brush()
else:
else: #Change right brush
Global.current_right_brush_type = brush_type
Global.right_brush_indicator.get_parent().remove_child(Global.right_brush_indicator)
add_child(Global.right_brush_indicator)
Global.custom_right_brush_index = custom_brush_index
if custom_brush_index > -1:
Global.custom_right_brush_index = custom_brush_index
if hint_tooltip == "":
Global.right_brush_type_label.text = "Custom brush"
else:
@ -39,17 +36,18 @@ func _on_DeleteButton_pressed() -> void:
if Global.custom_left_brush_index == custom_brush_index:
Global.custom_left_brush_index = -1
Global.current_left_brush_type = Global.BRUSH_TYPES.PIXEL
remove_child(Global.left_brush_indicator)
Global.file_brush_container.get_child(0).add_child(Global.left_brush_indicator)
Global.left_brush_type_label.text = "Brush: Pixel"
Global.update_left_custom_brush()
if Global.custom_right_brush_index == custom_brush_index:
Global.custom_right_brush_index = -1
Global.current_right_brush_type = Global.BRUSH_TYPES.PIXEL
remove_child(Global.right_brush_indicator)
Global.file_brush_container.get_child(0).add_child(Global.right_brush_indicator)
Global.right_brush_type_label.text = "Brush: Pixel"
Global.update_right_custom_brush()
var project_brush_index = custom_brush_index - Global.brushes_from_files
Global.undos += 1
Global.undo_redo.create_action("Delete Custom Brush")
for i in range(custom_brush_index - 1, Global.project_brush_container.get_child_count()):
for i in range(project_brush_index, Global.project_brush_container.get_child_count()):
var bb = Global.project_brush_container.get_child(i)
if Global.custom_left_brush_index == bb.custom_brush_index:
Global.custom_left_brush_index -= 1

View file

@ -641,7 +641,7 @@ func flood_fill(pos : Vector2, target_color : Color, replace_color : Color) -> v
q.append(north)
if south.y < south_limit && layers[current_layer_index][0].get_pixelv(south) == target_color:
q.append(south)
sprite_changed_this_frame = true
sprite_changed_this_frame = true
#I wish GDScript supported function overloading, I could add more versions of these scripts...
#...but with a Rect2() parameter instead of 2 Vector2()s

View file

@ -53,8 +53,6 @@ var left_brush_size_edit : SpinBox
var right_brush_size_edit : SpinBox
var left_interpolate_slider : HSlider
var right_interpolate_slider : HSlider
var left_brush_indicator : Sprite
var right_brush_indicator : Sprite
var loop_animation_button : BaseButton
var play_forward : BaseButton
@ -143,8 +141,6 @@ func _ready() -> void:
right_brush_size_edit = find_node_by_name(root, "RightBrushSizeEdit")
left_interpolate_slider = find_node_by_name(root, "LeftInterpolateFactor")
right_interpolate_slider = find_node_by_name(root, "RightInterpolateFactor")
left_brush_indicator = find_node_by_name(root, "LeftBrushIndicator")
right_brush_indicator = find_node_by_name(root, "RightBrushIndicator")
loop_animation_button = find_node_by_name(root, "LoopAnim")
play_forward = find_node_by_name(root, "PlayForward")

BIN
icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View file

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2