-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBabeElena_FullScreenToggles.js
119 lines (107 loc) · 4.18 KB
/
BabeElena_FullScreenToggles.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
//=============================================================================
// Fullscreen Settings Plugin
// by BabeElena, Glory Forever PCL
// Date: April 11, 2023
// Version: 1.0
//=============================================================================
/*:
* @target MZ
* @plugindesc A plugin that adds a Fullscreen Settings option in the Options menu.
* @author Glory Forever
*
* @help Fullscreen Settings Plugin
*
* This plugin allows the player to toggle fullscreen mode on/off in the Options menu.
*
* To use this plugin, simply add it to your plugin list and enable it.
*
* @param Fullscreen Text
* @text Fullscreen Text
* @desc The text to display for the Fullscreen option in the Options menu.
* @type text
* @default Fullscreen
*
* @param Window Mode Text
* @text Window Mode Text
* @desc The text to display for the Window mode option in the Options menu.
* @type text
* @default Window
*
* @param Fullscreen Mode Text
* @text Fullscreen Mode Text
* @desc The text to display for the Fullscreen mode option in the Options menu.
* @type text
* @default Fullscreen
*
* @param Default Fullscreen
* @text Default Fullscreen
* @desc Whether to enable Fullscreen mode by default.
* @type boolean
* @default false
*
* @param Default Window
* @text Default Window
* @desc Whether to enable Window mode by default.
* @type boolean
* @default true
*/
(function() {
var parameters = PluginManager.parameters('GF_Fullscreen_Settings');
var fullscreenText = parameters['Fullscreen Text'] || 'Fullscreen';
var windowModeText = parameters['Window Mode Text'] || 'Window';
var fullscreenModeText = parameters['Fullscreen Mode Text'] || 'Fullscreen';
var defaultFullscreen = parameters['Default Fullscreen'] === 'true' ? true : false;
var defaultWindow = parameters['Default Window'] === 'true' ? true : false;
//=============================================================================
// Window_Options
//=============================================================================
var GF_Window_Options_makeCommandList = Window_Options.prototype.makeCommandList;
Window_Options.prototype.makeCommandList = function() {
GF_Window_Options_makeCommandList.call(this);
this.addCommand(fullscreenText, 'fullscreen');
};
var GF_Window_Options_statusText = Window_Options.prototype.statusText;
Window_Options.prototype.statusText = function(index) {
var symbol = this.commandSymbol(index);
var value = this.getConfigValue(symbol);
if (symbol === 'fullscreen') {
return value ? fullscreenModeText : windowModeText;
} else {
return GF_Window_Options_statusText.call(this, index);
}
};
var GF_Window_Options_processOk = Window_Options.prototype.processOk;
Window_Options.prototype.processOk = function() {
var index = this.index();
var symbol = this.commandSymbol(index);
if (symbol === 'fullscreen') {
var value = this.getConfigValue(symbol);
this.changeValue(symbol, !value);
} else {
GF_Window_Options_processOk.call(this);
}
};
//=============================================================================
// ConfigManager
//=============================================================================
ConfigManager.fullscreen = defaultFullscreen;
var GF_ConfigManager_makeData = ConfigManager.makeData;
ConfigManager.makeData = function() {
var config = GF_ConfigManager_makeData.call(this);
config.fullscreen = this.fullscreen;
return config;
};
var GF_ConfigManager_applyData = ConfigManager.applyData;
ConfigManager.applyData = function(config) {
GF_ConfigManager_applyData.call(this, config);
this.fullscreen = this.readFlag(config, 'fullscreen');
};
//=============================================================================
// SceneManager
//=============================================================================
var GF_SceneManager_initialize = SceneManager.initialize;
SceneManager.initialize = function() {
GF_SceneManager_initialize.call(this);
Graphics.fullscreen = ConfigManager.fullscreen;
};
})();