mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Change guides when switching project
This commit is contained in:
parent
fc03e83377
commit
736521246d
|
@ -89,7 +89,7 @@ boot_splash/bg_color=Color( 0.145098, 0.145098, 0.164706, 1 )
|
||||||
config/icon="res://assets/graphics/icons/icon.png"
|
config/icon="res://assets/graphics/icons/icon.png"
|
||||||
config/macos_native_icon="res://assets/graphics/icons/icon.icns"
|
config/macos_native_icon="res://assets/graphics/icons/icon.icns"
|
||||||
config/windows_native_icon="res://assets/graphics/icons/icon.ico"
|
config/windows_native_icon="res://assets/graphics/icons/icon.ico"
|
||||||
config/Version="v0.7.1"
|
config/Version="v0.8-dev"
|
||||||
|
|
||||||
[autoload]
|
[autoload]
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ var layers := [] setget layers_changed # Array of Layers
|
||||||
var current_frame := 0 setget frame_changed
|
var current_frame := 0 setget frame_changed
|
||||||
var current_layer := 0 setget layer_changed
|
var current_layer := 0 setget layer_changed
|
||||||
var animation_tags := [] setget animation_tags_changed # Array of AnimationTags
|
var animation_tags := [] setget animation_tags_changed # Array of AnimationTags
|
||||||
#var guides := [] # Array of Guides
|
var guides := [] # Array of Guides
|
||||||
|
|
||||||
var brushes := [] # Array of Images
|
var brushes := [] # Array of Images
|
||||||
var brush_images := [Image.new(), Image.new()]
|
var brush_images := [Image.new(), Image.new()]
|
||||||
|
@ -91,6 +91,7 @@ func change_project() -> void:
|
||||||
|
|
||||||
self.animation_tags = animation_tags
|
self.animation_tags = animation_tags
|
||||||
|
|
||||||
|
# Change the selection rectangle
|
||||||
if selected_pixels.size() != 0:
|
if selected_pixels.size() != 0:
|
||||||
Global.selection_rectangle.polygon[0] = Vector2(x_min, y_min)
|
Global.selection_rectangle.polygon[0] = Vector2(x_min, y_min)
|
||||||
Global.selection_rectangle.polygon[1] = Vector2(x_max, y_min)
|
Global.selection_rectangle.polygon[1] = Vector2(x_max, y_min)
|
||||||
|
@ -102,6 +103,13 @@ func change_project() -> void:
|
||||||
Global.selection_rectangle.polygon[2] = Vector2.ZERO
|
Global.selection_rectangle.polygon[2] = Vector2.ZERO
|
||||||
Global.selection_rectangle.polygon[3] = Vector2.ZERO
|
Global.selection_rectangle.polygon[3] = Vector2.ZERO
|
||||||
|
|
||||||
|
for guide in Global.canvas.get_children():
|
||||||
|
if guide is Guide:
|
||||||
|
if guide in guides:
|
||||||
|
guide.visible = true
|
||||||
|
else:
|
||||||
|
guide.visible = false
|
||||||
|
|
||||||
|
|
||||||
func frames_changed(value : Array) -> void:
|
func frames_changed(value : Array) -> void:
|
||||||
frames = value
|
frames = value
|
||||||
|
|
|
@ -13,6 +13,7 @@ var type = Types.HORIZONTAL
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
width = 0.1
|
width = 0.1
|
||||||
default_color = Global.guide_color
|
default_color = Global.guide_color
|
||||||
|
Global.current_project.guides.append(self)
|
||||||
|
|
||||||
|
|
||||||
func _input(_event : InputEvent):
|
func _input(_event : InputEvent):
|
||||||
|
@ -31,7 +32,7 @@ func _input(_event : InputEvent):
|
||||||
has_focus = true
|
has_focus = true
|
||||||
Global.has_focus = false
|
Global.has_focus = false
|
||||||
update()
|
update()
|
||||||
if has_focus:
|
if has_focus and visible:
|
||||||
if Input.is_action_just_pressed("left_mouse"):
|
if Input.is_action_just_pressed("left_mouse"):
|
||||||
previous_points = points
|
previous_points = points
|
||||||
if Input.is_action_pressed("left_mouse"):
|
if Input.is_action_pressed("left_mouse"):
|
||||||
|
|
Loading…
Reference in a new issue