Skip to content

Commit

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

* New configuration value to allow hiding of mod.io tools in-editor
* New `ListUserGamesAsync` function to retrieve a list of games which
  contain the user as a member of their team
* Improvements to onboarding/setup/Getting Started widget
* Downvoting in the UI will be enabled or disabled based on the game's
  community options

Bugfixes

* Fix a thread-safety issue in input action handlers
  • Loading branch information
stephenwhittle committed Apr 3, 2024
1 parent c4de58f commit dd5be93
Show file tree
Hide file tree
Showing 166 changed files with 4,010 additions and 1,698 deletions.
Binary file modified Content/GettingStarted/OnboardingGuideWidget.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 modified Content/UI5/Default/Platform/Input/SwitchSpecific/Switch_A.uasset
Binary file not shown.
Binary file modified Content/UI5/Default/Platform/Input/SwitchSpecific/Switch_B.uasset
Binary file not shown.
Binary file modified Content/UI5/Default/Platform/Input/SwitchSpecific/Switch_L.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Content/UI5/Default/Platform/Input/SwitchSpecific/Switch_R.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Content/UI5/Default/Platform/Input/SwitchSpecific/Switch_X.uasset
Binary file not shown.
Binary file modified Content/UI5/Default/Platform/Input/SwitchSpecific/Switch_Y.uasset
Binary file not shown.
Binary file modified Content/UI5/Default/Platform/Input/SwitchSpecific/Switch_ZL.uasset
Binary file not shown.
Binary file modified Content/UI5/Default/Platform/Input/SwitchSpecific/Switch_ZR.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 modified Content/UI5/Default/Styles/ScrollBox/DefaultScrollBarStyle.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 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 modified Content/UI5/Default/Widgets/Tag/W_ModioCommonTags_SingleLine.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2,361 changes: 1,328 additions & 1,033 deletions Doc/documentation.html

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Doc/getting-started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ For more details on the error codes and how to inspect their values, please see

The plugin stores mods in a game-specific directory in the following directory by default:

[stripes=odd,frame=none,cols="1,^1,^1"]
[stripes=odd,frame=none,cols="1,^1,^1,^1"]
|===
| Windows | Linux | OSX
|`${FolderID_Public}/mod.io` | `${USER_HOME}/mod.io` | `${USER_HOME}/Library/Application Support/mod.io`
| Windows | Linux | macOS | iOS
|`${FolderID_Public}/mod.io` | `${USER_HOME}/mod.io` | `${USER_HOME}/Library/Application Support/mod.io` | `${APP-DIRECTORY}/Documents/mod.io`
|===

However, this value can be overridden in one of two ways:
Expand All @@ -174,7 +174,7 @@ Per-game settings are stored in `${FOLDERID_LocalAppData}/mod.io/${GameId}/${mod
+
*Adding* a `RootLocalDataPath` element to this file will redirect the mod installation directory for this specific game only, for the current system account. Removing this value will cause the game to revert back to the global value in `globalsettings.json`.


NOTE: In Linux, macOS & iOS, mods and data binds to a single user. Every other client would have their own instance in their home directory.

'''

Expand Down
Binary file added Doc/img/nd_img_GetDefaultCategoryFilterParams.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_GetNumOfAppliedFilters.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_ListUserGamesAsync.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/nd_img_MakeInitializeOptions.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_SetOnOperationStateDelegate.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/nd_img_SetPortal.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/nd_img_SetStyle.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/nd_img_SwitchDisableButtonVisibility.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/nd_img_SwitchEnableButtonVisibility.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/nd_img_SynchronizeFilterParams.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_ZeroOut.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_ZeroOutFiltering.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 README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The mod.io plugin is generally maintained to support the 3 most recent versions

### Platform compatability

The mod.io plugin supports Windows, Linux and Mac as part of the public release.
The mod.io plugin supports Windows, Linux, iOS and Mac as part of the public release.

For access to Windows (GDK), XBox, Playstation 4, Playstation 5 or Switch, please <<contact-us,(Contact Us)>>.

Expand Down
38 changes: 23 additions & 15 deletions Source/Modio/Modio.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ public class PlatformConfig
public List<string> ModuleDependencies = new List<string>();
public List<string> SystemLibraryDependencies = new List<string>();
public List<string> PlatformSourceFolderNames = new List<string>();
public List<string> AndroidPluginPropertiesForReceipt = new List<string>();

}
public Dictionary<string, PlatformConfig> Platforms;
public List<string> IncludeDirectories;
public List<string> PlatformSpecificDefines;
public List<string> ModuleDependencies = new List<string>();
public List<string> SystemLibraryDependencies = new List<string>();
};
#if UE_5_0_OR_LATER

private ModioPlatformConfigFile.PlatformConfig ParseInnerPlatformConfig(JsonObject InnerPlatformObject)
{
ModioPlatformConfigFile.PlatformConfig ParsedInnerPlatform = new ModioPlatformConfigFile.PlatformConfig();
Expand Down Expand Up @@ -78,14 +80,17 @@ private ModioPlatformConfigFile.PlatformConfig ParseInnerPlatformConfig(JsonObje
{
ParsedInnerPlatform.SystemLibraryDependencies = new List<string>(ParsedPlatformSystemLibraryDependencies);
}
return ParsedInnerPlatform;
}
#endif
string[] ParsedAndroidPluginPropertiesForReceipt;
if (InnerPlatformObject.TryGetStringArrayField("AndroidPluginPropertiesForReceipt", out ParsedAndroidPluginPropertiesForReceipt))
{
ParsedInnerPlatform.AndroidPluginPropertiesForReceipt = new List<string>(ParsedAndroidPluginPropertiesForReceipt);
}

return ParsedInnerPlatform;
}

private ModioPlatformConfigFile TryLoadPlatformConfig(string PlatformConfigPath)
{
#if UE_5_0_OR_LATER
ModioPlatformConfigFile ParsedConfig = new ModioPlatformConfigFile();

JsonObject PlatformConfigObject = JsonObject.Read(new FileReference(PlatformConfigPath));
Expand All @@ -105,10 +110,8 @@ private ModioPlatformConfigFile TryLoadPlatformConfig(string PlatformConfigPath)
JsonObject PlatformsInnerObject = PlatformConfigObject.GetObjectField("Platforms");
ParsedConfig.Platforms = PlatformsInnerObject.KeyNames.ToDictionary(x => x, x =>
ParseInnerPlatformConfig(PlatformsInnerObject.GetObjectField(x)), System.StringComparer.OrdinalIgnoreCase);

return ParsedConfig;
#else
return Json.Load<ModioPlatformConfigFile>(new FileReference(PlatformConfigPath));
#endif
}

private void InternalLog(string message)
Expand Down Expand Up @@ -189,6 +192,7 @@ private ModioPlatformConfigFile.PlatformConfig LoadNativePlatformConfig()
MergedConfig.PlatformSpecificDefines.AddRange(Platform.Value.PlatformSpecificDefines);
MergedConfig.ModuleDependencies.AddRange(Platform.Value.ModuleDependencies);
MergedConfig.SystemLibraryDependencies.AddRange(Platform.Value.SystemLibraryDependencies);
MergedConfig.AndroidPluginPropertiesForReceipt.AddRange(Platform.Value.AndroidPluginPropertiesForReceipt);
bFoundPlatformConfig = true;
}
}
Expand All @@ -199,7 +203,7 @@ private ModioPlatformConfigFile.PlatformConfig LoadNativePlatformConfig()
MergedConfig.PlatformSpecificDefines.AddRange(CurrentConfig.PlatformSpecificDefines);
MergedConfig.ModuleDependencies.AddRange(CurrentConfig.ModuleDependencies);
MergedConfig.SystemLibraryDependencies.AddRange(CurrentConfig.SystemLibraryDependencies);
}
}
}
}
}
Expand Down Expand Up @@ -228,9 +232,8 @@ private ModioTestConfigFile LoadTestConfig()
{
string TestConfigPath = Path.Combine(ModuleDirectory, "../ThirdParty/NativeSDK/tests", "UnrealTestConfig.json");
if (File.Exists(TestConfigPath))
{
#if UE_5_0_OR_LATER
ModioTestConfigFile ParsedConfig = new ModioTestConfigFile();
{
ModioTestConfigFile ParsedConfig = new ModioTestConfigFile();

JsonObject TestConfigObject = JsonObject.Read(new FileReference(TestConfigPath));
string[] ParsedTestDefines;
Expand All @@ -250,9 +253,6 @@ private ModioTestConfigFile LoadTestConfig()
}
}
return ParsedConfig;
#else
return Json.Load<ModioTestConfigFile>(new FileReference(TestConfigPath));
#endif
}
else
{
Expand Down Expand Up @@ -444,6 +444,14 @@ private void ApplyNativePlatformConfig(ModioPlatformConfigFile.PlatformConfig Co
// Add platform-specific include directories
PrivateIncludePaths.AddRange(Config.IncludeDirectories);
PublicSystemLibraries.AddRange(Config.SystemLibraryDependencies);

string pluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath);

InternalLog($"AndroidPluginPropertiesForReceipt is {Config.AndroidPluginPropertiesForReceipt.Count}");
foreach (var androidPluginProp in Config.AndroidPluginPropertiesForReceipt)
{
AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(pluginPath, androidPluginProp));
}
}
private void AddCommonDefinitions()
{
Expand Down
51 changes: 51 additions & 0 deletions Source/Modio/ModioAndroid_UPL.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>

<root xmlns:android="http://schemas.android.com/apk/res/android">

<!-- init section is always evaluated once per architecture -->
<init>
<log text="*** [UPL]*** Modio - Android - init"/>
</init>

<!--Android Specific sections-->
<!-- optional updates applied to AndroidManifest.xml -->
<androidManifestUpdates>
<!-- Add permissions -->
<log text="*** [UPL]*** Modio - Android - androidManifestUpdates"/>
<addPermission android:name="android.permission.READ_EXTERNAL_STORAGE" android:required="true"/>
<addPermission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:required="true"/>
<addPermission android:name="android.permission.READ_INTERNAL_STORAGE" android:required="true"/>
<addPermission android:name="android.permission.WRITE_INTERNAL_STORAGE" android:required="true"/>
<addPermission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" android:required="true"/>
</androidManifestUpdates>

<!-- Copy java sources to build sources -->
<prebuildCopies>
<log text="*** [UPL]*** Modio - Android - prebuildCopies"/>
<copyDir src="$S(ProjectDir)/Plugins/Modio/Source/ThirdParty/NativeSDK/platform/android/java/com/modio/modiosdk" dst="$S(BuildDir)/src/com/modio/modiosdk" />
</prebuildCopies>

<resourceCopies>
<log text="Copy Cert resources"/>
<copyDir src="$S(ProjectDir)/Plugins/Modio/Source/ThirdParty/NativeSDK/platform/android/assets" dst="$S(BuildDir)/assets" />
</resourceCopies>

<!-- Set androidX and jetifier to true for some android versions -->
<gradleProperties>
<log text="*** [UPL]*** Modio - Android - gradleProperties"/>
<insert>
android.useAndroidX=true
android.enableJetifier=true
</insert>
</gradleProperties>

<!-- Import classes in com.modio.modiosdk package -->
<gameActivityImportAdditions>
<log text="*** [UPL]*** Modio - Android - gameActivityImportAdditions"/>
<insert>
import com.modio.modiosdk.*;
</insert>
</gameActivityImportAdditions>

<compilerArgument>-Xlint:deprecation</compilerArgument>
</root>
10 changes: 10 additions & 0 deletions Source/Modio/Private/Internal/Convert/FilterParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ FORCEINLINE Modio::FilterParams::SortFieldType ToModio(EModioSortFieldType Envir
}
MODIO_END_CONVERT_SWITCHES

FORCEINLINE Modio::MaturityOption ToModio(EModioMaturityFlags Maturity)
{
return static_cast<Modio::MaturityOption>((uint8) Maturity);
}

FORCEINLINE Modio::FilterParams ToModio(const FModioFilterParams& In)
{
Modio::FilterParams Out;
Expand Down Expand Up @@ -100,6 +105,11 @@ FORCEINLINE Modio::FilterParams ToModio(const FModioFilterParams& In)
Out.RevenueType(ToModio(In.Revenue.GetValue()));
}

if (In.Maturity.IsSet())
{
Out.WithMatureContentFlags(ToModio(In.Maturity.GetValue()));
}

return Out.SortBy(ToModio(In.SortField), ToModio(In.Direction))
.NameContains(ToModio(In.SearchKeywords))
.MatchingIDs(ToModio<Modio::ModID>(In.IncludedIDs))
Expand Down
3 changes: 3 additions & 0 deletions Source/Modio/Private/Internal/Convert/GameInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

#pragma once
#include "Internal/Convert/GamePlatform.h"
#include "Internal/Convert/GameStats.h"
#include "Internal/Convert/HeaderImage.h"
#include "Internal/Convert/Icon.h"
Expand Down Expand Up @@ -39,7 +40,9 @@ FORCEINLINE FModioGameInfo ToUnreal(const Modio::GameInfo& In)
Out.Theme = ToUnreal(In.Theme);
Out.Stats = ToUnreal(In.Stats);
Out.OtherUrls = ToUnreal<FModioOtherUrl>(In.OtherUrls);
Out.bAllowNegativeRatings = In.CommunityOptions.HasFlag(Modio::GameCommunityOptions::AllowNegativeRatings);
Out.GameMonetizationOptions = ToUnreal<EGameMonetizationFlags, Modio::GameMonetizationOptions>(In.GameMonetizationOptions);
Out.GameMaturityOptions = ToUnreal<EGameMaturityFlags, Modio::GameMaturityOptions>(In.MaturityOptions);
Out.VirtualTokenName = ToUnreal(In.VirtualTokenName);
Out.PlatformSupport = ToUnreal<FModioGamePlatform>(In.PlatformSupport);

Expand Down
19 changes: 19 additions & 0 deletions Source/Modio/Private/Internal/Convert/GameInfoList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (C) 2024 mod.io Pty Ltd. <https://mod.io>
*
* This file is part of the mod.io UE4 Plugin.
*
* Distributed under the MIT License. (See accompanying file LICENSE or
* view online at <https://github.com/modio/modio-ue4/blob/main/LICENSE>)
*
*/

#pragma once

#include "ModioSDK.h"
#include "Types/ModioGameInfoList.h"

FModioGameInfoList ToUnreal(const Modio::GameInfoList& In)
{
return FModioGameInfoList(In);
}
10 changes: 10 additions & 0 deletions Source/Modio/Private/Libraries/ModioFilterParamsLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,13 @@ FModioFilterParams& UModioFilterParamsLibrary::MetadataLike(FModioFilterParams&
{
return Filter.MetadataLike(SearchString);
}

FModioFilterParams& UModioFilterParamsLibrary::DisallowMatureContent(FModioFilterParams& Filter)
{
return Filter.DisallowMatureContent();
}

FModioFilterParams& UModioFilterParamsLibrary::WithMatureContentFlags(FModioFilterParams& Filter, int32 ByMaturity)
{
return Filter.WithMatureContentFlags(static_cast<EModioMaturityFlags>(ByMaturity));
}
21 changes: 21 additions & 0 deletions Source/Modio/Private/Libraries/ModioGameInfoListLibrary.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2024 mod.io Pty Ltd. <https://mod.io>
*
* This file is part of the mod.io UE4 Plugin.
*
* Distributed under the MIT License. (See accompanying file LICENSE or
* view online at <https://github.com/modio/modio-ue4/blob/main/LICENSE>)
*
*/

#include "Libraries/ModioGameInfoListLibrary.h"

const TArray<FModioGameInfo>& UModioGameInfoListLibrary::GetGames(const FModioGameInfoList& GameInfoList)
{
return GameInfoList.GetRawList();
}

const FModioPagedResult& UModioGameInfoListLibrary::GetPagedResult(const FModioGameInfoList& GameInfoList)
{
return GameInfoList;
}
12 changes: 12 additions & 0 deletions Source/Modio/Private/Libraries/ModioOptionalLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "Libraries/ModioOptionalLibrary.h"
#include "Types/ModioGameInfo.h"
#include "Types/ModioGameInfoList.h"
#include "Types/ModioModDependencyList.h"
#include "Types/ModioModInfoList.h"
#include "Types/ModioModTagOptions.h"
Expand Down Expand Up @@ -44,6 +45,17 @@ bool UModioOptionalLibrary::GetValue_ModioOptionalModInfoList(const FModioOption
return GetValueInternal(OptionalModInfoList, ModInfoList);
}

bool UModioOptionalLibrary::IsSet_ModioOptionalGameInfoList(const FModioOptionalGameInfoList& OptionalGameInfoList)
{
return IsSetInternal(OptionalGameInfoList);
}

bool UModioOptionalLibrary::GetValue_ModioOptionalGameInfoList(const FModioOptionalGameInfoList& OptionalGameInfoList,
FModioGameInfoList& GameInfoList)
{
return GetValueInternal(OptionalGameInfoList, GameInfoList);
}

bool UModioOptionalLibrary::IsSet_ModioOptionalModInfo(const FModioOptionalModInfo& OptionalModInfo)
{
return IsSetInternal(OptionalModInfo);
Expand Down
11 changes: 10 additions & 1 deletion Source/Modio/Private/Libraries/ModioPlatformHelpersLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ EModioPlatformName UModioPlatformHelpersLibrary::GetCurrentPlatform()
return EModioPlatformName::Mac;
#endif

#if PLATFORM_IOS
return EModioPlatformName::iOS;
#endif

#if PLATFORM_LINUX
return EModioPlatformName::Linux;
#endif
#endif

#if PLATFORM_PS4
return EModioPlatformName::PS4;
Expand All @@ -39,6 +43,10 @@ EModioPlatformName UModioPlatformHelpersLibrary::GetCurrentPlatform()
#if PLATFORM_SWITCH
return EModioPlatformName::Switch;
#endif

#if PLATFORM_ANDROID
return EModioPlatformName::Android;
#endif
}

EModioPortal UModioPlatformHelpersLibrary::GetDefaultPortalForCurrentPlatform()
Expand All @@ -59,6 +67,7 @@ EModioPortal UModioPlatformHelpersLibrary::GetDefaultPortalForCurrentPlatform()
case EModioPlatformName::Switch:
return EModioPortal::Nintendo;
case EModioPlatformName::Unknown:
case EModioPlatformName::iOS:
return EModioPortal::None;
default:
return EModioPortal::None;
Expand Down
12 changes: 12 additions & 0 deletions Source/Modio/Private/ModioModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
#include "ISettingsModule.h"
#endif

#if PLATFORM_ANDROID
#include "Android/AndroidApplication.h"
extern JavaVM* GJavaVM;
#endif

#define LOCTEXT_NAMESPACE "FModioModule"

void FModioModule::StartupModule()
Expand Down Expand Up @@ -91,6 +96,13 @@ void FModioModule::StartupModule()
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load example third party
library"));
}*/


#if PLATFORM_ANDROID
Modio::InitializeAndroidJNI(GJavaVM, AndroidJavaEnv::GetClassLoader());
Modio::SetGlobalActivity(FAndroidApplication::GetGameActivityThis());
Modio::InitializeAndroid();
#endif
}

void FModioModule::UnregisterSettings()
Expand Down
Loading

0 comments on commit dd5be93

Please sign in to comment.