Option Name
The name used by the Window Skin option.
This Plugin adds a Window Skin selector to the Options Window that allows the Player to choose a Window Skin for the game. Can also set the order of the Window Skins and have some unlock based on Switches.
Window Skin Option
Version 1.00
SomeRanDev
This Plugin adds a Window Skin selector to the Options Window that allows
the Player to choose a Window Skin for the game.
==========================================================================
How to Set up the Images
==========================================================================
First place all of the Window Skins you wish to use in:
/img/SumRndmDde/window/
This does not include the default Window Skin which should be placed in
the normal location: /img/system/Window.png
==========================================================================
How to Set up the Options
==========================================================================
In order to set up the order and the names for the Window Skins in the
Options Menu, you must use the Parameters.
It is manadatory that one Window Skin is available for the Player, and
that Window Skin is the default one located here: /img/system/Window.png
Using the "Default Skin Name" Parameter, you can give it a specific
name when selected in the Options Menu.
Next, you can set up the choices by filling out the "Window Skin" sections.
Using "Skin # File", input the name of a Window Skin file located in:
/img/SumRndmDde/window/
Next, use "Skin # Name", set the name of that Window Skin that will be
displayed in the Options Menu.
Once you have filled out both Parameters for one "Window Skin" section,
it will be available in the Options Menu in game.
==========================================================================
End of Help File
==========================================================================
Welcome to the bottom of the Help file.
Thanks for reading!
If you have questions, or if you enjoyed this Plugin, please check
out my YouTube channel!
https://www.youtube.com/c/SumRndmDde
Until next time,
~ SomeRanDev
var SRD = SRD || {};
SRD.WindowSkinOptions = SRD.WindowSkinOptions || {};
var Imported = Imported || {};
Imported["SumRndmDde Window Skin Options"] = true;
(function(_) {
"use strict";
_.name = String(PluginManager.parameters('SRD_WindowSkinOption')['Option Name']);
_.position = String(PluginManager.parameters('SRD_WindowSkinOption')['Position']).trim().toLowerCase();
_.defaultName = String(PluginManager.parameters('SRD_WindowSkinOption')['Default Skin Name']);
_.index = 0;
_.lowest = 0;
_.windows = ["Window"];
_.names = [_.defaultName];
_.switches = [0];
for(var i = 1; i <= 50; i++) {
var file = String(PluginManager.parameters('SRD_WindowSkinOption')['Skin ' + i + ' File']);
var name = String(PluginManager.parameters('SRD_WindowSkinOption')['Skin ' + i + ' Name']);
var swit = parseInt(PluginManager.parameters('SRD_WindowSkinOption')['Skin ' + i + ' Switch']);
if(file.trim().length > 0) _.windows[i] = file;
if(name.trim().length > 0) _.names[i] = name;
if(swit) _.switches[i] = swit;
}
_.loadImage = function(filename, hue) {
return ImageManager.loadBitmap('img/SumRndmDde/window/', filename, hue, true);
};
//-----------------------------------------------------------------------------
// ConfigManager
//-----------------------------------------------------------------------------
Object.defineProperty(ConfigManager, 'windowSkin', {
get: function() {
while((_.switches[_.index] && _.switches[_.index] != 0) && (!$gameSwitches || !$gameSwitches.value(_.switches[_.index]))) {
_.index++;
if(_.index > _.windows.length - 1) _.index = 0;
}
return _.index;
},
set: function(value) {
_.index = Number(value).clamp(_.lowest, _.windows.length - 1);
while((_.switches[_.index] && _.switches[_.index] != 0) && (!$gameSwitches || !$gameSwitches.value(_.switches[_.index]))) {
_.index++;
if(_.index > _.windows.length - 1) _.index = 0;
}
},
configurable: true
});
var _ConfigManager_makeData = ConfigManager.makeData;
ConfigManager.makeData = function() {
var config = _ConfigManager_makeData.call(this);
config.windowSkin = this.windowSkin;
return config;
};
var _ConfigManager_applyData = ConfigManager.applyData;
ConfigManager.applyData = function(config) {
_ConfigManager_applyData.call(this, config);
this.windowSkin = this.readWindowskin(config, 'windowSkin');
};
ConfigManager.readWindowskin = function(config, name) {
var value = config[name];
if (value !== undefined) {
return value;
} else {
return _.lowest;
}
};
//-----------------------------------------------------------------------------
// Window_Base
//-----------------------------------------------------------------------------
var _Window_Base_initialize = Window_Base.prototype.initialize;
Window_Base.prototype.initialize = function(x, y, width, height) {
_Window_Base_initialize.call(this, x, y, width, height);
this._windowSkinName = "";
};
var _Window_Base_update = Window_Base.prototype.update;
if(Imported["SumRndmDde Individual Skins for Windows"]) {
Window_Base.prototype.update = function() {
_Window_Base_update.call(this);
if(!SRD.IndividualSkinsForWindows.skins[this.constructor.name] && this._windowSkinName !== _.windows[ConfigManager.windowSkin]) {
if(_.index === 0) {
this.windowskin = ImageManager.loadSystem(_.windows[ConfigManager.windowSkin]);
} else {
this.windowskin = _.loadImage(_.windows[ConfigManager.windowSkin]);
}
this._windowSkinName = _.windows[ConfigManager.windowSkin];
}
};
} else {
Window_Base.prototype.update = function() {
_Window_Base_update.call(this);
if(this._windowSkinName !== _.windows[ConfigManager.windowSkin]) {
if(_.index === 0) {
this.windowskin = ImageManager.loadSystem(_.windows[ConfigManager.windowSkin]);
} else {
this.windowskin = _.loadImage(_.windows[ConfigManager.windowSkin]);
}
this._windowSkinName = _.windows[ConfigManager.windowSkin];
}
};
}
//-----------------------------------------------------------------------------
// Window_Options
//-----------------------------------------------------------------------------
var _Window_Options_addGeneralOptions = Window_Options.prototype.addGeneralOptions;
Window_Options.prototype.addGeneralOptions = function() {
_Window_Options_addGeneralOptions.call(this);
if(_.position === 'middle') {
this.addCommand(_.name, 'windowSkin');
}
};
var _Window_Options_makeCommandList = Window_Options.prototype.makeCommandList;
Window_Options.prototype.makeCommandList = function() {
if(_.position === 'top') {
this.addCommand(_.name, 'windowSkin');
}
_Window_Options_makeCommandList.call(this);
};
var _Window_Options_addVolumeOptions = Window_Options.prototype.addVolumeOptions;
Window_Options.prototype.addVolumeOptions = function() {
_Window_Options_addVolumeOptions.call(this);
if(_.position === 'bottom') {
this.addCommand(_.name, 'windowSkin');
}
};
var _Window_Options_statusText = Window_Options.prototype.statusText;
Window_Options.prototype.statusText = function(index) {
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
if(this.isWindowSkinSymbol(symbol)) {
return this.windowSkinStatusText(value);
}
return _Window_Options_statusText.call(this, index);
};
Window_Options.prototype.isWindowSkinSymbol = function(symbol) {
return symbol === 'windowSkin';
};
Window_Options.prototype.windowSkinStatusText = function(value) {
return _.names[value];
};
var _Window_Options_processOk = Window_Options.prototype.processOk;
Window_Options.prototype.processOk = function() {
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
_Window_Options_processOk.call(this);
if(this.isWindowSkinSymbol(symbol)) {
value += 1;
if(value >= _.windows.length) value = _.lowest;
this.changeValue(symbol, value);
}
};
var _Window_Options_cursorRight = Window_Options.prototype.cursorRight;
Window_Options.prototype.cursorRight = function(wrap) {
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
_Window_Options_cursorRight.call(this, wrap);
if(this.isWindowSkinSymbol(symbol)) {
value += 1;
this.changeValue(symbol, value);
}
};
var _Window_Options_cursorLeft = Window_Options.prototype.cursorLeft;
Window_Options.prototype.cursorLeft = function(wrap) {
var index = this.index();
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
_Window_Options_cursorLeft.call(this, wrap);
if(this.isWindowSkinSymbol(symbol)) {
value -= 1;
this.changeValue(symbol, value);
}
};
})(SRD.WindowSkinOptions);