Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // Windowskin Tool Plugin v2.7
- // * This plugin enables you to tweak certain windowskin settings, such as
- // changing the default windowskin from within the Plugin Manager.
- //
- // Also, RMMV has the same transparency problem with windowskins as RMVX
- // did in that the windowskin colour (in the Database) overrides the
- // windowskin graphic (which is a simple hack really).
- //
- // * © 2015-2016, Companion Wulf
- //
- //=============================================================================
- // CW_WindowskinTool.js
- //=============================================================================
- var Imported = Imported || {}; Imported.CW_WindowskinTool = true;
- var CWT = CWT || {};
- /*:
- * @plugindesc Changes various windowskin settings.
- * @author Companion Wulf
- *
- * @param Default Windowskin
- * @desc The windowskin to replace the default one. You may still have to adjust the default background colors to match.
- * @default Window
- *
- * @param Change Opacity
- * @desc The translucency (0-255) standard windows.
- * @default 220
- *
- * @help
- *
- * -+ Windowskins Folder +-
- * ------------------------
- * Create a new folder called "windowskins" under "img/system/". This will then
- * be available in the "Resource Manager" (MV v1.1) for you to import windowskins
- * directly for use in your game.
- *
- *
- * -+ Plugin Commands +-
- * ---------------------
- *
- * To change the windowskin in-game, use the following plugin command:
- *
- * ChangeWindowskin <windowskin_name>
- *
- * where <windowskin_name> is the name of the windowskin you want to change to.
- *
- *
- * To reset the windowskin to default (as set in the "Default Windowskin"
- * parameter, not MV's default), use:
- *
- * ResetWindowskin
- *
- *
- * If you want to use MV's default Window (for whatever reason), use:
- *
- * ResetSystemWindowskin
- *
- *
- *
- */
- (function() {
- CWT.parameters = PluginManager.parameters('CW_WindowskinTool');
- CWT.defaultWindowskin = String(CWT.parameters['Default Windowskin'] || 'Window');
- CWT.opacity = Number(CWT.parameters['Change Opacity'] || 220);
- CWT.GameInterpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
- Game_Interpreter.prototype.pluginCommand = function(command, args) {
- CWT.GameInterpreter_pluginCommand.call(this, command, args);
- if (command === 'ChangeWindowskin') {
- $gameSystem._newWindowskin = String(args[0]);
- ImageManager.loadSystem('windowskins/'+$gameSystem._newWindowskin);
- }
- if (command === 'ResetWindowskin') {
- $gameSystem._newWindowskin = CWT.defaultWindowskin;
- ImageManager.loadSystem('windowskins/'+$gameSystem._newWindowskin);
- }
- if (command === 'ResetSystemWindowskin') {
- $gameSystem._newWindowskin = 'Window';
- ImageManager.loadSystem($gameSystem._newWindowskin);
- }
- }
- CWT.GameSystem_initialize = Game_System.prototype.initialize;
- Game_System.prototype.initialize = function() {
- CWT.GameSystem_initialize.call(this);
- this._newWindowskin = CWT.defaultWindowskin;
- };
- CWT.WindowBase_loadWindowskin = Window_Base.prototype.loadWindowskin;
- Window_Base.prototype.loadWindowskin = function() {
- if ($gameSystem._newWindowskin !== 'Window') {
- this.windowskin = ImageManager.loadSystem('windowskins/'+$gameSystem._newWindowskin);
- } else {
- this.windowskin = ImageManager.loadSystem('Window');
- }
- if (this.windowskin !== 'Window') {
- this.changeTextColor = this.normalColor;
- }
- };
- Window_Base.prototype.standardBackOpacity = function() {
- return CWT.opacity;
- };
- CWT.WindowBase_update = Window_Base.prototype.update;
- Window_Base.prototype.update = function() {
- CWT.WindowBase_update.call(this);
- if ('windowskins/'+$gameSystem._newWindowskin) {
- if (this.windowskin !== 'windowskins/'+$gameSystem._newWindowskin) this.loadWindowskin();
- }
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement