-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathGabeMZ_DisableTitleScreen.js
222 lines (198 loc) · 7.52 KB
/
GabeMZ_DisableTitleScreen.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
//==========================================================================
// Gabe MZ - Disable Title Screen
//----------------------------------------------------------------------------
// 20/08/20 | Version: 1.0.0 | Released
//----------------------------------------------------------------------------
// This software is released under the zlib License.
//============================================================================
/*:
* @target MZ
* @plugindesc [v1.0.0] Disable the default Title Screen.
* @author Gabe (Gabriel Nascimento)
* @url https://github.com/comuns-rpgmaker/GabeMZ
*
* @help Gabe MZ - Diblade Title Screen
* - This plugin is released under the zlib License.
*
* This plugin disable the default title screen of RPG Maker.
*
* Set the Default Title Screen parameter to set if the default title screen
* will still be accessible via the menu and the "Return to Title Screen" event
* command.
*
* Also is possible to enable or disable this option through a Plugin Command.
*
* Plugin Commands:
* Set Title Screen
* | This command allows to enable or disable the default Title Screen
* | in game start
*
* @param defaultTitleScreen
* @text Default Title Screen
* @desc Enable or disable the default Title Screen in game start.
* @type boolean
* @default false
*
* @command defaultTitle
* @text Set Title Screen
* @desc Set enable or disable the default Title Screen.
*
* @arg defaultTitleScreen
* @type boolean
* @default false
* @text Default Title Screen
* @desc Enable or disable the default Title Screen.
*/
/*:pt
* @target MZ
* @plugindesc [v1.0.0] Desabilita a Tela de Título padrão.
* @author Gabe (Gabriel Nascimento)
* @url https://github.com/comuns-rpgmaker/GabeMZ
*
* @help
* Gabe MZ - Disable Title Screen
* - Esse plugin foi disponibilizado sob a licença zlib.
*
* Esse plugin desabilita a tela de título padrão do RPG Maker MZ.
*
* Configure o parâmetro Default Title Screen para definir se a tela de título padrão
* ainda será acessível através do menu e do comando de evento "Voltar à Tela de
* Título".
*
* Também é possível ativar ou desativar essa opção através de um Plugin Command.
*
* Plugin Commands:
* Set Title Screen
* | Esse comando ativa ou desativa a Tela de Título padrão no início do
* | jogo.
*
* @param defaultTitleScreen
* @text Default Title Screen
* @desc Ativa ou desativa a Tela de Título padrão no início do jogo.
* @type boolean
* @default false
*
* @command defaultTitle
* @text Set Title Screen
* @desc Define se a Tela de Título padrão será ativa ou não.
*
* @arg defaultTitleScreen
* @type boolean
* @default false
* @text Default Title Screen
* @desc Ativa ou desativa a tela de título padrão.
*/
var Imported = Imported || {};
Imported.GMZ_DisableTitleScreen = true;
var GabeMZ = GabeMZ || {};
GabeMZ.DisableTitleScreen = GabeMZ.DisableTitleScreen || {};
GabeMZ.DisableTitleScreen.VERSION = [1, 0, 0];
(() => {
const pluginName = "GabeMZ_DisableTitleScreen";
const params = PluginManager.parameters(pluginName);
GabeMZ.DisableTitleScreen.titleInGame = params.defaultTitleScreen == "true";
GabeMZ.DisableTitleScreen.mapFadeOut = true;
//-----------------------------------------------------------------------------
// PluginManager
//
// The static class that manages the plugins.
PluginManager.registerCommand(pluginName, "defaultTitle", args => {
const bool = args.defaultTitleScreen == "true";
GabeMZ.DisableTitleScreen.titleInGame = bool;
});
//-----------------------------------------------------------------------------
// DataManager
//
// The static class that manages the database and game objects.
const _DataManager_makeSaveContents = DataManager.makeSaveContents;
DataManager.makeSaveContents = function() {
const contents = _DataManager_makeSaveContents.call(this);
contents.disableTitle = GabeMZ.DisableTitleScreen.titleInGame;
return contents;
}
const _DataManager_extractSaveContents = DataManager.extractSaveContents;
DataManager.extractSaveContents = function(contents) {
_DataManager_extractSaveContents.call(this, contents);
GabeMZ.DisableTitleScreen.titleInGame = contents.disableTitle;
};
//-----------------------------------------------------------------------------
// Game_Interpreter
//
// The interpreter for running event commands.
const _Game_Interpreter_command354 = Game_Interpreter.prototype.command354
Game_Interpreter.prototype.command354 = function() {
if (!GabeMZ.DisableTitleScreen.titleInGame) {
GabeMZ.DisableTitleScreen.mapFadeOut = true;
DataManager.setupNewGame();
SceneManager.goto(Scene_Map);
return true;
} else {
_Game_Interpreter_command354.call(this);
}
};
//-----------------------------------------------------------------------------
// Scene_Boot
//
// The scene class for initializing the entire game.
const _Scene_Boot_start = Scene_Boot.prototype.start;
Scene_Boot.prototype.start = function() {
if (GabeMZ.DisableTitleScreen.titleInGame) {
_Scene_Boot_start.call(this);
} else {
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.resizeScreen();
this.updateDocumentTitle();
}
};
//-----------------------------------------------------------------------------
// Scene_Map
//
// The scene class of the map screen.
const _Scene_Map_start = Scene_Map.prototype.start;
Scene_Map.prototype.start = function() {
_Scene_Map_start.call(this);
if (!GabeMZ.DisableTitleScreen.titleInGame) GabeMZ.DisableTitleScreen.mapFadeOut = false;
};
const _Scene_Map_needsSlowFadeOut = Scene_Map.prototype.needsSlowFadeOut;
Scene_Map.prototype.needsSlowFadeOut = function() {
return _Scene_Map_needsSlowFadeOut.call(this) || GabeMZ.DisableTitleScreen.mapFadeOut;
};
//-----------------------------------------------------------------------------
// Scene_GameEnd
//
// The scene class of the game end screen.
const _Scene_GameEnd_commandToTitle = Scene_GameEnd.prototype.commandToTitle;
Scene_GameEnd.prototype.commandToTitle = function() {
if (!GabeMZ.DisableTitleScreen.titleInGame) {
this.fadeOutAll();
DataManager.setupNewGame();
SceneManager.goto(Scene_Map);
} else {
_Scene_GameEnd_commandToTitle.call(this);
}
};
//-----------------------------------------------------------------------------
// Scene_Gameover
//
// The scene class of the game over screen.
const _Scene_Gameover_gotoTitle = Scene_Gameover.prototype.gotoTitle;
Scene_Gameover.prototype.gotoTitle = function() {
if (!GabeMZ.DisableTitleScreen.titleInGame) {
DataManager.setupNewGame();
SceneManager.goto(Scene_Map);
} else {
_Scene_Gameover_gotoTitle.call(this);
}
};
})();