-Fixed changes to default input actions not working, closes #10502

-Added Array.duplicate() method, needed to fix above
This commit is contained in:
Juan Linietsky 2017-09-06 18:13:05 -03:00
parent 0b8fa1e010
commit c771e03ee2
4 changed files with 19 additions and 4 deletions

View file

@ -210,6 +210,17 @@ const Variant &Array::get(int p_idx) const {
return operator[](p_idx);
}
Array Array::duplicate() const {
Array new_arr;
int element_count = size();
new_arr.resize(element_count);
for (int i = 0; i < element_count; i++) {
new_arr[i] = get(i);
}
return new_arr;
}
struct _ArrayVariantSort {
_FORCE_INLINE_ bool operator()(const Variant &p_l, const Variant &p_r) const {