diff --git a/Content/Luprex/KeyClassification.uasset b/Content/Luprex/KeyClassification.uasset new file mode 100644 index 00000000..9d435ca2 --- /dev/null +++ b/Content/Luprex/KeyClassification.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d69e89f83f1ef5dcfb231a4877304cbbc29653dfb7dea30736c1941f4262ae1d +size 3542 diff --git a/Content/Luprex/lxGameMode.uasset b/Content/Luprex/lxGameMode.uasset index 2518b745..243772ec 100644 --- a/Content/Luprex/lxGameMode.uasset +++ b/Content/Luprex/lxGameMode.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2293be3fd5733841383cb79fc3e694810cb16d46b86dc548daeae7f0f070393d -size 160427 +oid sha256:6f465b15991e5dd80c9b723d0e84d3ccd54943c28a87eac3e42bbf748d9fce42 +size 162688 diff --git a/Content/Luprex/lxUtilityFunctionsLibrary.uasset b/Content/Luprex/lxUtilityFunctionsLibrary.uasset index 7f7d01f6..223942c0 100644 --- a/Content/Luprex/lxUtilityFunctionsLibrary.uasset +++ b/Content/Luprex/lxUtilityFunctionsLibrary.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e53473869803421b5cb99e4dafb1edd6afd9ff4b542781bace4b39e3e2c62a9 -size 58604 +oid sha256:8cc0a1943b9c1affeaec49235a9e7bc77fee4f868e2b2364dc218b020eeac97a +size 87318 diff --git a/Content/Luprex/lxWidgetMacroLibrary.uasset b/Content/Luprex/lxWidgetMacroLibrary.uasset index 05f063c9..4bf643f6 100644 --- a/Content/Luprex/lxWidgetMacroLibrary.uasset +++ b/Content/Luprex/lxWidgetMacroLibrary.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e233a68905766a7cba284a9b4b49e0ad5019a7053df6fd8735950b40f30dbeec -size 31967 +oid sha256:63f1f07b5ff207ab5f77eed372a6cd447e19b116d4889a447939b9ac0265ff40 +size 20802 diff --git a/Content/Tangibles/TAN_StaticMesh.uasset b/Content/Tangibles/TAN_StaticMesh.uasset index 340df287..1f6a87a2 100644 --- a/Content/Tangibles/TAN_StaticMesh.uasset +++ b/Content/Tangibles/TAN_StaticMesh.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:737637ce0b9987fdecfe20abf3739565de913fdbdb831af14acdffd45e0d04c4 -size 172370 +oid sha256:64f746902f07c06222553701dfa143d050a6ff193bcc80609e85f7be486aeb69 +size 182324 diff --git a/Content/Widgets/WB_Hotkey_Action.uasset b/Content/Widgets/WB_Hotkey_Action.uasset index b098b482..abcffe36 100644 --- a/Content/Widgets/WB_Hotkey_Action.uasset +++ b/Content/Widgets/WB_Hotkey_Action.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9cac355d17042d47ee9938e10ee870e0e98f811b0e9fae71993dd3c8b4abbbfa -size 38863 +oid sha256:64cdca92aaa13ffb556cf8a24805127a2e42cb882458d29cfa4f7bb50492fe33 +size 38872 diff --git a/Content/Widgets/WB_Hotkey_Image.uasset b/Content/Widgets/WB_Hotkey_Image.uasset index c95f87b7..183c8159 100644 --- a/Content/Widgets/WB_Hotkey_Image.uasset +++ b/Content/Widgets/WB_Hotkey_Image.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ade3654dc07f8d8c60e6621cf12bd7df1aee099fe3bbbc43ccbebc4a3d3967d -size 58296 +oid sha256:00a0a4a02702ea87c62eb7ee236a048da5f8f8bb0ed88b321a3e1786be3ce127 +size 65725 diff --git a/Content/Widgets/WB_Hotkeys.uasset b/Content/Widgets/WB_Hotkeys.uasset index 7789b4ec..8e0bc2bc 100644 --- a/Content/Widgets/WB_Hotkeys.uasset +++ b/Content/Widgets/WB_Hotkeys.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1049d4f84d4222621d7c28de7594201fb935fd16be325282ff823856098c7b2b -size 213050 +oid sha256:ab45f996326e89394f518dccbe83f0b741eb3f681ea829d8259e7c85d222585d +size 275157 diff --git a/Source/Integration/BlueprintErrors.cpp b/Source/Integration/BlueprintErrors.cpp index e9a4c357..8e5b3ddf 100644 --- a/Source/Integration/BlueprintErrors.cpp +++ b/Source/Integration/BlueprintErrors.cpp @@ -134,6 +134,15 @@ FFormatArgumentData UlxFormatDataLibrary::FormatArgumentDataName(FName Value, co return Result; } +FFormatArgumentData UlxFormatDataLibrary::FormatArgumentDataKey(FKey Value, const FString &Name) +{ + FFormatArgumentData Result; + Result.ArgumentValueType = EFormatArgumentType::Text; + Result.ArgumentName = Name; + Result.ArgumentValue = UKismetTextLibrary::Conv_NameToText(Value.GetFName()); + return Result; +} + FFormatArgumentData UlxFormatDataLibrary::FormatArgumentDataGender(ETextGender Value, const FString &Name) { FFormatArgumentData Result; diff --git a/Source/Integration/BlueprintErrors.h b/Source/Integration/BlueprintErrors.h index 0230d139..aab88d42 100644 --- a/Source/Integration/BlueprintErrors.h +++ b/Source/Integration/BlueprintErrors.h @@ -125,6 +125,9 @@ public: UFUNCTION(BlueprintPure, meta = (BlueprintInternalUseOnly = "true"), Category = "Luprex|Utility") static FFormatArgumentData FormatArgumentDataName(FName Value, const FString &Name); + UFUNCTION(BlueprintPure, meta = (BlueprintInternalUseOnly = "true"), Category = "Luprex|Utility") + static FFormatArgumentData FormatArgumentDataKey(FKey Value, const FString &Name); + UFUNCTION(BlueprintPure, meta = (BlueprintInternalUseOnly = "true"), Category = "Luprex|Utility") static FFormatArgumentData FormatArgumentDataGender(ETextGender Value, const FString &Name); diff --git a/Source/Integration/CommonTypes.h b/Source/Integration/CommonTypes.h index ac4d733c..9bc0f13d 100644 --- a/Source/Integration/CommonTypes.h +++ b/Source/Integration/CommonTypes.h @@ -37,6 +37,12 @@ enum class ElxSuccessOrError : uint8 { Error, }; +UENUM(BlueprintType) +enum class ElxValidOrNotValid : uint8 { + Valid, + NotValid, +}; + UENUM(BlueprintType) enum class ElxFoundOrNotFound : uint8 { Found, diff --git a/Source/Integration/UtilityLibrary.cpp b/Source/Integration/UtilityLibrary.cpp index 9e9351d0..6fd2a954 100644 --- a/Source/Integration/UtilityLibrary.cpp +++ b/Source/Integration/UtilityLibrary.cpp @@ -227,3 +227,14 @@ ElxUsedOrNotUsed UlxUtilityLibrary::IsKeyUsedByMappingContext(const FKey &Key, c return ElxUsedOrNotUsed::NotUsed; } +FKey UlxUtilityLibrary::GetKeyByName(const FName &Name) +{ + FKey Key = FKey(Name); + return Key.IsValid() ? Key : FKey(); +} + +FKey UlxUtilityLibrary::GetKeyByNameString(const FString &Name) +{ + FKey Key = FKey(FName(*Name)); + return Key.IsValid() ? Key : FKey(); +} diff --git a/Source/Integration/UtilityLibrary.h b/Source/Integration/UtilityLibrary.h index 55482f55..adbc5eda 100644 --- a/Source/Integration/UtilityLibrary.h +++ b/Source/Integration/UtilityLibrary.h @@ -140,4 +140,18 @@ public: // UFUNCTION(BlueprintCallable, Category = "Input", meta = (ExpandEnumAsExecs="ReturnValue")) static ElxUsedOrNotUsed IsKeyUsedByMappingContext(const FKey &Key, const UInputMappingContext *MappingContext); + + // Get a key by name. + // + // Returns the null key if there is no such key. + // + UFUNCTION(BlueprintPure, Category = "Input|Key") + static FKey GetKeyByName(const FName &Name); + + // Get a key by name string. + // + // Returns the null key if there is no such key. + // + UFUNCTION(BlueprintPure, Category = "Input|Key") + static FKey GetKeyByNameString(const FString &Name); }; diff --git a/luprex/lua/login.lua b/luprex/lua/login.lua index 73493b0c..23df8ad6 100644 --- a/luprex/lua/login.lua +++ b/luprex/lua/login.lua @@ -19,15 +19,15 @@ function engio.move(action, xyz, facing) end function cube.lookhotkeys(keys) - keys:add("X", "Cube Hi", function () dprint("Cube Hi") end) - keys:add("A", "Cube Bye", function () dprint("Cube Bye") end) - keys:add("Y", "Cube Yo", function () dprint("Cube Yo") end) + keys:add("Z", "Cube Hi", function () dprint("Doing Cube Hi") end) + keys:add("X", "Cube Bye", function () dprint("Doing Cube Bye") end) + keys:add("C", "Cube Yo", function () dprint("Doing Cube Yo") end) end function sphere.lookhotkeys(keys) - keys:add("X", "Sphere Hi", function () dprint("Sphere Hi") end) - keys:add("A", "Sphere Bye", function () dprint("Sphere Bye") end) - keys:add("Y", "Sphere Yo", function () dprint("Sphere Yo") end) + keys:add("Z", "Sphere Hi", function () dprint("Doing Sphere Hi") end) + keys:add("X", "Sphere Bye", function () dprint("Doing Sphere Bye") end) + keys:add("C", "Sphere Yo", function () dprint("Doing Sphere Yo") end) end @@ -58,3 +58,19 @@ function engio.getlookat() return "" end +function engio.presshotkey(action) + local class = tangible.getclass(tangible.place()) + + -- if the tangible doesn't have a 'lookhotkeys' function, do nothing + if class == nil or class.lookhotkeys == nil then + return + end + + local press = hotkeypress.create(action) + class.lookhotkeys(press) + local closure = press.closure + if closure ~= nil then + closure() + end +end +