Nerine

Veteran
Veteran
Joined
Oct 3, 2020
Messages
34
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,376
Reaction score
1,781
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
34
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

Ugh! 15 posts waiting in the approval queue. Approve 3, decline 2, ask poster for more information on 4. Refresh. 18 posts waiting in the approval queue!
Shaz wrote on ZestyTS's profile.
Hi, there is a Completed Games forum where you can post your game. Or a Commercial Games forum if it's paid. The status feed is not where these belong. Just make sure to read the pinned threads and include all the required information in your post.
I was initially looking for some old archer design i made a few years ago, but couldn't find it...
but here's a sketch from some parade / festival I stumbled upon that i totally forgot :D
Not sure how i'll go about it, but i definitely want to incorporate some of it in my game :)
cxgRkhJ.png
So... what is sleep anyway? UGGGG

Forum statistics

Threads
110,555
Messages
1,054,225
Members
143,663
Latest member
Seori
Top