Commit Graph

41 Commits

Author SHA1 Message Date
robert manuszewski
d1443992e1 Deprecating ANY_PACKAGE.
This change consists of multiple changes:

Core:
- Deprecation of ANY_PACKAGE macro. Added ANY_PACKAGE_DEPRECATED macro which can still be used for backwards compatibility purposes (only used in CoreUObject)
- Deprecation of StaticFindObjectFast* functions that take bAnyPackage parameter
- Added UStruct::GetStructPathName function that returns FTopLevelAssetPath representing the path name (package + object FName, super quick compared to UObject::GetPathName) + wrapper UClass::GetClassPathName to make it look better when used with UClasses
- Added (Static)FindFirstObject* functions that find a first object given its Name (no Outer). These functions are used in places I consider valid to do global UObject (UClass) lookups like parsing command line parameters / checking for unique object names
- Added static UClass::TryFindType function which serves a similar purpose as FindFirstObject however it's going to throw a warning (with a callstack / maybe ensure in the future?) if short class name is provided. This function is used  in places that used to use short class names but now should have been converted to use path names to catch any potential regressions and or edge cases I missed.
- Added static UClass::TryConvertShortNameToPathName utility function
- Added static UClass::TryFixShortClassNameExportPath utility function
- Object text export paths will now also include class path (Texture2D'/Game/Textures/Grass.Grass' -> /Script/Engine.Texture2D'/Game/Textures/Grass.Grass')
- All places that manually generated object export paths for objects will now use FObjectPropertyBase::GetExportPath
- Added a new startup test that checks for short type names in UClass/FProperty MetaData values

AssetRegistry:
- Deprecated any member variables (FAssetData / FARFilter) or functions that use FNames to represent class names and replaced them with FTopLevelAssetPath
- Added new member variables and new function overloads that use FTopLevelAssetPath to represent class names
- This also applies to a few other modules' APIs to match AssetRegistry changes

Everything else:
- Updated code that used ANY_PACKAGE (depending on the use case) to use FindObject(nullptr, PathToObject), UClass::TryFindType (used when path name is expected, warns if it's a short name) or FindFirstObject (usually for finding types based on user input but there's been a few legitimate use cases not related to user input)
- Updated code that used AssetRegistry API to use FTopLevelAssetPaths and USomeClass::StaticClass()->GetClassPathName() instead of GetFName()
- Updated meta data and hardcoded FindObject(ANY_PACKAGE, "EEnumNameOrClassName") calls to use path names

#jira UE-99463
#rb many.people
[FYI] Marcus.Wassmer
#preflight 629248ec2256738f75de9b32

#codereviewnumbers 20320742, 20320791, 20320799, 20320756, 20320809, 20320830, 20320840, 20320846, 20320851, 20320863, 20320780, 20320765, 20320876, 20320786

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20430220 via CL 20433854 via CL 20435474 via CL 20435484
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20448496 by robert manuszewski in ue5-main branch]
2022-06-01 03:46:59 -04:00
ben hoffman
39f8ee0c4b Exclude blueprint assets that have been marked for deletion in the content browser when we are building the enhanced input trigger defaults panel.
#jira UE-93458
#rb trivial
#preflight 62967495db7419b82988fed0
#rnx

[CL 20443183 by ben hoffman in ue5-main branch]
2022-05-31 17:56:10 -04:00
ben hoffman
390306e278 Fix cook error that was happening because the ActionDescription is built from a FString, and thus did not have a null FText namespace key.
#jira none
#rnx
#rb trivial
#preflight skip

[CL 20396995 by ben hoffman in ue5-main branch]
2022-05-27 15:04:52 -04:00
ben hoffman
48c2464350 For Input Action instance data that is flagged to trigger with "StartedAndTriggered" (i.e. started and triggered happen within the same frame) ensure that the "Started" delegate will always get called before the "Triggered" delegate. Before, "Triggered" was happening first because of the "TriggeredDelegates.Add(Binding->Clone())" logic, which would always put the "Started" event at the end of the array.
#jira UE-154115
#rb justin.hare
#preflight 628febb974630984fd50d947

[CL 20396192 by ben hoffman in ue5-main branch]
2022-05-27 14:09:39 -04:00
ben hoffman
d6421692ef Add an FText action description to UInputAction. Default the value to the name of the action with the common "IA_" prefix removed, and underscores replaced with white spaces. Change the category of the Input Mapping Context description field to be consistent with the input action's.
#jira none
#rb jules.blok
#preflight 62910255183e241099cbe25c

[CL 20395371 by ben hoffman in ue5-main branch]
2022-05-27 13:17:55 -04:00
ben hoffman
9ac12530cf Add display names to the Enhanced Input developer settings and the EI editor settings
#jira none
#preflight 628d4259347b7778b6d1a3fb
#rnx
#rb trivial

[CL 20356481 by ben hoffman in ue5-main branch]
2022-05-24 17:39:54 -04:00
ben hoffman
151a4ef653 Add a "Scale by delta time" input modifier. This can be useful for if you wanted to have your look input or something in here, and then you don't need to add an additional " * deltatime " call in your input code every time.
#jira none
#rb andy.davidson
#preflight 628adfa46278bd4e1e1e4671

[CL 20347974 by ben hoffman in ue5-main branch]
2022-05-24 10:23:48 -04:00
robert manuszewski
f8a812a32f Converting hardcoded short class/enum names to pathnames ahead of ANY_PACKAGE removal
#rb trivial
#jira UE-99463
#preflight 6288fd998828ea88c8aef3d0

#ROBOMERGE-OWNER: robert.manuszewski
#ROBOMERGE-AUTHOR: robert.manuszewski
#ROBOMERGE-SOURCE: CL 20314896 via CL 20314897 via CL 20314903 via CL 20314904
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v948-20297126)

[CL 20315214 by robert manuszewski in ue5-main branch]
2022-05-22 10:30:02 -04:00
ben hoffman
cfab426af9 Add a style set for Enhanced Input so that the asset types have custom icons.
#jira UE-148432
#rb benjamin.fox
#preflight 6286c320045aba22797a5687

[CL 20296433 by ben hoffman in ue5-main branch]
2022-05-20 12:13:19 -04:00
ben hoffman
76ed907f03 Enhanced Input: Add a "MetaData" pointer on the player mappable options. This will be really usefuil for devs if they wanted to define random stuff for each key mapping, like icons, maybe an ability asset, whatever you want.
#jira none
#rb trivial
#rnx
#preflight 6286649115019f647745be08

[CL 20283091 by ben hoffman in ue5-main branch]
2022-05-19 13:19:43 -04:00
ben hoffman
e423243c88 [Enhanced Input] Deprecated UInputMappingContext::UnmapAction because the name is a bit confusing. Create a new "UnmapAllKeysFromAction" function instead to be more explicit.
#jira UE-97032
#rb trivial
#preflight 627bf1b12d678960301a00b6

[CL 20145607 by ben hoffman in ue5-main branch]
2022-05-11 14:19:51 -04:00
lauren barnes
00c86da7f5 Adding AppStyle.h includes
#rb trivial

#ROBOMERGE-OWNER: lauren.barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20072361 via CL 20072577 via CL 20072706
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20105734 by lauren barnes in ue5-main branch]
2022-05-09 13:31:23 -04:00
Lauren Barnes
6248f8d412 Replacing legacy EditorStyle calls with AppStyle
#preflight 6272a74d2f6d177be3c6fdda
#rb Matt.Kuhlenschmidt

#ROBOMERGE-OWNER: Lauren.Barnes
#ROBOMERGE-AUTHOR: lauren.barnes
#ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
#ROBOMERGE-CONFLICT from-shelf

[CL 20105363 by Lauren Barnes in ue5-main branch]
2022-05-09 13:12:28 -04:00
ben hoffman
c2768da7a2 First pass at a "showdebug Devices" command that will display debug info about all current platform users and their connected input devices. This will display some basic information on the screen that will be really useful while testing all this on different platforms.
Note: For now this lives with Enhanced Input, but should probably go somewhere else as it doesn't actually depend on anything related to Enhanced Input. Ideally I think it should live in InputCore, but it cant because InputCore cannot depend on the "Engine" module which is where all the debug helpers are.

#jira UE-147805
#rb andy.davidson
#preflight 6275531bd8373707f21bcf76

[CL 20102045 by ben hoffman in ue5-main branch]
2022-05-09 09:53:40 -04:00
Matt Peters
d64cf41728 AssetRegistry includes (Engine Plugins): change #include "AssetData.h" -> #include "AssetRegistry/AssetData.h", and similar for the other moved AssetRegistry headers.
#rb Zousar.Shaker
#rnx
#preflight 6270563191629533ec2b6f6e

[CL 20017756 by Matt Peters in ue5-main branch]
2022-05-02 18:59:38 -04:00
ben hoffman
6a44e8145d Create accessors on the Enhaced Player input for the currently applied mapping contexts and mappings.
These functions will make it easier for people to extend this class, while still keeping the AppliedInputContext and EnhancedActionMappings properties const and non-mutable.

#jira none
#rb trivial
#preflight 626fe786264f78f46f766589

[CL 20008700 by ben hoffman in ue5-main branch]
2022-05-02 10:55:12 -04:00
ben hoffman
a46003c9e8 Add a missing 'ENHANCEDINPUT_API' to the Enhanced Input editor subsystem so that it can be used outside of the module
#jira none
#rb trivial
#rnx
#preflight 624dfe294c5db57ae60aad42

[CL 19656295 by ben hoffman in ue5-main branch]
2022-04-06 17:31:07 -04:00
ben hoffman
04eded9160 Set the display name on Player Mappable Input Configs correctly. They were previously "Bindable", but that naming isn't consistent
#jira none
#rb me
#rnx
#preflight skip

[CL 19608971 by ben hoffman in ue5-main branch]
2022-04-04 10:44:31 -04:00
ben hoffman
7c8249e388 Fix the "editCondition" metadata on the PlayerMappableOptions for enhanced input actions. This fixes the errors in the log as well as provides the proper edit condition behavior.
#jira UE-147760
#rb trivial
#rnx
#preflight skip

[CL 19608172 by ben hoffman in ue5-main branch]
2022-04-04 09:44:23 -04:00
ben hoffman
a81500a2d9 Fix a linux ASan error when shutting down the InputEditorModule. We can use ::StaticClass()->GetName because the UObject may be uninitalized already
#jira none
#rb none
#rnx
#preflight skip

[CL 19590001 by ben hoffman in ue5-main branch]
2022-04-01 12:19:08 -04:00
ben hoffman
0e0fe95da9 Refactor of the Enhanced Input Project Settings. This moves the Trigger and Modifier default value customizations to the "InputCustomizations" header file, and out of the InputEditorModule. This allows us to simply add a class customization for the Developer Settings, and combine the two setting panels.
#jira UE-144850
#rb andrew.davidson
#preflight 6245e42d8f066102242239d8

[CL 19577762 by ben hoffman in ue5-main branch]
2022-03-31 16:16:07 -04:00
ben hoffman
bf1436c011 Add Enhanced Input developer and Platform settings.
Create a "UEnhancedInputPlatformData" base class that can be subclassed in a blueprint and placed on specific platforms. By default, this object has a map of Input Contexts that will "redirect" one context to another. This makes it possible to swap out Input Mapping Contexts on specific platforms, with an asset that will simply be added to the input ini of the game.

#jira UE-144850
#preflight 6245cae4c51908059abd88b4
#rb andrew.davidson
#rb dave.jones2

[CL 19575308 by ben hoffman in ue5-main branch]
2022-03-31 13:45:38 -04:00
marc audy
f65e749eb3 Fix static initialization using /Script/CoreUObject before it is created causing crash in monolithic editor
[CODEREVIEW] Andrew.Davidson

#ROBOMERGE-AUTHOR: marc.audy
#ROBOMERGE-SOURCE: CL 19506837 via CL 19506844
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19514679 by marc audy in ue5-main branch]
2022-03-25 12:40:57 -04:00
ben hoffman
204cc669f9 Mark Enhanced Input as non-beta because it will be the default on option for 5.1
#jira UE-144847
#rb trivial
#rnx
#preflight 623a43eb10251d53d5797c77

[CL 19473019 by ben hoffman in ue5-main branch]
2022-03-22 18:11:15 -04:00
fabian giesen
490f937e80 Change FMath::Min/Max to fix two potholes with the current definitions
1. On custom types, they require overloads for operator <= and >= respectively; it's more idiomatic in C++ code for ordering predicates to rely solely on <
2. The current definition results in highly suboptimal code generation for floating-point types on x86 when compiling in IEEE compliant mode: https://godbolt.org/z/3zsYKaasc

In short, x86 min/max instructions are equivalent to "(a < b) ? a : b" and "(a > b) ? a : b", respectively. In the specific case where a=+0, b=-0 (IEEE signed zeros), then in comparisons +0 == -0, so we have both (a >= b) and (a <= b), but neither (a > b) nor (b < a). As a result, the original expressions for FMath::{Min,Max} return a (+0), while the changed expressions returns b (-0) in this particular case. (The a=-0, b=+0 case is analogous.)

Most code in UE currently compiles with /fp:fast or -ffast-math, which makes the compiler not respect signed zero behavior; see behavior with -fno-signed-zeros in the Compiler Explorer link. Because so much gets compiled with fast math semantics, behavior in this case was not reliable anyway. We might as well pick the definition that is efficient on x86 even without fast math.

#rb devin.doucette
#preflight 6239248304769ab4934cd0ea

[CL 19462511 by fabian giesen in ue5-main branch]
2022-03-21 21:36:48 -04:00