Per la rubrica: "fatto in casa per voi"
Oggi lo chef Ischenderun vi mostra un plugin per il riposizionamento personalizzato della finestra scelte basato su variabili e switch.
Scegliete lo switch che attiverà il funzionamento del plugin.
Scegliete 2 variabili di gioco che modificheranno la posizione della finestra in base alle vostre esigenze.
Posizionate le finestre dove vi pare.
Nota: copiate e incollate il codice seguente su un blocco note o un editor di codice.
Nominate il file: ISC_Position_choice_window
con estensione .js
Condite il tutto con olio e sale.
Buon riposizionamento delle finestre di scelta a tutti!
/*: * @target MZ * @plugindesc v1.00 ISC_Position_choice_window * Allows the user to reposition the choices window * @author Ischenderun * * * @param Variable Id x * @type number * @min 0 * @text Variable Id x * @desc Set variable Id for position x * @default 1 * * @param Variable Id y * @type number * @min 0 * @text Variable Id y * @desc Set variable Id for position y * @default 2 * * @param Switch * @type number * @min 1 * @text Switch number Id * @desc Set switch ID for run plugin * @default 1 * @help Position_choice_window * * Choose the switch that enables the plugin. * Choose which variables will affect the positioning (pixel) * of the choices window. * * When the switch is off the choice windows will work with * the normal positions. * */ var Imported = Imported || {}; Imported.ISC_Position_choice_window = true; var Isc = Isc || {}; Isc.POS = Isc.POS || {}; Isc.POS.version = 1.00 Isc.Parameters = PluginManager.parameters('ISC_Position_choice_window'); Isc.Param = Isc.Param || {}; Isc.Param.POSvariableIdx = Number(Isc.Parameters['variable Id x']); Isc.Param.POSvariableIdy = Number(Isc.Parameters['variable Id y']); Isc.Param.POSSwitch = Number(Isc.Parameters['Switch']); Window_ChoiceList.prototype.updatePlacement = function() { var positionType = $gameMessage.choicePositionType(); var messageY = this._messageWindow.y; this.width = this.windowWidth(); this.height = this.windowHeight(); if ($gameSwitches.value(Isc.Param.POSSwitch) === true){ this.y = $gameVariables.value(Isc.Param.POSvariableIdx); this.x = $gameVariables.value(Isc.Param.POSvariableIdy); }else{ switch(positionType){ case 0: this.x = 0; break; case 1: this.x = (Graphics.boxWidth - this.width) / 2; break; case 2: this.x = Graphics.boxWidth - this.width; break; } if (messageY >= Graphics.boxHeight / 2){ this.y = messageY - this.height; }else{ this.y = messageY + this._messageWindow.height; } }; };
Modificato da Ischenderun, 17 May 2022 - 15:15 PM.