-
Notifications
You must be signed in to change notification settings - Fork 1
/
KRD_ConfigCancel.js
49 lines (41 loc) · 1.45 KB
/
KRD_ConfigCancel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//================================================
// KRD-ConfigCancel.js
//
// Copyright (c) 2018 KRD_DATA (くろうど)
// This plugin is released under the MIT License.
// https://opensource.org/licenses/mit-license.php
//================================================
/*:
* @plugindesc This plugin adds "Cancel" to config window.
* @author KRD_DATA (くろうど)
*
*/
(function() {
'use strict';
//================================================
var KRD_Window_Options_makeCommandList = Window_Options.prototype.makeCommandList;
Window_Options.prototype.makeCommandList = function() {
KRD_Window_Options_makeCommandList.call(this);
this.addCommand(TextManager.cancel, 'cancel');
};
var KRD_Window_Options_statusText = Window_Options.prototype.statusText;
Window_Options.prototype.statusText = function(index) {
var symbol = this.commandSymbol(index);
if (symbol.contains('cancel')) {
return '';
}
return KRD_Window_Options_statusText.call(this, index);
};
var KRD_Window_Options_processOk = Window_Options.prototype.processOk;
Window_Options.prototype.processOk = function() {
var index = this.index();
var symbol = this.commandSymbol(index);
if (symbol.contains('cancel')) {
SoundManager.playCancel();
SceneManager.pop();
} else {
KRD_Window_Options_processOk.call(this);
}
};
//================================================
})();