Skip to content

Instantly share code, notes, and snippets.

View alextd's full-sized avatar

Alex TD alextd

View GitHub Profile
@alextd
alextd / DragManipulator.cs
Last active April 16, 2025 04:31 — forked from shanecelis/DragManipulator.cs
This manipulator makes a visual element draggable at runtime in Unity's UIToolkit.
/* Original code[1] Copyright (c) 2022 Shane Celis[2]
Licensed under the MIT License[3]
(edits from alextd)
[1]: https://gist.github.com/shanecelis/b6fb3fe8ed5356be1a3aeeb9e7d2c145
[2]: https://twitter.com/shanecelis
[3]: https://opensource.org/licenses/MIT
*/
@alextd
alextd / DragManipulator.cs
Created April 15, 2025 22:05 — forked from shanecelis/DragManipulator.cs
This manipulator makes a visual element draggable at runtime in Unity's UIToolkit.
/* Original code[1] Copyright (c) 2022 Shane Celis[2]
Licensed under the MIT License[3]
[1]: https://gist.github.com/shanecelis/b6fb3fe8ed5356be1a3aeeb9e7d2c145
[2]: https://twitter.com/shanecelis
[3]: https://opensource.org/licenses/MIT
*/
using UnityEngine;
using UnityEngine.UIElements;
@alextd
alextd / Harmony.snippet
Created August 14, 2023 22:44
Visual Studio Code Snippit to insert Harmony patches
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Harmony Transpiler (foreach)</Title>
<Shortcut>htp</Shortcut>
<Author>AlexTD</Author>
<Description>Sets up a Harmony Transpiler using foreach</Description>
</Header>
<Snippet>
using System;
using System.IO;
using System.Xml;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Verse;
namespace List_Everything
{
@alextd
alextd / translateDefs.py
Created April 5, 2018 01:11
RimWorld mod utility to create a sample translation file for strings in def xmls
import os
import sys
import re
import shutil
#usage:
#python translateDefs.py ModFolder
#
# Reads Def Xmls for reportString
# Creates sample XML files for translation in Languages/Sample/DefInjected/*Def/