mirror of
https://github.com/Relintai/draw_gd.git
synced 2025-02-15 23:44:35 +01:00
Removal of the DrawGD/Global singleton part 3.
This commit is contained in:
parent
f0bf996e70
commit
efb6641ddc
@ -165,7 +165,7 @@ var error_dialog : AcceptDialog
|
|||||||
var quit_dialog : ConfirmationDialog
|
var quit_dialog : ConfirmationDialog
|
||||||
var quit_and_save_dialog : ConfirmationDialog
|
var quit_and_save_dialog : ConfirmationDialog
|
||||||
|
|
||||||
onready var current_version : String = ProjectSettings.get_setting("application/config/Version")
|
var current_version : String = ""
|
||||||
|
|
||||||
var tools_script = preload("res://addons/draw_gd/src/Autoload/Tools.gd")
|
var tools_script = preload("res://addons/draw_gd/src/Autoload/Tools.gd")
|
||||||
var tools = null
|
var tools = null
|
||||||
@ -174,6 +174,8 @@ var opensave_script = preload("res://addons/draw_gd/src/Autoload/OpenSave.gd")
|
|||||||
var opensave = null
|
var opensave = null
|
||||||
|
|
||||||
func _enter_tree() -> void:
|
func _enter_tree() -> void:
|
||||||
|
current_version = ProjectSettings.get_setting("application/config/Version")
|
||||||
|
|
||||||
randomize()
|
randomize()
|
||||||
if OS.has_feature("standalone"):
|
if OS.has_feature("standalone"):
|
||||||
root_directory = OS.get_executable_path().get_base_dir()
|
root_directory = OS.get_executable_path().get_base_dir()
|
||||||
@ -278,7 +280,8 @@ func refresh_nodes():
|
|||||||
quit_dialog = find_node_by_name(control, "QuitDialog")
|
quit_dialog = find_node_by_name(control, "QuitDialog")
|
||||||
quit_and_save_dialog = find_node_by_name(control, "QuitAndSaveDialog")
|
quit_and_save_dialog = find_node_by_name(control, "QuitAndSaveDialog")
|
||||||
|
|
||||||
projects.append(Project.new())
|
projects.append(Project.new(self))
|
||||||
|
|
||||||
projects[0].layers.append(Layer.new())
|
projects[0].layers.append(Layer.new())
|
||||||
current_project = projects[0]
|
current_project = projects[0]
|
||||||
|
|
||||||
@ -435,13 +438,15 @@ func update_hint_tooltips() -> void:
|
|||||||
%s for left mouse button
|
%s for left mouse button
|
||||||
%s for right mouse button
|
%s for right mouse button
|
||||||
|
|
||||||
Press %s to move the content""") % [InputMap.get_action_list("left_rectangle_select_tool")[0].as_text(), InputMap.get_action_list("right_rectangle_select_tool")[0].as_text(), "Shift"]
|
Press %s to move the content""") % ["", "", "Shift"]
|
||||||
|
#% [InputMap.get_action_list("left_rectangle_select_tool")[0].as_text(), InputMap.get_action_list("right_rectangle_select_tool")[0].as_text(), "Shift"]
|
||||||
|
|
||||||
var zoom_tool : BaseButton = find_node_by_name(self, "Zoom")
|
var zoom_tool : BaseButton = find_node_by_name(self, "Zoom")
|
||||||
zoom_tool.hint_tooltip = tr("""Zoom
|
zoom_tool.hint_tooltip = tr("""Zoom
|
||||||
|
|
||||||
%s for left mouse button
|
%s for left mouse button
|
||||||
%s for right mouse button""") % [InputMap.get_action_list("left_zoom_tool")[0].as_text(), InputMap.get_action_list("right_zoom_tool")[0].as_text()]
|
%s for right mouse button""") % ["", ""]
|
||||||
|
#% [InputMap.get_action_list("left_zoom_tool")[0].as_text(), InputMap.get_action_list("right_zoom_tool")[0].as_text()]
|
||||||
|
|
||||||
|
|
||||||
var color_picker : BaseButton = find_node_by_name(self, "ColorPicker")
|
var color_picker : BaseButton = find_node_by_name(self, "ColorPicker")
|
||||||
@ -449,7 +454,8 @@ Press %s to move the content""") % [InputMap.get_action_list("left_rectangle_sel
|
|||||||
Select a color from a pixel of the sprite
|
Select a color from a pixel of the sprite
|
||||||
|
|
||||||
%s for left mouse button
|
%s for left mouse button
|
||||||
%s for right mouse button""") % [InputMap.get_action_list("left_colorpicker_tool")[0].as_text(), InputMap.get_action_list("right_colorpicker_tool")[0].as_text()]
|
%s for right mouse button""") % ["", ""]
|
||||||
|
#% [InputMap.get_action_list("left_colorpicker_tool")[0].as_text(), InputMap.get_action_list("right_colorpicker_tool")[0].as_text()]
|
||||||
|
|
||||||
var pencil : BaseButton = find_node_by_name(self, "Pencil")
|
var pencil : BaseButton = find_node_by_name(self, "Pencil")
|
||||||
pencil.hint_tooltip = tr("""Pencil
|
pencil.hint_tooltip = tr("""Pencil
|
||||||
@ -457,7 +463,8 @@ Select a color from a pixel of the sprite
|
|||||||
%s for left mouse button
|
%s for left mouse button
|
||||||
%s for right mouse button
|
%s for right mouse button
|
||||||
|
|
||||||
Hold %s to make a line""") % [InputMap.get_action_list("left_pencil_tool")[0].as_text(), InputMap.get_action_list("right_pencil_tool")[0].as_text(), "Shift"]
|
Hold %s to make a line""") % ["", "", "Shift"]
|
||||||
|
#% [InputMap.get_action_list("left_pencil_tool")[0].as_text(), InputMap.get_action_list("right_pencil_tool")[0].as_text(), "Shift"]
|
||||||
|
|
||||||
var eraser : BaseButton = find_node_by_name(self, "Eraser")
|
var eraser : BaseButton = find_node_by_name(self, "Eraser")
|
||||||
eraser.hint_tooltip = tr("""Eraser
|
eraser.hint_tooltip = tr("""Eraser
|
||||||
@ -465,45 +472,55 @@ Hold %s to make a line""") % [InputMap.get_action_list("left_pencil_tool")[0].as
|
|||||||
%s for left mouse button
|
%s for left mouse button
|
||||||
%s for right mouse button
|
%s for right mouse button
|
||||||
|
|
||||||
Hold %s to make a line""") % [InputMap.get_action_list("left_eraser_tool")[0].as_text(), InputMap.get_action_list("right_eraser_tool")[0].as_text(), "Shift"]
|
Hold %s to make a line""") % ["", "", "Shift"]
|
||||||
|
#% [InputMap.get_action_list("left_eraser_tool")[0].as_text(), InputMap.get_action_list("right_eraser_tool")[0].as_text(), "Shift"]
|
||||||
|
|
||||||
var bucket : BaseButton = find_node_by_name(self, "Bucket")
|
var bucket : BaseButton = find_node_by_name(self, "Bucket")
|
||||||
bucket.hint_tooltip = tr("""Bucket
|
bucket.hint_tooltip = tr("""Bucket
|
||||||
|
|
||||||
%s for left mouse button
|
%s for left mouse button
|
||||||
%s for right mouse button""") % [InputMap.get_action_list("left_fill_tool")[0].as_text(), InputMap.get_action_list("right_fill_tool")[0].as_text()]
|
%s for right mouse button""") % ["", ""]
|
||||||
|
#% [InputMap.get_action_list("left_fill_tool")[0].as_text(), InputMap.get_action_list("right_fill_tool")[0].as_text()]
|
||||||
|
|
||||||
var ld : BaseButton = find_node_by_name(self, "LightenDarken")
|
var ld : BaseButton = find_node_by_name(self, "LightenDarken")
|
||||||
ld.hint_tooltip = tr("""Lighten/Darken
|
ld.hint_tooltip = tr("""Lighten/Darken
|
||||||
|
|
||||||
%s for left mouse button
|
%s for left mouse button
|
||||||
%s for right mouse button""") % [InputMap.get_action_list("left_lightdark_tool")[0].as_text(), InputMap.get_action_list("right_lightdark_tool")[0].as_text()]
|
%s for right mouse button""") % ["", ""]
|
||||||
|
#% [InputMap.get_action_list("left_lightdark_tool")[0].as_text(), InputMap.get_action_list("right_lightdark_tool")[0].as_text()]
|
||||||
|
|
||||||
var color_switch : BaseButton = find_node_by_name(self, "ColorSwitch")
|
var color_switch : BaseButton = find_node_by_name(self, "ColorSwitch")
|
||||||
color_switch.hint_tooltip = tr("""Switch left and right colors
|
color_switch.hint_tooltip = tr("""Switch left and right colors
|
||||||
(%s)""") % InputMap.get_action_list("switch_colors")[0].as_text()
|
(%s)""") % ""
|
||||||
|
#InputMap.get_action_list("switch_colors")[0].as_text()
|
||||||
|
|
||||||
var first_frame : BaseButton = find_node_by_name(self, "FirstFrame")
|
var first_frame : BaseButton = find_node_by_name(self, "FirstFrame")
|
||||||
first_frame.hint_tooltip = tr("""Jump to the first frame
|
first_frame.hint_tooltip = tr("""Jump to the first frame
|
||||||
(%s)""") % InputMap.get_action_list("go_to_first_frame")[0].as_text()
|
(%s)""") % ""
|
||||||
|
#InputMap.get_action_list("go_to_first_frame")[0].as_text()
|
||||||
|
|
||||||
var previous_frame : BaseButton = find_node_by_name(self, "PreviousFrame")
|
var previous_frame : BaseButton = find_node_by_name(self, "PreviousFrame")
|
||||||
previous_frame.hint_tooltip = tr("""Go to the previous frame
|
previous_frame.hint_tooltip = tr("""Go to the previous frame
|
||||||
(%s)""") % InputMap.get_action_list("go_to_previous_frame")[0].as_text()
|
(%s)""") % ""
|
||||||
|
#InputMap.get_action_list("go_to_previous_frame")[0].as_text()
|
||||||
|
|
||||||
play_backwards.hint_tooltip = tr("""Play the animation backwards (from end to beginning)
|
play_backwards.hint_tooltip = tr("""Play the animation backwards (from end to beginning)
|
||||||
(%s)""") % InputMap.get_action_list("play_backwards")[0].as_text()
|
(%s)""") % ""
|
||||||
|
#InputMap.get_action_list("play_backwards")[0].as_text()
|
||||||
|
|
||||||
play_forward.hint_tooltip = tr("""Play the animation forward (from beginning to end)
|
play_forward.hint_tooltip = tr("""Play the animation forward (from beginning to end)
|
||||||
(%s)""") % InputMap.get_action_list("play_forward")[0].as_text()
|
(%s)""") % ""
|
||||||
|
#InputMap.get_action_list("play_forward")[0].as_text()
|
||||||
|
|
||||||
var next_frame : BaseButton = find_node_by_name(self, "NextFrame")
|
var next_frame : BaseButton = find_node_by_name(self, "NextFrame")
|
||||||
next_frame.hint_tooltip = tr("""Go to the next frame
|
next_frame.hint_tooltip = tr("""Go to the next frame
|
||||||
(%s)""") % InputMap.get_action_list("go_to_next_frame")[0].as_text()
|
(%s)""") % ""
|
||||||
|
#InputMap.get_action_list("go_to_next_frame")[0].as_text()
|
||||||
|
|
||||||
var last_frame : BaseButton = find_node_by_name(self, "LastFrame")
|
var last_frame : BaseButton = find_node_by_name(self, "LastFrame")
|
||||||
last_frame.hint_tooltip = tr("""Jump to the last frame
|
last_frame.hint_tooltip = tr("""Jump to the last frame
|
||||||
(%s)""") % InputMap.get_action_list("go_to_last_frame")[0].as_text()
|
(%s)""") % ""
|
||||||
|
#InputMap.get_action_list("go_to_last_frame")[0].as_text()
|
||||||
|
|
||||||
|
|
||||||
func _exit_tree() -> void:
|
func _exit_tree() -> void:
|
||||||
|
@ -11,7 +11,14 @@ onready var autosave_timer : Timer
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
autosave_timer = Timer.new()
|
autosave_timer = Timer.new()
|
||||||
autosave_timer.one_shot = false
|
autosave_timer.one_shot = false
|
||||||
autosave_timer.process_mode = Timer.TIMER_PROCESS_IDLE
|
autosave_timer.process_mode = Timer.TIMER_PROCESS_IDLE
|
||||||
@ -69,7 +76,7 @@ func open_pxo_file(path : String, untitled_backup : bool = false) -> void:
|
|||||||
new_project.animation_tags.clear()
|
new_project.animation_tags.clear()
|
||||||
new_project.name = path.get_file()
|
new_project.name = path.get_file()
|
||||||
else:
|
else:
|
||||||
new_project = Project.new([], path.get_file())
|
new_project = Project.new(DrawGD, [], path.get_file())
|
||||||
|
|
||||||
var first_line := file.get_line()
|
var first_line := file.get_line()
|
||||||
var dict := JSON.parse(first_line)
|
var dict := JSON.parse(first_line)
|
||||||
@ -325,7 +332,7 @@ func save_pxo_file(path : String, autosave : bool, use_zstd_compression := true,
|
|||||||
|
|
||||||
|
|
||||||
func open_image_as_new_tab(path : String, image : Image) -> void:
|
func open_image_as_new_tab(path : String, image : Image) -> void:
|
||||||
var project = Project.new([], path.get_file(), image.get_size())
|
var project = Project.new(DrawGD, [], path.get_file(), image.get_size())
|
||||||
project.layers.append(Layer.new())
|
project.layers.append(Layer.new())
|
||||||
DrawGD.projects.append(project)
|
DrawGD.projects.append(project)
|
||||||
|
|
||||||
@ -339,7 +346,7 @@ func open_image_as_new_tab(path : String, image : Image) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func open_image_as_spritesheet(path : String, image : Image, horizontal : int, vertical : int) -> void:
|
func open_image_as_spritesheet(path : String, image : Image, horizontal : int, vertical : int) -> void:
|
||||||
var project = Project.new([], path.get_file())
|
var project = Project.new(DrawGD, [], path.get_file())
|
||||||
project.layers.append(Layer.new())
|
project.layers.append(Layer.new())
|
||||||
DrawGD.projects.append(project)
|
DrawGD.projects.append(project)
|
||||||
horizontal = min(horizontal, image.get_size().x)
|
horizontal = min(horizontal, image.get_size().x)
|
||||||
|
@ -17,7 +17,8 @@ class Slot:
|
|||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
|
|
||||||
func _init(slot_name : String) -> void:
|
func _init(pDrawGD, slot_name : String) -> void:
|
||||||
|
DrawGD = pDrawGD
|
||||||
name = slot_name
|
name = slot_name
|
||||||
kname = name.replace(" ", "_").to_lower()
|
kname = name.replace(" ", "_").to_lower()
|
||||||
load_config()
|
load_config()
|
||||||
@ -63,10 +64,17 @@ var alt := false
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
func _ready():
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
yield(get_tree(), "idle_frame")
|
yield(get_tree(), "idle_frame")
|
||||||
_slots[BUTTON_LEFT] = Slot.new("Left tool")
|
_slots[BUTTON_LEFT] = Slot.new(DrawGD, "Left tool")
|
||||||
_slots[BUTTON_RIGHT] = Slot.new("Right tool")
|
_slots[BUTTON_RIGHT] = Slot.new(DrawGD, "Right tool")
|
||||||
_panels[BUTTON_LEFT] = DrawGD.find_node_by_name(DrawGD.control, "LeftPanelContainer")
|
_panels[BUTTON_LEFT] = DrawGD.find_node_by_name(DrawGD.control, "LeftPanelContainer")
|
||||||
_panels[BUTTON_RIGHT] = DrawGD.find_node_by_name(DrawGD.control, "RightPanelContainer")
|
_panels[BUTTON_RIGHT] = DrawGD.find_node_by_name(DrawGD.control, "RightPanelContainer")
|
||||||
_tool_buttons = DrawGD.find_node_by_name(DrawGD.control, "ToolButtons")
|
_tool_buttons = DrawGD.find_node_by_name(DrawGD.control, "ToolButtons")
|
||||||
|
@ -66,9 +66,7 @@ func set_pixel_perfect(value: bool) -> void:
|
|||||||
else:
|
else:
|
||||||
drawers = [simple_drawer, simple_drawer, simple_drawer, simple_drawer]
|
drawers = [simple_drawer, simple_drawer, simple_drawer, simple_drawer]
|
||||||
|
|
||||||
|
func set_pixel(image: Image, position: Vector2, color: Color, project : Project) -> void:
|
||||||
func set_pixel(image: Image, position: Vector2, color: Color) -> void:
|
|
||||||
var project : Project = DrawGD.current_project
|
|
||||||
drawers[0].set_pixel(image, position, color, color_op)
|
drawers[0].set_pixel(image, position, color, color_op)
|
||||||
|
|
||||||
# Handle Mirroring
|
# Handle Mirroring
|
||||||
|
@ -19,7 +19,14 @@ var affect_option_button : OptionButton
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
set_nodes()
|
set_nodes()
|
||||||
current_cel = Image.new()
|
current_cel = Image.new()
|
||||||
current_frame = Image.new()
|
current_frame = Image.new()
|
||||||
|
@ -38,7 +38,7 @@ var file_name := "untitled"
|
|||||||
var file_format : int = Export.FileFormat.PNG
|
var file_format : int = Export.FileFormat.PNG
|
||||||
|
|
||||||
|
|
||||||
func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) -> void:
|
func _init(pDrawGD, _frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) -> void:
|
||||||
frames = _frames
|
frames = _frames
|
||||||
name = _name
|
name = _name
|
||||||
size = _size
|
size = _size
|
||||||
@ -46,6 +46,7 @@ func _init(_frames := [], _name := tr("untitled"), _size := Vector2(64, 64)) ->
|
|||||||
|
|
||||||
undo_redo = UndoRedo.new()
|
undo_redo = UndoRedo.new()
|
||||||
|
|
||||||
|
DrawGD = pDrawGD
|
||||||
DrawGD.tabs.add_tab(name)
|
DrawGD.tabs.add_tab(name)
|
||||||
DrawGD.opensave.current_save_paths.append("")
|
DrawGD.opensave.current_save_paths.append("")
|
||||||
DrawGD.opensave.backup_save_paths.append("")
|
DrawGD.opensave.backup_save_paths.append("")
|
||||||
@ -392,6 +393,9 @@ func layers_changed(value : Array) -> void:
|
|||||||
for i in range(layers.size() - 1, -1, -1):
|
for i in range(layers.size() - 1, -1, -1):
|
||||||
var layer_container = load("res://addons/draw_gd/src/UI/Timeline/LayerButton.tscn").instance()
|
var layer_container = load("res://addons/draw_gd/src/UI/Timeline/LayerButton.tscn").instance()
|
||||||
layer_container.i = i
|
layer_container.i = i
|
||||||
|
layer_container.DrawGD = DrawGD
|
||||||
|
layer_container.init()
|
||||||
|
|
||||||
if layers[i].name == tr("Layer") + " 0":
|
if layers[i].name == tr("Layer") + " 0":
|
||||||
layers[i].name = tr("Layer") + " %s" % i
|
layers[i].name = tr("Layer") + " %s" % i
|
||||||
|
|
||||||
|
@ -9,18 +9,19 @@ var opensprite_file_selected := false
|
|||||||
var redone := false
|
var redone := false
|
||||||
var is_quitting_on_save := false
|
var is_quitting_on_save := false
|
||||||
|
|
||||||
onready var DrawGD : Node = get_node("..")
|
var DrawGD : Node = null
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
DrawGD = get_node("..")
|
||||||
#get_tree().set_auto_accept_quit(false)
|
#get_tree().set_auto_accept_quit(false)
|
||||||
setup_application_window_size()
|
setup_application_window_size()
|
||||||
|
|
||||||
DrawGD.window_title = tr("untitled") + " - Pixelorama " + DrawGD.current_version
|
DrawGD.window_title = tr("untitled") + " - Pixelorama " + DrawGD.current_version
|
||||||
|
|
||||||
DrawGD.current_project.layers[0].name = tr("Layer") + " 0"
|
DrawGD.current_project.layers[0].name = tr("Layer") + " 0"
|
||||||
DrawGD.layers_container.get_child(0).label.text = DrawGD.current_project.layers[0].name
|
#DrawGD.layers_container.get_child(0).label.text = DrawGD.current_project.layers[0].name
|
||||||
DrawGD.layers_container.get_child(0).line_edit.text = DrawGD.current_project.layers[0].name
|
#DrawGD.layers_container.get_child(0).line_edit.text = DrawGD.current_project.layers[0].name
|
||||||
|
|
||||||
Import.import_brushes(DrawGD.directory_module.get_brushes_search_path_in_order())
|
Import.import_brushes(DrawGD.directory_module.get_brushes_search_path_in_order())
|
||||||
Import.import_patterns(DrawGD.directory_module.get_patterns_search_path_in_order())
|
Import.import_patterns(DrawGD.directory_module.get_patterns_search_path_in_order())
|
||||||
@ -49,14 +50,14 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _input(event : InputEvent) -> void:
|
func _input(event : InputEvent) -> void:
|
||||||
DrawGD.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)
|
# DrawGD.left_cursor.position = get_global_mouse_position() + Vector2(-32, 32)
|
||||||
DrawGD.left_cursor.texture = DrawGD.left_cursor_tool_texture
|
# DrawGD.left_cursor.texture = DrawGD.left_cursor_tool_texture
|
||||||
DrawGD.right_cursor.position = get_global_mouse_position() + Vector2(32, 32)
|
# DrawGD.right_cursor.position = get_global_mouse_position() + Vector2(32, 32)
|
||||||
DrawGD.right_cursor.texture = DrawGD.right_cursor_tool_texture
|
# DrawGD.right_cursor.texture = DrawGD.right_cursor_tool_texture
|
||||||
|
|
||||||
if event is InputEventKey and (event.scancode == KEY_ENTER or event.scancode == KEY_KP_ENTER):
|
# if event is InputEventKey and (event.scancode == KEY_ENTER or event.scancode == KEY_KP_ENTER):
|
||||||
if get_focus_owner() is LineEdit:
|
# if get_focus_owner() is LineEdit:
|
||||||
get_focus_owner().release_focus()
|
# get_focus_owner().release_focus()
|
||||||
|
|
||||||
#TODO TEMP
|
#TODO TEMP
|
||||||
return
|
return
|
||||||
|
@ -16,7 +16,14 @@ var Import = preload("res://addons/draw_gd/src/Autoload/Import.gd")
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
_load_palettes()
|
_load_palettes()
|
||||||
|
|
||||||
# Select default palette "Default"
|
# Select default palette "Default"
|
||||||
|
@ -29,13 +29,12 @@ onready var cjk_font = preload("res://addons/draw_gd/assets/fonts/CJK/NotoSansCJ
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
var n : Node = get_parent()
|
var n : Node = get_parent()
|
||||||
while n:
|
while n:
|
||||||
if n.has_method("DrawGD"):
|
if n.name == "DrawGDSingleton":
|
||||||
print("ddddddddddddddddd")
|
DrawGD = n
|
||||||
DrawGD = n.DrawGD
|
break
|
||||||
|
|
||||||
n = n.get_parent()
|
n = n.get_parent()
|
||||||
|
|
||||||
loaded_locales = TranslationServer.get_loaded_locales()
|
loaded_locales = TranslationServer.get_loaded_locales()
|
||||||
|
@ -10,14 +10,25 @@ var new_input_event : InputEventKey
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
onready var shortcut_selector_popup = DrawGD.preferences_dialog.get_node("Popups/ShortcutSelector")
|
var shortcut_selector_popup = null
|
||||||
onready var theme_font_color : Color = DrawGD.preferences_dialog.get_node("Popups/ShortcutSelector/EnteredShortcut").get_color("font_color")
|
var theme_font_color : Color = Color()
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
# Disable input until the shortcut selector is displayed
|
# Disable input until the shortcut selector is displayed
|
||||||
set_process_input(false)
|
set_process_input(false)
|
||||||
|
|
||||||
|
shortcut_selector_popup = DrawGD.preferences_dialog.get_node("Popups/ShortcutSelector")
|
||||||
|
theme_font_color = DrawGD.preferences_dialog.get_node("Popups/ShortcutSelector/EnteredShortcut").get_color("font_color")
|
||||||
|
|
||||||
|
|
||||||
# Get default preset for shortcuts from project input map
|
# Get default preset for shortcuts from project input map
|
||||||
# Buttons in shortcuts selector should be called the same as actions
|
# Buttons in shortcuts selector should be called the same as actions
|
||||||
for shortcut_grid_item in get_node("Shortcuts").get_children():
|
for shortcut_grid_item in get_node("Shortcuts").get_children():
|
||||||
@ -25,9 +36,9 @@ func _ready() -> void:
|
|||||||
var input_events = InputMap.get_action_list(shortcut_grid_item.name)
|
var input_events = InputMap.get_action_list(shortcut_grid_item.name)
|
||||||
if input_events.size() > 1:
|
if input_events.size() > 1:
|
||||||
printerr("Every shortcut action should have just one input event assigned in input map")
|
printerr("Every shortcut action should have just one input event assigned in input map")
|
||||||
shortcut_grid_item.text = (input_events[0] as InputEventKey).as_text()
|
#shortcut_grid_item.text = (input_events[0] as InputEventKey).as_text()
|
||||||
shortcut_grid_item.connect("pressed", self, "_on_Shortcut_button_pressed", [shortcut_grid_item])
|
shortcut_grid_item.connect("pressed", self, "_on_Shortcut_button_pressed", [shortcut_grid_item])
|
||||||
default_shortcuts_preset[shortcut_grid_item.name] = input_events[0]
|
#default_shortcuts_preset[shortcut_grid_item.name] = input_events[0]
|
||||||
|
|
||||||
# Load custom shortcuts from the config file
|
# Load custom shortcuts from the config file
|
||||||
custom_shortcuts_preset = default_shortcuts_preset.duplicate()
|
custom_shortcuts_preset = default_shortcuts_preset.duplicate()
|
||||||
@ -42,6 +53,9 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _input(event : InputEvent) -> void:
|
func _input(event : InputEvent) -> void:
|
||||||
|
#TODO
|
||||||
|
return
|
||||||
|
|
||||||
if event is InputEventKey:
|
if event is InputEventKey:
|
||||||
if event.pressed:
|
if event.pressed:
|
||||||
if event.scancode == KEY_ESCAPE:
|
if event.scancode == KEY_ESCAPE:
|
||||||
|
@ -10,7 +10,14 @@ var node : Node
|
|||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
# Handle themes
|
# Handle themes
|
||||||
if DrawGD.theme_type == DrawGD.Theme_Types.LIGHT:
|
if DrawGD.theme_type == DrawGD.Theme_Types.LIGHT:
|
||||||
texture_normal = load("res://addons/draw_gd/assets/graphics/light_themes/misc/icon_reload.png")
|
texture_normal = load("res://addons/draw_gd/assets/graphics/light_themes/misc/icon_reload.png")
|
||||||
|
@ -7,8 +7,16 @@ var cursor_text := ""
|
|||||||
|
|
||||||
var _cursor := Vector2.INF
|
var _cursor := Vector2.INF
|
||||||
|
|
||||||
|
var DrawGD : Node
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
func _ready():
|
|
||||||
kname = name.replace(" ", "_").to_lower()
|
kname = name.replace(" ", "_").to_lower()
|
||||||
$Label.text = tool_slot.name
|
$Label.text = tool_slot.name
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ func _set_pixel(position : Vector2) -> void:
|
|||||||
var i := int(position.x + position.y * image.get_size().x)
|
var i := int(position.x + position.y * image.get_size().x)
|
||||||
if _mask[i] < DrawGD.tools.pen_pressure:
|
if _mask[i] < DrawGD.tools.pen_pressure:
|
||||||
_mask[i] = DrawGD.tools.pen_pressure
|
_mask[i] = DrawGD.tools.pen_pressure
|
||||||
_drawer.set_pixel(image, position, tool_slot.color)
|
_drawer.set_pixel(image, position, tool_slot.color, project)
|
||||||
|
|
||||||
|
|
||||||
func _draw_brush_image(_image : Image, _src_rect: Rect2, _dst: Vector2) -> void:
|
func _draw_brush_image(_image : Image, _src_rect: Rect2, _dst: Vector2) -> void:
|
||||||
|
@ -1,9 +1,17 @@
|
|||||||
tool
|
tool
|
||||||
extends BaseButton
|
extends BaseButton
|
||||||
|
|
||||||
|
var DrawGD : Node = null
|
||||||
|
|
||||||
var brush := Brushes.Brush.new()
|
var brush := Brushes.Brush.new()
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
func _on_BrushButton_pressed() -> void:
|
func _on_BrushButton_pressed() -> void:
|
||||||
# Delete the brush on middle mouse press
|
# Delete the brush on middle mouse press
|
||||||
|
@ -21,7 +21,14 @@ var circle_image = preload("res://addons/draw_gd/assets/graphics/circle_9x9.png"
|
|||||||
var circle_filled_image = preload("res://addons/draw_gd/assets/graphics/circle_filled_9x9.png")
|
var circle_filled_image = preload("res://addons/draw_gd/assets/graphics/circle_filled_9x9.png")
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
var container = DrawGD.brushes_popup.get_node("TabContainer/File/FileBrushContainer")
|
var container = DrawGD.brushes_popup.get_node("TabContainer/File/FileBrushContainer")
|
||||||
var button = create_button(pixel_image)
|
var button = create_button(pixel_image)
|
||||||
button.brush.type = PIXEL
|
button.brush.type = PIXEL
|
||||||
|
@ -12,7 +12,14 @@ var drag := false
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
viewport_container = get_parent().get_parent()
|
viewport_container = get_parent().get_parent()
|
||||||
transparent_checker = get_parent().get_node("TransparentChecker")
|
transparent_checker = get_parent().get_node("TransparentChecker")
|
||||||
tween = Tween.new()
|
tween = Tween.new()
|
||||||
|
@ -18,7 +18,14 @@ var DrawGD : Node = null
|
|||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
var frame : Frame = new_empty_frame(true)
|
var frame : Frame = new_empty_frame(true)
|
||||||
DrawGD.current_project.frames.append(frame)
|
DrawGD.current_project.frames.append(frame)
|
||||||
yield(get_tree().create_timer(0.2), "timeout")
|
yield(get_tree().create_timer(0.2), "timeout")
|
||||||
|
@ -7,6 +7,14 @@ onready var animation_timer : Timer = $AnimationTimer
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
func _draw() -> void:
|
func _draw() -> void:
|
||||||
var current_project : Project = DrawGD.current_project
|
var current_project : Project = DrawGD.current_project
|
||||||
if frame >= current_project.frames.size():
|
if frame >= current_project.frames.size():
|
||||||
|
@ -7,6 +7,14 @@ var isometric_polylines := [] # An array of PoolVector2Arrays
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
func _draw() -> void:
|
func _draw() -> void:
|
||||||
if DrawGD.draw_grid:
|
if DrawGD.draw_grid:
|
||||||
draw_grid(DrawGD.grid_type)
|
draw_grid(DrawGD.grid_type)
|
||||||
|
@ -3,6 +3,14 @@ extends Node2D
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
func _input(event : InputEvent) -> void:
|
func _input(event : InputEvent) -> void:
|
||||||
if DrawGD.has_focus and event is InputEventMouseMotion:
|
if DrawGD.has_focus and event is InputEventMouseMotion:
|
||||||
update()
|
update()
|
||||||
|
@ -4,7 +4,14 @@ class_name SymmetryGuide extends Guide
|
|||||||
var _texture = preload("res://addons/draw_gd/assets/graphics/dotted_line.png")
|
var _texture = preload("res://addons/draw_gd/assets/graphics/dotted_line.png")
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
has_focus = false
|
has_focus = false
|
||||||
visible = false
|
visible = false
|
||||||
texture = _texture
|
texture = _texture
|
||||||
|
@ -6,6 +6,14 @@ var location := Vector2.ZERO
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
func _draw() -> void:
|
func _draw() -> void:
|
||||||
var current_cels : Array = DrawGD.current_project.frames[DrawGD.current_project.current_frame].cels
|
var current_cels : Array = DrawGD.current_project.frames[DrawGD.current_project.current_frame].cels
|
||||||
var size : Vector2 = DrawGD.current_project.size
|
var size : Vector2 = DrawGD.current_project.size
|
||||||
|
@ -2,13 +2,24 @@ tool
|
|||||||
extends VBoxContainer
|
extends VBoxContainer
|
||||||
|
|
||||||
|
|
||||||
onready var left_picker := $ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton
|
var left_picker : ColorPickerButton = null
|
||||||
onready var right_picker := $ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/RightColorPickerButton
|
var right_picker : ColorPickerButton = null
|
||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
DrawGD.tools.connect("color_changed", self, "update_color")
|
DrawGD.tools.connect("color_changed", self, "update_color")
|
||||||
|
|
||||||
|
left_picker = get_node("ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton")
|
||||||
|
right_picker = get_node("ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/RightColorPickerButton")
|
||||||
|
|
||||||
left_picker.get_picker().presets_visible = false
|
left_picker.get_picker().presets_visible = false
|
||||||
right_picker.get_picker().presets_visible = false
|
right_picker.get_picker().presets_visible = false
|
||||||
|
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
[ext_resource path="res://addons/draw_gd/assets/graphics/dark_themes/misc/color_defaults.png" type="Texture" id=2]
|
[ext_resource path="res://addons/draw_gd/assets/graphics/dark_themes/misc/color_defaults.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://addons/draw_gd/src/UI/ColorAndToolOptions.gd" type="Script" id=8]
|
[ext_resource path="res://addons/draw_gd/src/UI/ColorAndToolOptions.gd" type="Script" id=8]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[sub_resource type="ShortCut" id=1]
|
[sub_resource type="ShortCut" id=1]
|
||||||
|
|
||||||
[node name="ColorAndToolOptions" type="VBoxContainer"]
|
[node name="ColorAndToolOptions" type="VBoxContainer"]
|
||||||
@ -110,6 +108,7 @@ margin_right = 313.0
|
|||||||
margin_bottom = 196.0
|
margin_bottom = 196.0
|
||||||
rect_min_size = Vector2( 130, 0 )
|
rect_min_size = Vector2( 130, 0 )
|
||||||
size_flags_horizontal = 6
|
size_flags_horizontal = 6
|
||||||
|
|
||||||
[connection signal="pressed" from="ColorButtonsVertical/ColorSwitchCenter/ColorSwitch" to="." method="_on_ColorSwitch_pressed"]
|
[connection signal="pressed" from="ColorButtonsVertical/ColorSwitchCenter/ColorSwitch" to="." method="_on_ColorSwitch_pressed"]
|
||||||
[connection signal="color_changed" from="ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_ColorPickerButton_color_changed" binds= [ false ]]
|
[connection signal="color_changed" from="ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_ColorPickerButton_color_changed" binds= [ false ]]
|
||||||
[connection signal="popup_closed" from="ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_ColorPickerButton_popup_closed"]
|
[connection signal="popup_closed" from="ColorButtonsVertical/ColorPickersCenter/ColorPickersHorizontal/LeftColorPickerButton" to="." method="_on_ColorPickerButton_popup_closed"]
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
tool
|
tool
|
||||||
extends ConfirmationDialog
|
extends ConfirmationDialog
|
||||||
|
|
||||||
onready var templates_options = $VBoxContainer/OptionsContainer/TemplatesOptions
|
var templates_options = null
|
||||||
onready var ratio_box = $VBoxContainer/OptionsContainer/RatioCheckBox
|
var ratio_box = null
|
||||||
onready var width_value = $VBoxContainer/OptionsContainer/WidthValue
|
var width_value = null
|
||||||
onready var height_value = $VBoxContainer/OptionsContainer/HeightValue
|
var height_value = null
|
||||||
onready var fill_color_node = $VBoxContainer/OptionsContainer/FillColor
|
var fill_color_node = null
|
||||||
|
|
||||||
onready var size_value = Vector2()
|
onready var size_value = Vector2()
|
||||||
|
|
||||||
@ -55,7 +55,23 @@ var TStrings ={
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
|
if !n:
|
||||||
|
return
|
||||||
|
|
||||||
|
templates_options = get_node("VBoxContainer/OptionsContainer/TemplatesOptions")
|
||||||
|
ratio_box = get_node("VBoxContainer/OptionsContainer/RatioCheckBox")
|
||||||
|
width_value = get_node("VBoxContainer/OptionsContainer/WidthValue")
|
||||||
|
height_value = get_node("VBoxContainer/OptionsContainer/HeightValue")
|
||||||
|
fill_color_node = get_node("VBoxContainer/OptionsContainer/FillColor")
|
||||||
|
|
||||||
width_value.value = DrawGD.default_image_width
|
width_value.value = DrawGD.default_image_width
|
||||||
height_value.value = DrawGD.default_image_height
|
height_value.value = DrawGD.default_image_height
|
||||||
fill_color_node.color = DrawGD.default_fill_color
|
fill_color_node.color = DrawGD.default_fill_color
|
||||||
@ -83,7 +99,7 @@ func _on_CreateNewImage_confirmed() -> void:
|
|||||||
DrawGD.canvas.fill_color = fill_color
|
DrawGD.canvas.fill_color = fill_color
|
||||||
|
|
||||||
var frame : Frame = DrawGD.canvas.new_empty_frame(false, true, Vector2(width, height))
|
var frame : Frame = DrawGD.canvas.new_empty_frame(false, true, Vector2(width, height))
|
||||||
var new_project := Project.new([frame], tr("untitled"), Vector2(width, height).floor())
|
var new_project := Project.new(DrawGD, [frame], tr("untitled"), Vector2(width, height).floor())
|
||||||
new_project.layers.append(Layer.new())
|
new_project.layers.append(Layer.new())
|
||||||
DrawGD.projects.append(new_project)
|
DrawGD.projects.append(new_project)
|
||||||
DrawGD.tabs.current_tab = DrawGD.tabs.get_tab_count() - 1
|
DrawGD.tabs.current_tab = DrawGD.tabs.get_tab_count() - 1
|
||||||
|
@ -11,7 +11,10 @@ var line_edit : LineEdit
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _enter_tree() -> void:
|
||||||
|
if DrawGD:
|
||||||
|
return
|
||||||
|
|
||||||
var n : Node = get_parent()
|
var n : Node = get_parent()
|
||||||
while n:
|
while n:
|
||||||
if n.name == "DrawGDSingleton":
|
if n.name == "DrawGDSingleton":
|
||||||
@ -19,6 +22,9 @@ func _ready() -> void:
|
|||||||
break
|
break
|
||||||
n = n.get_parent()
|
n = n.get_parent()
|
||||||
|
|
||||||
|
init()
|
||||||
|
|
||||||
|
func init():
|
||||||
visibility_button = DrawGD.find_node_by_name(self, "VisibilityButton")
|
visibility_button = DrawGD.find_node_by_name(self, "VisibilityButton")
|
||||||
lock_button = DrawGD.find_node_by_name(self, "LockButton")
|
lock_button = DrawGD.find_node_by_name(self, "LockButton")
|
||||||
linked_button = DrawGD.find_node_by_name(self, "LinkButton")
|
linked_button = DrawGD.find_node_by_name(self, "LinkButton")
|
||||||
|
@ -3,6 +3,14 @@ extends ViewportContainer
|
|||||||
|
|
||||||
var DrawGD : Node = null
|
var DrawGD : Node = null
|
||||||
|
|
||||||
|
func _enter_tree():
|
||||||
|
var n : Node = get_parent()
|
||||||
|
while n:
|
||||||
|
if n.name == "DrawGDSingleton":
|
||||||
|
DrawGD = n
|
||||||
|
break
|
||||||
|
n = n.get_parent()
|
||||||
|
|
||||||
func _on_ViewportContainer_mouse_entered() -> void:
|
func _on_ViewportContainer_mouse_entered() -> void:
|
||||||
DrawGD.has_focus = true
|
DrawGD.has_focus = true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user