Move 'break to debugger' into editor preferences

This commit is contained in:
2026-06-09 14:32:02 -04:00
parent 6a230e3ab2
commit 7d6b1f207f
5 changed files with 17 additions and 12 deletions

View File

@@ -0,0 +1 @@
#include "LuprexEditorSettings.h"

View File

@@ -3,7 +3,8 @@
#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "Engine/DeveloperSettings.h"
#include "ProjectSettings.generated.h"
#include "BreakToDebugger.h"
#include "LuprexEditorSettings.generated.h"
UCLASS(BlueprintType)
class INTEGRATION_API UlxServerSelection : public UPrimaryDataAsset
@@ -18,17 +19,25 @@ public:
FString Host;
};
UCLASS(Config=EditorPerProjectUserSettings, DefaultConfig, meta=(DisplayName="Server Settings"))
class INTEGRATION_API UlxProjectSettings : public UDeveloperSettings
UCLASS(Config=EditorPerProjectUserSettings, DefaultConfig, meta=(DisplayName="Luprex Editor Settings"))
class INTEGRATION_API UlxEditorSettings : public UDeveloperSettings
{
GENERATED_BODY()
public:
virtual FName GetContainerName() const override { return TEXT("Editor"); }
virtual FName GetCategoryName() const override { return TEXT("Luprex"); }
virtual FName GetSectionName() const override { return TEXT("Server"); }
virtual FName GetSectionName() const override { return TEXT("Settings"); }
// The server to connect to. You can add an option to the list by creating
// a new data asset of type 'lx Server Selection'.
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="Server",
meta=(AllowedClasses="/Script/Integration.lxServerSelection"))
TSoftObjectPtr<UlxServerSelection> ActiveServer;
// If blueprint execution generates a log message of at least the following
// severity, the blueprint debugger will automatically pause with a breakpoint.
UPROPERTY(Config, EditAnywhere, Category="Debugging Tools")
ElxBreakToDebuggerThreshold BreakToDebuggerLogVerbosity;
};

View File

@@ -12,7 +12,7 @@
#include "Blueprint/WidgetBlueprintLibrary.h"
#include "Kismet/GameplayStatics.h"
#include "Engine/GameInstance.h"
#include "ProjectSettings.h"
#include "LuprexEditorSettings.h"
#include "Common.h"
#include "AnimQueue.h"
@@ -215,7 +215,7 @@ void ALuprexGameModeBase::InitializeGlobalState()
// Possibly tell the engine to connect to a server.
if (Playing) {
UlxServerSelection* Server = GetDefault<UlxProjectSettings>()->ActiveServer.LoadSynchronous();
UlxServerSelection* Server = GetDefault<UlxEditorSettings>()->ActiveServer.LoadSynchronous();
if (Server) {
FString Host = Server->Host.TrimStartAndEnd();
if (!Host.IsEmpty()) {
@@ -238,7 +238,7 @@ void ALuprexGameModeBase::InitializeGlobalState()
// If somebody generates a log message that's severe enough, break to debugger.
BreakToDebuggerLogVerbosityDevice.Reset(
new FlxBreakToDebuggerOutputDevice(BreakToDebuggerLogVerbosity));
new FlxBreakToDebuggerOutputDevice(GetDefault<UlxEditorSettings>()->BreakToDebuggerLogVerbosity));
}
void ALuprexGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)

View File

@@ -68,10 +68,6 @@ public:
UFUNCTION(BlueprintCallable, Category = "Luprex|Miscellaneous", meta = (WorldContext = "WorldContextObject"))
static void TriggerReloadSource(const UObject *WorldContextObject);
// The sensitivity level at which a log message triggers a debugger breakpoint.
UPROPERTY(EditAnywhere, Category="Debugging Tools")
ElxBreakToDebuggerThreshold BreakToDebuggerLogVerbosity;
// Luprex socket system.
TUniquePtr<FlxSockets> Sockets;

View File

@@ -1 +0,0 @@
#include "ProjectSettings.h"