PageSourceSearch

https://bakerfury.netlify.app/gdjs-evtsext__gamepads__connectedgamepadscount-func.js

js bakerfury.netlify.app collected 2026-10-03 10:30:19 UTC 3,029 bytes, 98 lines download raw bytes

1
2if (typeof gdjs.evtsExt__Gamepads__ConnectedGamepadsCount !== "undefined") {
3  gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.registeredGdjsCallbacks.forEach(callback =>
4    gdjs._unregisterCallback(callback)
5  );
6}
7
8gdjs.evtsExt__Gamepads__ConnectedGamepadsCount = {};
9
10
11gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.userFunc0xb74f68 = function(runtimeScene, eventsFunctionContext) {
12"use strict";
13/** @type {Gamepad[]} */
14const gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webkitGetGamepads ? navigator.webkitGetGamepads() : []);
15
16// Gamepads can be disconnected and become null, so we have to filter them.
17eventsFunctionContext.returnValue = Object.keys(gamepads).filter(key => !!gamepads[key]).length;
18
19};
20gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.eventsList0 = function(runtimeScene, eventsFunctionContext) {
21
22{
23
24
25let isConditionTrue_0 = false;
26{
27}
28
29}
30
31
32{
33
34
35gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.userFunc0xb74f68(runtimeScene, typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined);
36
37}
38
39
40};
41
42gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.func = function(runtimeScene, parentEventsFunctionContext) {
43var eventsFunctionContext = {
44  _objectsMap: {
45},
46  _objectArraysMap: {
47},
48  _behaviorNamesMap: {
49},
50  getObjects: function(objectName) {
51    return eventsFunctionContext._objectArraysMap[objectName] || [];
52  },
53  getObjectsLists: function(objectName) {
54    return eventsFunctionContext._objectsMap[objectName] || null;
55  },
56  getBehaviorName: function(behaviorName) {
57    return eventsFunctionContext._behaviorNamesMap[behaviorName] || behaviorName;
58  },
59  createObject: function(objectName) {
60    const objectsList = eventsFunctionContext._objectsMap[objectName];
61    if (objectsList) {
62      const object = parentEventsFunctionContext ?
63        parentEventsFunctionContext.createObject(objectsList.firstKey()) :
64        runtimeScene.createObject(objectsList.firstKey());
65      if (object) {
66        objectsList.get(objectsList.firstKey()).push(object);
67        eventsFunctionContext._objectArraysMap[objectName].push(object);
68      }
69      return object;    }
70    return null;
71  },
72  getInstancesCountOnScene: function(objectName) {
73    const objectsList = eventsFunctionContext._objectsMap[objectName];
74    let count = 0;
75    if (objectsList) {
76      for(const objectName in objectsList.items)
77        count += parentEventsFunctionContext ?
78parentEventsFunctionContext.getInstancesCountOnScene(objectName) :
79        runtimeScene.getInstancesCountOnScene(objectName);
80    }
81    return count;
82  },
83  getLayer: function(layerName) {
84    return runtimeScene.getLayer(layerName);
85  },
86  getArgument: function(argName) {
87    return "";
88  },
89  getOnceTriggers: function() { return runtimeScene.getOnceTriggers(); }
90};
91
92
93gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.eventsList0(runtimeScene, eventsFunctionContext);
94
95return Number(eventsFunctionContext.returnValue) || 0;
96}
97
98gdjs.evtsExt__Gamepads__ConnectedGamepadsCount.registeredGdjsCallbacks = [];

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.