-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGoS_FontSize.js
More file actions
244 lines (234 loc) · 7.04 KB
/
GoS_FontSize.js
File metadata and controls
244 lines (234 loc) · 7.04 KB
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
/*:
* @plugindesc Change font sizing (make it 'x' smaller and 'y' bigger)
* @author GamesOfShadows
* @help
* With this plugin (for RPGmaker MV & MZ) you can change the font sizing.
* So you can make your text 'x' smaller and 'y' bigger using \} and \{.
*
* - I'm using a different font, so it looked weird when I used '\}' or '\{'.
* Also I didn't liked the steps (I think they are way to big).
*
* - To change the default font size in MZ, go to
* "Database" -> "System 2" and change the "Font size".
*
* ------------------------------------------------------------
*
* - Plugin-Commands (MV) - Change the settings later ingame:
*
* makeFontBigger x
*
* makeFontSmaller x
*
* maxFontSize x
*
* minFontSize x
*
* defaultFontSize x
*
* resetFontSize
*
* (replace x with a number)
*
* Example: makeFontBigger 5
*
* - Plugin-Commands (MZ) - Change the settings later ingame:
* Same as MV, but without entering the commands.
* You have to select them and just input the values.
*
* ------------------------------------------------------------
*
* PS: I'm still "beginner" to something "advanced" regarding JS.
* If there are problems with a plugin,
* I will probably NOT be able to solve them!
*
* ------------------------------------------------------------
*
* Version: 1.0
*
* - You can do everything you want with this plugin
* - You can use it commercially
* - You DON'T need to credit me
*
* It's just a short & simple plugin. ^^
*
* @target MV
*
* @param makeFontBigger
* @text Make font bigger
* @desc Size / value by which to increase the font size (\{)
* @type number
* @default 2
*
* @param makeFontSmaller
* @text Make font smaller
* @desc Size / value by which to decrease the font size (\})
* @type number
* @default 2
*
* @param maxFontSize
* @text Max. font size
* @desc Max. size of the font (\{)
* @type number
* @default 100
*
* @param minFontSize
* @text Min. font size
* @desc Min. size of the font (\})
* @type number
* @default 8
*
* @param defaultFontSize
* @text Default font size (MV only)
* @desc Set the default font size (MV only)!
* For MZ: "Database" -> "System 2", edit "Font size"
* @type number
* @default 28
*
* @target MZ
*
* @command change_FontSizeSettings
* @text Change Plugin-Settings
* @desc If you change the font you can use this to adjust the settings
*
* @arg change_makeFontBigger
* @text makeFontBigger
* @desc Input a Number
* @type number
* @default 2
*
* @arg change_makeFontSmaller
* @text makeFontSmaller
* @desc Input a Number
* @type number
* @default 2
*
* @arg change_maxFontSize
* @text maxFontSize
* @desc Input a Number
* @type number
* @default 100
*
* @arg change_minFontSize
* @text minFontSize
* @desc Input a Number
* @type number
* @default 8
*
* @arg change_defaultFontSize
* @text defaultFontSize
* @desc Input a Number
* @type number
* @default 28
*
* @command reset_defaultFontSize
* @text Reset default font size
* @desc If you want to use the default font size you set in the database / "system 2"
*/
(() => {
const pluginName = "GoS_FontSize";
let GoS_makeFontBigger = Number(PluginManager.parameters(pluginName).makeFontBigger);
let GoS_makeFontSmaller = Number(PluginManager.parameters(pluginName).makeFontSmaller);
let GoS_maxFontSize = Number(PluginManager.parameters(pluginName).maxFontSize);
let GoS_minFontSize = Number(PluginManager.parameters(pluginName).minFontSize);
let GoS_defaultFontSize = Number(PluginManager.parameters(pluginName).defaultFontSize);
Window_Base.prototype.makeFontBigger = function() {
if (this.contents.fontSize <= GoS_maxFontSize) {
this.contents.fontSize += GoS_makeFontBigger;
};
};
Window_Base.prototype.makeFontSmaller = function() {
if (this.contents.fontSize >= GoS_minFontSize) {
this.contents.fontSize -= GoS_makeFontSmaller;
};
};
if (Utils.RPGMAKER_NAME == "MV") {
Window_Base.prototype.standardFontSize = function() {
return GoS_defaultFontSize;
};
};
//Plugin Commands (MZ)
if (Utils.RPGMAKER_NAME == "MZ") {
PluginManager.registerCommand(pluginName, "change_FontSizeSettings", args => {
GoS_makeFontBigger = Number(args.change_makeFontBigger);
GoS_makeFontSmaller = Number(args.change_makeFontSmaller);
GoS_maxFontSize = Number(args.change_maxFontSize);
GoS_minFontSize = Number(args.change_minFontSize);
GoS_defaultFontSize = Number(args.change_defaultFontSize);
Window_Base.prototype.makeFontBigger = function() {
if (this.contents.fontSize <= GoS_maxFontSize) {
this.contents.fontSize += GoS_makeFontBigger;
};
};
Window_Base.prototype.makeFontSmaller = function() {
if (this.contents.fontSize >= GoS_minFontSize) {
this.contents.fontSize -= GoS_makeFontSmaller;
};
};
Game_System.prototype.mainFontSize = function() {
return GoS_defaultFontSize;
};
});
PluginManager.registerCommand(pluginName, "reset_defaultFontSize", args => {
GoS_defaultFontSize = Number($dataSystem.advanced.fontSize);
Game_System.prototype.mainFontSize = function() {
return $dataSystem.advanced.fontSize;
};
});
};
//Plugin Commands (MV)
if (Utils.RPGMAKER_NAME == "MV") {
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'makeFontBigger') {
if (args.length >= 1) {
GoS_makeFontBigger = Number(args[0]);
Window_Base.prototype.makeFontBigger = function() {
if (this.contents.fontSize <= GoS_maxFontSize) {
this.contents.fontSize += GoS_makeFontBigger;
};
};
};
} else if (command === 'makeFontSmaller') {
if (args.length >= 1) {
GoS_makeFontSmaller = Number(args[0]);
Window_Base.prototype.makeFontSmaller = function() {
if (this.contents.fontSize >= GoS_minFontSize) {
this.contents.fontSize -= GoS_makeFontSmaller;
};
};
};
} else if (command === 'maxFontSize') {
if (args.length >= 1) {
GoS_maxFontSize = Number(args[0]);
Window_Base.prototype.makeFontBigger = function() {
if (this.contents.fontSize <= GoS_maxFontSize) {
this.contents.fontSize += GoS_makeFontBigger;
};
};
};
} else if (command === 'minFontSize') {
if (args.length >= 1) {
GoS_minFontSize = Number(args[0]);
Window_Base.prototype.makeFontSmaller = function() {
if (this.contents.fontSize >= GoS_minFontSize) {
this.contents.fontSize -= GoS_makeFontSmaller;
};
};
};
} else if (command === 'defaultFontSize') {
if (args.length >= 1) {
GoS_defaultFontSize = Number(args[0]);
Window_Base.prototype.standardFontSize = function() {
return GoS_defaultFontSize;
};
};
} else if (command === 'resetFontSize') {
GoS_defaultFontSize = 28;
Window_Base.prototype.standardFontSize = function() {
return 28;
};
};
};
};
})();