@@ -140,9 +140,9 @@ function fetchAndUpdatePlayerInfo() {
140140 const isLogout = ! cookieSessionId && loginToken && cookieSessionId !== loginToken ;
141141 if ( isLogin || isLogout ) {
142142 loginToken = isLogin ? cookieSessionId : null ;
143- const ptr = Module . allocate ( Module . intArrayFromString ( isLogin ? loginToken : '' ) , Module . ALLOC_NORMAL ) ;
144- Module . _SetSessionToken ( ptr ) ;
145- Module . _free ( ptr ) ;
143+ const ptr = easyrpgPlayer . allocate ( easyrpgPlayer . intArrayFromString ( isLogin ? loginToken : '' ) , easyrpgPlayer . ALLOC_NORMAL ) ;
144+ easyrpgPlayer . _SetSessionToken ( ptr ) ;
145+ easyrpgPlayer . _free ( ptr ) ;
146146 }
147147 apiFetch ( 'info' )
148148 . then ( response => response . json ( ) )
@@ -480,8 +480,8 @@ function onReceiveInputFeedback(inputId) {
480480 config [ configKey ] = toggled ;
481481 updateConfig ( isGlobal ? globalConfig : config , isGlobal ) ;
482482 if ( configKey === 'mute' ) {
483- Module . _SetSoundVolume ( toggled ? 0 : globalConfig . soundVolume ) ;
484- Module . _SetMusicVolume ( toggled ? 0 : globalConfig . musicVolume ) ;
483+ easyrpgPlayer . _SetSoundVolume ( toggled ? 0 : globalConfig . soundVolume ) ;
484+ easyrpgPlayer . _SetMusicVolume ( toggled ? 0 : globalConfig . musicVolume ) ;
485485 }
486486 }
487487 }
@@ -741,7 +741,7 @@ document.getElementById('privateModeButton').onclick = function () {
741741 if ( connStatus == 1 || connStatus == 3 )
742742 onUpdateConnectionStatus ( config . privateMode ? 3 : 1 ) ;
743743
744- Module . _SessionReady ( ) ;
744+ easyrpgPlayer . _SessionReady ( ) ;
745745} ;
746746
747747let reconnectCooldownTimer ;
@@ -877,8 +877,8 @@ document.getElementById('clearChatButton').onclick = function () {
877877document . getElementById ( 'settingsButton' ) . onclick = ( ) => openModal ( 'settingsModal' ) ;
878878
879879document . getElementById ( 'muteButton' ) . onclick = function ( ) {
880- if ( Module . INITIALIZED )
881- Module . _ToggleMute ( ) ;
880+ if ( easyrpgPlayer . INITIALIZED )
881+ easyrpgPlayer . _ToggleMute ( ) ;
882882} ;
883883
884884document . getElementById ( 'soundVolume' ) . oninput = function ( ) {
@@ -902,13 +902,13 @@ document.getElementById('lang').onchange = function () {
902902} ;
903903
904904document . getElementById ( 'nametagMode' ) . onchange = function ( ) {
905- if ( Module . INITIALIZED )
906- Module . _SetNametagMode ( this . value ) ;
905+ if ( easyrpgPlayer . INITIALIZED )
906+ easyrpgPlayer . _SetNametagMode ( this . value ) ;
907907} ;
908908
909909document . getElementById ( 'playerSoundsButton' ) . onclick = ( ) => {
910- if ( Module . INITIALIZED )
911- Module . _TogglePlayerSounds ( ) ;
910+ if ( easyrpgPlayer . INITIALIZED )
911+ easyrpgPlayer . _TogglePlayerSounds ( ) ;
912912} ;
913913
914914if ( gameId === '2kki' ) {
@@ -1448,7 +1448,7 @@ document.onmousemove = function () {
14481448function setLang ( lang , isInit ) {
14491449 globalConfig . lang = lang ;
14501450 if ( isInit && gameIds . indexOf ( gameId ) > - 1 )
1451- Module . EASYRPG_LANGUAGE = ( gameDefaultLangs . hasOwnProperty ( gameId ) ? gameDefaultLangs [ gameId ] !== lang : lang !== 'en' ) ? lang : 'default' ;
1451+ easyrpgPlayer . language = ( gameDefaultLangs . hasOwnProperty ( gameId ) ? gameDefaultLangs [ gameId ] !== lang : lang !== 'en' ) ? lang : 'default' ;
14521452 initLocalization ( isInit ) ;
14531453 if ( ! isInit )
14541454 updateConfig ( globalConfig , true ) ;
@@ -1463,8 +1463,8 @@ function setName(name, isInit) {
14631463function setSoundVolume ( value , isInit ) {
14641464 if ( isNaN ( value ) )
14651465 return ;
1466- if ( Module . INITIALIZED && ! config . mute )
1467- Module . _SetSoundVolume ( value ) ;
1466+ if ( easyrpgPlayer . INITIALIZED && ! config . mute )
1467+ easyrpgPlayer . _SetSoundVolume ( value ) ;
14681468 globalConfig . soundVolume = value ;
14691469 if ( ! isInit )
14701470 updateConfig ( globalConfig , true ) ;
@@ -1473,8 +1473,8 @@ function setSoundVolume(value, isInit) {
14731473function setMusicVolume ( value , isInit ) {
14741474 if ( isNaN ( value ) )
14751475 return ;
1476- if ( Module . INITIALIZED && ! config . mute )
1477- Module . _SetMusicVolume ( value ) ;
1476+ if ( easyrpgPlayer . INITIALIZED && ! config . mute )
1477+ easyrpgPlayer . _SetMusicVolume ( value ) ;
14781478 globalConfig . musicVolume = value ;
14791479 if ( ! isInit )
14801480 updateConfig ( globalConfig , true ) ;
0 commit comments