Hi, everybody!
I had the following code working until the last RPG Maker MV version (ignores Portuguese comments and strings).
But, after update 1.6, the DevTools window opens but the var consoleWindow still undefined and doesn't moves. From what I understood, a new NW.js version is being used in RMMV 1.6, so my code is outdated. I'm searching for how correctly opens DevTools window (and if possibly, set it to a variable), focus game window and reposition the DevTools window.
Thanks in advance! 😅
I had the following code working until the last RPG Maker MV version (ignores Portuguese comments and strings).
Code:
var cons_pos_x = 1150; // Posicao X
var cons_pos_y = 180; // Posicao Y
var cons_tam_x = 716; // Tamanho X, 716 é o padrão
var cons_tam_y = 539; // Tamanho Y, 539 é o padrão.
if (Utils.isNwjs() && Utils.isOptionValid('test')) {
var consoleWindow = require('nw.gui').Window.get().showDevTools();
this.focus();
if(cons_pos_x > window.screen.availWidth || cons_pos_x < 0 || cons_pos_y > window.screen.availHeight || cons_pos_y < 0){
console.log("Posição da janela inválida. X ou Y está fora da tela.");
cons_pos_x = 0;
cons_pos_y = 0;
}
consoleWindow.moveTo(cons_pos_x, cons_pos_y);
consoleWindow.resizeTo(cons_tam_x, cons_tam_y);
};
But, after update 1.6, the DevTools window opens but the var consoleWindow still undefined and doesn't moves. From what I understood, a new NW.js version is being used in RMMV 1.6, so my code is outdated. I'm searching for how correctly opens DevTools window (and if possibly, set it to a variable), focus game window and reposition the DevTools window.
Thanks in advance! 😅