Skip to content

Commit c22f99a

Browse files
authored
Merge pull request rpgtkoolmv#155 from rpgtkoolmv/add_textspeed
Add text speed
2 parents 346d34b + f2bbf16 commit c22f99a

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

js/rpg_windows/Window_Message.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Window_Message.prototype.clearFlags = function() {
5757
this._showFast = false;
5858
this._lineShowFast = false;
5959
this._pauseSkip = false;
60+
this._textSpeed = 0;
61+
this._textSpeedCount = 0;
6062
};
6163

6264
Window_Message.prototype.numVisibleRows = function() {
@@ -176,8 +178,13 @@ Window_Message.prototype.updateMessage = function() {
176178
this.newPage(this._textState);
177179
}
178180
this.updateShowFast();
181+
if (!this._showFast && !this._lineShowFast && this._textSpeedCount < this._textSpeed) {
182+
this._textSpeedCount++;
183+
break;
184+
}
185+
this._textSpeedCount = 0;
179186
this.processCharacter(this._textState);
180-
if (!this._showFast && !this._lineShowFast) {
187+
if (!this._showFast && !this._lineShowFast && this._textSpeed !== -1) {
181188
break;
182189
}
183190
if (this.pause || this._waitCount > 0) {
@@ -313,6 +320,9 @@ Window_Message.prototype.processEscapeCharacter = function(code, textState) {
313320
case '^':
314321
this._pauseSkip = true;
315322
break;
323+
case 'S':
324+
this._textSpeed = this.obtainEscapeParam(textState) - 1;
325+
break;
316326
default:
317327
Window_Base.prototype.processEscapeCharacter.call(this, code, textState);
318328
break;

plugins/Community_Basic.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
* @desc The initial value whether the player always dashes (on/off)
5050
* @default false
5151
*
52+
* @param textSpeed
53+
* @type number
54+
* @desc The text speed on "Show Text". The larger this parameter is, the slower text speed. (0: show all texts at once)
55+
* @default 1
56+
*
5257
* @param autoSaveFileId
5358
* @type number
5459
* @desc The file number to auto save when "Transfer Player" (0: off)
@@ -114,6 +119,12 @@
114119
* @text 「常時ダッシュ」の初期値
115120
* @default false
116121
*
122+
* @param textSpeed
123+
* @type number
124+
* @text 「文章の表示」のスピード
125+
* @desc 数字が大きいほど文章の表示スピードが遅くなります (0を指定した場合は一度に全文を表示します)
126+
* @default 1
127+
*
117128
* @param autoSaveFileId
118129
* @type number
119130
* @text オートセーブ番号
@@ -142,6 +153,7 @@
142153
var screenHeight = toNumber(parameters['screenHeight'], 624);
143154
var renderingMode = parameters['renderingMode'].toLowerCase();
144155
var alwaysDash = parameters['alwaysDash'].toLowerCase() === 'true';
156+
var textSpeed = toNumber(parameters['textSpeed'], 1);
145157
var windowWidthTo = toNumber(parameters['changeWindowWidthTo'], 0);
146158
var windowHeightTo = toNumber(parameters['changeWindowHeightTo'], 0);
147159
var autoSaveFileId = toNumber(parameters['autoSaveFileId'], 0);
@@ -191,6 +203,11 @@
191203
}
192204
};
193205

206+
var _Window_Message_clearFlags = Window_Message.prototype.clearFlags;
207+
Window_Message.prototype.clearFlags = function(textState) {
208+
_Window_Message_clearFlags.apply(this, arguments);
209+
this._textSpeed = textSpeed - 1;
210+
};
194211

195212
var _SceneManager_initNwjs = SceneManager.initNwjs;
196213
SceneManager.initNwjs = function() {

0 commit comments

Comments
 (0)