Skip to content

Commit 9b55bfb

Browse files
committed
Support UE5.0.0-preview-1
1 parent 4ad30a9 commit 9b55bfb

File tree

134 files changed

+1020
-500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1020
-500
lines changed

Source/PythonAutomation/Public/PythonAutomationModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#pragma once
44

55
#include "CoreMinimal.h"
6-
#if ENGINE_MAJOR_VERSION==4 && ENGINE_MINOR_VERSION>=22
6+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 22)
77
#include "Modules/ModuleInterface.h"
88
#else
99
#include "ModuleInterface.h"

Source/PythonConsole/Private/PyFbxFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void UPyFbxFactory::PostInitProperties() {
2626

2727
UObject * UPyFbxFactory::FactoryCreateFile(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename, const TCHAR* Parms, FFeedbackContext* Warn, bool& bOutOperationCanceled)
2828
{
29-
#if ENGINE_MINOR_VERSION >= 20
29+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 20)
3030
if (ImportUI->MeshTypeToImport == FBXIT_MAX)
3131
{
3232
if (!DetectImportType(UFactory::CurrentFilename))

Source/PythonConsole/Private/PythonConsoleModule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ static TSharedPtr<FPythonLogHistory> PythonLogHistory;
6060
TSharedRef<SDockTab> SpawnPythonLog( const FSpawnTabArgs& Args )
6161
{
6262
return SNew(SDockTab)
63+
#if ENGINE_MAJOR_VERSION == 4
6364
.Icon(FEditorStyle::GetBrush("Log.TabIcon"))
65+
#endif
6466
.TabRole( ETabRole::NomadTab )
6567
.Label( NSLOCTEXT("PythonConsole", "TabTitle", "Python Console") )
6668
[

Source/PythonConsole/Private/SPythonLog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ FPythonLogTextLayoutMarshaller::FPythonLogTextLayoutMarshaller(TArray< TSharedPt
371371
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
372372
void SPythonLog::Construct(const FArguments& InArgs)
373373
{
374-
#if ENGINE_MINOR_VERSION < 18
374+
#if !(ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 18))
375375
MessagesTextMarshaller = FPythonLogTextLayoutMarshaller::Create(MoveTemp(InArgs._Messages));
376376
#else
377377
MessagesTextMarshaller = FPythonLogTextLayoutMarshaller::Create(InArgs._Messages);

Source/PythonEditor/Private/PYRichTextSyntaxHighlighterTextLayoutMarshaller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ void FPYRichTextSyntaxHighlighterTextLayoutMarshaller::ParseTokens(const FString
311311
FRunInfo RunInfo(TEXT("SyntaxHighlight.PY.Normal"));
312312
FTextBlockStyle TextBlockStyle = SyntaxTextStyle.NormalTextStyle;
313313

314-
#if ENGINE_MINOR_VERSION >= 18
314+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 18)
315315
const bool bIsWhitespace = FString(TokenText).TrimEnd().IsEmpty();
316316
#else
317317
const bool bIsWhitespace = FString(TokenText).TrimTrailing().IsEmpty();

Source/PythonEditor/Private/PythonEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "PythonEditorStyle.h"
88
#include "PythonProjectEditor.h"
99
#include "PythonProject.h"
10-
#if ENGINE_MINOR_VERSION >= 24
10+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 24)
1111
#include "Subsystems/AssetEditorSubsystem.h"
1212
#endif
1313
#include "Runtime/Slate/Public/Framework/MultiBox/MultiBoxBuilder.h"

Source/PythonEditor/Private/PythonProjectEditor.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include "PythonProjectEditor.h"
44

5-
#if ENGINE_MINOR_VERSION >= 24
5+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 24)
66
#include "Subsystems/AssetEditorSubsystem.h"
77

88
// #include "UnrealEd.h"
@@ -12,8 +12,13 @@
1212
#include "SPythonProjectEditor.h"
1313
#include "Runtime/Slate/Public/Widgets/Docking/SDockTab.h"
1414
#include "PythonProjectEditorToolbar.h"
15+
#if ENGINE_MAJOR_VERSION == 5
16+
#include "WorkflowOrientedApp/WorkflowUObjectDocuments.h"
17+
#include "WorkflowOrientedApp/ApplicationMode.h"
18+
#else
1519
#include "Editor/Kismet/Public/WorkflowOrientedApp/WorkflowUObjectDocuments.h"
1620
#include "Editor/Kismet/Public/WorkflowOrientedApp/ApplicationMode.h"
21+
#endif
1722
#include "PythonProjectItem.h"
1823
#include "PythonEditorStyle.h"
1924
#include "PythonProject.h"
@@ -162,7 +167,9 @@ FBasicPythonEditorMode::FBasicPythonEditorMode(TSharedPtr<class FPythonProjectEd
162167
FTabManager::NewStack()
163168
->SetSizeCoefficient(0.1f)
164169
->SetHideTabWell(true)
170+
#if ENGINE_MAJOR_VERSION == 4
165171
->AddTab(InPythonEditor->GetToolbarTabId(), ETabState::OpenedTab)
172+
#endif
166173
)
167174
->Split
168175
(
@@ -218,7 +225,7 @@ void FPythonProjectEditor::RegisterToolbarTab(const TSharedRef<class FTabManager
218225

219226
void FPythonProjectEditor::InitPythonEditor(const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, class UPythonProject* PythonProject)
220227
{
221-
#if ENGINE_MINOR_VERSION >= 24
228+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 24)
222229
// UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
223230
// GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->CloseOtherEditors(PythonProject, this);
224231
GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->CloseOtherEditors(PythonProject, this);

Source/PythonEditor/Private/PythonProjectEditor.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@
22

33
#pragma once
44

5+
#if ENGINE_MAJOR_VERSION == 5
6+
#include "WorkflowOrientedApp/WorkflowCentricApplication.h"
7+
#include "WorkflowOrientedApp/WorkflowTabManager.h"
8+
#else
59
#include "Editor/Kismet/Public/WorkflowOrientedApp/WorkflowCentricApplication.h"
610
#include "Editor/Kismet/Public/WorkflowOrientedApp/WorkflowTabManager.h"
11+
#endif
712
#include "Runtime/Launch/Resources/Version.h"
813

914
class FPythonProjectEditor : public FWorkflowCentricApplication, public FGCObject
1015
{
1116
public:
1217
FPythonProjectEditor();
1318

19+
// FGCObject interface
20+
virtual FString GetReferencerName() const override
21+
{
22+
return TEXT("FPythonProjectEditor");
23+
}
24+
// End of FGCObject interface
25+
1426
// IToolkit interface
1527
virtual void RegisterTabSpawners(const TSharedRef<class FTabManager>& TabManager) override;
1628
// End of IToolkit interface
@@ -112,7 +124,7 @@ class FPythonProjectEditor : public FWorkflowCentricApplication, public FGCObjec
112124
static TWeakPtr<FPythonProjectEditor> PythonEditor;
113125

114126
virtual bool CanSaveAsset() const override { return false; }
115-
#if ENGINE_MINOR_VERSION > 17
127+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 17)
116128
virtual bool CanFindInContentBrowser() const override { return false; }
117129
#endif
118130
};

Source/PythonEditor/Private/PythonProjectEditorCommands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ FPythonProjectEditorCommands::FPythonProjectEditorCommands()
1414

1515
void FPythonProjectEditorCommands::RegisterCommands()
1616
{
17-
#if ENGINE_MINOR_VERSION >= 25
17+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 25)
1818
UI_COMMAND(New, "New", "New Python Script.", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Control, EKeys::N));
1919
UI_COMMAND(NewDirectory, "New Directory", "New Directory.", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Control | EModifierKey::Shift, EKeys::N));
2020
UI_COMMAND(Delete, "Delete", "Delete Python Script.", EUserInterfaceActionType::Button, FInputChord(EModifierKey::Control, EKeys::D));

Source/UnrealEnginePython/Private/Blueprint/UEPyEdGraph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ PyObject *py_ue_graph_add_node_dynamic_cast(ue_PyUObject * self, PyObject * args
535535

536536
UK2Node_DynamicCast *node = NewObject<UK2Node_DynamicCast>(graph);
537537
node->TargetType = u_class;
538-
#if ENGINE_MINOR_VERSION > 15
538+
#if ENGINE_MAJOR_VERSION == 5 || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION > 15)
539539
node->SetPurity(false);
540540
#endif
541541
node->AllocateDefaultPins();

0 commit comments

Comments
 (0)