mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-20 20:43:14 +00:00
Minor code changes
This commit is contained in:
parent
8ff5e30682
commit
66ad745c52
8 changed files with 15 additions and 33 deletions
|
@ -1,5 +1,7 @@
|
|||
extends Node
|
||||
|
||||
signal project_changed
|
||||
|
||||
enum GridTypes { CARTESIAN, ISOMETRIC, ALL }
|
||||
enum PressureSensitivity { NONE, ALPHA, SIZE, ALPHA_AND_SIZE }
|
||||
enum TileMode { NONE, BOTH, X_AXIS, Y_AXIS }
|
||||
|
@ -99,7 +101,7 @@ var onion_skinning_blue_red := false
|
|||
var palettes := {}
|
||||
|
||||
# Nodes
|
||||
var notification_label_node = preload("res://src/UI/NotificationLabel.tscn")
|
||||
var notification_label_node: PackedScene = preload("res://src/UI/NotificationLabel.tscn")
|
||||
|
||||
onready var root: Node = get_tree().get_root()
|
||||
onready var control: Node = root.get_node("Control")
|
||||
|
@ -110,7 +112,6 @@ onready var canvas: Canvas = control.find_node("Canvas")
|
|||
onready var tabs: Tabs = control.find_node("Tabs")
|
||||
onready var main_viewport: ViewportContainer = control.find_node("ViewportContainer")
|
||||
onready var second_viewport: ViewportContainer = control.find_node("Second Canvas")
|
||||
onready var main_canvas_container: Container = control.find_node("Main Canvas")
|
||||
onready var canvas_preview_container: Container = control.find_node("Canvas Preview")
|
||||
onready var small_preview_viewport: ViewportContainer = canvas_preview_container.find_node(
|
||||
"PreviewViewportContainer"
|
||||
|
@ -124,9 +125,6 @@ onready var vertical_ruler: BaseButton = control.find_node("VerticalRuler")
|
|||
onready var transparent_checker: ColorRect = control.find_node("TransparentChecker")
|
||||
onready var preview_zoom_slider: VSlider = control.find_node("PreviewZoomSlider")
|
||||
|
||||
onready var tool_panel: ScrollContainer = control.find_node("Tools")
|
||||
onready var left_tool_options_scroll: ScrollContainer = control.find_node("Left Tool Options")
|
||||
onready var right_tool_options_scroll: ScrollContainer = control.find_node("Right Tool Options")
|
||||
onready var brushes_popup: Popup = control.find_node("BrushesPopup")
|
||||
onready var patterns_popup: Popup = control.find_node("PatternsPopup")
|
||||
onready var palette_panel: PalettePanel = control.find_node("Palettes")
|
||||
|
@ -163,7 +161,6 @@ onready var save_sprites_html5_dialog: ConfirmationDialog = control.find_node("S
|
|||
onready var export_dialog: AcceptDialog = control.find_node("ExportDialog")
|
||||
onready var preferences_dialog: AcceptDialog = control.find_node("PreferencesDialog")
|
||||
onready var error_dialog: AcceptDialog = control.find_node("ErrorDialog")
|
||||
onready var quit_and_save_dialog: ConfirmationDialog = control.find_node("QuitAndSaveDialog")
|
||||
|
||||
onready var current_version: String = ProjectSettings.get_setting("application/config/Version")
|
||||
|
||||
|
@ -200,8 +197,7 @@ func notification_label(text: String) -> void:
|
|||
var notification: Label = notification_label_node.instance()
|
||||
notification.text = tr(text)
|
||||
notification.rect_position = Vector2(70, animation_timeline.rect_position.y)
|
||||
notification.theme = control.theme
|
||||
get_tree().get_root().add_child(notification)
|
||||
control.add_child(notification)
|
||||
|
||||
|
||||
func general_undo(project: Project = current_project) -> void:
|
||||
|
@ -284,7 +280,9 @@ func _project_changed(value: int) -> void:
|
|||
canvas.selection.transform_content_confirm()
|
||||
current_project_index = value
|
||||
current_project = projects[value]
|
||||
current_project.change_project()
|
||||
connect("project_changed", current_project, "change_project")
|
||||
emit_signal("project_changed")
|
||||
disconnect("project_changed", current_project, "change_project")
|
||||
|
||||
|
||||
func dialog_open(open: bool) -> void:
|
||||
|
|
|
@ -6,9 +6,9 @@ var is_quitting_on_save := false
|
|||
var cursor_image: Texture = preload("res://assets/graphics/cursor.png")
|
||||
|
||||
onready var ui := $MenuAndUI/UI/DockableContainer
|
||||
onready var canvas_preview_container := ui.find_node("CanvasPreviewContainer")
|
||||
onready var scroll_container := ui.find_node("ColorAndToolOptions/ScrollContainer")
|
||||
onready var quit_dialog: ConfirmationDialog = find_node("QuitDialog")
|
||||
onready var quit_and_save_dialog: ConfirmationDialog = find_node("QuitAndSaveDialog")
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
|
@ -28,8 +28,8 @@ func _ready() -> void:
|
|||
Import.import_brushes(Global.directory_module.get_brushes_search_path_in_order())
|
||||
Import.import_patterns(Global.directory_module.get_patterns_search_path_in_order())
|
||||
|
||||
Global.quit_and_save_dialog.add_button("Save & Exit", false, "Save")
|
||||
Global.quit_and_save_dialog.get_ok().text = "Exit without saving"
|
||||
quit_and_save_dialog.add_button("Save & Exit", false, "Save")
|
||||
quit_and_save_dialog.get_ok().text = "Exit without saving"
|
||||
|
||||
Global.open_sprites_dialog.current_dir = Global.config_cache.get_value(
|
||||
"data", "current_dir", OS.get_system_dir(OS.SYSTEM_DIR_DESKTOP)
|
||||
|
@ -317,7 +317,7 @@ func show_quit_dialog() -> void:
|
|||
else:
|
||||
_on_QuitDialog_confirmed()
|
||||
else:
|
||||
Global.quit_and_save_dialog.call_deferred("popup_centered")
|
||||
quit_and_save_dialog.call_deferred("popup_centered")
|
||||
|
||||
Global.dialog_open(true)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extends ConfirmationDialog
|
||||
|
||||
# Emitted when user confirms his changes
|
||||
# Emitted when user confirms their changes
|
||||
signal saved(preset, name, comment, width, height, add_alpha_colors, colors_from)
|
||||
|
||||
# Reference to current palette stored when dialog opens
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
extends ConfirmationDialog
|
||||
|
||||
# Emitted when user confirms his changes
|
||||
# Emitted when user confirms their changes
|
||||
signal saved(name, comment, width, height)
|
||||
signal deleted
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ margin_bottom = 56.0
|
|||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Same color area"
|
||||
items = [ "Same color area", null, false, 0, null, "Similar color pixels", null, false, 1, null ]
|
||||
items = [ "Same color area", null, false, 0, null, "Same color pixels", null, false, 1, null ]
|
||||
selected = 0
|
||||
|
||||
[node name="Similarity" type="VBoxContainer" parent="." index="3"]
|
||||
|
|
|
@ -24,9 +24,6 @@ margin_right = 328.0
|
|||
margin_bottom = 174.0
|
||||
size_flags_vertical = 0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
margin_left = 7.0
|
||||
|
|
|
@ -7,17 +7,11 @@ margin_right = 1280.0
|
|||
margin_bottom = 28.0
|
||||
rect_min_size = Vector2( 0, 28 )
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MenuItems" type="HBoxContainer" parent="."]
|
||||
margin_left = 7.0
|
||||
margin_top = 4.0
|
||||
margin_right = 1010.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FileMenu" type="MenuButton" parent="MenuItems"]
|
||||
margin_right = 35.0
|
||||
|
@ -82,9 +76,6 @@ anchor_bottom = 1.0
|
|||
margin_left = -65.5
|
||||
margin_right = 65.5
|
||||
custom_constants/separation = 20
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="RotationStats" type="CenterContainer" parent="TopLabels"]
|
||||
margin_right = 60.0
|
||||
|
@ -157,9 +148,6 @@ margin_right = 0.00012207
|
|||
margin_bottom = 13.0
|
||||
grow_horizontal = 2
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CurrentFrame" type="Label" parent="HBoxContainer"]
|
||||
margin_left = 106.0
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
extends Panel
|
||||
|
||||
onready var main_canvas_container = Global.main_canvas_container
|
||||
onready var main_canvas_container: Container = find_node("Main Canvas")
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
update_transparent_shader()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue