-
Notifications
You must be signed in to change notification settings - Fork 0
/
skiptitle.js
83 lines (77 loc) · 2.78 KB
/
skiptitle.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//=============================================================================
// SilvSkipTitle.js
// Version: 1.02
// License: Public Domain or CC0
//=============================================================================
/*:
* @plugindesc v1.00 Skips Title Screen
<SilverSkipTitle>
* @author Silver
*
* @param Skip Title Screen Entirely
* @desc Set to false to load the titlescreen briefly. true/false
* @default true
*
* @param Skip If Savefile Present
* @desc Skip the titlescreen if one or more savefiles are present? true/false
* @default true
*
* @param FadeOut Title
* @desc Only applies when SkipTitleScreenEntirely is set to false. true/false
* @default false
*
* @help No credits required, modify as you see fit.
*/
(function()
{
// Get Plugin Parameters
var Silv = Silv || {};
Silv.Parameters = $plugins.filter(function(p) { return p.description.contains('<SilverSkipTitle>'); })[0].parameters;
Silv.SkipTitle = Silv.SkipTitle || {};
Silv.SkipTitle.SkipTitleScreenEntirely = Silv.Parameters['Skip Title Screen Entirely'].toLowerCase() == 'true';
Silv.SkipTitle.SkipIfSavefilePresent = Silv.Parameters['Skip If Savefile Present'].toLowerCase() == 'true';
Silv.SkipTitle.FadeOutTitle = Silv.Parameters['FadeOut Title'].toLowerCase() == 'true';
function ShowTitleScreen() { return DataManager.isAnySavefileExists() && !Silv.SkipTitle.SkipIfSavefilePresent; }
// Skipping the title screen entirely
var alias_methodSceneBootStart = Scene_Boot.prototype.start;
Scene_Boot.prototype.start = function()
{
if (Silv.SkipTitle.SkipTitleScreenEntirely && !ShowTitleScreen())
{
Scene_Base.prototype.start.call(this);
SoundManager.preloadImportantSounds();
if (DataManager.isBattleTest()) {
DataManager.setupBattleTest();
SceneManager.goto(Scene_Battle);
} else if (DataManager.isEventTest()) {
DataManager.setupEventTest();
SceneManager.goto(Scene_Map);
} else {
this.checkPlayerLocation();
DataManager.setupNewGame();
SceneManager.goto(Scene_Map);
}
this.updateDocumentTitle();
}
else
{
alias_methodSceneBootStart.apply(this, arguments);
}
};
// Fading closing and optionally fading the titlescreen entirely.
var alias_method_SceneTitleStart = Scene_Title.prototype.start;
Scene_Title.prototype.start = function()
{
if(ShowTitleScreen)
{
alias_method_SceneTitleStart.apply(this, arguments);
}
else // Skip title screen
{
DataManager.setupNewGame();
this._commandWindow.close();
if (Silv.SkipTitle.FadeOutTitle) { this.fadeOutAll(); }
SceneManager.goto(Scene_Map);
}
};
})();