Skip to content

Instantly share code, notes, and snippets.

View brombres's full-sized avatar

Brom Bresenham brombres

View GitHub Profile
@brombres
brombres / DungeonMaster.karabiner
Created January 6, 2024 22:34
Karabiner QWEASD to Numpad - Mac - Dungeon Master (can adapt for Eye of the Beholder)
{
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^org\\.gamesnostalgia\\.amiga\\.DungeonMaster$"
],
"type": "frontmost_application_if"
}
@brombres
brombres / CapsLock-to-ESC-and-CTRL.ahk
Last active September 27, 2023 03:12
AutoHotkey 2.0 Caps Lock to Escape and Control (Windows)
#Requires AutoHotkey v2.0
#SingleInstance
; Caps Lock is ESC if tapped (pressed and quickly released).
; Caps Lock is CTRL if held down.
; Install AHK 2: https://www.autohotkey.com
; Create CapsLock-to-ESC-and-CTRL.ahk in Startup containing this code.
; (File Explorer/Dialog > type in: Startup)
; Double-click to run
; Will auto-run next startup
@brombres
brombres / CustomEditorButton.gd
Created August 12, 2023 13:49
Skeleton to add a custom button to the Godot editor above the view.
# CustomEditorButton.gd
# Created 2023.08.12 by Brom Bresenham
@tool
extends EditorPlugin
var selected_object:Control
var button:Button
func _handles( object:Object )->bool:
@brombres
brombres / AtlasMeshInstance2D.gd
Last active October 11, 2023 15:51
Godot script that allows a MeshInstance2D node to correctly show an atlas texture.
# AtlasMeshInstance2D.gd
#
# ABOUT
# 2023.08.02 by Brom Bresenham
# Tested on Godot 4.2-dev2
#
# USAGE
# 1. Attach to a MeshInstance2D.
# 2. Set the MeshInstance2D's texture by calling .set_atlas_texture(new_texture:Texture2D) instead
# of directly assigning `texture = new_texture'. set_atlas_texture() works whether or not the
@brombres
brombres / AutoscaleRichTextLabel.gd
Created August 5, 2023 13:15
A Godot script to auto-scale the text of a RichTextLabel node as the RTL size changes.
# AutoscaleRichTextLabel.gd
#
# ABOUT
# 2023.08.04 by Brom Bresenham
# Tested on Godot 4.2-dev2
#
# USAGE
# 1. [Inspector] Create a RichTextLabel node and attach this script to it.
# 2. [Editor] Save and reload the scene to activate this as a @tool script
# that will automatically set the Node Reference Height.