diff --git a/data/emulator.js b/data/emulator.js index 5df7fce..5fbcfb0 100644 --- a/data/emulator.js +++ b/data/emulator.js @@ -1847,241 +1847,241 @@ class EmulatorJS { let buttons; if (['nes', 'gb'].includes(this.getControlScheme())) { buttons = [ - {id: 8, label: 'A'}, - {id: 0, label: 'B'}, - {id: 2, label: 'SELECT'}, - {id: 3, label: 'START'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else if ('snes' === this.getControlScheme()) { buttons = [ - {id: 8, label: 'A'}, - {id: 0, label: 'B'}, - {id: 9, label: 'X'}, - {id: 1, label: 'Y'}, - {id: 2, label: 'SELECT'}, - {id: 3, label: 'START'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, - {id: 10, label: 'L'}, - {id: 11, label: 'R'}, + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 9, label: this.localization('X')}, + {id: 1, label: this.localization('Y')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, ]; } else if ('n64' === this.getControlScheme()) { buttons = [ - {id: 0, label: 'A'}, - {id: 1, label: 'B'}, - {id: 3, label: 'START'}, - {id: 4, label: 'D-PAD UP'}, - {id: 5, label: 'D-PAD DOWN'}, - {id: 6, label: 'D-PAD LEFT'}, - {id: 7, label: 'D-PAD RIGHT'}, - {id: 10, label: 'L'}, - {id: 11, label: 'R'}, - {id: 12, label: 'Z'}, - {id: 19, label: 'STICK UP'}, - {id: 18, label: 'STICK DOWN'}, - {id: 17, label: 'STICK LEFT'}, - {id: 16, label: 'STICK RIGHT'}, - {id: 23, label: 'C-PAD UP'}, - {id: 22, label: 'C-PAD DOWN'}, - {id: 21, label: 'C-PAD LEFT'}, - {id: 20, label: 'C-PAD RIGHT'}, + {id: 0, label: this.localization('A')}, + {id: 1, label: this.localization('B')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('D-PAD UP')}, + {id: 5, label: this.localization('D-PAD DOWN')}, + {id: 6, label: this.localization('D-PAD LEFT')}, + {id: 7, label: this.localization('D-PAD RIGHT')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 12, label: this.localization('Z')}, + {id: 19, label: this.localization('STICK UP')}, + {id: 18, label: this.localization('STICK DOWN')}, + {id: 17, label: this.localization('STICK LEFT')}, + {id: 16, label: this.localization('STICK RIGHT')}, + {id: 23, label: this.localization('C-PAD UP')}, + {id: 22, label: this.localization('C-PAD DOWN')}, + {id: 21, label: this.localization('C-PAD LEFT')}, + {id: 20, label: this.localization('C-PAD RIGHT')}, ]; } else if ('gba' === this.getControlScheme()) { buttons = [ - {id: 8, label: 'A'}, - {id: 0, label: 'B'}, - {id: 10, label: 'L'}, - {id: 11, label: 'R'}, - {id: 2, label: 'SELECT'}, - {id: 3, label: 'START'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else if ('nds' === this.getControlScheme()) { buttons = [ - {id: 8, label: 'A'}, - {id: 0, label: 'B'}, - {id: 9, label: 'X'}, - {id: 1, label: 'Y'}, - {id: 2, label: 'SELECT'}, - {id: 3, label: 'START'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, - {id: 10, label: 'L'}, - {id: 11, label: 'R'}, - {id: 14, label: 'Microphone'}, + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 9, label: this.localization('X')}, + {id: 1, label: this.localization('Y')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 14, label: this.localization('Microphone')}, ]; } else if ('vb' === this.getControlScheme()) { buttons = [ - {id: 8, label: 'A'}, - {id: 0, label: 'B'}, - {id: 10, label: 'L'}, - {id: 11, label: 'R'}, - {id: 2, label: 'SELECT'}, - {id: 3, label: 'START'}, - {id: 4, label: 'LEFT D-PAD UP'}, - {id: 5, label: 'LEFT D-PAD DOWN'}, - {id: 6, label: 'LEFT D-PAD LEFT'}, - {id: 7, label: 'LEFT D-PAD RIGHT'}, - {id: 19, label: 'RIGHT D-PAD UP'}, - {id: 18, label: 'RIGHT D-PAD DOWN'}, - {id: 17, label: 'RIGHT D-PAD LEFT'}, - {id: 16, label: 'RIGHT D-PAD RIGHT'}, + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('LEFT D-PAD UP')}, + {id: 5, label: this.localization('LEFT D-PAD DOWN')}, + {id: 6, label: this.localization('LEFT D-PAD LEFT')}, + {id: 7, label: this.localization('LEFT D-PAD RIGHT')}, + {id: 19, label: this.localization('RIGHT D-PAD UP')}, + {id: 18, label: this.localization('RIGHT D-PAD DOWN')}, + {id: 17, label: this.localization('RIGHT D-PAD LEFT')}, + {id: 16, label: this.localization('RIGHT D-PAD RIGHT')}, ]; } else if (['segaMD', 'segaCD', 'sega32x'].includes(this.getControlScheme())) { buttons = [ - {id: 1, label: 'A'}, - {id: 0, label: 'B'}, - {id: 8, label: 'C'}, - {id: 10, label: 'X'}, - {id: 9, label: 'Y'}, - {id: 11, label: 'Z'}, - {id: 3, label: 'START'}, - {id: 2, label: 'MODE'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 1, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 8, label: this.localization('C')}, + {id: 10, label: this.localization('X')}, + {id: 9, label: this.localization('Y')}, + {id: 11, label: this.localization('Z')}, + {id: 3, label: this.localization('START')}, + {id: 2, label: this.localization('MODE')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else if ('segaMS' === this.getControlScheme()) { buttons = [ - {id: 0, label: 'BUTTON 1 / START'}, - {id: 8, label: 'BUTTON 2'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 0, label: this.localization('BUTTON 1 / START')}, + {id: 8, label: this.localization('BUTTON 2')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else if ('segaGG' === this.getControlScheme()) { buttons = [ - {id: 0, label: 'BUTTON 1'}, - {id: 8, label: 'BUTTON 2'}, - {id: 3, label: 'START'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 0, label: this.localization('BUTTON 1')}, + {id: 8, label: this.localization('BUTTON 2')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else if ('segaSaturn' === this.getControlScheme()) { buttons = [ - {id: 1, label: 'A'}, - {id: 0, label: 'B'}, - {id: 8, label: 'C'}, - {id: 9, label: 'X'}, - {id: 10, label: 'Y'}, - {id: 11, label: 'Z'}, - {id: 12, label: 'L'}, - {id: 13, label: 'R'}, - {id: 3, label: 'START'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 1, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 8, label: this.localization('C')}, + {id: 9, label: this.localization('X')}, + {id: 10, label: this.localization('Y')}, + {id: 11, label: this.localization('Z')}, + {id: 12, label: this.localization('L')}, + {id: 13, label: this.localization('R')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else if ('3do' === this.getControlScheme()) { buttons = [ - {id: 1, label: 'A'}, - {id: 0, label: 'B'}, - {id: 8, label: 'C'}, - {id: 10, label: 'L'}, - {id: 11, label: 'R'}, - {id: 2, label: 'X'}, - {id: 3, label: 'P'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 1, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 8, label: this.localization('C')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 2, label: this.localization('X')}, + {id: 3, label: this.localization('P')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else if ('atari2600' === this.getControlScheme()) { buttons = [ - {id: 0, label: 'FIRE'}, - {id: 2, label: 'SELECT'}, - {id: 3, label: 'RESET'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, - {id: 10, label: 'LEFT DIFFICULTY A'}, - {id: 12, label: 'LEFT DIFFICULTY B'}, - {id: 11, label: 'RIGHT DIFFICULTY A'}, - {id: 13, label: 'RIGHT DIFFICULTY B'}, - {id: 14, label: 'COLOR'}, - {id: 15, label: 'B/W'}, + {id: 0, label: this.localization('FIRE')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('RESET')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 10, label: this.localization('LEFT DIFFICULTY A')}, + {id: 12, label: this.localization('LEFT DIFFICULTY B')}, + {id: 11, label: this.localization('RIGHT DIFFICULTY A')}, + {id: 13, label: this.localization('RIGHT DIFFICULTY B')}, + {id: 14, label: this.localization('COLOR')}, + {id: 15, label: this.localization('B/W')}, ]; } else if ('atari7800' === this.getControlScheme()) { buttons = [ - {id: 0, label: 'BUTTON 1'}, - {id: 8, label: 'BUTTON 2'}, - {id: 2, label: 'SELECT'}, - {id: 3, label: 'PAUSE'}, - {id: 9, label: 'RESET'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, - {id: 10, label: 'LEFT DIFFICULTY'}, - {id: 11, label: 'RIGHT DIFFICULTY'}, + {id: 0, label: this.localization('BUTTON 1')}, + {id: 8, label: this.localization('BUTTON 2')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('PAUSE')}, + {id: 9, label: this.localization('RESET')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 10, label: this.localization('LEFT DIFFICULTY')}, + {id: 11, label: this.localization('RIGHT DIFFICULTY')}, ]; } else if ('lynx' === this.getControlScheme()) { buttons = [ - {id: 8, label: 'A'}, - {id: 0, label: 'B'}, - {id: 10, label: 'OPTION 1'}, - {id: 11, label: 'OPTION 2'}, - {id: 3, label: 'START'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 10, label: this.localization('OPTION 1')}, + {id: 11, label: this.localization('OPTION 2')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else if ('jaguar' === this.getControlScheme()) { buttons = [ - {id: 8, label: 'A'}, - {id: 0, label: 'B'}, - {id: 1, label: 'C'}, - {id: 2, label: 'PAUSE'}, - {id: 3, label: 'OPTION'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, + {id: 8, label: this.localization('A')}, + {id: 0, label: this.localization('B')}, + {id: 1, label: this.localization('C')}, + {id: 2, label: this.localization('PAUSE')}, + {id: 3, label: this.localization('OPTION')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, ]; } else { buttons = [ - {id: 0, label: 'B'}, - {id: 1, label: 'Y'}, - {id: 2, label: 'SELECT'}, - {id: 3, label: 'START'}, - {id: 4, label: 'UP'}, - {id: 5, label: 'DOWN'}, - {id: 6, label: 'LEFT'}, - {id: 7, label: 'RIGHT'}, - {id: 8, label: 'A'}, - {id: 9, label: 'X'}, - {id: 10, label: 'L'}, - {id: 11, label: 'R'}, - {id: 12, label: 'L2'}, - {id: 13, label: 'R2'}, - {id: 14, label: 'L3'}, - {id: 15, label: 'R3'}, - {id: 19, label: 'L STICK UP'}, - {id: 18, label: 'L STICK DOWN'}, - {id: 17, label: 'L STICK LEFT'}, - {id: 16, label: 'L STICK RIGHT'}, - {id: 23, label: 'R STICK UP'}, - {id: 22, label: 'R STICK DOWN'}, - {id: 21, label: 'R STICK LEFT'}, - {id: 20, label: 'R STICK RIGHT'}, + {id: 0, label: this.localization('B')}, + {id: 1, label: this.localization('Y')}, + {id: 2, label: this.localization('SELECT')}, + {id: 3, label: this.localization('START')}, + {id: 4, label: this.localization('UP')}, + {id: 5, label: this.localization('DOWN')}, + {id: 6, label: this.localization('LEFT')}, + {id: 7, label: this.localization('RIGHT')}, + {id: 8, label: this.localization('A')}, + {id: 9, label: this.localization('X')}, + {id: 10, label: this.localization('L')}, + {id: 11, label: this.localization('R')}, + {id: 12, label: this.localization('L2')}, + {id: 13, label: this.localization('R2')}, + {id: 14, label: this.localization('L3')}, + {id: 15, label: this.localization('R3')}, + {id: 19, label: this.localization('L STICK UP')}, + {id: 18, label: this.localization('L STICK DOWN')}, + {id: 17, label: this.localization('L STICK LEFT')}, + {id: 16, label: this.localization('L STICK RIGHT')}, + {id: 23, label: this.localization('R STICK UP')}, + {id: 22, label: this.localization('R STICK DOWN')}, + {id: 21, label: this.localization('R STICK LEFT')}, + {id: 20, label: this.localization('R STICK RIGHT')}, ]; } if (['arcade', 'mame'].includes(this.getControlScheme())) { diff --git a/data/emulator.min.js b/data/emulator.min.js index 535c29c..4587cba 100644 --- a/data/emulator.min.js +++ b/data/emulator.min.js @@ -1 +1 @@ -!function(){var e,t;e=window,t=function(){return n=[function(e,t,n){"use strict";n.r(t);function b(e,t){var n=t.x-e.x,t=t.y-e.y;return Math.sqrt(n*n+t*t)}function _(e){return e*(Math.PI/180)}function o(e){f.has(e)&&clearTimeout(f.get(e)),f.set(e,setTimeout(e,100))}function s(e,t,n){for(var i,o=t.split(/[ ,]+/g),s=0;sthis.options.threshold){var r,l={};for(r in this.direction)this.direction.hasOwnProperty(r)&&(l[r]=this.direction[r]);var c={};for(r in this.direction={x:n,y:i,angle:t},e.direction=this.direction,l)l[r]===this.direction[r]&&(c[r]=!0);if(c.x&&c.y&&c.angle)return e;c.x&&c.y||this.trigger("plain",e),c.x||this.trigger("plain:"+n,e),c.y||this.trigger("plain:"+i,e),c.angle||this.trigger("dir dir:"+t,e)}else this.resetDirection();return e};var x=w;function E(e,t){this.nipples=[],this.idles=[],this.actives=[],this.ids=[],this.pressureIntervals={},this.manager=e,this.id=E.id,E.id+=1,this.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:.5,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},this.config(t),"static"!==this.options.mode&&"semi"!==this.options.mode||(this.options.multitouch=!1),this.options.multitouch||(this.options.maxNumberOfNipples=1);e=getComputedStyle(this.options.zone.parentElement);return e&&"flex"===e.display&&(this.parentIsFlex=!0),this.updateBox(),this.prepareNipples(),this.bindings(),this.begin(),this.nipples}E.prototype=new m,(E.constructor=E).id=0,E.prototype.prepareNipples=function(){var i=this.nipples;i.on=this.on.bind(this),i.off=this.off.bind(this),i.options=this.options,i.destroy=this.destroy.bind(this),i.ids=this.ids,i.id=this.id,i.processOnMove=this.processOnMove.bind(this),i.processOnEnd=this.processOnEnd.bind(this),i.get=function(e){if(void 0===e)return i[0];for(var t=0,n=i.length;t