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 "CoreMinimal.h"
#include "Engine/DataAsset.h" #include "Engine/DataAsset.h"
#include "Engine/DeveloperSettings.h" #include "Engine/DeveloperSettings.h"
#include "ProjectSettings.generated.h" #include "BreakToDebugger.h"
#include "LuprexEditorSettings.generated.h"
UCLASS(BlueprintType) UCLASS(BlueprintType)
class INTEGRATION_API UlxServerSelection : public UPrimaryDataAsset class INTEGRATION_API UlxServerSelection : public UPrimaryDataAsset
@@ -18,17 +19,25 @@ public:
FString Host; FString Host;
}; };
UCLASS(Config=EditorPerProjectUserSettings, DefaultConfig, meta=(DisplayName="Server Settings")) UCLASS(Config=EditorPerProjectUserSettings, DefaultConfig, meta=(DisplayName="Luprex Editor Settings"))
class INTEGRATION_API UlxProjectSettings : public UDeveloperSettings class INTEGRATION_API UlxEditorSettings : public UDeveloperSettings
{ {
GENERATED_BODY() GENERATED_BODY()
public: public:
virtual FName GetContainerName() const override { return TEXT("Editor"); } virtual FName GetContainerName() const override { return TEXT("Editor"); }
virtual FName GetCategoryName() const override { return TEXT("Luprex"); } 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", UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category="Server",
meta=(AllowedClasses="/Script/Integration.lxServerSelection")) meta=(AllowedClasses="/Script/Integration.lxServerSelection"))
TSoftObjectPtr<UlxServerSelection> ActiveServer; 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 "Blueprint/WidgetBlueprintLibrary.h"
#include "Kismet/GameplayStatics.h" #include "Kismet/GameplayStatics.h"
#include "Engine/GameInstance.h" #include "Engine/GameInstance.h"
#include "ProjectSettings.h" #include "LuprexEditorSettings.h"
#include "Common.h" #include "Common.h"
#include "AnimQueue.h" #include "AnimQueue.h"
@@ -215,7 +215,7 @@ void ALuprexGameModeBase::InitializeGlobalState()
// Possibly tell the engine to connect to a server. // Possibly tell the engine to connect to a server.
if (Playing) { if (Playing) {
UlxServerSelection* Server = GetDefault<UlxProjectSettings>()->ActiveServer.LoadSynchronous(); UlxServerSelection* Server = GetDefault<UlxEditorSettings>()->ActiveServer.LoadSynchronous();
if (Server) { if (Server) {
FString Host = Server->Host.TrimStartAndEnd(); FString Host = Server->Host.TrimStartAndEnd();
if (!Host.IsEmpty()) { if (!Host.IsEmpty()) {
@@ -238,7 +238,7 @@ void ALuprexGameModeBase::InitializeGlobalState()
// If somebody generates a log message that's severe enough, break to debugger. // If somebody generates a log message that's severe enough, break to debugger.
BreakToDebuggerLogVerbosityDevice.Reset( BreakToDebuggerLogVerbosityDevice.Reset(
new FlxBreakToDebuggerOutputDevice(BreakToDebuggerLogVerbosity)); new FlxBreakToDebuggerOutputDevice(GetDefault<UlxEditorSettings>()->BreakToDebuggerLogVerbosity));
} }
void ALuprexGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason) void ALuprexGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)

View File

@@ -68,10 +68,6 @@ public:
UFUNCTION(BlueprintCallable, Category = "Luprex|Miscellaneous", meta = (WorldContext = "WorldContextObject")) UFUNCTION(BlueprintCallable, Category = "Luprex|Miscellaneous", meta = (WorldContext = "WorldContextObject"))
static void TriggerReloadSource(const UObject *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. // Luprex socket system.
TUniquePtr<FlxSockets> Sockets; TUniquePtr<FlxSockets> Sockets;

View File

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