Hello, I was wondering if there is a plugin that will allow to change the Window style(for all menus) to a different png file using plugin commands?
MZ Change of a window
JS Plugin RequestsYou can use the resource manager to import a custom window skin.
But I can't change it during game with a manager.
Use a different windowskin for a specific type of window, e.g.
Or, allow swapping the default windowskin mid-game via a Script command:
To use one of these:
Window_Gold:
JavaScript:
Window_Gold.prototype.loadWindowskin = function() {
this.windowskin = ImageManager.loadSystem('WindowGold');
};
JavaScript:
/*:
* @target MZ
* @plugindesc Reassign the windowskin mid-game.
* @author Caethyril
* @help You can change the windowskin mid-game using a Script command, e.g.
* ChangeWindow.skin = 'Window2';
*
* All windowskin images should be stored under img/system.
* The default windowskin will be Window.png.
*
* This plugin is written for RPG Maker MZ.
*/
($ => {
'use strict';
// include skin name in save files under this identifier
const SAVKEY = 'windowskin';
// variable skin name
Object.defineProperty($, 'skin', {
get: ( ) => $._s ||= 'Window',
set: (v) => { if ($._s !== v) $._s = v, refreshSkin(); },
configurable: true
});
// refreshes active display elements
let refreshSkin = function() {
ColorManager.loadWindowskin();
SceneManager._scene._windowLayer?.children.forEach(c => c.loadWindowskin?.());
};
// overrides to reference variable skin name
ColorManager.loadWindowskin = function() { // colour map (bottom-right)
this._windowskin = ImageManager.loadSystem($.skin);
};
Window_Base.prototype.loadWindowskin = function() { // window parts
this.windowskin = ImageManager.loadSystem($.skin);
};
// alias to initialise skin name on new game
void (alias => {
DataManager.setupNewGame = function() {
alias.apply(this, arguments), $.skin = '';
};
})(DataManager.setupNewGame);
// alias to include skin name in save data
void (alias => {
DataManager.makeSaveContents = function() {
const o = alias.apply(this, arguments);
o[SAVKEY] = $.skin;
return o;
};
})(DataManager.makeSaveContents);
// alias to extract skin name from save data
void (alias => {
DataManager.extractSaveContents = function(contents) {
alias.apply(this, arguments);
$.skin = contents[SAVKEY];
};
})(DataManager.extractSaveContents);
})(window['ChangeWindow'] ||= {});
- Copy the code into a text editor (e.g. Notepad),
- Save it as a .js file (Save As > File Type: All Files, Filename: whatever.js),
- Import via the Plugin Manager,
- Save your project to apply plugin changes,
- Test!
Thank you.
Hi there!
I also have made a plugin for that: Eli Window Skin
I also have made a plugin for that: Eli Window Skin
Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/change-of-a-window.134192/