The easiest way to go about this is to switch the underlying icon which represents the file type.
tool
extends EditorPlugin
func _enter_tree() -> void:
var base_theme := get_editor_interface().get_base_control().themeNote: This mini tutorial is for Godot 3.5. There are some changes that need to be made for Godot 4, check them out in this other gist
Since there is no built-in method to add context actions, we have to make our own.
To start, we need to get the file system dock. This can be done in the EditorPlugin. If we need it in any other script, we can just pass it to them.
tool| extends TextEdit | |
| var last_text: String | |
| var last_selection: TextSelection | |
| var autobrace_pairs := { | |
| "(": ")", | |
| "{": "}", | |
| "[": "]", | |
| '"': '"', | |
| "'": "'", |
| [ | |
| { | |
| "title": "Legacy Mod loader", | |
| "description": "Loader to use mods. Read the README file included in the download.", | |
| "authors": | |
| [ | |
| "Hello World" | |
| ], | |
| "tags": | |
| [ |
| for (let audio of document.querySelectorAll('audio')) {audio.volume = 0.5} | |
| // lower volume periodically - good for google meet etc. | |
| function lowerVolume(vol = .5) { | |
| for (let audio of document.querySelectorAll('audio')) { | |
| audio.volume = vol | |
| } | |
| } | |
| let volInterval = setInterval(lowerVolume, 2000, .1) |