Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*=============================================================================
- * TextSpeed
- *=============================================================================*/
- var Imported = Imported || {};
- Imported.Krimer_TextSpeed = true;
- /*:
- * @plugindesc 1.0 Text speed control, available speed - 0.5x, 1x, 2x, instant.
- * <TextSpeed>
- * @author Krimer
- *
- * @param Variable id
- * @desc Variable id for text speed control. Left 0 to disable. Default: 0
- * @default 0
- *
- * @param Default text speed
- * @desc Default value of text speed variable. 0 = 0.5x, 1 = 1x, 2 = 2x, 3 = instant. Default: 1
- * @default 1
- *
- * @help
- * --------------------------------------------------------------------------------
- * Free for use.
- * Version 1.0
- * --------------------------------------------------------------------------------
- * To change text speed in show text command, set text speed variable to
- * proper value.
- * Available variable values:
- * 0 = 0.5x text speed
- * 1 = 1x normal text speed
- * 2 = 2x text speed
- * 3 = instant text speed
- */
- (function() {
- var parameters = $plugins.filter(function(p) { return p.description.contains('<TextSpeed>'); })[0].parameters;
- var paramVariableId = Number(parameters['Variable id'] || 0);
- var paramDefaultValue = Number(parameters['Default text speed'] || 1);
- /* Alias */
- var textSpeed_Alias_DataManager_setupNewGame = DataManager.setupNewGame;
- DataManager.setupNewGame = function() {
- textSpeed_Alias_DataManager_setupNewGame.call(this)
- if (paramVariableId !== 0){
- $gameVariables[paramVariableId] = paramDefaultValue;
- }
- };
- /* OVERWRITE */
- Window_Message.prototype.updateMessage = function() {
- if (this._textState) {
- while (!this.isEndOfText(this._textState)) {
- if (this.needsNewPage(this._textState)) {
- this.newPage(this._textState);
- }
- this.updateShowFast();
- if (paramVariableId !== 0){
- switch ($gameVariables[paramVariableId]) {
- case 0:
- this.startWait(1);
- break
- case 1:
- break
- case 2:
- this.processCharacter(this._textState);
- break
- case 3:
- this._showFast = true;
- break
- default:
- break
- }
- }
- this.processCharacter(this._textState);
- if (!this._showFast && !this._lineShowFast) {
- break;
- }
- if (this.pause || this._waitCount > 0) {
- break;
- }
- }
- if (this.isEndOfText(this._textState)) {
- this.onEndOfText();
- }
- return true;
- } else {
- return false;
- }
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment