Skip to content

Instantly share code, notes, and snippets.

View aquanox's full-sized avatar

Valentin Plyasinov aquanox

View GitHub Profile
@aquanox
aquanox / ffi-kernel32.h
Last active November 7, 2025 12:27
PHP 8.4 FFI Windows Registry Query
#define FFI_LIB "kernel32.dll"
#define FFI_SCOPE "kernel32"
typedef unsigned short wchar_t;
typedef int BOOL;
typedef unsigned long DWORD;
typedef void *PVOID;
typedef PVOID HANDLE;
typedef DWORD *LPDWORD;
typedef unsigned short WORD;
@aquanox
aquanox / SSearchableComboBox.md
Last active July 10, 2025 14:57
SSearchableComboBox with struct content

I wanted to use SSearchableComboBox for the nice searchable ui but it was tied to TSharedPtr<FString>

I did not want to copy the entire thing but C++ came for the rescue, sharing the cursed knowledge.

// The struct. FString has to be first member
struct FMyItemStruct 
{  
    FString DisplayString;
    // ... other members ... 
@aquanox
aquanox / ReloadSoundEffect.cpp
Created April 20, 2025 12:01
UE Reload Sound Effect
// module startup
FCoreUObjectDelegates::ReloadCompleteDelegate.AddRaw( this, &FMyEditorModule::HandleReloadFinished );
// module shutdown
FCoreUObjectDelegates::ReloadCompleteDelegate.RemoveAll( this );
void FMyEditorModule::HandleReloadFinished( EReloadCompleteReason Reason )
{
@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()
{