renaming tool add to dock

This commit is contained in:
Lucas 2024-07-24 10:56:04 +02:00
parent a31b68eff2
commit c9c9fc9b90
6 changed files with 60 additions and 10 deletions

View file

@ -0,0 +1,17 @@
@tool
extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_button_pressed():
# TODO Get the files selected
EditorInterface.get_selected_paths() # Doesnt work
print("Pushed")

View file

@ -0,0 +1,20 @@
[gd_scene load_steps=2 format=3 uid="uid://cs740b0dde5o1"]
[ext_resource type="Script" path="res://addons/RenamingTool/RenamingTool.gd" id="1_smv3y"]
[node name="RenamingTool" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_smv3y")
[node name="Button" type="Button" parent="."]
layout_mode = 0
offset_right = 8.0
offset_bottom = 8.0
text = "Rename"
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,7 @@
[plugin]
name="RenamingTool"
description=""
author="Lucastucious"
version=""
script="plugin.gd"

View file

@ -0,0 +1,15 @@
@tool
extends EditorPlugin
const DockScene := preload("res://addons/RenamingTool/RenamingTool.tscn")
const Dock := preload("res://addons/RenamingTool/RenamingTool.gd")
var _dockUI
func _enter_tree():
_dockUI = DockScene.instantiate() as Control
add_control_to_dock(EditorPlugin.DOCK_SLOT_LEFT_UL,_dockUI)
func _exit_tree():
remove_control_from_docks(_dockUI)
_dockUI.free()

View file

@ -1,9 +0,0 @@
[gd_scene format=3 uid="uid://cbq2l8dypu7yw"]
[node name="Window" type="Window"]
[node name="TextEdit" type="TextEdit" parent="."]
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 8.0
grow_horizontal = 2

View file

@ -23,7 +23,7 @@ version_control/autoload_on_startup=true
[editor_plugins] [editor_plugins]
enabled=PackedStringArray("res://addons/Todo_Manager/plugin.cfg") enabled=PackedStringArray("res://addons/RenamingTool/plugin.cfg", "res://addons/Todo_Manager/plugin.cfg")
[input] [input]