Skip to content

Instantly share code, notes, and snippets.

View Solessfir's full-sized avatar

Constantine Romakhov Solessfir

View GitHub Profile
@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);
@iUltimateLP
iUltimateLP / GetP4Changelist.cs
Last active May 22, 2025 16:00
Example Unreal Engine 4/5 Build.cs script that automatically fetches the current Perforce changelist and embeds it into code
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using System;
using UnrealBuildTool;
using System.Diagnostics;
public class BuildScriptUtils
{
// Runs p4.exe to determine the current changelist
// Returns true if it could determine the changelist, false if not
@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();
@norlin
norlin / UE5-Project.sublime-build
Last active March 26, 2026 15:34
Build system for Unreal Engine projects for Sublime Text
{
"cmd": [
// Default path for UE 5
"C:/Program Files/Epic Games/UE_5.0/Engine/Build/BatchFiles/Build.bat",
// Build configuration is set to "Development" by default
"Development",
// The platform is set to Win64 by default
"Win64",
"-Project",
// The Sublime project name must match the Unreal project filename