Skip to content

Instantly share code, notes, and snippets.

@Qubus0
Qubus0 / console.js
Last active July 23, 2022 09:43
Lower audio volume for a whole webpage until refresh. Paste into the page console
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)
@Qubus0
Qubus0 / redis-express-beginner.md
Created June 1, 2022 18:44
A detailed beginner tutorial on how to use Redis with Express and Docker

Using Redis with Express and Docker

I recommend typing everything in this tutorial by hand without copying, as it helps deepen your understanding for the syntax and in general.

Setup

Create a new Project Folder and initialize Node.js within it.

mkdir express-redis
cd express-redis
@Qubus0
Qubus0 / mod-list.json
Last active April 3, 2023 00:06
A list of current dome keeper mods
[
{
"title": "Legacy Mod loader",
"description": "Loader to use mods. Read the README file included in the download.",
"authors":
[
"Hello World"
],
"tags":
[
@Qubus0
Qubus0 / godot_tabbed_dock.md
Last active February 26, 2023 21:42
Godot Plugins: Good looking tabbed dock (3.5)

Making a tabbed EditorPlugin dock in Godot (3.5.x)

...seems simple enough:

Make a dock scene, load it, add it, done. Like any other dock, right?

extends EditorPlugin

var dock: Control

func _enter_tree():
@Qubus0
Qubus0 / autobrace.gd
Last active February 26, 2023 14:13
Godot automatic brace completion for TextEdit (3.5)
extends TextEdit
var last_text: String
var last_selection: TextSelection
var autobrace_pairs := {
"(": ")",
"{": "}",
"[": "]",
'"': '"',
"'": "'",
@Qubus0
Qubus0 / context_actions.md
Last active September 8, 2023 12:40
Godot Plugins: adding context actions to the file system dock (3.5)

Adding context actions to the file system dock in a plugin

Note: 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
@Qubus0
Qubus0 / file_system_icons.md
Last active March 5, 2023 03:14
Godot Plugins: Changing icons and other parts of the FileSystemDock

How to change icons, their color, and other parts in the FileSystemDock

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().theme
@Qubus0
Qubus0 / inspector_full_property_path.gd
Created March 4, 2023 21:30
Godot Plugins: Get the full property path from the Inspector panel including nested resource inspectors (4.x)
@tool
extends EditorPlugin
var last_path := []
func _process(delta: float) -> void:
# Optimally just do this on button press or connected to a signal
var new_path := get_inspector_full_selected_path()
@Qubus0
Qubus0 / GodotPluginDevelopment.md
Last active January 14, 2024 20:55
How to make plugin development in Godot easier

Plugin Development

Basics

Creating a new plugin is best done through the ProjectSettings under Plugins > Create (top right)

Messing up the editor nodes happens quite a lot. When it does, you can use the Reload Current Project button from the top menu > Project. If it happens often, you can also set a shortcut for it. Useful in combination with that is the EditorSetting (not project) to re-open all scenes which were previously open. You can find it under this path interface/scene_tabs/restore_scenes_on_load