flockbay 0.10.20 → 0.10.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-D_mglYG0.cjs → index-Bhkn02hu.cjs} +125 -22
- package/dist/{index-CX0Z8pmz.mjs → index-By332wvJ.mjs} +124 -21
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.mjs +1 -1
- package/dist/{runCodex-CXJW0tzo.cjs → runCodex-CH4lz1QX.cjs} +2 -4
- package/dist/{runCodex-Biis9GFw.mjs → runCodex-d2KQX2mn.mjs} +2 -4
- package/dist/{runGemini-BSH4b0wu.mjs → runGemini-Cn0C7MS1.mjs} +101 -31
- package/dist/{runGemini-FOBXtEU6.cjs → runGemini-DNSymY04.cjs} +101 -31
- package/dist/{types-BYHCKlu_.cjs → types-DeH24uWs.cjs} +2 -2
- package/dist/{types-C4QeUggl.mjs → types-mXJc7o0P.mjs} +1 -1
- package/package.json +1 -1
- package/scripts/claude_version_utils.cjs +66 -12
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPEditorCommands.cpp +32 -11
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/UnrealMCP.Build.cs +1 -0
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
#include "Components/StaticMeshComponent.h"
|
|
28
28
|
#include "Materials/MaterialInterface.h"
|
|
29
29
|
#include "Sound/SoundWave.h"
|
|
30
|
+
#include "IImageWrapper.h"
|
|
31
|
+
#include "IImageWrapperModule.h"
|
|
30
32
|
#include "EditorSubsystem.h"
|
|
31
33
|
#include "Subsystems/EditorActorSubsystem.h"
|
|
32
34
|
#include "Engine/Blueprint.h"
|
|
@@ -54,6 +56,31 @@
|
|
|
54
56
|
#include "Components/SceneCaptureComponent2D.h"
|
|
55
57
|
#include "Engine/TextureRenderTarget2D.h"
|
|
56
58
|
|
|
59
|
+
static bool SavePngToFile(const FString& FilePath, int32 Width, int32 Height, const TArray<FColor>& Bitmap)
|
|
60
|
+
{
|
|
61
|
+
IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
|
|
62
|
+
TSharedPtr<IImageWrapper> Wrapper = ImageWrapperModule.CreateImageWrapper(EImageFormat::PNG);
|
|
63
|
+
if (!Wrapper.IsValid())
|
|
64
|
+
{
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (!Wrapper->SetRaw(Bitmap.GetData(), Bitmap.Num() * sizeof(FColor), Width, Height, ERGBFormat::BGRA, 8))
|
|
69
|
+
{
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const TArray64<uint8>& Compressed = Wrapper->GetCompressed(100);
|
|
74
|
+
if (Compressed.Num() <= 0 || Compressed.Num() > MAX_int32)
|
|
75
|
+
{
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
TArray<uint8> Out;
|
|
80
|
+
Out.Append(Compressed.GetData(), static_cast<int32>(Compressed.Num()));
|
|
81
|
+
return FFileHelper::SaveArrayToFile(Out, *FilePath);
|
|
82
|
+
}
|
|
83
|
+
|
|
57
84
|
FUnrealMCPEditorCommands::FUnrealMCPEditorCommands()
|
|
58
85
|
{
|
|
59
86
|
}
|
|
@@ -219,7 +246,7 @@ TSharedPtr<FJsonObject> FUnrealMCPEditorCommands::HandleSaveAll(const TSharedPtr
|
|
|
219
246
|
}
|
|
220
247
|
|
|
221
248
|
TArray<UPackage*> DirtyBefore;
|
|
222
|
-
FEditorFileUtils::GetDirtyPackages(DirtyBefore
|
|
249
|
+
FEditorFileUtils::GetDirtyPackages(DirtyBefore);
|
|
223
250
|
|
|
224
251
|
TSet<FString> DirtyBeforeNames;
|
|
225
252
|
for (UPackage* Pkg : DirtyBefore)
|
|
@@ -239,7 +266,7 @@ TSharedPtr<FJsonObject> FUnrealMCPEditorCommands::HandleSaveAll(const TSharedPtr
|
|
|
239
266
|
);
|
|
240
267
|
|
|
241
268
|
TArray<UPackage*> DirtyAfter;
|
|
242
|
-
FEditorFileUtils::GetDirtyPackages(DirtyAfter
|
|
269
|
+
FEditorFileUtils::GetDirtyPackages(DirtyAfter);
|
|
243
270
|
|
|
244
271
|
TSet<FString> DirtyAfterNames;
|
|
245
272
|
for (UPackage* Pkg : DirtyAfter)
|
|
@@ -293,8 +320,7 @@ TSharedPtr<FJsonObject> FUnrealMCPEditorCommands::HandleSaveAll(const TSharedPtr
|
|
|
293
320
|
Details->SetArrayField(TEXT("stillDirtyPackages"), StillDirty);
|
|
294
321
|
|
|
295
322
|
TSharedPtr<FJsonObject> ErrObj = FUnrealMCPCommonUtils::CreateErrorResponse(
|
|
296
|
-
TEXT("Some packages are still dirty after save_all. They may require manual Save As, source control checkout, or have save errors. Resolve in-editor and retry save_all.")
|
|
297
|
-
);
|
|
323
|
+
TEXT("Some packages are still dirty after save_all. They may require manual Save As, source control checkout, or have save errors. Resolve in-editor and retry save_all."));
|
|
298
324
|
ErrObj->SetObjectField(TEXT("details"), Details);
|
|
299
325
|
return ErrObj;
|
|
300
326
|
}
|
|
@@ -2445,9 +2471,7 @@ TSharedPtr<FJsonObject> FUnrealMCPEditorCommands::HandleTakeScreenshot(const TSh
|
|
|
2445
2471
|
|
|
2446
2472
|
CaptureActor->Destroy();
|
|
2447
2473
|
|
|
2448
|
-
|
|
2449
|
-
FImageUtils::CompressImageArray(Width, Height, Bitmap, CompressedBitmap);
|
|
2450
|
-
if (!FFileHelper::SaveArrayToFile(CompressedBitmap, *FilePath))
|
|
2474
|
+
if (!SavePngToFile(FilePath, Width, Height, Bitmap))
|
|
2451
2475
|
{
|
|
2452
2476
|
return FUnrealMCPCommonUtils::CreateErrorResponse(TEXT("Failed to save screenshot PNG to disk."));
|
|
2453
2477
|
}
|
|
@@ -2472,10 +2496,7 @@ TSharedPtr<FJsonObject> FUnrealMCPEditorCommands::HandleTakeScreenshot(const TSh
|
|
|
2472
2496
|
|
|
2473
2497
|
if (Viewport->ReadPixels(Bitmap, FReadSurfaceDataFlags(), ViewportRect))
|
|
2474
2498
|
{
|
|
2475
|
-
|
|
2476
|
-
FImageUtils::CompressImageArray(ViewSize.X, ViewSize.Y, Bitmap, CompressedBitmap);
|
|
2477
|
-
|
|
2478
|
-
if (FFileHelper::SaveArrayToFile(CompressedBitmap, *FilePath))
|
|
2499
|
+
if (SavePngToFile(FilePath, ViewSize.X, ViewSize.Y, Bitmap))
|
|
2479
2500
|
{
|
|
2480
2501
|
TSharedPtr<FJsonObject> ResultObj = MakeShared<FJsonObject>();
|
|
2481
2502
|
ResultObj->SetStringField(TEXT("filepath"), FilePath);
|