From c39ec970f161562e4848761f4d46269daa197294 Mon Sep 17 00:00:00 2001 From: OleSTEEP Date: Tue, 6 Feb 2024 23:56:10 +0300 Subject: [PATCH] Move all engine changes into plugin --- www.eng/js/plugins.js | 7 + www.eng/js/plugins/VND_OmoriFixes.js | 189 +++++++++++++++++++++++++++ www.eng/js/rpg_core.js | 55 ++++---- www.eng/js/rpg_managers.js | 11 +- www.eng/js/rpg_objects.js | 1 - www.rus/js/plugins.js | 7 + www.rus/js/plugins/VND_OmoriFixes.js | 189 +++++++++++++++++++++++++++ www.rus/js/rpg_core.js | 55 ++++---- www.rus/js/rpg_managers.js | 11 +- www.rus/js/rpg_objects.js | 1 - 10 files changed, 452 insertions(+), 74 deletions(-) create mode 100644 www.eng/js/plugins/VND_OmoriFixes.js create mode 100644 www.rus/js/plugins/VND_OmoriFixes.js diff --git a/www.eng/js/plugins.js b/www.eng/js/plugins.js index 8dc7cd8..1b0273e 100644 --- a/www.eng/js/plugins.js +++ b/www.eng/js/plugins.js @@ -73,6 +73,13 @@ var $plugins = [ "parameters": {} }, + { + "name": "VND_OmoriFixes", + "status": true, + "description": "Some fixes for android platform", + "parameters": + {} + }, { "name": "YEP_CoreEngine", "status": true, diff --git a/www.eng/js/plugins/VND_OmoriFixes.js b/www.eng/js/plugins/VND_OmoriFixes.js new file mode 100644 index 0000000..5a3a7a5 --- /dev/null +++ b/www.eng/js/plugins/VND_OmoriFixes.js @@ -0,0 +1,189 @@ +// by VienDesu! 2023 + +//============================================================================= +// * Patches for rpg_core +//============================================================================= + +Bitmap.prototype._requestImage = function (url) { + if (Bitmap._reuseImages.length !== 0) { + this._image = Bitmap._reuseImages.pop(); + } else { + this._image = new Image(); + } + + url = replaceSpecialSymbols(url); + url = require("fs").cachedAlternativeName(url); + + if (this._decodeAfterRequest && !this._loader) { + this._loader = ResourceHandler.createLoader(url, this._requestImage.bind(this, url), this._onError.bind(this)); + } + + this._image = new Image(); + this._url = url; + this._loadingState = 'requesting'; + + if (!Decrypter.checkImgIgnore(url) && Decrypter.hasEncryptedImages) { + this._loadingState = 'decrypting'; + Decrypter.decryptImg(url, this); + } else { + this._image.src = encodeURI(url); + + this._image.addEventListener('load', this._loadListener = Bitmap.prototype._onLoad.bind(this)); + this._image.addEventListener('error', this._errorListener = this._loader || Bitmap.prototype._onError.bind(this)); + } +}; + +Graphics.printLoadingError = function (url) { + if (this._errorPrinter && !this._errorShowed) { + this._errorPrinter.innerHTML = this._makeErrorHtml('Loading Error', 'Failed to load: ' + url); + var button = document.createElement('button'); + button.innerHTML = 'Retry'; + button.style.fontSize = '24px'; + button.style.color = '#000000'; + button.style.backgroundColor = '#000000'; + button.onmousedown = button.ontouchstart = function (event) { + ResourceHandler.retry(); + event.stopPropagation(); + }; + this._errorPrinter.appendChild(button); + this._loadingCount = -Infinity; + } +}; + +Graphics._switchFPSMeter = function() { + +}; + +Graphics._switchFullScreen = function () { + this._requestFullScreen(); +}; + +Graphics._isFullScreen = function () { + return true; +}; + +Graphics._requestFullScreen = function () { + try { + var element = document.body; + if (element.requestFullScreen) { + element.requestFullScreen(); + } else if (element.mozRequestFullScreen) { + element.mozRequestFullScreen(); + } else if (element.webkitRequestFullScreen) { + element.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); + } else if (element.msRequestFullscreen) { + element.msRequestFullscreen(); + } + } catch (e) { + console.log(`Fullscreen request denied! %s`, e) + } +}; + +Input._wrapNwjsAlert = function () { + if (Utils.isNwjs()) { + var _alert = window.alert; + window.alert = function () { + var gui = require('nw.gui'); + var win = gui.window; + _alert.apply(this, arguments); + win.focus(); + Input.clear(); + }; + } +}; + +Input._setupEventHandlers = function () { + document.addEventListener('keydown', this._onKeyDown.bind(this)); + document.addEventListener('keyup', this._onKeyUp.bind(this)); +}; + +TouchInput.update = function () { + return; +}; + +//============================================================================= +// * Patches for rpg_managers +//============================================================================= + +DataManager.loadDataFile = function (name, src) { + var xhr = new XMLHttpRequest(); + var url = _dfs.cachedAlternativeName('data/' + src); + xhr.open('GET', url); + xhr.overrideMimeType('application/json'); + xhr.onload = function () { + if (xhr.status < 400) { + window[name] = JSON.parse(xhr.responseText); + DataManager.onLoad(window[name]); + } + }; + xhr.onerror = this._mapLoader || function () { + DataManager._errorUrl = DataManager._errorUrl || url; + }; + window[name] = null; + xhr.send(); +}; + +ImageManager.loadBitmap = function (folder, filename, hue, smooth) { + if (filename) { + var path = folder + filename + '.png'; + var bitmap = this.loadNormalBitmap(path, hue || 0); + bitmap.smooth = smooth; + return bitmap; + } else { + return this.loadEmptyBitmap(); + } +}; + +ImageManager.loadNormalBitmap = function (path, hue) { + var key = this._generateCacheKey(path, hue); + var bitmap = this._imageCache.get(key); + if (!bitmap) { + bitmap = Bitmap.load(decodeURIComponent(replaceSpecialSymbols(path))); + bitmap.addLoadListener(function () { + bitmap.rotateHue(hue); + }); + this._imageCache.add(key, bitmap); + } else if (!bitmap.isReady()) { + bitmap.decode(); + } + + return bitmap; +}; + +SceneManager.initNwjs = function () { + if (Utils.isNwjs()) { + var gui = require('nw.gui'); + var win = gui.window; + if (process.platform === 'darwin' && !win.menu) { + var menubar = new gui.Menu({ type: 'menubar' }); + var option = { hideEdit: true, hideWindow: true }; + menubar.createMacBuiltin('Game', option); + win.menu = menubar; + } + } +}; + +SceneManager.onKeyDown = function (event) { + if (!event.ctrlKey && !event.altKey) { + switch (event.keyCode) { + case 116: // F5 + if (Utils.isNwjs()) { + location.reload(); + } + break; + case 119: // F8 + if (Utils.isNwjs() && Utils.isOptionValid('test')) { + require('nw.gui').window.showDevTools(); + } + break; + } + } +}; + +//============================================================================= +// * Patches for rpg_objects +//============================================================================= + +Game_Temp.prototype.setDestination = function (x, y) { + return; +}; diff --git a/www.eng/js/rpg_core.js b/www.eng/js/rpg_core.js index b50fd61..f07dd91 100644 --- a/www.eng/js/rpg_core.js +++ b/www.eng/js/rpg_core.js @@ -1671,9 +1671,6 @@ Bitmap.prototype._requestImage = function (url) { this._image = new Image(); } - url = replaceSpecialSymbols(url); - url = require("fs").cachedAlternativeName(url); - if (this._decodeAfterRequest && !this._loader) { this._loader = ResourceHandler.createLoader(url, this._requestImage.bind(this, url), this._onError.bind(this)); } @@ -1686,7 +1683,7 @@ Bitmap.prototype._requestImage = function (url) { this._loadingState = 'decrypting'; Decrypter.decryptImg(url, this); } else { - this._image.src = encodeURI(url); + this._image.src = url; this._image.addEventListener('load', this._loadListener = Bitmap.prototype._onLoad.bind(this)); this._image.addEventListener('error', this._errorListener = this._loader || Bitmap.prototype._onError.bind(this)); @@ -1997,7 +1994,7 @@ Graphics.printLoadingError = function (url) { var button = document.createElement('button'); button.innerHTML = 'Retry'; button.style.fontSize = '24px'; - button.style.color = '#000000'; + button.style.color = '#ffffff'; button.style.backgroundColor = '#000000'; button.onmousedown = button.ontouchstart = function (event) { ResourceHandler.retry(); @@ -2866,23 +2863,23 @@ Graphics._onTouchEnd = function (event) { } }; -///** -// * @static -// * @method _switchFPSMeter -// * @private -// */ -//Graphics._switchFPSMeter = function() { -// if (this._fpsMeter.isPaused) { -// this.showFps(); -// this._fpsMeter.showFps(); -// this._fpsMeterToggled = false; -// } else if (!this._fpsMeterToggled) { -// this._fpsMeter.showDuration(); -// this._fpsMeterToggled = true; -// } else { -// this.hideFps(); -// } -//}; +/** + * @static + * @method _switchFPSMeter + * @private + */ +Graphics._switchFPSMeter = function() { + if (this._fpsMeter.isPaused) { + this.showFps(); + this._fpsMeter.showFps(); + this._fpsMeterToggled = false; + } else if (!this._fpsMeterToggled) { + this._fpsMeter.showDuration(); + this._fpsMeterToggled = true; + } else { + this.hideFps(); + } +}; /** * @static @@ -2901,7 +2898,11 @@ Graphics._switchStretchMode = function () { * @private */ Graphics._switchFullScreen = function () { + if (this._isFullScreen()) { this._requestFullScreen(); + } else { + this._cancelFullScreen(); + } }; /** @@ -2911,7 +2912,6 @@ Graphics._switchFullScreen = function () { * @private */ Graphics._isFullScreen = function () { - return true; return ((document.fullScreenElement && document.fullScreenElement !== null) || (!document.mozFullScreen && !document.webkitFullscreenElement && !document.msFullscreenElement)); @@ -2923,7 +2923,6 @@ Graphics._isFullScreen = function () { * @private */ Graphics._requestFullScreen = function () { - try { var element = document.body; if (element.requestFullScreen) { element.requestFullScreen(); @@ -2934,9 +2933,6 @@ Graphics._requestFullScreen = function () { } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } - } catch (e) { - console.log(`Fullscreen request denied! %s`, e) - } }; /** @@ -3212,7 +3208,7 @@ Input._wrapNwjsAlert = function () { var _alert = window.alert; window.alert = function () { var gui = require('nw.gui'); - var win = gui.window; + var win = gui.Window.get(); _alert.apply(this, arguments); win.focus(); Input.clear(); @@ -3228,7 +3224,7 @@ Input._wrapNwjsAlert = function () { Input._setupEventHandlers = function () { document.addEventListener('keydown', this._onKeyDown.bind(this)); document.addEventListener('keyup', this._onKeyUp.bind(this)); - //window.addEventListener('blur', this._onLostFocus.bind(this)); + window.addEventListener('blur', this._onLostFocus.bind(this)); }; /** @@ -3517,7 +3513,6 @@ TouchInput.clear = function () { * @method update */ TouchInput.update = function () { - return; this._triggered = this._events.triggered; this._cancelled = this._events.cancelled; this._moved = this._events.moved; diff --git a/www.eng/js/rpg_managers.js b/www.eng/js/rpg_managers.js index fd02110..0825dfd 100644 --- a/www.eng/js/rpg_managers.js +++ b/www.eng/js/rpg_managers.js @@ -76,10 +76,9 @@ DataManager.loadDatabase = function () { } }; -window._dfs = require("fs"); DataManager.loadDataFile = function (name, src) { var xhr = new XMLHttpRequest(); - var url = _dfs.cachedAlternativeName('data/' + src); + var url = 'data/' + src; xhr.open('GET', url); xhr.overrideMimeType('application/json'); xhr.onload = function () { @@ -863,7 +862,7 @@ ImageManager.loadTitle2 = function (filename, hue) { ImageManager.loadBitmap = function (folder, filename, hue, smooth) { if (filename) { - var path = folder + filename + '.png'; + var path = folder + encodeURIComponent(filename) + '.png'; var bitmap = this.loadNormalBitmap(path, hue || 0); bitmap.smooth = smooth; return bitmap; @@ -887,7 +886,7 @@ ImageManager.loadNormalBitmap = function (path, hue) { var key = this._generateCacheKey(path, hue); var bitmap = this._imageCache.get(key); if (!bitmap) { - bitmap = Bitmap.load(decodeURIComponent(replaceSpecialSymbols(path))); + bitmap = Bitmap.load(decodeURIComponent(path)); bitmap.addLoadListener(function () { bitmap.rotateHue(hue); }); @@ -1877,7 +1876,7 @@ SceneManager.initInput = function () { SceneManager.initNwjs = function () { if (Utils.isNwjs()) { var gui = require('nw.gui'); - var win = gui.window; + var win = gui.Window.get(); if (process.platform === 'darwin' && !win.menu) { var menubar = new gui.Menu({ type: 'menubar' }); var option = { hideEdit: true, hideWindow: true }; @@ -1941,7 +1940,7 @@ SceneManager.onKeyDown = function (event) { break; case 119: // F8 if (Utils.isNwjs() && Utils.isOptionValid('test')) { - require('nw.gui').window.showDevTools(); + require('nw.gui').Window.get().showDevTools(); } break; } diff --git a/www.eng/js/rpg_objects.js b/www.eng/js/rpg_objects.js index fd835a7..cbfe71d 100644 --- a/www.eng/js/rpg_objects.js +++ b/www.eng/js/rpg_objects.js @@ -39,7 +39,6 @@ Game_Temp.prototype.reservedCommonEvent = function () { }; Game_Temp.prototype.setDestination = function (x, y) { - return; this._destinationX = x; this._destinationY = y; }; diff --git a/www.rus/js/plugins.js b/www.rus/js/plugins.js index 9947e78..828530a 100644 --- a/www.rus/js/plugins.js +++ b/www.rus/js/plugins.js @@ -73,6 +73,13 @@ var $plugins = [ "parameters": {} }, + { + "name": "VND_OmoriFixes", + "status": true, + "description": "Some fixes for android platform", + "parameters": + {} + }, { "name": "YEP_CoreEngine", "status": true, diff --git a/www.rus/js/plugins/VND_OmoriFixes.js b/www.rus/js/plugins/VND_OmoriFixes.js new file mode 100644 index 0000000..5a3a7a5 --- /dev/null +++ b/www.rus/js/plugins/VND_OmoriFixes.js @@ -0,0 +1,189 @@ +// by VienDesu! 2023 + +//============================================================================= +// * Patches for rpg_core +//============================================================================= + +Bitmap.prototype._requestImage = function (url) { + if (Bitmap._reuseImages.length !== 0) { + this._image = Bitmap._reuseImages.pop(); + } else { + this._image = new Image(); + } + + url = replaceSpecialSymbols(url); + url = require("fs").cachedAlternativeName(url); + + if (this._decodeAfterRequest && !this._loader) { + this._loader = ResourceHandler.createLoader(url, this._requestImage.bind(this, url), this._onError.bind(this)); + } + + this._image = new Image(); + this._url = url; + this._loadingState = 'requesting'; + + if (!Decrypter.checkImgIgnore(url) && Decrypter.hasEncryptedImages) { + this._loadingState = 'decrypting'; + Decrypter.decryptImg(url, this); + } else { + this._image.src = encodeURI(url); + + this._image.addEventListener('load', this._loadListener = Bitmap.prototype._onLoad.bind(this)); + this._image.addEventListener('error', this._errorListener = this._loader || Bitmap.prototype._onError.bind(this)); + } +}; + +Graphics.printLoadingError = function (url) { + if (this._errorPrinter && !this._errorShowed) { + this._errorPrinter.innerHTML = this._makeErrorHtml('Loading Error', 'Failed to load: ' + url); + var button = document.createElement('button'); + button.innerHTML = 'Retry'; + button.style.fontSize = '24px'; + button.style.color = '#000000'; + button.style.backgroundColor = '#000000'; + button.onmousedown = button.ontouchstart = function (event) { + ResourceHandler.retry(); + event.stopPropagation(); + }; + this._errorPrinter.appendChild(button); + this._loadingCount = -Infinity; + } +}; + +Graphics._switchFPSMeter = function() { + +}; + +Graphics._switchFullScreen = function () { + this._requestFullScreen(); +}; + +Graphics._isFullScreen = function () { + return true; +}; + +Graphics._requestFullScreen = function () { + try { + var element = document.body; + if (element.requestFullScreen) { + element.requestFullScreen(); + } else if (element.mozRequestFullScreen) { + element.mozRequestFullScreen(); + } else if (element.webkitRequestFullScreen) { + element.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); + } else if (element.msRequestFullscreen) { + element.msRequestFullscreen(); + } + } catch (e) { + console.log(`Fullscreen request denied! %s`, e) + } +}; + +Input._wrapNwjsAlert = function () { + if (Utils.isNwjs()) { + var _alert = window.alert; + window.alert = function () { + var gui = require('nw.gui'); + var win = gui.window; + _alert.apply(this, arguments); + win.focus(); + Input.clear(); + }; + } +}; + +Input._setupEventHandlers = function () { + document.addEventListener('keydown', this._onKeyDown.bind(this)); + document.addEventListener('keyup', this._onKeyUp.bind(this)); +}; + +TouchInput.update = function () { + return; +}; + +//============================================================================= +// * Patches for rpg_managers +//============================================================================= + +DataManager.loadDataFile = function (name, src) { + var xhr = new XMLHttpRequest(); + var url = _dfs.cachedAlternativeName('data/' + src); + xhr.open('GET', url); + xhr.overrideMimeType('application/json'); + xhr.onload = function () { + if (xhr.status < 400) { + window[name] = JSON.parse(xhr.responseText); + DataManager.onLoad(window[name]); + } + }; + xhr.onerror = this._mapLoader || function () { + DataManager._errorUrl = DataManager._errorUrl || url; + }; + window[name] = null; + xhr.send(); +}; + +ImageManager.loadBitmap = function (folder, filename, hue, smooth) { + if (filename) { + var path = folder + filename + '.png'; + var bitmap = this.loadNormalBitmap(path, hue || 0); + bitmap.smooth = smooth; + return bitmap; + } else { + return this.loadEmptyBitmap(); + } +}; + +ImageManager.loadNormalBitmap = function (path, hue) { + var key = this._generateCacheKey(path, hue); + var bitmap = this._imageCache.get(key); + if (!bitmap) { + bitmap = Bitmap.load(decodeURIComponent(replaceSpecialSymbols(path))); + bitmap.addLoadListener(function () { + bitmap.rotateHue(hue); + }); + this._imageCache.add(key, bitmap); + } else if (!bitmap.isReady()) { + bitmap.decode(); + } + + return bitmap; +}; + +SceneManager.initNwjs = function () { + if (Utils.isNwjs()) { + var gui = require('nw.gui'); + var win = gui.window; + if (process.platform === 'darwin' && !win.menu) { + var menubar = new gui.Menu({ type: 'menubar' }); + var option = { hideEdit: true, hideWindow: true }; + menubar.createMacBuiltin('Game', option); + win.menu = menubar; + } + } +}; + +SceneManager.onKeyDown = function (event) { + if (!event.ctrlKey && !event.altKey) { + switch (event.keyCode) { + case 116: // F5 + if (Utils.isNwjs()) { + location.reload(); + } + break; + case 119: // F8 + if (Utils.isNwjs() && Utils.isOptionValid('test')) { + require('nw.gui').window.showDevTools(); + } + break; + } + } +}; + +//============================================================================= +// * Patches for rpg_objects +//============================================================================= + +Game_Temp.prototype.setDestination = function (x, y) { + return; +}; diff --git a/www.rus/js/rpg_core.js b/www.rus/js/rpg_core.js index b50fd61..f07dd91 100644 --- a/www.rus/js/rpg_core.js +++ b/www.rus/js/rpg_core.js @@ -1671,9 +1671,6 @@ Bitmap.prototype._requestImage = function (url) { this._image = new Image(); } - url = replaceSpecialSymbols(url); - url = require("fs").cachedAlternativeName(url); - if (this._decodeAfterRequest && !this._loader) { this._loader = ResourceHandler.createLoader(url, this._requestImage.bind(this, url), this._onError.bind(this)); } @@ -1686,7 +1683,7 @@ Bitmap.prototype._requestImage = function (url) { this._loadingState = 'decrypting'; Decrypter.decryptImg(url, this); } else { - this._image.src = encodeURI(url); + this._image.src = url; this._image.addEventListener('load', this._loadListener = Bitmap.prototype._onLoad.bind(this)); this._image.addEventListener('error', this._errorListener = this._loader || Bitmap.prototype._onError.bind(this)); @@ -1997,7 +1994,7 @@ Graphics.printLoadingError = function (url) { var button = document.createElement('button'); button.innerHTML = 'Retry'; button.style.fontSize = '24px'; - button.style.color = '#000000'; + button.style.color = '#ffffff'; button.style.backgroundColor = '#000000'; button.onmousedown = button.ontouchstart = function (event) { ResourceHandler.retry(); @@ -2866,23 +2863,23 @@ Graphics._onTouchEnd = function (event) { } }; -///** -// * @static -// * @method _switchFPSMeter -// * @private -// */ -//Graphics._switchFPSMeter = function() { -// if (this._fpsMeter.isPaused) { -// this.showFps(); -// this._fpsMeter.showFps(); -// this._fpsMeterToggled = false; -// } else if (!this._fpsMeterToggled) { -// this._fpsMeter.showDuration(); -// this._fpsMeterToggled = true; -// } else { -// this.hideFps(); -// } -//}; +/** + * @static + * @method _switchFPSMeter + * @private + */ +Graphics._switchFPSMeter = function() { + if (this._fpsMeter.isPaused) { + this.showFps(); + this._fpsMeter.showFps(); + this._fpsMeterToggled = false; + } else if (!this._fpsMeterToggled) { + this._fpsMeter.showDuration(); + this._fpsMeterToggled = true; + } else { + this.hideFps(); + } +}; /** * @static @@ -2901,7 +2898,11 @@ Graphics._switchStretchMode = function () { * @private */ Graphics._switchFullScreen = function () { + if (this._isFullScreen()) { this._requestFullScreen(); + } else { + this._cancelFullScreen(); + } }; /** @@ -2911,7 +2912,6 @@ Graphics._switchFullScreen = function () { * @private */ Graphics._isFullScreen = function () { - return true; return ((document.fullScreenElement && document.fullScreenElement !== null) || (!document.mozFullScreen && !document.webkitFullscreenElement && !document.msFullscreenElement)); @@ -2923,7 +2923,6 @@ Graphics._isFullScreen = function () { * @private */ Graphics._requestFullScreen = function () { - try { var element = document.body; if (element.requestFullScreen) { element.requestFullScreen(); @@ -2934,9 +2933,6 @@ Graphics._requestFullScreen = function () { } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } - } catch (e) { - console.log(`Fullscreen request denied! %s`, e) - } }; /** @@ -3212,7 +3208,7 @@ Input._wrapNwjsAlert = function () { var _alert = window.alert; window.alert = function () { var gui = require('nw.gui'); - var win = gui.window; + var win = gui.Window.get(); _alert.apply(this, arguments); win.focus(); Input.clear(); @@ -3228,7 +3224,7 @@ Input._wrapNwjsAlert = function () { Input._setupEventHandlers = function () { document.addEventListener('keydown', this._onKeyDown.bind(this)); document.addEventListener('keyup', this._onKeyUp.bind(this)); - //window.addEventListener('blur', this._onLostFocus.bind(this)); + window.addEventListener('blur', this._onLostFocus.bind(this)); }; /** @@ -3517,7 +3513,6 @@ TouchInput.clear = function () { * @method update */ TouchInput.update = function () { - return; this._triggered = this._events.triggered; this._cancelled = this._events.cancelled; this._moved = this._events.moved; diff --git a/www.rus/js/rpg_managers.js b/www.rus/js/rpg_managers.js index fd02110..0825dfd 100644 --- a/www.rus/js/rpg_managers.js +++ b/www.rus/js/rpg_managers.js @@ -76,10 +76,9 @@ DataManager.loadDatabase = function () { } }; -window._dfs = require("fs"); DataManager.loadDataFile = function (name, src) { var xhr = new XMLHttpRequest(); - var url = _dfs.cachedAlternativeName('data/' + src); + var url = 'data/' + src; xhr.open('GET', url); xhr.overrideMimeType('application/json'); xhr.onload = function () { @@ -863,7 +862,7 @@ ImageManager.loadTitle2 = function (filename, hue) { ImageManager.loadBitmap = function (folder, filename, hue, smooth) { if (filename) { - var path = folder + filename + '.png'; + var path = folder + encodeURIComponent(filename) + '.png'; var bitmap = this.loadNormalBitmap(path, hue || 0); bitmap.smooth = smooth; return bitmap; @@ -887,7 +886,7 @@ ImageManager.loadNormalBitmap = function (path, hue) { var key = this._generateCacheKey(path, hue); var bitmap = this._imageCache.get(key); if (!bitmap) { - bitmap = Bitmap.load(decodeURIComponent(replaceSpecialSymbols(path))); + bitmap = Bitmap.load(decodeURIComponent(path)); bitmap.addLoadListener(function () { bitmap.rotateHue(hue); }); @@ -1877,7 +1876,7 @@ SceneManager.initInput = function () { SceneManager.initNwjs = function () { if (Utils.isNwjs()) { var gui = require('nw.gui'); - var win = gui.window; + var win = gui.Window.get(); if (process.platform === 'darwin' && !win.menu) { var menubar = new gui.Menu({ type: 'menubar' }); var option = { hideEdit: true, hideWindow: true }; @@ -1941,7 +1940,7 @@ SceneManager.onKeyDown = function (event) { break; case 119: // F8 if (Utils.isNwjs() && Utils.isOptionValid('test')) { - require('nw.gui').window.showDevTools(); + require('nw.gui').Window.get().showDevTools(); } break; } diff --git a/www.rus/js/rpg_objects.js b/www.rus/js/rpg_objects.js index fd835a7..cbfe71d 100644 --- a/www.rus/js/rpg_objects.js +++ b/www.rus/js/rpg_objects.js @@ -39,7 +39,6 @@ Game_Temp.prototype.reservedCommonEvent = function () { }; Game_Temp.prototype.setDestination = function (x, y) { - return; this._destinationX = x; this._destinationY = y; };