Skip to content

Instantly share code, notes, and snippets.

View Solessfir's full-sized avatar

Constantine Romakhov Solessfir

View GitHub Profile
@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
{
@aquanox
aquanox / DefaultEvents.cpp
Last active April 14, 2025 08:34
Smart Default Event Nodes
// Normally it is possible to register each member function to be spawned as default like this
// But it does not work with ForceAsFunction or BlueprintNativeEvents that return value that spawn function graphs
// FKismetEditorUtilities::RegisterAutoGeneratedDefaultEvent(this, UDynamicAssetFilter::StaticClass(), GET_FUNCTION_NAME_CHECKED(UDynamicAssetFilter, K2_FilterAsset));
//
// By utilizig RegisterOnBlueprintCreatedCallback can track new blueprint creation and do any stuff to blueprints
// for example - finding BlueprintDefaultEvent meta and creating default node or graph for Blueprint(Native|Implementable)Event
// With this hook any BNE/BIE with BlueprintDefaultEvent will be generated into default node or overridden by default function
// No more need to manually register each function
void MODULENAME::RegisterBlueprintDefaultEvents()
{
@ThioJoe
ThioJoe / !AddCompressToMenu -- How-To-Use.txt
Last active April 24, 2025 22:34
Add "Compress To" Option to Old Windows 11 Start Menu - Registry Tweak
How To Use:
1. Choose which version you want to use:
- "Full Menu" Version: The same as the original one in the new context menu, and has multiple sub-menu items
- Other Version: Doesn't have a sub-menu, it just directly opens the "Create Archive" menu. (The equivalent of clicking the "Additional Options" sub-item in the original)
2. Double click the "Add_" reg file of whichever version you choose
3. Restart Windows Explorer
- You can restart it by opening Task Manager with Ctrl+Shift+Esc, then search it for "Windows Explorer", right click that and hit "Restart"
@intaxwashere
intaxwashere / customthunkexample.md
Last active March 25, 2025 14:42
Custom Thunks Unreal Engine TL;DR

Custom thunks TL;DR

This smol post assumes you worked on a custom thunk implementation before but no idea how it works, why you're using cursed macros from 1990s etc. If you don't have any programming experience or relatively new to Unreal world, it's likely you might not understand anything from this post, not because concepts are too difficult to grasp, but rather because this post is written for the people who has an understanding of how Unreal works since a while and want to expand their knowledge of custom thunks implementation.

Part 1:

  • A thunk is a function that you can save and call later, so if you had an array of TFunction<void()>s, you would have an array of custom thunks that you can bind/unbind new function pointers to existing TFunctions.
  • Custom thunks of Blueprints are the same, they're a fancy array/list of function pointers. Imagine for each node you placed to graph, Blueprints have a place for that node in it's list of custom thunks. For example the + node in Blueprints that
@MilkyEngineer
MilkyEngineer / Minimal-5.2.uproject
Last active March 23, 2025 12:20
Minimal project descriptor that "Disables Engine Plugins by Default" for Unreal Engine
{
"FileVersion": 3,
"EngineAssociation": "5.2",
"Description": "Minimum viable plugin dependencies for a usable Unreal Engine project",
"DisableEnginePluginsByDefault": true,
"Plugins": [
{
"Name": "PluginBrowser",
"Enabled": true
},
@intaxwashere
intaxwashere / YourProjectEditorModule.cpp
Last active April 25, 2024 11:01
Automatically adding category sections to editor
// add this code to your StartupModule() function of your EDITOR module
// if it doesnt work, try setting loading phase to "postdefault" -- no idea if this will produce side effects though.
// basically idea is looping all CDOs (i.e. UClasses) and their properties, getting their "category" meta value and registering them to
// property sections
FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");
static constexpr bool bAddSubcategories = false; // you probably want this to be false
auto ProcessCategory = [&PropertyModule](const FName ClassName, const FString& Category)
#include "AsyncMoveTo.h"
#include "AIController.h"
#include "AISystem.h"
#include "NavigationSystem.h"
#include "Logging/MessageLog.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(AsyncMoveTo)
DEFINE_LOG_CATEGORY_STATIC(AsyncMoveTo, Warning, All);
@benui-dev
benui-dev / IsOverUIElement.h
Created October 27, 2021 17:19
Hacky way to see if the cursor is over a UI element. Useful for detecting whether to do raycasts into the world or not.
static const FString RootName = "SGameLayerManager";
bool IsOverUIElement()
{
FVector2D CursorPos = FSlateApplication::Get().GetCursorPos();
FWidgetPath WidgetPath = FSlateApplication::Get().LocateWindowUnderMouse( CursorPos, FSlateApplication::Get().GetInteractiveTopLevelWindows() );
if ( WidgetPath.IsValid() )
{
const FArrangedChildren::FArrangedWidgetArray& AllArrangedWidgets = WidgetPath.Widgets.GetInternalArray();