Hi people!
I have two scenes and two windows in my custom plugin.
Scene_Language > Window_Language(Based on window_options).
Scene_Confirmation > Window_Confirmation.
As soon as the Scene_language opens, the window language also opens and a option appears for the player choose.
The player make a choice.
i call the SceneManager.snapForBackground()
the Scene_Confirmation opens(and the background for it, is the Image of the previous Scene), and so the Window_Confirmation.
If the player choose "YES", everything works fine, and he goes to the sceneMap.
But, if the player choose "NO", he comes back to the Scene_Language.
But the background still there, so when the window open again it causes like a duplicate of the background making the screen more dark.
Here is a video to show better what i'm trying to explain:
[[[EDIT]]]] - Code Updated
And here is the code:

I have two scenes and two windows in my custom plugin.
Scene_Language > Window_Language(Based on window_options).
Scene_Confirmation > Window_Confirmation.
As soon as the Scene_language opens, the window language also opens and a option appears for the player choose.
The player make a choice.
i call the SceneManager.snapForBackground()
the Scene_Confirmation opens(and the background for it, is the Image of the previous Scene), and so the Window_Confirmation.
If the player choose "YES", everything works fine, and he goes to the sceneMap.
But, if the player choose "NO", he comes back to the Scene_Language.
But the background still there, so when the window open again it causes like a duplicate of the background making the screen more dark.
Here is a video to show better what i'm trying to explain:
[[[EDIT]]]] - Code Updated
And here is the code:
Code:
//=================================================================================
// SCENE LANGUAGE (SCENE_MENUBASE)
//=================================================================================
function Scene_Language() {
this.initialize.apply(this, arguments);
this.removeChild(this._spriteset);
SceneManager.snap();
}
Scene_Language.prototype = Object.create(Scene_MenuBase.prototype);
Scene_Language.prototype.constructor = Scene_Language;
Scene_Language.prototype.initialize = function() {
Scene_MenuBase.prototype.initialize.call(this);
};
Scene_Language.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createWindowLayer();
this.createLanguageWindow();
this.createConfirmationWindow();
};
Scene_Language.prototype.terminate = function() {
Scene_MenuBase.prototype.terminate.call(this);
ConfigManager.save();
};
Scene_Language.prototype.createLanguageWindow = function() {
this._languageWindow = new Window_Language();
this._languageWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._languageWindow);
};
Scene_Language.prototype.createConfirmationWindow = function() {
this._commandWindow = new Window_Confirmation();
this._commandWindow.setHandler('Yes', this.commandYes.bind(this));
this._commandWindow.setHandler('No', this.commandNo.bind(this));
this.addChild(this._commandWindow);
};
Scene_Language.prototype.commandYes = function() {
SceneManager.goto(Scene_Map);
};
Scene_Language.prototype.commandNo = function() {
this._commandWindow.close();//SceneManager.pop();
};
//=================================================================================
// WINDOW LANGUAGE (WINDOW_COMMAND)
//=================================================================================
function Window_Language() {
this.initialize.apply(this, arguments);
}
Window_Language.prototype = Object.create(Window_Command.prototype);
Window_Language.prototype.constructor = Window_Language;
Window_Language.prototype.initialize = function() {
Window_Command.prototype.initialize.call(this, 0, 0);
this.updatePlacement();
this.idiomaflagA();
this.idiomaflagB();
};
Window_Language.prototype.Opacity = function() {
return 255;
};
Window_Language.prototype.standardBackOpacity = function() {
return 180;
};
Window_Language.prototype.idiomaflagA = function() {
this._flaga = new Sprite();
this._flaga.move(200, 200, 0, 0);
this._flaga.bitmap = ImageManager.loadSystem('red');
this._flaga.height = this.windowHeight();
this._flaga.opacity = 255;
this.addChildAt(this._flaga, 1); // 0 = Layer
};
Window_Language.prototype.idiomaflagB = function() {
this._flagb = new Sprite();
this._flagb.move(400, 200, 0, 0);
this._flagb.bitmap = ImageManager.loadSystem('blue');
this._flagb.height = this.windowHeight();
this._flagb.opacity = 50;
this.addChildAt(this._flagb, 1); // 0 = Layer
};
Window_Language.prototype.windowWidth = function() {
return Graphics.boxWidth;
};
Window_Language.prototype.windowHeight = function() {
return Graphics.boxHeight;
};
Window_Language.prototype.updatePlacement = function() {
this.x = 0;
this.y = 0;
};
Window_Language.prototype.makeCommandList = function() {
};
Window_Language.prototype.drawItem = function(index) {
var rect = this.itemRectForText(index);
var statusWidth = this.statusWidth();
var titleWidth = rect.width - statusWidth;
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
this.drawText(this.commandName(index), rect.x, rect.y, titleWidth, 'left');
this.drawText(this.statusText(index), titleWidth, rect.y, statusWidth, 'right');
};
Window_Language.prototype.cursorRight = function(wrap) {
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, true);
};
Window_Language.prototype.cursorLeft = function(wrap) {
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
this.changeValue(symbol, false);
};
Window_Language.prototype.statusWidth = function() {
return (Graphics.boxWidth /2);
};
Window_Language.prototype.changeValue = function(symbol, value) {
var lastValue = this.getConfigValue(symbol);
if (lastValue !== value) {
this.setConfigValue(symbol, value);
this.redrawItem(this.findSymbol(symbol));
SoundManager.playCursor();
}
};
Window_Language.prototype.getConfigValue = function(symbol) {
return ConfigManager[symbol];
};
Window_Language.prototype.setConfigValue = function(symbol, volume) {
ConfigManager[symbol] = volume;
};
Window_Language.prototype.update = function() {
if(Input.isTriggered('right')) {
this._flagb.opacity = 255;
this._flaga.opacity = 50;
this.cursorRight();
}
if(Input.isTriggered('left')) {
this._flagb.opacity = 50;
this._flaga.opacity = 255;
this.cursorLeft();
}
if(Input.isTriggered('ok')) {
this._confirmationWindow.open();
// this._confirmationWindow.activate();
}
};
//=================================================================================
// WINDOW CONFIRMATION (WINDOW_COMMAND)
//=================================================================================
function Window_Confirmation() {
this.initialize.apply(this, arguments);
}
Window_Confirmation.prototype = Object.create(Window_Command.prototype);
Window_Confirmation.prototype.constructor = Window_Confirmation;
Window_Confirmation.prototype.initialize = function() {
Window_Command.prototype.initialize.call(this, 0, 0);
this.openness = 0;
this.close();
this.updatePlacement();
//this.deactivate();
};
Window_Confirmation.prototype.windowWidth = function() {
return 240;
};
Window_Confirmation.prototype.updatePlacement = function() {
this.x = (Graphics.boxWidth - this.width) / 2;
this.y = (Graphics.boxHeight - this.height) / 2;
};
Window_Confirmation.prototype.makeCommandList = function() {
this.addCommand('Yes', 'Yes');
this.addCommand('No', 'No');
};
Last edited:

