Support /debug nw

This opens the desktop client's debugger, which for some reason doesn't
open the way NW.js's documentation says it should.
This commit is contained in:
Guangcong Luo
2020-03-13 22:38:55 -04:00
parent e452b1b730
commit 95d3d3a95d

View File

@@ -547,6 +547,12 @@
type: 'modal',
htmlMessage: "Extracted team data:<br /><textarea rows=\"10\" cols=\"60\">" + BattleLog.escapeHTML(JSON.stringify(Storage.teams)) + "</textarea>"
});
} else if (target === 'nw') {
try {
nw.Window.get().showDevTools();
} catch (e) {
this.add('|error|' + e.message);
}
} else {
this.add('|error|Unknown debug command.');
this.add('|error|Are you looking for /showdebug and /hidedebug?');