mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-19 01:29:49 +00:00
Preload more resources
Had to remove references to Brushes and Patterns classes from BrushesButton.gd and PatternButton.gd due to GDScript's cyclic reference bug
This commit is contained in:
parent
763a063de7
commit
9bec8f1b09
|
@ -189,10 +189,10 @@ var palette_panel : PalettePanel
|
||||||
var error_dialog : AcceptDialog
|
var error_dialog : AcceptDialog
|
||||||
var quit_dialog : ConfirmationDialog
|
var quit_dialog : ConfirmationDialog
|
||||||
var quit_and_save_dialog : ConfirmationDialog
|
var quit_and_save_dialog : ConfirmationDialog
|
||||||
|
var notification_label_node = preload("res://src/UI/NotificationLabel.tscn")
|
||||||
|
|
||||||
onready var current_version : String = ProjectSettings.get_setting("application/config/Version")
|
onready var current_version : String = ProjectSettings.get_setting("application/config/Version")
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
randomize()
|
randomize()
|
||||||
if OS.get_name() == "OSX":
|
if OS.get_name() == "OSX":
|
||||||
|
@ -327,7 +327,7 @@ func _ready() -> void:
|
||||||
|
|
||||||
|
|
||||||
func notification_label(text : String) -> void:
|
func notification_label(text : String) -> void:
|
||||||
var notification : Label = load("res://src/UI/NotificationLabel.tscn").instance()
|
var notification : Label = notification_label_node.instance()
|
||||||
notification.text = tr(text)
|
notification.text = tr(text)
|
||||||
notification.rect_position = Vector2(70, OS.window_size.y - animation_timeline.rect_size.y - 20)
|
notification.rect_position = Vector2(70, OS.window_size.y - animation_timeline.rect_size.y - 20)
|
||||||
notification.theme = control.theme
|
notification.theme = control.theme
|
||||||
|
|
|
@ -42,6 +42,7 @@ var was_exported := false
|
||||||
var frame_button_node = preload("res://src/UI/Timeline/FrameButton.tscn")
|
var frame_button_node = preload("res://src/UI/Timeline/FrameButton.tscn")
|
||||||
var layer_button_node = preload("res://src/UI/Timeline/LayerButton.tscn")
|
var layer_button_node = preload("res://src/UI/Timeline/LayerButton.tscn")
|
||||||
var cel_button_node = preload("res://src/UI/Timeline/CelButton.tscn")
|
var cel_button_node = preload("res://src/UI/Timeline/CelButton.tscn")
|
||||||
|
var animation_tag_node = preload("res://src/UI/Timeline/AnimationTagUI.tscn")
|
||||||
|
|
||||||
|
|
||||||
func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) -> void:
|
func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) -> void:
|
||||||
|
@ -564,7 +565,7 @@ func animation_tags_changed(value : Array) -> void:
|
||||||
|
|
||||||
for tag in animation_tags:
|
for tag in animation_tags:
|
||||||
var tag_base_size = Global.animation_timeline.cel_size + 3
|
var tag_base_size = Global.animation_timeline.cel_size + 3
|
||||||
var tag_c : Container = load("res://src/UI/Timeline/AnimationTagUI.tscn").instance()
|
var tag_c : Container = animation_tag_node.instance()
|
||||||
Global.tag_container.add_child(tag_c)
|
Global.tag_container.add_child(tag_c)
|
||||||
tag_c.tag = tag
|
tag_c.tag = tag
|
||||||
var tag_position : int = Global.tag_container.get_child_count() - 1
|
var tag_position : int = Global.tag_container.get_child_count() - 1
|
||||||
|
|
|
@ -8,7 +8,7 @@ var edited_swatch_index = -1
|
||||||
|
|
||||||
onready var palette_select := $PaletteVBoxContainer/PaletteButtons/PaletteSelect
|
onready var palette_select := $PaletteVBoxContainer/PaletteButtons/PaletteSelect
|
||||||
onready var add_palette_button := $PaletteVBoxContainer/PaletteButtons/AddPalette
|
onready var add_palette_button := $PaletteVBoxContainer/PaletteButtons/AddPalette
|
||||||
onready var palette_grid := $PaletteVBoxContainer/SwatchesContainer/PaletteScroll/HBoxContainer/CenterContainer/HBoxContainer/PaletteGrid
|
onready var palette_grid := find_node("PaletteGrid")
|
||||||
onready var palette_scroll := $PaletteVBoxContainer/SwatchesContainer/PaletteScroll
|
onready var palette_scroll := $PaletteVBoxContainer/SwatchesContainer/PaletteScroll
|
||||||
|
|
||||||
onready var add_color_button := $PaletteVBoxContainer/SwatchesContainer/ColorButtons/AddColor
|
onready var add_color_button := $PaletteVBoxContainer/SwatchesContainer/ColorButtons/AddColor
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
extends BaseButton
|
extends BaseButton
|
||||||
|
|
||||||
|
|
||||||
var brush := Brushes.Brush.new()
|
var brush = Global.brushes_popup.Brush.new()
|
||||||
|
|
||||||
|
|
||||||
func _on_BrushButton_pressed() -> void:
|
func _on_BrushButton_pressed() -> void:
|
||||||
|
@ -13,17 +13,17 @@ func _on_BrushButton_pressed() -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_DeleteButton_pressed() -> void:
|
func _on_DeleteButton_pressed() -> void:
|
||||||
if brush.type != Brushes.CUSTOM:
|
if brush.type != Global.brushes_popup.CUSTOM:
|
||||||
return
|
return
|
||||||
|
|
||||||
Global.brushes_popup.remove_brush(self)
|
Global.brushes_popup.remove_brush(self)
|
||||||
|
|
||||||
|
|
||||||
func _on_BrushButton_mouse_entered() -> void:
|
func _on_BrushButton_mouse_entered() -> void:
|
||||||
if brush.type == Brushes.CUSTOM:
|
if brush.type == Global.brushes_popup.CUSTOM:
|
||||||
$DeleteButton.visible = true
|
$DeleteButton.visible = true
|
||||||
|
|
||||||
|
|
||||||
func _on_BrushButton_mouse_exited() -> void:
|
func _on_BrushButton_mouse_exited() -> void:
|
||||||
if brush.type == Brushes.CUSTOM:
|
if brush.type == Global.brushes_popup.CUSTOM:
|
||||||
$DeleteButton.visible = false
|
$DeleteButton.visible = false
|
||||||
|
|
|
@ -52,7 +52,7 @@ static func get_default_brush() -> Brush:
|
||||||
|
|
||||||
|
|
||||||
static func create_button(image : Image) -> Node:
|
static func create_button(image : Image) -> Node:
|
||||||
var button : BaseButton = load("res://src/UI/BrushButton.tscn").instance()
|
var button : BaseButton = preload("res://src/UI/BrushButton.tscn").instance()
|
||||||
var tex := ImageTexture.new()
|
var tex := ImageTexture.new()
|
||||||
tex.create_from_image(image, 0)
|
tex.create_from_image(image, 0)
|
||||||
button.get_child(0).texture = tex
|
button.get_child(0).texture = tex
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
extends BaseButton
|
extends BaseButton
|
||||||
|
|
||||||
|
|
||||||
var pattern := Patterns.Pattern.new()
|
var pattern = Global.patterns_popup.Pattern.new()
|
||||||
|
|
||||||
|
|
||||||
func _on_PatternButton_pressed() -> void:
|
func _on_PatternButton_pressed() -> void:
|
||||||
|
|
|
@ -17,7 +17,7 @@ func select_pattern(pattern : Pattern) -> void:
|
||||||
|
|
||||||
|
|
||||||
static func create_button(image : Image) -> Node:
|
static func create_button(image : Image) -> Node:
|
||||||
var button : BaseButton = load("res://src/UI/PatternButton.tscn").instance()
|
var button : BaseButton = preload("res://src/UI/PatternButton.tscn").instance()
|
||||||
var tex := ImageTexture.new()
|
var tex := ImageTexture.new()
|
||||||
tex.create_from_image(image, 0)
|
tex.create_from_image(image, 0)
|
||||||
button.get_child(0).texture = tex
|
button.get_child(0).texture = tex
|
||||||
|
|
Loading…
Reference in a new issue