-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWindow_TitleCommand.js
56 lines (45 loc) · 1.74 KB
/
Window_TitleCommand.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
50
51
52
53
54
55
56
//-----------------------------------------------------------------------------
// Window_TitleCommand
//
// The window for selecting New Game/Continue on the title screen.
function Window_TitleCommand() {
this.initialize.apply(this, arguments);
}
Window_TitleCommand.prototype = Object.create(Window_Command.prototype);
Window_TitleCommand.prototype.constructor = Window_TitleCommand;
Window_TitleCommand.prototype.initialize = function() {
Window_Command.prototype.initialize.call(this, 0, 0);
this.updatePlacement();
this.openness = 0;
this.selectLast();
};
Window_TitleCommand._lastCommandSymbol = null;
Window_TitleCommand.initCommandPosition = function() {
this._lastCommandSymbol = null;
};
Window_TitleCommand.prototype.windowWidth = function() {
return 240;
};
Window_TitleCommand.prototype.updatePlacement = function() {
this.x = (Graphics.boxWidth - this.width) / 2;
this.y = Graphics.boxHeight - this.height - 96;
};
Window_TitleCommand.prototype.makeCommandList = function() {
this.addCommand(TextManager.newGame, 'newGame');
this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled());
this.addCommand(TextManager.options, 'options');
};
Window_TitleCommand.prototype.isContinueEnabled = function() {
return DataManager.isAnySavefileExists();
};
Window_TitleCommand.prototype.processOk = function() {
Window_TitleCommand._lastCommandSymbol = this.currentSymbol();
Window_Command.prototype.processOk.call(this);
};
Window_TitleCommand.prototype.selectLast = function() {
if (Window_TitleCommand._lastCommandSymbol) {
this.selectSymbol(Window_TitleCommand._lastCommandSymbol);
} else if (this.isContinueEnabled()) {
this.selectSymbol('continue');
}
};