Skip to content

Instantly share code, notes, and snippets.

View pbhogan's full-sized avatar

Patrick Hogan pbhogan

View GitHub Profile
@pbhogan
pbhogan / AspectRatioPanel.cs
Last active November 15, 2024 20:02
Unity UI-Toolkit Aspect Ratio Preserving Panel
/*
This is free and unencumbered software released into the public
domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
@pbhogan
pbhogan / ComboBindingSource.cs
Created March 10, 2020 18:30
ComboBindingSource for InControl
namespace Area51
{
using System;
using System.Collections.Generic;
using System.IO;
using InControl;
public class ComboBindingSource : BindingSource
{
@pbhogan
pbhogan / InControlProfiles_HowTo.md
Last active April 8, 2020 13:05
How to create device profiles in InControl

Adding support for controllers involves having them physically present to create and test the mappings. You can create the profiles yourself. It’s not very hard but takes a little bit of manual trial and error.

First, you’ll want to fire up the TestInputManager scene on device (or run it in the Unity editor for desktop systems). The controller should come up as an unknown controller if InControl doesn’t support it and will list a bunch of analogs and buttons. Fiddling with the controls will show you which inputs respond as which buttons and analogs.

Then copy one of the profiles in InControl/Source/Unity/DeviceProfiles and adjust it accordingly. Other than the button/analog mappings, you have to make sure the IncludePlatforms array property contains the right string in it and the Matchers array property should have a matcher with the NameLiteral field containing the name exactly as it appears to Unity in GetJoystickNames(). This also shows up in the TestInputManager scene when run.

Similarly, i

@pbhogan
pbhogan / factool.rb
Last active March 9, 2018 16:51
Factorio Helper Script
#!/usr/bin/ruby
require "thor"
require "httparty"
require "logger"
require "fileutils"
class FactorioTools < Thor
SOURCE_LINK = "https://www.factorio.com/get-download/latest/headless/linux64"
### Keybase proof
I hereby claim:
* I am pbhogan on github.
* I am pbhogan (https://keybase.io/pbhogan) on keybase.
* I have a public key whose fingerprint is 3CE2 14B1 436B EC7A 27E3 15A4 BE5A B8F6 6044 91AD
To claim this, I am signing this object: