-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
RS_TitleManagerEx.js
753 lines (702 loc) · 21.2 KB
/
RS_TitleManagerEx.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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
//================================================================
// RS_TitleManagerEx.js
// ---------------------------------------------------------------
// The MIT License
// Copyright (c) 2015 biud436
// ---------------------------------------------------------------
// Free for commercial and non commercial use.
//================================================================
var Imported = Imported || {};
Imported.RS_TitleManagerEx = true;
/*:ko
* @plugindesc 엔딩 에필로그 이후 타이틀 설정을 변경할 수 있는 플러그인입니다.
* @author 러닝은빛(biud436)
*
* @param Epilogue 1
* @text 에필로그 1
*
* @param ep1 Title1
* @text 타이틀 1
* @parent Epilogue 1
* @desc 배경으로 쓸 타이틀1 이미지를 고르세요.
* @default Book
* @require 1
* @dir img/titles1/
* @type file
*
* @param ep1 Title2
* @text 타이틀 2
* @parent Epilogue 1
* @desc 배경으로 쓸 타이틀2 이미지를 고르세요.
* @default
* @require 1
* @dir img/titles2/
* @type file
*
* @param ep1 BGM
* @text BGM
* @parent Epilogue 1
* @desc 배경 음악을 설정하세요.
* @default Theme1
* @require 1
* @dir audio/bgm/
* @type file
*
* @param Epilogue 2
* @text 에필로그 2
*
* @param ep2 Title1
* @text 타이틀 1
* @parent Epilogue 2
* @desc 배경으로 쓸 타이틀1 이미지를 고르세요.
* @default Devil
* @require 1
* @dir img/titles1/
* @type file
*
* @param ep2 Title2
* @text 타이틀 2
* @parent Epilogue 2
* @desc 배경으로 쓸 타이틀2 이미지를 고르세요.
* @default
* @require 1
* @dir img/titles2/
* @type file
*
* @param ep2 BGM
* @text BGM
* @parent Epilogue 2
* @desc 배경 음악을 설정하세요.
* @default Field2
* @require 1
* @dir audio/bgm/
* @type file
*
* @param Epilogue 3
* @text 에필로그 3
*
* @param ep3 Title1
* @text Title 1
* @parent Epilogue 3
* @desc 배경으로 쓸 타이틀1 이미지를 고르세요.
* @default Book
* @require 1
* @dir img/titles1/
* @type file
*
* @param ep3 Title2
* @text Title 2
* @parent Epilogue 3
* @desc 배경으로 쓸 타이틀2 이미지를 고르세요.
* @default
* @require 1
* @dir img/titles2/
* @type file
*
* @param ep3 BGM
* @text BGM
* @parent Epilogue 3
* @desc 배경 음악을 설정하세요.
* @default Theme1
* @require 1
* @dir audio/bgm/
* @type file
*
* @param Epilogue 4
* @text 에필로그 4
*
* @param ep4 Title1
* @text Title 1
* @parent Epilogue 4
* @desc 에필로그 4의 타이틀1 이미지를 설정하세요
* @default Book
* @require 1
* @dir img/titles1/
* @type file
*
* @param ep4 Title2
* @text Title 2
* @parent Epilogue 4
* @desc 에필로그 4의 타이틀2 이미지를 설정하세요
* @default
* @require 1
* @dir img/titles2/
* @type file
*
* @param ep4 BGM
* @text BGM
* @parent Epilogue 4
* @desc 에필로그 4의 배경 음악을 설정하세요
* @default Theme1
* @require 1
* @dir audio/bgm/
* @type file
*
* @param Location
* @text 플레이어 초기 위치
*
* @param Map ID
* @text 맵 ID
* @parent Location
* @desc 에필로그 이후 특전 맵으로 들어갈 수 있는 버튼이 활성화 되는데 해당 맵의 ID입니다.
* @type number
* @default 1
*
* @param Map X
* @text 맵 X
* @parent Location
* @desc 에필로그 이후 특전 맵으로 들어갈 수 있는 버튼이 활성화 되는데 해당 맵의 X좌표입니다.
* @type number
* @min 0
* @default 0
*
* @param Map Y
* @text 맵 Y
* @parent Location
* @desc 에필로그 이후 특전 맵으로 들어갈 수 있는 버튼이 활성화 되는데 해당 맵의 Y좌표입니다.
* @type number
* @min 0
* @default 0
*
* @param Additional Command
* @text 추가 버튼 설정
*
* @param Specific Command
* @text 추가 버튼명
* @parent Additional Command
* @desc 에필로그 이후 특전 맵으로 들어갈 수 있는 버튼의 이름입니다.
* @type text
* @default Specific Command
*
* @param Show Specific Command
* @text 추가 버튼 표시 여부
* @parent Additional Command
* @desc 에필로그 이후 특전 맵으로 들어갈 수 있는 버튼이 표시되어야 하는 지 여부
* @type boolean
* @default true
* @on 표시한다
* @off 표시하지 않는다
*
* @help
* =============================================================================
* 플러그인 커맨드
* =============================================================================
* 에필로그 이후 아래 플러그인 커맨드를 호출해야 에필로그가 끝났음을 인식합니다.
*
* 엔딩 설정 ending1
* 엔딩 설정 ending2
* 엔딩 설정 ending3
* 엔딩 설정 ending4
*
* 새로운 플러그인 관리자의 구조체 기능을 사용하기에는 구조가 적합하지 않아,
* 엔딩 이름은 고정되어있습니다.
*
* 다음 명령은 설정된 에필로그를 모두 지우고 타이틀을 게임 화면과 동일하게 만듭니다.
*
* 엔딩 초기화
*
* =============================================================================
* 스크립트 호출
* =============================================================================
*
* 다음은 게임 내에서 어떤 엔딩을 클리어 했는 지 여부를 판단하는 함수입니다.
*
* if($gameMap.isClearEnding("ending1")) {
* // true
* } else {
* // false
* }
*
* 다음은 클리어한 엔딩 목록을 배열로 즉각 반환하는 함수입니다.
*
* $gameMap.getEnding();
*
* 이렇게 하면 클리어한 엔딩의 갯수를 알 수 있습니다.
*
* $gameMap.getEnding().length;
*
* =============================================================================
* 변경 기록
* =============================================================================
* 2015.12.21 (v1.0.0) - First Release.
* 2015.12.22 (v1.0.2) - Fixed a bug about the web local storage.
* 2016.03.07 (v1.0.3) - Fixed a bug that causes a serious problem when the parameters were set to English.
* 2017.06.09 (v1.0.4) - Fixed the parameter not to remove the resource when deploying the game.
* 2017.07.23 (v1.0.5) - Fixed the incorrect description
* 2018.08.28 (v1.0.6) - Fixed the incorrect plugin parameter's name.
* 2018.12.01 (v1.0.7) :
* - BGM이 재생되지 않았던 문제를 수정했습니다.
*/
/*:
* @plugindesc This plugin allows player to change resources of the title scene after the user has been ended a certain epilogue.
* @author biud436
*
* @param Epilogue 1
*
* @param ep1 Title1
* @text Title 1
* @parent Epilogue 1
* @desc Specify the title 1 image.
* @default Book
* @require 1
* @dir img/titles1/
* @type file
*
* @param ep1 Title2
* @text Title 2
* @parent Epilogue 1
* @desc Specify the title 2 image.
* @default
* @require 1
* @dir img/titles2/
* @type file
*
* @param ep1 BGM
* @text BGM
* @parent Epilogue 1
* @desc Specify the BGM file
* @default Theme1
* @require 1
* @dir audio/bgm/
* @type file
*
* @param Epilogue 2
*
* @param ep2 Title1
* @text Title 1
* @parent Epilogue 2
* @desc Specify the title 1 image.
* @default Devil
* @require 1
* @dir img/titles1/
* @type file
*
* @param ep2 Title2
* @text Title 2
* @parent Epilogue 2
* @desc Specify the title 2 image.
* @default
* @require 1
* @dir img/titles2/
* @type file
*
* @param ep2 BGM
* @text BGM
* @parent Epilogue 2
* @desc Specify the BGM file.
* @default Field2
* @require 1
* @dir audio/bgm/
* @type file
*
* @param Epilogue 3
*
* @param ep3 Title1
* @text Title 1
* @parent Epilogue 3
* @desc Specify the title 1 image.
* @default Book
* @require 1
* @dir img/titles1/
* @type file
*
* @param ep3 Title2
* @text Title 2
* @parent Epilogue 3
* @desc Specify the title 2 image.
* @default
* @require 1
* @dir img/titles2/
* @type file
*
* @param ep3 BGM
* @text BGM
* @parent Epilogue 3
* @desc Specify the BGM file.
* @default Theme1
* @require 1
* @dir audio/bgm/
* @type file
*
* @param Epilogue 4
*
* @param ep4 Title1
* @text Title 1
* @parent Epilogue 4
* @desc Specify the title 1 image.
* @default Book
* @require 1
* @dir img/titles1/
* @type file
*
* @param ep4 Title2
* @text Title 2
* @parent Epilogue 4
* @desc Specify the title 2 image.
* @default
* @require 1
* @dir img/titles2/
* @type file
*
* @param ep4 BGM
* @text BGM
* @parent Epilogue 4
* @desc Specify the BGM file.
* @default Theme1
* @require 1
* @dir audio/bgm/
* @type file
*
* @param Location
*
* @param Map ID
* @parent Location
* @desc Specify the id of hidden map. This can move to a hidden map through a newly created command
* @type number
* @default 1
*
* @param Map X
* @parent Location
* @desc Specify the starting point of hidden map. This can move to a hidden map through a newly created command
* @type number
* @min 0
* @default 0
*
* @param Map Y
* @parent Location
* @desc Specify the starting point of hidden map. This can move to a hidden map through a newly created command
* @type number
* @min 0
* @default 0
*
* @param Additional Command
*
* @param Specific Command
* @parent Additional Command
* @desc Specify the command name. This can move to a hidden map through this command
* @type text
* @default Specific Command
*
* @param Show Specific Command
* @text Show
* @parent Additional Command
* @desc Decide whether the command window is visible.
* @type boolean
* @default true
* @on visible
* @off hide
*
* @help
* =============================================================================
* Plugin Commands
* =============================================================================
* This plugin command allows you to set the Ending :
*
* Ending Setup ending1
* Ending Setup ending2
* Ending Setup ending3
* Ending Setup ending4
*
* This plugin command allows you to initialize the Ending :
*
* Ending RemoveAll
*
* =============================================================================
* Useful Scripts
* =============================================================================
*
* This code confirms an ended Ending of the game :
*
* if($gameMap.isClearEnding("ending1")) {
* // true
* } else {
* // false
* }
*
* Returns a completed game's Ending List. For example :
*
* $gameMap.getEnding();
*
* Returns the number of the completed ending. For example :
*
* $gameMap.getEnding().length;
*
* =============================================================================
* Change Log
* =============================================================================
* 2015.12.21 (v1.0.0) - First Release.
* 2015.12.22 (v1.0.2) - Fixed a bug about the web local storage.
* 2016.03.07 (v1.0.3) - Fixed a bug that causes a serious problem when the parameters were set to English.
* 2017.06.09 (v1.0.4) - Fixed the parameter not to remove the resource when deploying the game.
* 2017.07.23 (v1.0.5) - Fixed the incorrect description
* 2018.08.28 (v1.0.6) - Fixed the inccorect plugin parameter's name.
* 2018.12.01 (v1.0.7) :
* - Fixed the issue that couldn't playback the BGM.
*/
var RS = RS || {};
RS.TitleManagerEx = RS.TitleManagerEx || {};
(function() {
"use strict";
var parameters = PluginManager.parameters("RS_TitleManagerEx");
RS.TitleManagerEx.Params = RS.TitleManagerEx.Params || {};
RS.TitleManagerEx.Params.Position = RS.TitleManagerEx.Params.Position || {};
RS.TitleManagerEx.Params.EndingClearList = RS.TitleManagerEx.Params.EndingClearList || [];
RS.TitleManagerEx.Tool = RS.TitleManagerEx.Tool || {};
RS.TitleManagerEx.Header = RS.TitleManagerEx.Header || {};
//============================================================================
RS.TitleManagerEx.Params.specialMenuName = String(parameters['Specific Command'] || 'Specific Command');
RS.TitleManagerEx.Params.showSpecialMenu = Boolean(parameters['Show Specific Command'] === 'true');
RS.TitleManagerEx.Tool.RESOURCE = RS.TitleManagerEx.Tool.RESOURCE || {};
RS.TitleManagerEx.Tool.RESOURCE["base title"] = [];
RS.TitleManagerEx.getEpilogue = function (name) {
var ret = [];
var failedRet = RS.TitleManagerEx.Tool.RESOURCE['base title'];
if(name === 'base title') {
return failedRet;
}
name = name.replace('ending', 'ep');
ret.push(parameters[`${name} Title1`]);
ret.push(parameters[`${name} Title2`]);
ret.push(parameters[`${name} BGM`]);
return (!!ret) ? ret : failedRet;
};
Object.assign(RS.TitleManagerEx.Tool.RESOURCE, {
'ending1': RS.TitleManagerEx.getEpilogue('ending1'),
'ending2': RS.TitleManagerEx.getEpilogue('ending2'),
'ending3': RS.TitleManagerEx.getEpilogue('ending3'),
'ending4': RS.TitleManagerEx.getEpilogue('ending4')
});
RS.TitleManagerEx.Params.Position = {
'MAP_ID': Number(parameters["Map ID"] || 1),
'X': Number(parameters["Map X"] || 0),
'Y': Number(parameters["Map Y"] || 0)
};
RS.TitleManagerEx.Params.Position.RESULT = [
RS.TitleManagerEx.Params.Position.MAP_ID,
RS.TitleManagerEx.Params.Position.X,
RS.TitleManagerEx.Params.Position.Y
];
//============================================================================
// DataManager
//============================================================================
DataManager.setupSpecialGame = function() {
this.createGameObjects();
this.selectSavefileForNewGame();
$gameParty.setupStartingMembers();
$gamePlayer.reserveTransfer(arguments[0], arguments[1], arguments[2]);
Graphics.frameCount = 0;
};
DataManager.saveToEnding = function(string) {
if(StorageManager.isLocalMode()) {
StorageManager.saveToLocalEnding(string);
} else {
StorageManager.saveToWebEnding(string);
}
};
DataManager.removeEnding = function() {
if(StorageManager.isLocalMode()) {
StorageManager.removeLocalEnding();
} else {
StorageManager.removeWebEnding();
}
};
DataManager.loadFromEnding = function(string) {
if(StorageManager.isLocalMode()) {
return StorageManager.loadFromLocalEnding(string);
} else {
return StorageManager.loadFromWebEnding(string);
}
};
//============================================================================
// StorageManager
//============================================================================
StorageManager.saveToLocalEnding = function(string) {
var json = JSON.stringify(this.publishKey(string));
var data = LZString.compressToBase64(json);
var fs = require('fs');
var dirPath = this.localFileDirectoryPath();
var filePath = dirPath + "ending.dat";
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath);
}
fs.writeFileSync(filePath, data);
};
StorageManager.loadFromLocalEnding = function(string) {
var data = null;
var fs = require('fs');
var filePath = this.localFileDirectoryPath() + 'ending.dat';
if(fs.existsSync(filePath)) {
data = fs.readFileSync(filePath, { encoding: 'utf8' });
return JSON.parse(LZString.decompressFromBase64(data));
} else {
return this.endingNull();
}
};
StorageManager.removeLocalEnding = function() {
var fs = require('fs');
var filePath = this.localFileDirectoryPath() + 'ending.dat';
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
}
};
StorageManager.saveToWebEnding = function(string) {
var key = 'RPG Ending';
var json = JSON.stringify(this.publishKey(string));
var data = LZString.compressToBase64(json);
localStorage.setItem(key, data);
};
StorageManager.loadFromWebEnding = function(string) {
var key = 'RPG Ending';
var data = null;
if(!!localStorage.getItem(key)) {
data = localStorage.getItem(key);
return JSON.parse(LZString.decompressFromBase64(data));
} else {
return this.endingNull();
}
};
StorageManager.removeWebEnding = function() {
var key = 'RPG Ending';
localStorage.removeItem(key);
};
StorageManager.endingNull = function() {
var ending;
ending = {};
ending.version = 0;
ending.n = RS.TitleManagerEx.Tool.RESOURCE['base title'];
ending.endingClearList = RS.TitleManagerEx.Params.EndingClearList;
return ending;
};
StorageManager.publishKey = function(string) {
try {
var ending;
ending = {};
ending.version = 1000;
ending.n = RS.TitleManagerEx.Tool.RESOURCE[string];
RS.TitleManagerEx.Params.EndingClearList.push(string);
ending.endingClearList = RS.TitleManagerEx.Params.EndingClearList;
return ending;
} catch(e) {
return this.endingNull();
}
};
//============================================================================
// RS.TitleManagerEx.Header
//============================================================================
RS.TitleManagerEx.Header.background = null;
RS.TitleManagerEx.Header.load = function() {
var f = DataManager.loadFromEnding();
RS.TitleManagerEx.Params.EndingClearList = f.endingClearList;
var result = [f.version, f.n];
return result;
}
RS.TitleManagerEx.Header.chooseBackground = function() {
if(this.load()[0] === 1000) {
this.loadBackground(this.load()[1])
return true;
} else {
RS.TitleManagerEx.Header.background = RS.TitleManagerEx.Tool.RESOURCE['base title'];
return false;
}
};
RS.TitleManagerEx.Header.loadBackground = function(set) {
RS.TitleManagerEx.Header.background = set;
};
RS.TitleManagerEx.Header.exportBackground = function() {
return RS.TitleManagerEx.Header.background;
};
RS.TitleManagerEx.Header.isSpecialMenu = function() {
if(this.load()[0] === 1000 && RS.TitleManagerEx.Params.showSpecialMenu) {
return true;
} else {
return false;
}
};
//============================================================================
// Game_Map
//============================================================================
Game_Map.prototype.isClearEnding = function(string) {
var result = RS.TitleManagerEx.Params.EndingClearList.filter(function(i){
if(i === string) {
return true;
} else {
return false;
}
}.bind(this));
return result.length > 0
};
Game_Map.prototype.getEnding = function() {
return RS.TitleManagerEx.Params.EndingClearList;
};
//============================================================================
// Window_TitleCommand
//============================================================================
Window_TitleCommand.prototype.makeCommandList = function() {
this.addCommand(TextManager.newGame, 'newGame');
this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled());
if(RS.TitleManagerEx.Header.isSpecialMenu()) {
this.addCommand(RS.TitleManagerEx.Params.specialMenuName, 'specialMenu');
}
this.addCommand(TextManager.options, 'options');
};
//============================================================================
// Scene_Title
//============================================================================
var alias_Scene_Title_create = Scene_Title.prototype.create;
Scene_Title.prototype.create = function() {
RS.TitleManagerEx.Tool.RESOURCE['base title'] = [$dataSystem.title1Name, $dataSystem.title2Name, $dataSystem.titleBgm],
alias_Scene_Title_create.call(this);
};
Scene_Title.prototype.createBackground = function() {
RS.TitleManagerEx.Header.chooseBackground();
this._backSprite1 = new Sprite(ImageManager.loadTitle1(RS.TitleManagerEx.Header.exportBackground()[0]));
this._backSprite2 = new Sprite(ImageManager.loadTitle2(RS.TitleManagerEx.Header.exportBackground()[1]));
this.addChild(this._backSprite1);
this.addChild(this._backSprite2);
};
Scene_Title.prototype.playTitleMusic = function() {
if(RS.TitleManagerEx.Header.chooseBackground()) {
var data = AudioManager.makeEmptyAudioObject();
data.name = RS.TitleManagerEx.Header.exportBackground()[2];
data.volume = 90;
data.pitch = 100;
AudioManager.playBgm(data);
} else {
AudioManager.playBgm($dataSystem.titleBgm);
}
AudioManager.stopBgs();
AudioManager.stopMe();
};
var alias_createCommandWindow = Scene_Title.prototype.createCommandWindow;
Scene_Title.prototype.createCommandWindow = function() {
alias_createCommandWindow.call(this);
if(RS.TitleManagerEx.Header.isSpecialMenu()) {
this._commandWindow.setHandler('specialMenu', this.specialMenu.bind(this));
}
};
Scene_Title.prototype.specialMenu = function() {
DataManager.setupSpecialGame.apply(DataManager, RS.TitleManagerEx.Params.Position.RESULT);
this._commandWindow.close();
this.fadeOutAll();
SceneManager.goto(Scene_Map);
};
//============================================================================
// Game_Interpreter
//============================================================================
var alias_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
alias_pluginCommand.call(this, command, args);
if(command === "Ending" || command === "엔딩") {
switch (args[0].toLowerCase()) {
case 'setup':
case '설정':
DataManager.saveToEnding(args[1]);
break;
case '초기화':
case 'removeall':
DataManager.removeEnding();
break;
}
}
};
})();