diff --git a/.github/workflows/build-windows-msvc.yml b/.github/workflows/build-windows-msvc.yml index ee642d711..6dd243048 100644 --- a/.github/workflows/build-windows-msvc.yml +++ b/.github/workflows/build-windows-msvc.yml @@ -9,7 +9,6 @@ concurrency: cancel-in-progress: true jobs: build-windows: - if: github.repository == 'TorqueGameEngines/Torque3D' name: ${{matrix.config.name}} runs-on: windows-latest strategy: diff --git a/.github/workflows/test-results-linux.yml b/.github/workflows/test-results-linux.yml index 23a6b7a23..7f61a8c5f 100644 --- a/.github/workflows/test-results-linux.yml +++ b/.github/workflows/test-results-linux.yml @@ -21,7 +21,6 @@ jobs: runos: ubuntu-latest, artifact-name: "torque3dLinuxGCCUnitTest" } - steps: - name: Download Linux Test Report uses: dawidd6/action-download-artifact@v2 diff --git a/Engine/source/console/arrayObject.cpp b/Engine/source/console/arrayObject.cpp index cfd25d6cb..d5eaffe98 100644 --- a/Engine/source/console/arrayObject.cpp +++ b/Engine/source/console/arrayObject.cpp @@ -404,6 +404,22 @@ void ArrayObject::uniqueKey() //----------------------------------------------------------------------------- +void ArrayObject::uniquePair() +{ + for (S32 i = 0; i < mArray.size(); i++) + { + for (S32 j = i + 1; j < mArray.size(); j++) + { + if (isEqual(mArray[i].key, mArray[j].key) && isEqual(mArray[i].value, mArray[j].value)) + { + erase(j); + j--; + } + } + } +} +//----------------------------------------------------------------------------- + void ArrayObject::duplicate(ArrayObject* obj) { empty(); @@ -740,6 +756,12 @@ DefineEngineMethod( ArrayObject, uniqueKey, void, (),, object->uniqueKey(); } +DefineEngineMethod(ArrayObject, uniquePair, void, (), , + "Removes any elements that have duplicated key and value pairs (leaving the first instance)") +{ + object->uniquePair(); +} + DefineEngineMethod( ArrayObject, duplicate, bool, ( ArrayObject* target ),, "Alters array into an exact duplicate of the target array.\n" "@param target ArrayObject to duplicate\n" ) diff --git a/Engine/source/console/arrayObject.h b/Engine/source/console/arrayObject.h index 81531b6c2..cde4f92b6 100644 --- a/Engine/source/console/arrayObject.h +++ b/Engine/source/console/arrayObject.h @@ -158,6 +158,10 @@ public: /// (keeps the first instance only) void uniqueKey(); + /// Removes any duplicate keys from the array + /// (keeps the first instance only) + void uniquePair(); + /// Makes this array an exact duplicate of another array void duplicate( ArrayObject *obj ); @@ -229,4 +233,4 @@ public: static void initPersistFields(); }; -#endif // _ARRAYOBJECT_H_ \ No newline at end of file +#endif // _ARRAYOBJECT_H_ diff --git a/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript b/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript index 905100648..fc6e0d33c 100644 --- a/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript +++ b/Templates/BaseGame/game/core/utility/scripts/helperFunctions.tscript @@ -650,7 +650,7 @@ function populateAllFonts() continue; %fontarray.push_back(%obj.fontType,%obj.fontSize); } - %fontarray.uniqueKey(); + %fontarray.uniquePair(); %fontarrayCount = %fontarray.count();