-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathce-tweaks.gd
More file actions
58 lines (43 loc) · 1.51 KB
/
ce-tweaks.gd
File metadata and controls
58 lines (43 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 2026 CE-Studio: LGPL-3.0-only
@tool
extends EditorPlugin
const _EPACKED:PackedStringArray = []
const _CEPACKED:PackedColorArray = []
const SETTINGS = [
["CE-Tweaks/bookmarks", _EPACKED],
["CE-Tweaks/bookmark_colors", _CEPACKED],
["CE-Tweaks/linter_licence", "AGPL-3.0-only"],
["CE-Tweaks/linter_licence_blurb", "Copyright {year} CE-Studio: {licence}"]
]
var buttons:PanelContainer
var lint_dock:EditorDock
func _enable_plugin() -> void:
# Add autoloads here.
pass
func _disable_plugin() -> void:
# Remove autoloads here.
pass
func _enter_tree():
for i in SETTINGS:
if not ProjectSettings.has_setting(i[0]):
ProjectSettings.set_setting(i[0], i[1])
ProjectSettings.set_initial_value(i[0], i[1])
if not is_instance_valid(buttons):
var b := EditorInterface.get_base_control()
var button_parent:HBoxContainer = b.get_child(0).get_child(0).get_child(4).get_child(0)
buttons = preload("uid://c428nc5q7j8vs").instantiate()
button_parent.add_child(buttons)
button_parent.move_child(buttons, 0)
var linter:HSplitContainer = preload("uid://bm3nbfr8dy454").instantiate()
linter.running = true
lint_dock = EditorDock.new()
lint_dock.add_child(linter)
lint_dock.title = "CE-Lint"
lint_dock.default_slot = EditorDock.DOCK_SLOT_BOTTOM
lint_dock.available_layouts = EditorDock.DOCK_LAYOUT_HORIZONTAL | EditorDock.DOCK_LAYOUT_FLOATING
resource_saved.connect(linter._rsaved)
add_dock(lint_dock)
func _exit_tree() -> void:
if is_instance_valid(buttons):
buttons.queue_free()
remove_dock(lint_dock)