Nerine

Veteran
Veteran
Joined
Oct 3, 2020
Messages
40
Reaction score
15
First Language
Polish
Primarily Uses
RMMZ
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?
 

Tarzanthecat

(Meow)
Veteran
Joined
Jan 18, 2017
Messages
93
Reaction score
66
First Language
English
Primarily Uses
N/A
You can use the resource manager to import a custom window skin.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,417
Reaction score
1,827
First Language
EN
Primarily Uses
RMMZ
Use a different windowskin for a specific type of window, e.g. Window_Gold:
JavaScript:
Window_Gold.prototype.loadWindowskin = function() {
  this.windowskin = ImageManager.loadSystem('WindowGold');
};
Or, allow swapping the default windowskin mid-game via a Script command:
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'] ||= {});
To use one of these:
  1. Copy the code into a text editor (e.g. Notepad),
  2. Save it as a .js file (Save As > File Type: All Files, Filename: whatever.js),
  3. Import via the Plugin Manager,
  4. Save your project to apply plugin changes,
  5. Test!
(Seems like both of these might be popular requests, so I'll make a note to include them in one of my plugins at some point~)
 

Nerine

Veteran
Veteran
Joined
Oct 3, 2020
Messages
40
Reaction score
15
First Language
Polish
Primarily Uses
RMMZ
Use a different windowskin for a specific type of window, e.g. Window_Gold:
JavaScript:
Window_Gold.prototype.loadWindowskin = function() {[/INDENT]
[INDENT]  this.windowskin = ImageManager.loadSystem('WindowGold');[/INDENT]
[INDENT]};
Or, allow swapping the default windowskin mid-game via a Script command:
JavaScript:
/*:[/INDENT]
[INDENT]* @target MZ[/INDENT]
[INDENT]* @plugindesc Reassign the windowskin mid-game.[/INDENT]
[INDENT]* @author Caethyril[/INDENT]
[INDENT]* @help You can change the windowskin mid-game using a Script command, e.g.[/INDENT]
[INDENT]*    ChangeWindow.skin = 'Window2';[/INDENT]
[INDENT]*[/INDENT]
[INDENT]* All windowskin images should be stored under img/system.[/INDENT]
[INDENT]* The default windowskin will be Window.png.[/INDENT]
[INDENT]*[/INDENT]
[INDENT]* This plugin is written for RPG Maker MZ.[/INDENT]
[INDENT]*/[/INDENT]
[INDENT][/INDENT]
[INDENT]($ => {[/INDENT]
[INDENT]'use strict';[/INDENT]
[INDENT][/INDENT]
[INDENT]    // include skin name in save files under this identifier[/INDENT]
[INDENT]    const SAVKEY = 'windowskin';[/INDENT]
[INDENT][/INDENT]
[INDENT]    // variable skin name[/INDENT]
[INDENT]    Object.defineProperty($, 'skin', {[/INDENT]
[INDENT]        get: ( ) => $._s ||= 'Window',[/INDENT]
[INDENT]        set: (v) => { if ($._s !== v) $._s = v, refreshSkin(); },[/INDENT]
[INDENT]        configurable: true[/INDENT]
[INDENT]    });[/INDENT]
[INDENT][/INDENT]
[INDENT]    // refreshes active display elements[/INDENT]
[INDENT]    let refreshSkin = function() {[/INDENT]
[INDENT]        ColorManager.loadWindowskin();[/INDENT]
[INDENT]        SceneManager._scene._windowLayer?.children.forEach(c => c.loadWindowskin?.());[/INDENT]
[INDENT]    };[/INDENT]
[INDENT][/INDENT]
[INDENT]    // overrides to reference variable skin name[/INDENT]
[INDENT]    ColorManager.loadWindowskin = function() {  // colour map (bottom-right)[/INDENT]
[INDENT]        this._windowskin = ImageManager.loadSystem($.skin);[/INDENT]
[INDENT]    };[/INDENT]
[INDENT]    Window_Base.prototype.loadWindowskin = function() {  // window parts[/INDENT]
[INDENT]        this.windowskin = ImageManager.loadSystem($.skin);[/INDENT]
[INDENT]    };[/INDENT]
[INDENT][/INDENT]
[INDENT]    // alias to initialise skin name on new game[/INDENT]
[INDENT]    void (alias => {[/INDENT]
[INDENT]        DataManager.setupNewGame = function() {[/INDENT]
[INDENT]            alias.apply(this, arguments), $.skin = '';[/INDENT]
[INDENT]        };[/INDENT]
[INDENT]    })(DataManager.setupNewGame);[/INDENT]
[INDENT][/INDENT]
[INDENT]    // alias to include skin name in save data[/INDENT]
[INDENT]    void (alias => {[/INDENT]
[INDENT]        DataManager.makeSaveContents = function() {[/INDENT]
[INDENT]            const o = alias.apply(this, arguments);[/INDENT]
[INDENT]            o[SAVKEY] = $.skin;[/INDENT]
[INDENT]            return o;[/INDENT]
[INDENT]        };[/INDENT]
[INDENT]    })(DataManager.makeSaveContents);[/INDENT]
[INDENT][/INDENT]
[INDENT]    // alias to extract skin name from save data[/INDENT]
[INDENT]    void (alias => {[/INDENT]
[INDENT]        DataManager.extractSaveContents = function(contents) {[/INDENT]
[INDENT]            alias.apply(this, arguments);[/INDENT]
[INDENT]            $.skin = contents[SAVKEY];[/INDENT]
[INDENT]        };[/INDENT]
[INDENT]    })(DataManager.extractSaveContents);[/INDENT]
[INDENT][/INDENT]
[INDENT]})(window['ChangeWindow'] ||= {});
To use one of these:
  1. Copy the code into a text editor (e.g. Notepad),
  2. Save it as a .js file (Save As > File Type: All Files, Filename: whatever.js),
  3. Import via the Plugin Manager,
  4. Save your project to apply plugin changes,
  5. Test!
(Seems like both of these might be popular requests, so I'll make a note to include them in one of my plugins at some point~)
Thank you.
 

Latest Threads

Latest Profile Posts

I feel still screenshots don't do my game justice. the characters don't move, but the filter over them does...
Wonder if this year, there be more MZ plugin than MV or that MZ is still small compare to whole MV collection
Zaj
Hey morning all! I got another quick question..I just switched to RMMZ from VX Ace..so I am wondering why default scripts(is that how u call it) of VXAce is available, but not in MZ's case? How do I figure out ahh I mean could you show me
Sometimes im the biggest fool alive... Ah well, ce la vie
The worst feeling in the world is going for a walk on a nice summer day, seeing an ice cream truck, and realizing you don't have any money with you :(

Forum statistics

Threads
111,346
Messages
1,060,373
Members
144,672
Latest member
oddRABBIT
Top