Commit Graph

426 Commits

Author SHA1 Message Date
jamie dale
6e9d3680c9 Centralized the logic for forcing game localization data to load in an editor
This is now controlled by FTextLocalizationManager::ShouldForceLoadGameLocalization, which will return true in the following cases:
  * A cooked editor.
  * An uncooked editor with the game localization preview enabled, or with the CVar Localization.ForceLoadGameLocalizationInEditor set to true.

This is queried to add the ELocalizationLoadFlags::ForceLocalizedGame flag when loading localization data, and also by FLocalizationTargetDescriptor::ShouldLoadLocalizationTarget when deciding whether to load a game localization target for a plugin (which also allows plugins to work with the game localization preview).

#rb eric.boucher

[CL 34460891 by jamie dale in ue5-main branch]
2024-06-18 10:51:09 -04:00
dave belanger
d86e214cf0 IPlugin::Get/SetVerseVersion
#rb Rex.Hill

[CL 34458414 by dave belanger in ue5-main branch]
2024-06-18 09:58:40 -04:00
eric boucher
5fe1716cf3 Load game localization data in cooked editors
#rb Jamie.Dale
#rnx

[CL 34357337 by eric boucher in ue5-main branch]
2024-06-13 18:23:49 -04:00
eric knapik
31b5565620 Fix issue where GFS plugins or dependencies of root plugins might become unmounted and not enabled. This would prevent them from being mounted again by requiring that the plugins be enabled when tied to a root.
Add way to know the current enabled plugins for the target. This allows the application to only load the modules and plugins.

[REVIEW] [at]Will.Brown [at]Lewis.Farrell [at]Aidan.McDu
#rb aidan.mcdu, will.brown

[CL 34212830 by eric knapik in ue5-main branch]
2024-06-07 15:59:14 -04:00
zach brockway
f74f50ff06 UnrealBuildTool: Introduce TargetRules.bAllowEnginePluginsEnabledByDefault, analogous to (the inverse of) "DisableEnginePluginsByDefault" in the project descriptor.
This is passed through to the target receipt, and respected in FPluginManager.

#jira UE-214749
#rb Joe.Kirchoff

[CL 33811096 by zach brockway in ue5-main branch]
2024-05-21 17:30:36 -04:00
will brown
101934fc5e Adding an optional sort delegate to allow custom sorting of the updated json array before it's set. The default behavor adds new elements to the end of the json array which may not match the source input array. Removing the clearing of "Plugins" so that existing data is preserved again.
#jira UE-214985
#rb Dave.Belanger, robert.millar

[CL 33687013 by will brown in ue5-main branch]
2024-05-16 10:23:59 -04:00
josh adams
908083ad22 FConfigBranch Phase 2:
- Making use of unload configs in PluginManager, GameFeaturePlugins, and HotFixes
- To help with memory increase from the branch memory for unloadable configs, I added FConfigCacheIni::SafeUnload(BranchName), which can unload the memory usage by a branch, but then will on-demand reload the hierarchy if accessed
- Used SafeUnload to GGameplayTagsIni because that is read once and cached
- Various other minor optimizations, like not creating hundreds of empty configs in GConfig,
- Added "config memusage" (similar to configmem as it turns out)
- Removed some old deprecated code
- Added ability for editor to remember and write out comments in .ini files
- Changed commandline ini overrides to a dynamic layer (this is a work in progress - old method is still in there - it's tied to the ini.UseNewDynamicLayers cvar - old GFP code used the old way, etc, which i still support)
- Experimental support for runtime config change tracking, so saving out .ini files will have more context about how the user changed a config section (mostly important for arrays). This is not fully functional yet [WILL PROBABLY REMOVE]
- Experimental new config layer expansion system that uses FPaths::ConvertPath to find Restricted/Platform locations, instead of hardcoding
#rb David.Harvey

[CL 33489816 by josh adams in ue5-main branch]
2024-05-07 14:20:06 -04:00
jamie dale
5e7a6465f7 Avoid localization data failing to load for loaded/active GFPs if GameFeaturePlugin.DeferLocalizationDataLoad is hotfixed to false after the GFPs have already mounted
Since the mount/unmount localization calls are now ref-counted, we can just always call them during GFP loading/unloading as they'll be a no-op if the localization data was already loaded by mounting (or anything else).

Also improved the logging when the localization data skips being loaded/unloaded due to an existing reference, so that we can see the ref-count in the log.

[FYI] Kelby.Gamble
#rnx

[CL 33204941 by jamie dale in ue5-main branch]
2024-04-24 13:28:35 -04:00
zousar shaker
95ce2445c4 Adding internal API to allow monolithic programs to optionally accept a uproject as a first argument and use that as its project directory even if it is an engine executable.
#rb paul.chipchase

[CL 33084091 by zousar shaker in ue5-main branch]
2024-04-18 16:23:21 -04:00
jamie dale
2f91dbac02 Ref-count the mounting of localization data for explicitly mounted plugins
This allows different systems that need plugin localization to call MountExplicitlyLoadedPluginLocalizationData and UnmountExplicitlyLoadedPluginLocalizationData (in pairs), without needing to understand any other system that may have mounted localization for that plugin, and avoids the unmount calls from different systems fighting with each other.

#rb simon.orr

[CL 32929429 by jamie dale in ue5-main branch]
2024-04-12 10:36:02 -04:00
will brown
685fe96237 Enabling the runtime root plugin optional references code so that not enabled plugins are ignored with snapshot use. Non shipping builds only. This is required as the staging step which performs the stripping is not executed in this workflow
#rb Eric.Knapik, robert.millar

[CL 32913468 by will brown in ue5-main branch]
2024-04-11 18:58:09 -04:00
george rolfe
e05aebc20a Adding GameTarget Allow/Deny Lists to UBT
#rnx
#rb Joe.Kirchoff

[CL 32721753 by george rolfe in ue5-main branch]
2024-04-04 04:41:05 -04:00
will brown
dfc6665b28 Displaying the SunsetFortReleaseVersion in the plugin editor through the FortGameFeaturePluginMetadataCustomization
#rb robert.millar

[CL 32705650 by will brown in ue5-main branch]
2024-04-03 14:36:35 -04:00
daniel lamb
be0ce0757f Added plugin param for generating iads
[CL 32431824 by daniel lamb in ue5-main branch]
2024-03-22 09:34:47 -04:00
will brown
741bee3268 Removing the field "Plugins" on update to force the array to be rebuilt in the same order as the plugins array rather than new items being appended to the end
#rb robert.millar

[CL 32390197 by will brown in ue5-main branch]
2024-03-20 21:11:28 -04:00
jamie dale
d463d5199b Implemented localization resource unloading for plugins
This leverages 4-bytes of padding in FDisplayStringEntry to store an ID (an int32 index generated via FTextLocalizationManager::GetLocalizationTargetPathId) that is used to tag each display string with the localization target that it belongs to, without increasing the size of DisplayStringLookupTable.

There is an additional LUT mapping each localization target ID to its text IDs to act as an accelerator for HandleLocalizationTargetsUnmounted, however this LUT only tracks text IDs associated with localization data loaded via HandleLocalizationTargetsMounted to minimize the memory impact of this additional tracking. Without this LUT HandleLocalizationTargetsUnmounted would need to spin the entire live table each time, which is not acceptable from a performance standpoint.

Now that HandleLocalizationTargetsUnmounted is implemented it's also been hooked into GFP deactivation, to mirror how HandleLocalizationTargetsMounted was hooked into GFP activation.

#rb anton.dunchev

[CL 32312744 by jamie dale in ue5-main branch]
2024-03-18 17:21:49 -04:00
jamie dale
87c34119f4 Don't mount localization data for explicitly loaded plugins by default
This allows them to separate their mounting and content loading into two phases, such as allowing a GFP to mount the plugin when "registered" and defer mounting the localization data until "activating".

Note: Anything that was calling one of the MountExplicitlyLoadedPlugin functions to load a plugin, will now need to also call MountExplicitlyLoadedPluginLocalizationData if it wants to also mount the localization data.

#rb anton.dunchev, Leon.Huang

[CL 32029617 by jamie dale in ue5-main branch]
2024-03-05 14:18:02 -05:00
jamie dale
edef03928d Don't load localization data for unmounted explicitly loaded plugins
[FYI] Leon.Huang
#rnx

[CL 31978251 by jamie dale in ue5-main branch]
2024-03-02 17:41:16 -05:00
matt breindel
3c6cf59c14 Infrastructure and general implementation of a new system for providing improve error messages when we skip loading a package during import because the plugin wasn't mounted. the plugin manager and the GameFeatureSubsystem now have an opportunity to provide additional information to the user about why the plugin wasn't loaded or the package wasn't found.
#jira UE-205029
[REVIEW] [at]will.brown [at]*eric.knapik [at]*danny.couture
[FYI] [at]francis.hurteau
#rb danny.couture, Eric.Knapik

[CL 31957199 by matt breindel in ue5-main branch]
2024-03-01 16:48:08 -05:00
will brown
9171aa0825 Added new function suite to return found plugins that are enabled. Updated the LoadBuiltInGameFeaturePlugins sort function to skip plugin dependencies that are not enabled for correctness however it does not impact the final EnabledPlugins list
#rb Eric.Knapik

[CL 31824835 by will brown in ue5-main branch]
2024-02-26 19:29:36 -05:00
david punsetmartinez
35b92de9d0 Keep shared reference of IPlugin instead of its raw pointer
[REVIEW] [at]dave.belanger [at]robert.manuszewski
#rb Dave.Belanger, Robert.Manuszewski

[CL 31808550 by david punsetmartinez in ue5-main branch]
2024-02-26 12:44:06 -05:00
will brown
1895b96763 Removing the UE_LOG bandaid now that the real solution is submitted. The log is also missing the file name context and it wasn't that helpful.
[CL 31779526 by will brown in ue5-main branch]
2024-02-23 17:17:31 -05:00
will brown
89e769075b In editor, optional plugin dependencies need to be compiled enabled or command line enabled otherwise they are ignored. Updated UBT to write out the BuildPlugins names to the target receipt or compiled into the executable.
#rb Joe.Kirchoff, Justin.Marcus
[FYI] Eric.Knapik

[CL 31774544 by will brown in ue5-main branch]
2024-02-23 15:23:25 -05:00
will brown
b22ae9215d Adding UE_LOG when the descriptor fails to read or parse as a bandaid. There is a race condition when calling FText::Format when FInternationalization is not initialized yet. The crash prevents the plugin name from outputing.
#rb bhavan.vaishnav
[FYI] guillaume.patry

[CL 31506576 by will brown in ue5-main branch]
2024-02-14 20:34:26 -05:00
josh adams
08e95db7d2 Fixed the warning that caused the original backout
[Backout] - CL31459949
[FYI] bob.tellez
Original CL Desc
-----------------------------------------------------------------
[Backout] - CL31443953
[FYI] Josh.Adams
Original CL Desc
-----------------------------------------------------------------
Phase 1 of the FConfigBranch changes:
Introduced FConfigBranch which maintains logic and data for each individual branch of GConfig (Engine, Game, Input, DeviceProfiles, etc), with static and dynamic layers
Introduced FConfigCommandStream which is how each layer is loaded, and Apply'd to an FConfigFile
Added a new way of making a "diff" of in-memory vs what's loaded, which creates an FConfigCommandStream that can be re-applied (more useful in Phase 2, see below)
Expectation is no visible differences from before this change, as it's mostly internal data structure changes
Phase 2 is where the functional changes will happen, with the dynamic layers being able to be removed at runtime, and the state of GConfig is maintained as expdected
The editor does maintain full state of where config values come from, so the "getini" command in the editor will show a lot more information now
Runtime will not keep any state, so unloading dynamic layers is not supported by default (running with -ConfigReplayMethod=1 or 2 will allow for it, but will use more memory)

#rb david.harvey
#jira UE-201472

[CL 31470013 by josh adams in ue5-main branch]
2024-02-14 08:59:25 -05:00