Skip to content

Instantly share code, notes, and snippets.

@Qubus0
Qubus0 / cursed.gd
Created November 26, 2024 19:28
cursed but valid gdscript to test the godot mod loader hook preprocessor with
class_name ScriptTesting
extends Node
var six: set = actual_setter
#var six: set = set_exclude_me
var seven: set= actual_setter, get = actually_get_something
var eight: get = actually_get_something, set= actual_setter
var nine: int: set= actual_setter, get = actually_get_something
var thirteen: int: set= actual_setter ,get = actually_get_something
var ten: Array[String]: get = actually_get_something, set= actual_setter
@Qubus0
Qubus0 / SteamDownloadDepot.md
Last active November 17, 2024 20:05
download windows games on mac (any OS to any OS really)

How To: download win games on mac via steam console

  1. launch steam in console mode - terminal:
/Applications/Steam.app/Contents/MacOS/steam_osx -console
  1. go to the "console" tab at the top, to the right of shop and library
  2. Visit https://steamdb.info/ and find the entry for the game you wish to download. You will need to take note of the app ID (should be the first thing available) and the depot ID (navigate to "Depots" in the left-hand-side menu – and select the option from the table associated with content). For demos, explicitly search for the name + demo or go to the "related apps" tab at the bottom, they are normal steam games too, with id and depot
@Qubus0
Qubus0 / godot_userdata_paths.md
Last active December 29, 2024 18:11
default file paths for userdata and common files

Godot User Files

Common Files in the User Folder

Logs are all stored in the /logs folder.
The most recent one does not have a time stamp (named godot.log or godot if the extension is hidden)

Deleting settings and save files can resolve some issues, but can of course reset stuff. It's safer to move them to another folder as backup. File names differ for each game, fill them in for your community if you know them.
Saves are named ###
Settings are named ###

@Qubus0
Qubus0 / SteamSoftware.js
Created February 1, 2024 22:02
Zotero Web Translator for Steam Games (store.steampowered.com). No fancy checks for pages, so only use on app pages.
{
"translatorID": "92c1c200-6cca-4dd0-8d61-573a50a60f16",
"label": "Steam Software",
"creator": "Ste",
"target": "store\\.steampowered\\.com\\/app",
"minVersion": "5.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
@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

@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 / 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 / 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 / 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 := {
"(": ")",
"{": "}",
"[": "]",
'"': '"',
"'": "'",