I did a quick search with my low skill with plugins and came across this code
and it was working fine, but I don't know if it was in conflict with other plugins, it only activates the switch when the game is minimized, when I close the game and start it again, I go back to the save, the switch was not activated as the command was intended, the switch should only be activated when the game is closed and opened again, does anyone have a fix or a ready plugin that does this?
Code:
if (Utils.isNwjs()) {
var onClose = function() {
if (confirm("Deseja mesmo sair?")) {
$gameSwitches.setValue(1809, true); // Ativa o switch 2
nw.App.quit();
}
};
var onSmall = function() {
$gameSwitches.setValue(1810, true); // Ativa o switch 1
};
var w = nw.Window.get();
w.on("close", onClose);
w.on("minimize", onSmall);
}
and it was working fine, but I don't know if it was in conflict with other plugins, it only activates the switch when the game is minimized, when I close the game and start it again, I go back to the save, the switch was not activated as the command was intended, the switch should only be activated when the game is closed and opened again, does anyone have a fix or a ready plugin that does this?
