Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Unreal Engine 5.4 #17

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ workflows:
- unreal-engine-ci
matrix:
parameters:
# TODO: The container image is not supported for 5.4.0.
unreal-engine-version: ["4.27.0", "5.0.0", "5.1.0", "5.2.0", "5.3.0"]
version: ["free", "full"]
- build-sample:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
unreal_engine_version:
["4.26.0", "4.27.0", "5.0.0", "5.1.0", "5.2.0", "5.3.0"]
["4.26.0", "4.27.0", "5.0.0", "5.1.0", "5.2.0", "5.3.0", "5.4.0"]
version:
["free", "full"]
steps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The **Shortcut** asset supports the following features.

This plugin supports on the below environment.

* Unreal Engine Version: 4.27 / 5.0 / 5.1 / 5.2 / 5.3
* Unreal Engine Version: 4.27 / 5.0 / 5.1 / 5.2 / 5.3 / 5.4
* Development Platforms: Windows / macOS / Linux
* Target Build Platforms: All platform

Expand Down
2 changes: 1 addition & 1 deletion ShortcutAsset/ShortcutAsset.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"VersionName": "1.2.0",
"FriendlyName": "Shortcut Asset",
"Description": "Asset to open the linked asset/directory",
"EngineVersion": "5.3.0",
"EngineVersion": "5.4.0",
"Category": "Other",
"CreatedBy": "nutti (Colory Games)",
"CreatedByURL": "https://github.com/colory-games/UEPlugin-ShortcutAssets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ void FShortcutAssetActions::OpenAssetEditor(const TArray<UObject*>& InObjects, T
TEXT("The link stored in '{0}' is missing.\nDo you want to edit the link?"), {ShortcutAsset->GetName()});
FText TitleText = LOCTEXT("Title", "Missing Link Error");
FText MessageText = FText::AsCultureInvariant(Message);
#if UE_VERSION_OLDER_THAN(5, 4, 0)
if (FMessageDialog::Open(EAppMsgType::OkCancel, MessageText, &TitleText) == EAppReturnType::Ok)
#else
if (FMessageDialog::Open(EAppMsgType::OkCancel, MessageText, TitleText) == EAppReturnType::Ok)
#endif
{
UShortcutAssetSubsystem* Subsystem = GEditor->GetEditorSubsystem<UShortcutAssetSubsystem>();
Subsystem->OpenShortcutAssetEditor({ShortcutAsset});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ FShortcutAssetEditorToolkit::~FShortcutAssetEditorToolkit()
UShortcutAssetSubsystem* Subsystem = GEditor->GetEditorSubsystem<UShortcutAssetSubsystem>();
if (Subsystem)
{
TArray<OBJECT_PTR(UObject)> ObjectsToEdit;
TArray<UObject*> ObjectsToEdit;
OwningAssetEditor->GetObjectsToEdit(ObjectsToEdit);
Subsystem->NotifyShortcutAssetEditorClosed(ObjectsToEdit);

TArray<OBJECT_PTR(UObject)> ObjectsToEditWithObjectPtr;
for (auto& O : ObjectsToEdit)
{
ObjectsToEditWithObjectPtr.Add(O);
}
Subsystem->NotifyShortcutAssetEditorClosed(ObjectsToEditWithObjectPtr);
}
}

Expand Down Expand Up @@ -105,7 +111,13 @@ void FShortcutAssetEditorToolkit::RegisterTabSpawners(const TSharedRef<FTabManag
InTabManager->RegisterTabSpawner(TabID, FOnSpawnTab::CreateSP(this, &FShortcutAssetEditorToolkit::HandleTabManagerSpawnTab, TabID))
.SetDisplayName(LOCTEXT("ShortcutEditorTabName", "Shortcut Editor"))
.SetGroup(WorkspaceMenuCategory.ToSharedRef())
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tabs.Viewports"));
.SetIcon(FSlateIcon(
#if UE_VERSION_NEWER_THAN(5, 1, 0)
FAppStyle::GetAppStyleSetName(), "LevelEditor.Tabs.Viewports")
#else
FEditorStyle::GetStyleSetName(), "LevelEditor.Tabs.Viewports")
#endif
);
// clang-format on
}

Expand Down
10 changes: 10 additions & 0 deletions ShortcutAsset/Source/ShortcutAsset/Private/ShortcutAssetUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#include "ShortcutAssetUtils.h"

#include "AssetRegistry/AssetRegistryModule.h"
#include "Misc/EngineVersionComparison.h"
#include "Misc/MessageDialog.h"
#include "ShortcutAsset.h"

#define LOCTEXT_NAMESPACE "ShortcutAsset"

Expand All @@ -25,15 +27,23 @@ bool ReachFreeVersionLimitation(bool bIsCreateNew)
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(FName("AssetRegistry"));
FARFilter Filter;
TArray<FAssetData> AssetData;
#if UE_VERSION_NEWER_THAN(5, 1, 0)
Filter.ClassPaths.Add(UShortcutAsset::StaticClass()->GetClassPathName());
#else
Filter.ClassNames.Add(UShortcutAsset::StaticClass()->GetFName());
#endif

AssetRegistryModule.Get().GetAssets(Filter, AssetData);
if (AssetData.Num() >= MaxAssets)
{
FText TitleText = LOCTEXT("Title", "Reached Free Version Limitation");
FText MessageText =
LOCTEXT("Message", "Free version can only create up to 3 assets.\nDo you want to open the marketplace of this plugin?");
#if UE_VERSION_OLDER_THAN(5, 4, 0)
if (FMessageDialog::Open(EAppMsgType::OkCancel, MessageText, &TitleText) == EAppReturnType::Ok)
#else
if (FMessageDialog::Open(EAppMsgType::OkCancel, MessageText, TitleText) == EAppReturnType::Ok)
#endif
{
FPlatformProcess::LaunchURL(
TEXT("https://forums.unrealengine.com/t/how-to-open-a-browser-from-the-game/24346/3"), NULL, NULL);
Expand Down
2 changes: 1 addition & 1 deletion tools/remove_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -eEu

SUPPORTED_VERSIONS=(
"4.26.0" "4.27.0"
"5.0.0" "5.1.0" "5.2.0" "5.3.0"
"5.0.0" "5.1.0" "5.2.0" "5.3.0" "5.4.0"
)

function usage() {
Expand Down
4 changes: 2 additions & 2 deletions tools/replace_engine_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -eEu

SUPPORTED_VERSIONS=(
"4.26.0" "4.27.0"
"5.0.0" "5.1.0" "5.2.0" "5.3.0"
"5.0.0" "5.1.0" "5.2.0" "5.3.0" "5.4.0"
)

function usage() {
Expand Down Expand Up @@ -34,6 +34,6 @@ if [ ${supported} -eq 0 ]; then
fi

for file in `find ${source_dir} -name "*.uplugin"`; do
sed -i -e "s/\"EngineVersion\": \"5.3.0\",/\"EngineVersion\": \"${engine_version}\",/g" ${file}
sed -i -e "s/\"EngineVersion\": \"5.4.0\",/\"EngineVersion\": \"${engine_version}\",/g" ${file}
echo "Replaced engine version in ${file}"
done
Loading