Skip to content

Instantly share code, notes, and snippets.

View jeremyabel's full-sized avatar

Jeremy Abel jeremyabel

View GitHub Profile
@jeremyabel
jeremyabel / InputEventDebugger.cpp
Created April 17, 2025 21:51
Slate Widget Input Debug Panel
// Copyright Feral Cat Den, LLC. All Rights Reserved.
#include "GNInputEventDebugger.h"
#if WITH_GN_DEBUGGER && WITH_SLATE_DEBUGGING
#include "Debugging/SlateDebugging.h"
#include "Development/GNDebugImGuiCommon.h"
#include "UI/GNWidgetStatics.h"
@jeremyabel
jeremyabel / MyComponentVisualizer.cpp
Last active April 17, 2025 11:06
Editable Component Vector Property Visualizer
// Copyright Feral Cat Den, LLC. All Rights Reserved.
#include "MyComponentVisualizer.h"
#include "ActorEditorUtils.h"
#include "EditorViewportClient.h"
#include "HitProxies.h"
// Include your component here
struct HMyPropertyHitProxy : HComponentVisProxy
{
@jeremyabel
jeremyabel / KeyboardKeyIcons.csv
Last active March 24, 2025 20:31
Unreal Common Input Keyboard Action Icon Generator
Key Label Icon XOffset YOffset
BackSpace
Tab
Enter
Pause
CapsLock CapsLk -5
Escape Esc
SpaceBar
PageUp PgUp -5
PageDown PgDn -5
#pragma once
#include <stdlib.h>
#define NAME_NONE "NONE"
#define U8_MAX 0xFF
typedef signed char S8;
typedef unsigned char U8;
typedef signed short S16;
@jeremyabel
jeremyabel / index.html
Created July 22, 2020 18:40
Line derivatives?
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<p>There's an interaction in our game that looks like this:</p>
<br/>
<img src="https://i.imgur.com/gIixK0p.png" />
<br/>
<p>You move a slider and the landscape changes with a nice noisy kind of movement until you get the plant in the right position.</p>
<br/>
<img src="https://i.imgur.com/8dRCevu.png">
@jeremyabel
jeremyabel / index.html
Last active July 22, 2020 18:38
Line derivatives?
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<p>There's an interaction in our game that looks like this:</p>
<img src="https://i.imgur.com/gIixK0p.png" />
<p>You move a slider and the landscape changes with a nice noisy kind of movement until you get the plant in the right position.</p>
<img src="https://i.imgur.com/8dRCevu.png">
<p>

Our game has two input modes when using the controller. One is called Virtual Cursor, where it just mimics a mouse cursor directly. Moving the analog stick moves a cursor on screen. Pressing the gamepad bottom face button registers as EKeys::LeftMouseButton as far as the input system is concerned. This is done using a IInputProcessor.

The other is called Character Pilot, which is your typical 3rd-person controller movement setup. Analog stick moves the character, pressing the gamepad bottom face button registers as EKeys::Gamepad_FaceButton_Bottom. This also uses a IInputProcessor, but it's more of just a dummy one, it doesn't actually process inputs. It's mostly used to help figure out when the player has switched from mouse to controller at any given time.

Whenever the player stops piloting the character, we remove the Virtual Cursor processor and add the Character Pilot processor. Doing this changes what the gamepad bottom face button registers as:

With Virtual Cursor: EKeys::Gamepad_FaceButton_Botto
// Fill out your copyright notice in the Description page of Project Settings.
#include "GNNode_RegisterTweakableVariable.h"
#include "GNBaseHUD.h"
#include "Framework/Commands/UIAction.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "EdGraphSchema_K2.h"
#include "EdGraph/EdGraphNodeUtils.h"
#include "K2Node_InputKeyEvent.h"
#include "K2Node_CallFunction.h"
var endian = true;
var byte = 0;
var magic = view.getUint32(byte, endian);
var objectCount = view.getUint32(byte += 4, endian);
var vertexCount = view.getUint32(byte += 8, endian);
var indexCount = view.getSome8ByteValue(byte += 8, endian);