diff --git a/Config/DefaultEngine.ini b/Config/DefaultEngine.ini index 58c6953..a3165e5 100644 --- a/Config/DefaultEngine.ini +++ b/Config/DefaultEngine.ini @@ -86,3 +86,8 @@ ConnectionType=USBOnly bUseManualIPAddress=False ManualIPAddress= +[/Script/Engine.UserInterfaceSettings] +UIScaleRule=Custom +DesignScreenSize=(X=2560,Y=1440) +UIScaleCurve=(EditorCurveData=(Keys=((Time=1080.000000,Value=1.000000),(Time=1440.000000,Value=1.000000),(Time=8640.000000,Value=1.000000)),DefaultValue=340282346638528859811704183484516925440.000000,PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant),ExternalCurve=None) + diff --git a/Content/TopDown/Blueprints/BP_TopDownCharacter.uasset b/Content/TopDown/Blueprints/BP_TopDownCharacter.uasset index 174af0c..e60a2fa 100644 Binary files a/Content/TopDown/Blueprints/BP_TopDownCharacter.uasset and b/Content/TopDown/Blueprints/BP_TopDownCharacter.uasset differ diff --git a/Content/Vehicle/BP/ABP_German_Tank_01.uasset b/Content/Vehicle/BP/ABP_German_Tank_01.uasset index 2620354..b011b4f 100644 Binary files a/Content/Vehicle/BP/ABP_German_Tank_01.uasset and b/Content/Vehicle/BP/ABP_German_Tank_01.uasset differ diff --git a/Content/Vehicle/BP/TankControlRig.uasset b/Content/Vehicle/BP/TankControlRig.uasset index 8e907fb..8e999f2 100644 Binary files a/Content/Vehicle/BP/TankControlRig.uasset and b/Content/Vehicle/BP/TankControlRig.uasset differ diff --git a/Source/AncientCivil/AncientCivil.Build.cs b/Source/AncientCivil/AncientCivil.Build.cs index 3398829..33f08e5 100644 --- a/Source/AncientCivil/AncientCivil.Build.cs +++ b/Source/AncientCivil/AncientCivil.Build.cs @@ -8,6 +8,6 @@ public class AncientCivil : ModuleRules { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; - PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "NavigationSystem", "AIModule", "Niagara", "EnhancedInput","JsEnv" }); + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "NavigationSystem", "AIModule", "Niagara", "EnhancedInput","JsEnv","SlateCore","Slate" }); } } diff --git a/Source/AncientCivil/GameBPExtension.cpp b/Source/AncientCivil/GameBPExtension.cpp new file mode 100644 index 0000000..ff7ff43 --- /dev/null +++ b/Source/AncientCivil/GameBPExtension.cpp @@ -0,0 +1,19 @@ +#include "GameBPExtension.h" +#include "Framework/Application/SlateApplication.h" + + +UGameBPExtension::UGameBPExtension(const FObjectInitializer& ObjectInitializer) + : Super(ObjectInitializer) +{ +} + +FVector2D UGameBPExtension::GetGameWindowSize() { + if (FSlateApplication::IsInitialized()) { + TArray> GameWindows = FSlateApplication::Get().GetInteractiveTopLevelWindows(); + TSharedPtr GameWindow = GameWindows[0]; + if (GameWindow.IsValid()) { + return GameWindow->GetSizeInScreen(); // 返回窗口的物理尺寸(单位:像素) + } + } + return FVector2D(0, 0); +} \ No newline at end of file diff --git a/Source/AncientCivil/GameBPExtension.h b/Source/AncientCivil/GameBPExtension.h new file mode 100644 index 0000000..ba49a31 --- /dev/null +++ b/Source/AncientCivil/GameBPExtension.h @@ -0,0 +1,14 @@ +#pragma once +#include "Uobject/Class.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "GameBPExtension.generated.h" + +UCLASS(meta = (ScriptName = "UGameBPExtension")) +class UGameBPExtension :public UBlueprintFunctionLibrary +{ + GENERATED_UCLASS_BODY() + + UFUNCTION(BlueprintCallable, Category = "Window Utils") + static FVector2D GetGameWindowSize(); +}; +