Update gamepad handler, bump version

This commit is contained in:
Ethan O'Brien 2023-03-07 10:07:38 -06:00
parent 5d985fd239
commit d1d66a776c
4 changed files with 14 additions and 30 deletions

View file

@ -6837,14 +6837,17 @@ window.EJS_main = function(_0xa88a13, _0x17edbf, _0x2c1832) {
return path
}
try {
const logID = new Date().getTime() + '-' + Math.floor(Math.random() * 1000);
_0x470424({
config: _0x2ba0e6,
domain: window.location.hostname,
page: window.location.href
page: window.location.href,
id: logID
});
console.log("Error Reporting ID:", logID);
} catch(e) {};
this.localization = e => {return e};
this.version = '3.1.5';
this.version = '3.1.6';
this.system = '';
this.adUrl = null;
this.gameName = null;

View file

@ -89,17 +89,11 @@ var EJS = function(_0x574f5e) {
}
}, null, null, null, null, function(module) {
// Project located at https://github.com/ethanaobrien/gamepad
class Gamepad {
class GamepadHandler {
gamepads;
timeout;
listeners;
constructor() {
if (!navigator.getGamepads && !navigator.webkitGetGamepads) {
throw new Error("Get gamepads not found!");
}
if (!window.setTimeout) {
throw new Error("setTimeout was not found!");
}
this.gamepads = [];
this.listeners = {};
this.timeout = null;
@ -126,20 +120,7 @@ var EJS = function(_0x574f5e) {
oldGamepad.axes.forEach((axis, axisIndex) => {
if (gamepad.axes[axisIndex] !== axis) {
const axis = function(index) {
switch (index) {
case 0:
return 'LEFT_STICK_X';
case 1:
return 'LEFT_STICK_Y';
case 2:
return 'RIGHT_STICK_X';
case 3:
return 'RIGHT_STICK_Y';
default:
return null;
}
}(axisIndex);
const axis = ['LEFT_STICK_X', 'LEFT_STICK_Y', 'RIGHT_STICK_X', 'RIGHT_STICK_Y'][axisIndex];
if (!axis) return;
this.dispatchEvent('axischanged', {axis: axis, value: gamepad.axes[axisIndex], index: gamepad.index, gamepadIndex: gamepad.index});
}
@ -198,7 +179,7 @@ var EJS = function(_0x574f5e) {
this.listeners[name.toLowerCase()] = cb;
}
}
module.exports = Gamepad;
module.exports = GamepadHandler;
}, null, null, null, null, function(module, _0x4f5203, _0x5028a6) {
const _0x33171 = function(inUrl, opts) {
let url;

View file

@ -1,5 +1,5 @@
(async function() {
let VERSION = 31.5;
let VERSION = 31.6;
if ((window.location && ['localhost', '127.0.0.1'].includes(location.hostname)) ||
'undefined' != typeof EJS_DEBUG_XX && true === EJS_DEBUG_XX) {
fetch('https://raw.githack.com/EmulatorJS/EmulatorJS/main/data/version.json').then(response => {

View file

@ -1 +1 @@
{ "current_version": 31.5 }
{ "current_version": 31.6 }