You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Add array element type to get_connected_joypads
This commit is contained in:
@@ -1401,8 +1401,8 @@ String Input::get_joy_guid(int p_device) const {
|
|||||||
return joy_names[p_device].uid;
|
return joy_names[p_device].uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
Array Input::get_connected_joypads() {
|
TypedArray<int> Input::get_connected_joypads() {
|
||||||
Array ret;
|
TypedArray<int> ret;
|
||||||
HashMap<int, Joypad>::Iterator elem = joy_names.begin();
|
HashMap<int, Joypad>::Iterator elem = joy_names.begin();
|
||||||
while (elem) {
|
while (elem) {
|
||||||
if (elem->value.connected) {
|
if (elem->value.connected) {
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "core/os/keyboard.h"
|
#include "core/os/keyboard.h"
|
||||||
#include "core/os/thread_safe.h"
|
#include "core/os/thread_safe.h"
|
||||||
#include "core/templates/rb_set.h"
|
#include "core/templates/rb_set.h"
|
||||||
|
#include "core/variant/typed_array.h"
|
||||||
|
|
||||||
class Input : public Object {
|
class Input : public Object {
|
||||||
GDCLASS(Input, Object);
|
GDCLASS(Input, Object);
|
||||||
@@ -259,7 +260,7 @@ public:
|
|||||||
|
|
||||||
float get_joy_axis(int p_device, JoyAxis p_axis) const;
|
float get_joy_axis(int p_device, JoyAxis p_axis) const;
|
||||||
String get_joy_name(int p_idx);
|
String get_joy_name(int p_idx);
|
||||||
Array get_connected_joypads();
|
TypedArray<int> get_connected_joypads();
|
||||||
Vector2 get_joy_vibration_strength(int p_device);
|
Vector2 get_joy_vibration_strength(int p_device);
|
||||||
float get_joy_vibration_duration(int p_device);
|
float get_joy_vibration_duration(int p_device);
|
||||||
uint64_t get_joy_vibration_timestamp(int p_device);
|
uint64_t get_joy_vibration_timestamp(int p_device);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="get_connected_joypads">
|
<method name="get_connected_joypads">
|
||||||
<return type="Array" />
|
<return type="int[]" />
|
||||||
<description>
|
<description>
|
||||||
Returns an [Array] containing the device IDs of all currently connected joypads.
|
Returns an [Array] containing the device IDs of all currently connected joypads.
|
||||||
</description>
|
</description>
|
||||||
|
|||||||
Reference in New Issue
Block a user