Skip to content

Commit

Permalink
2023.11
Browse files Browse the repository at this point in the history
Updates

* Stability and performance improvements for the UI
* Improved gamepad support within the UE5 UI
* New `PreviewExternalUpdatesAsync` method allows you to see what mods would require update or installation based on external changes the user has made to their subscriptions, so that you can unmount or close open file handles to mod files to allow them to be updated
* NativeSDK updated to 2023.11 release

Deprecations

* This is the last major release of the mod.io Unreal Plugin to have support for UE4.26 and UE4.27.
  • Loading branch information
stephenwhittle committed Dec 6, 2023
1 parent 6abc0a4 commit 64d2a1d
Show file tree
Hide file tree
Showing 335 changed files with 6,273 additions and 5,789 deletions.
3 changes: 3 additions & 0 deletions Config/Defaultmodio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[CoreRedirects]
+PropertyRedirects=(OldName="/Script/ModioUI5.ModioCommonFeaturedParamsSettings.AdditionalCategoryParams",NewName="/Script/ModioUI5.ModioCommonFeaturedParamsSettings.CategoryParams")
+PropertyRedirects=(OldName="/Script/ModioUI5.ModioCommonUISettings.FeaturedAdditionalParams",NewName="/Script/ModioUI5.ModioCommonUISettings.FeaturedParams")
Binary file added Content/Audio/S_Modio_UI.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/GettingStarted/OnboardingGuideWidget.uasset
Binary file not shown.
Binary file removed Content/UI/Audio/S_Modio_UI.uasset
Binary file not shown.
Binary file modified Content/UI/Browser/DefaultModBrowserParams.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Content/UI/Browser/ModioFeaturedCategoryWidget.uasset
Binary file not shown.
Binary file modified Content/UI/Browser/ModioFeaturedViewWidget.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/UI/Styles/ModioUIMaterialData.uasset
Binary file not shown.
Binary file modified Content/UI/Styles/WidgetStyles/ButtonStyles.uasset
Binary file not shown.
Binary file modified Content/UI/Styles/WidgetStyles/InputStyles.uasset
Binary file not shown.
Binary file modified Content/UI/Styles/WidgetStyles/PanelStyles.uasset
Binary file not shown.
Binary file modified Content/UI/Styles/WidgetStyles/StatusWidgetStyles.uasset
Binary file not shown.
Binary file added Content/UI5/Default/Images/Icons/T_Back.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Content/UI5/Default/Images/Icons/T_Tick.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/UI5/Default/Styles/CheckBox/DefaultCheckBoxStyle.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/UI5/Default/Styles/ScrollBox/DefaultScrollBoxStyle.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/UI5/Default/Styles/Tab/DefaultTabActiveTextStyle.uasset
Binary file not shown.
Binary file modified Content/UI5/Default/Styles/Tab/DefaultTabNormalTextStyle.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/UI5/Default/Widgets/Auth/W_ModioCommonAuthView.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Content/UI5/W_OverallUILayout.uasset
Binary file not shown.
4,315 changes: 1,966 additions & 2,349 deletions Doc/documentation.html

Large diffs are not rendered by default.

33 changes: 30 additions & 3 deletions Doc/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Once this is done, you can configure the plugin and get started.

The plugin requires some configuration information to behave correctly. You can access the configuration settings in the Project Settings window:

image::img/plugin_settings.png[]
image::img/UE4/plugin_settings.png[]

The settings have the following parameters:

Expand Down Expand Up @@ -192,7 +192,7 @@ When you are ready to initialize the plugin for the current user, you'll need to
image::img/initasync_customoptions.png[]
If you have configured your game's API Key, ID and environment via the Plugin Settings window as in <<Configuration>>, you can use the convenience function <<Get Project Initialize Options>>:
If you have configured your game's API Key, ID and environment via the Plugin Settings window as in <<Configuration>>, you can use the convenience function <<Get Project Initialize Options For Session Id>>:
image::img/initasync_getoptions.png[]
Expand All @@ -212,7 +212,9 @@ void UModioManager::Init()
{
if (GEngine->GetEngineSubsystem<UModioSubsystem>())
{
GEngine->GetEngineSubsystem<UModioSubsystem>()->InitializeAsync(UModioSDKLibrary::GetProjectInitializeOptions(), FOnErrorOnlyDelegateFast::CreateUObject(this, &UModioManager::OnInitCallback));
GEngine->GetEngineSubsystem<UModioSubsystem>()->InitializeAsync(
UModioSDKLibrary::GetProjectInitializeOptionsForSessionId(UModioSDKLibrary::GetDefaultSessionIdWindows()),
FOnErrorOnlyDelegateFast::CreateUObject(this, &UModioManager::OnInitCallback));
}
UE_LOG(LogModioGame, Log, TEXT("Initializing Modio SDK"));
Expand All @@ -232,6 +234,9 @@ void UModioManager::Tick(float DeltaTime)
}
----
.Notes
* You need to provide a default Session Id to initialize the SDK, for Windows we provide a method : <<GetDefaultSessionIdWindows>>.
====

Doing the reverse and shutting down the plugin is equally simple.
Expand Down Expand Up @@ -598,6 +603,28 @@ void UModioManager::OnFetchExternalUpdatesCallback(FModioErrorCode ErrorCode)

NOTE: You should call <<K2_FetchExternalUpdatesAsync>> sparingly, at times you want to ensure that the state is up-to-date. Alternatively, we recommend calling it based on user input such as a button in your UI, so you don't make spurious update checks.

In case you need to prepare for changes happening beforehand, call <<K2_PreviewExternalUpdates>>. This function retrieves a list of updates between the users local mod state, and the server-side state. It allows you to identify which mods will be modified when you call <<K2_FetchExternalUpdatesAsync>> next in order to perform any content management (such as unloading files) that might be required. Its use is very similar:

.C++ Example
[%collapsible]
====
[source,c++]
----
void UModioManager::PreviewExternalUpdates()
{
if (GEngine->GetEngineSubsystem<UModioSubsystem>())
{
GEngine->GetEngineSubsystem<UModioSubsystem>()->PreviewExternalUpdates(FOnPreviewExternalUpdatesDelegateFast::CreateUObject(this, &UModioManager::OnFetchExternalUpdatesCallback));
}
};
void UModioManager::OnPreviewExternalUpdatesCallback(FModioErrorCode ErrorCode, TMap<FModioModID, EModioModChangeType> PreviewMap)
{
}
----
===== Checking the user subscription list
In order to see which mods the user has subscribed to, call <<QueryUserSubscriptions>> to retrieve a collection of <<ModioModCollectionEntry>> objects, one for each subscribed mod.
Expand Down
Binary file added Doc/img/UE5/plugin_ui_enable_plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/UE5/plugin_ui_input_data.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/UE5/plugin_ui_platform_input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/UE5/plugin_ui_settings_params.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Doc/img/initasync_getoptions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_GetAsyncOperationState.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_GetDefaultSessionIdWindows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_K2_PreviewExternalUpdatesAsync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/img/nd_img_ShowDialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Doc/ui-documentation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ These modules are optional - you can remove them, the UI folder in the Plugin Co

=== Displaying the Mod Browser

The main Mod Browser widget is located at /Modio/UI/Browser/Views/ModioModBrowserWidget.ModioModBrowserWidget. Once the Plugin has been initialized, you can show the Mod Browser via a new UI-focused subsystem, `UModioUISubsystem`.
The main Mod Browser widget is located at `/Modio/UI/Browser/Views/ModioModBrowserWidget.ModioModBrowserWidget`. After the Plugin has been initialized, you can show the Mod Browser via a new UI-focused subsystem `UModioUISubsystem` using the function `ShowModBrowserUIForPlayer()`.
Currently the mod browser does not support being embedded inside your own UI hierarchy, so you must load it directly (for instance, from a button on your main menu).

.Blueprint Example
Expand Down
34 changes: 31 additions & 3 deletions Doc/ui5-documentation.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
== mod.io Mod Browser UE5 UI

Mod.io UE5 UI is built upon the concepts outlined in the link:https://docs.unrealengine.com/5.0/en-US/common-ui-plugin-for-advanced-user-interfaces-in-unreal-engine/[Common UI approach].
Mod.io UE5 UI is built upon the concepts outlined in the link:https://docs.unrealengine.com/5.0/en-US/common-ui-plugin-for-advanced-user-interfaces-in-unreal-engine/[Common UI].

=== How to Set Up Common UI for Project to Use Mod.io UE5 UI

==== Enable Common UI plugin

Open the **Edit -> Plugins** window, and enable the `Common UI` plugin.

image::img/UE5/plugin_ui_enable_plugin.png[]

==== Game Viewport Client Class

Navigate to **Project Settings -> Engine -> General Settings**, and set the `Game Viewport Client Class` to `CommonGameViewportClient`.

image::img/UE5/plugin_ui_game_viewport_client_class.png[]

==== Input Data

Go to **Project Settings -> Game -> Common Input Settings**, and set the `Input Data` to `ModioInputData`.

Alternatively, you can create your own `Input Data` class that inherits from `CommonInputData` and set that instead. However, you will need to reassign all the Input Actions to your custom ones in **Project Settings -> Modio UI -> Modio Common UI Settings**.

image::img/UE5/plugin_ui_input_data.png[]

==== Platform Input

Within the same section (**Project Settings -> Game -> Common Input Settings**), locate the `Platform Input` property to specify the per-platform settings.

image::img/UE5/plugin_ui_platform_input.png[]

=== Organization

Expand Down Expand Up @@ -34,7 +62,7 @@ For example, take a look at the **Collection View (W_ModioCommonCollectionView)*

=== Customizing Text and Input Actions

For most of the default widgets where the text and actions are available, they can be customized in the project settings. There are different Params sections for most of the widgets where you can specify your own text and input action details.
For most of the default widgets where the text and actions are available, they can be customized in the project settings. There are different sections for most of the widgets where you can specify your own text and input action details.

image::img/UE5/plugin_ui_settings_params.png[]

Expand Down Expand Up @@ -72,7 +100,7 @@ Here's a code snippet to demonstrate the typical use case that is intended to be
// Listen for input actions and execute the OnSubmitClicked delegate when the action is triggered
if (SubmitButton)
{
ListenForInputAction(SubmitButton, AuthSettings->SubmitInputAction, AuthCodeSettings->SubmitButtonText, [this]() {
ListenForInputAction(SubmitButton, AuthSettings->SubmitInputAction, AuthCodeSettings->SubmitButtonText, FOnModioCommonActivatableWidgetActionFiredFast::CreateWeakLambda(this, [this]() {
if (OnSubmitClicked.IsBound()) OnSubmitClicked.Execute(GetInputText());
});
}
Expand Down
20 changes: 10 additions & 10 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Welcome to the mod.io Unreal Engine plugin repository. It allows game developers
## Platform Support

|===
|Platform | UE4.26 | UE4.27 | UE5.0 | UE5.1 |
|Windows | ✔ | ✔ | ✔ | ✔ |
|Windows (GDK) | - | ✔ | ✔ | ✔ |<<contact-us,(Contact Us)>>
|XBox (GDK) | - | ✔ | ✔ | - |<<contact-us,(Contact Us)>>
|PlayStation 4 | - | ✔ | ✔ | ✔ |<<contact-us,(Contact Us)>>
|PlayStation 5 | - | ✔ | ✔ | ✔ |<<contact-us,(Contact Us)>>
|Nintendo Switch| - | ✔ | ✔ | ✔ |<<contact-us,(Contact Us)>>
|Linux | ✔ | ✔ | ✔ | ✔ |
|macOS | ✔ | ✔ | ✔ | ✔ |
|Platform | UE4.26 | UE4.27 | UE5.0 | UE5.1 | UE 5.2 |
|Windows | ✔ | ✔ | ✔ | ✔ | ✔ |
|Windows (GDK) | - | ✔ | ✔ | ✔ | ✔ | <<contact-us,(Contact Us)>>
|XBox (GDK) | - | ✔ | ✔ | ✔ | ✔ | <<contact-us,(Contact Us)>>
|PlayStation 4 | - | ✔ | ✔ | ✔ | ✔ | <<contact-us,(Contact Us)>>
|PlayStation 5 | - | ✔ | ✔ | ✔ | ✔ | <<contact-us,(Contact Us)>>
|Nintendo Switch| - | ✔ | ✔ | ✔ | ✔ | <<contact-us,(Contact Us)>>
|Linux | ✔ | ✔ | ✔ | ✔ | ✔ |
|macOS | ✔ | ✔ | ✔ | ✔ | ✔ |
|===

## Features
Expand Down Expand Up @@ -68,7 +68,7 @@ Once this is done, you can configure the plugin and get started.

The plugin requires some configuration information to behave correctly. You can access the configuration settings in the Project Settings window:

image::Doc/img/plugin_settings.png[]
image::Doc/img/UE4/plugin_settings.png[]

The settings have the following parameters:

Expand Down
12 changes: 10 additions & 2 deletions Source/Modio/Private/Internal/Convert/InitializeOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,24 @@ FORCEINLINE Modio::InitializeOptions ToModio(const FModioInitializeOptions& In)
Options.GameID = ToModio(In.GameId);
Options.APIKey = ToModio(In.ApiKey);
Options.GameEnvironment = ToModio(In.GameEnvironment);

#if PLATFORM_WINDOWS

Options.User =
In.LocalSessionIdentifier.IsSet() ? ToModio(In.LocalSessionIdentifier.GetValue()) : GetUserSidString();

#else
checkf(In.LocalSessionIdentifier.IsSet(),
TEXT("Please set LocalSessionIdentifier on your InitializeOptions before passing them to InitializeAsync"))

if (In.LocalSessionIdentifier.IsSet())
{
Options.User = ToModio(In.LocalSessionIdentifier.GetValue());
}
{
UE_LOG(LogTemp, Warning, TEXT("Please set LocalSessionIdentifier on your InitializeOptions before passing them to InitializeAsync"));
}

#endif

Options.PortalInUse = ToModio(In.PortalInUse);

for (const TPair<FString, FString>& Element : In.ExtendedInitializationParameters)
Expand Down
5 changes: 3 additions & 2 deletions Source/Modio/Private/Internal/Convert/Optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
#include "ModioSDK.h"
#include "Types/ModioCreateModParams.h"
#include "Templates/EnableIf.h"
#include <type_traits>

template<typename DestinationType, typename SourceType>
FORCEINLINE typename TEnableIf<TNot<TIsSame<SourceType,DestinationType>>::Value, typename Modio::Optional<DestinationType>>::Type ToModioOptional(const TOptional<SourceType>& In)
FORCEINLINE typename TEnableIf<!std::is_same<SourceType,DestinationType>::value, typename Modio::Optional<DestinationType>>::Type ToModioOptional(const TOptional<SourceType>& In)
{
if (In.IsSet())
{
Expand All @@ -29,7 +30,7 @@ FORCEINLINE typename TEnableIf<TNot<TIsSame<SourceType,DestinationType>>::Value,
}

template<typename DestinationType, typename SourceType>
FORCEINLINE typename TEnableIf<TIsSame<SourceType,DestinationType>::Value, typename Modio::Optional<DestinationType>>::Type ToModioOptional(const TOptional<SourceType>& In)
FORCEINLINE typename TEnableIf<std::is_same<SourceType,DestinationType>::value, typename Modio::Optional<DestinationType>>::Type ToModioOptional(const TOptional<SourceType>& In)
{
if (In.IsSet())
{
Expand Down
15 changes: 15 additions & 0 deletions Source/Modio/Private/Internal/ModioConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,3 +357,18 @@ EModioModfilePlatform ToUnreal(const Modio::ModfilePlatform& PlatformIn)
checkf(false, TEXT("Missed a case in ToUnreal(const Modio::ModfilePlatform& PlatformIn)"));
return EModioModfilePlatform::Windows;
}

EModioModChangeType ToUnreal(const Modio::UserSubscriptionList::ChangeType& In)
{
switch (In)
{
case Modio::UserSubscriptionList::ChangeType::Added:
return EModioModChangeType::Added;
case Modio::UserSubscriptionList::ChangeType::Removed:
return EModioModChangeType::Removed;
case Modio::UserSubscriptionList::ChangeType::Updated:
return EModioModChangeType::Updated;
default:
return EModioModChangeType::Removed;
}
}
1 change: 1 addition & 0 deletions Source/Modio/Private/Internal/ModioConvert.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct FModioIcon ToUnreal(const Modio::Detail::Icon& In);
struct FModioGameStats ToUnreal(const Modio::GameStats& In);
EModioModfilePlatform ToUnreal(const Modio::ModfilePlatform& In);
struct FModioGamePlatform ToUnreal(const Modio::GamePlatform& In);
EModioModChangeType ToUnreal(const Modio::UserSubscriptionList::ChangeType& In);

std::string ToModio(const FString& String);
std::vector<std::string> ToModio(const TArray<FString>& StringArray);
Expand Down
10 changes: 10 additions & 0 deletions Source/Modio/Private/Libraries/ModioSDKLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "Libraries/ModioSDKLibrary.h"
#include "Internationalization/Regex.h"
#include "Internal/Convert/InitializeOptions.h"
#include "Modio.h"
#include "ModioSettings.h"

Expand Down Expand Up @@ -262,3 +263,12 @@ FString UModioSDKLibrary::GetShortenedNumberAsString(int64 Number)

return FString::FromInt(Number);
}

FString UModioSDKLibrary::GetDefaultSessionIdWindows()
{
#if PLATFORM_WINDOWS
return FString(GetUserSidString().c_str());
#else
return FString(TEXT(""));
#endif
}
10 changes: 9 additions & 1 deletion Source/Modio/Private/Modio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "Modio.h"
#include "Containers/Array.h"
#include "Math/Color.h"
#include "Misc/EngineVersionComparison.h"
#include "Stats/Stats.h"

DEFINE_LOG_CATEGORY(LogModio)
Expand Down Expand Up @@ -56,8 +57,11 @@ extern "C"
return StatIDs[StatName];
}
}

#if UE_VERSION_OLDER_THAN(5, 2, 0)
PRAGMA_DISABLE_OPTIMIZATION
#else
UE_DISABLE_OPTIMIZATION
#endif
void modio_profile_scope_start(const char* Name, void** Data)
{
if (FThreadStats::IsCollectingData())
Expand Down Expand Up @@ -102,7 +106,11 @@ extern "C"
{
FThreadStats::AddMessage(GetOrCreateStat(FName(Name)).GetName(), EStatOperation::Set, int64(Data));
}
#if UE_VERSION_OLDER_THAN(5, 2, 0)
PRAGMA_ENABLE_OPTIMIZATION
#else
UE_ENABLE_OPTIMIZATION
#endif
}

#endif
Loading

0 comments on commit 64d2a1d

Please sign in to comment.