-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGS_ExtraSettings.js
176 lines (164 loc) · 5.37 KB
/
GS_ExtraSettings.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
/*:
* @plugindesc Adds Extra Elements to Settings Menu, requires Yanfly Battle System Core
* @author Gamestailer94
*
* @param Difficulty Variable
* @desc Variable used For Difficulty
* @default 1
*
* @param --------
*
* @param Difficulty Word
* @desc Word for Difficulty
* @default Difficulty
*
* @param Easy Word
* @desc Word for Easy
* @default Easy
*
* @param Medium Word
* @desc Word for Medium
* @default Medium
*
* @param Hard Word
* @desc Word for Hard
* @default Hard
*
* @param Battle Style Word
* @desc Word for Battle Style
* @default Battle Style
*
* @param ATB Word
* @desc Word for... (you know what)
* @default ATB
*
* @param CTB Word
* @default CTB
*
* @param DTB Word
* @default DTB
*/
var GSScripts = GSScripts || {};
GSScripts["Config"] = GSScripts["Config"] || {};
GSScripts["Config"]["ExtraSettings"] = PluginManager.parameters("GS_ExtraSettings");
// -----------------------------
// Window_Options
//------------------------------
GS_Window_Options_makeCommandList = Window_Options.prototype.makeCommandList;
GS_Window_Options_processOk = Window_Options.prototype.processOk;
GS_Window_Options_statusText = Window_Options.prototype.statusText;
GS_Window_Options_cursorRight = Window_Options.prototype.cursorRight;
GS_Window_Options_cursorLeft = Window_Options.prototype.cursorLeft;
Window_Options.prototype.makeCommandList = function() {
this.addExtraCommands();
GS_Window_Options_makeCommandList.call(this);
};
Window_Options.prototype.addExtraCommands = function(){
this.addCommand(GSScripts["Config"]["ExtraSettings"]["Difficulty Word"], "difficulty");
this.addCommand(GSScripts["Config"]["ExtraSettings"]["Battle Style Word"], "battleStyle");
};
Window_Options.prototype.processOk = function(){
var index = this.index();
var symbol = this.commandSymbol(index);
if(symbol != "difficulty" && symbol != "battleStyle") {
GS_Window_Options_processOk.call(this);
}else if (symbol === "difficulty"){
this.changeDifficulty('up',false);
}else if(symbol === "battleStyle"){
this.changeBattleSys('up',false);
}
};
Window_Options.prototype.cursorRight = function(wrap){
var index = this.index();
var symbol = this.commandSymbol(index);
if(symbol != "difficulty" && symbol != "battleStyle") {
GS_Window_Options_cursorRight.call(this);
}else if (symbol === "difficulty"){
this.changeDifficulty('up',true);
}else if(symbol === "battleStyle"){
this.changeBattleSys('up',true);
}
};
Window_Options.prototype.cursorLeft = function(wrap){
var index = this.index();
var symbol = this.commandSymbol(index);
if(symbol != "difficulty" && symbol != "battleStyle") {
GS_Window_Options_cursorLeft.call(this);
}else if (symbol === "difficulty"){
this.changeDifficulty('down',true);
}else if(symbol === "battleStyle"){
this.changeBattleSys('down',true);
}
};
Window_Options.prototype.changeDifficulty = function(state,max){
var value = $gameVariables.value(GSScripts["Config"]["ExtraSettings"]["Difficulty Variable"] || 1) || 1;
if(state == 'up'){
if(value < 3)
value++;
else if(!max)
value = 1;
}else if(state == 'down'){
if(value > 1)
value--;
else if(!max)
value = 3;
}
$gameVariables.setValue(GSScripts["Config"]["ExtraSettings"]["Difficulty Variable"] || 1, value);
this.redrawItem(this.findSymbol("difficulty"));
};
Window_Options.prototype.changeBattleSys = function(state,max){
var types = ['atb','ctb','dtb'];
var battleSys = $gameSystem.getBattleSystem();
for(var i = 0; i < types.length; i++){
if(types[i] == battleSys)
var activeType = i;
}
if(state == 'up'){
if(activeType < types.length-1)
activeType++;
else if(!max)
activeType = 0;
}
if(state == 'down'){
if(activeType > 0)
activeType--;
else if(!max)
activeType = 2;
}
$gameSystem.setBattleSystem(types[activeType]);
this.redrawItem(this.findSymbol("battleStyle"));
};
Window_Options.prototype.statusText = function(index){
var symbol = this.commandSymbol(index);
if(symbol !== "difficulty" && symbol !== "battleStyle") {
return GS_Window_Options_statusText.call(this, index);
}else if(symbol === "difficulty"){
var difficultly = $gameVariables.value(GSScripts["Config"]["ExtraSettings"]["Difficulty Variable"] || 1);
switch (difficultly) {
case 1:
default:
return GSScripts["Config"]["ExtraSettings"]["Easy Word"];
break;
case 2:
return GSScripts["Config"]["ExtraSettings"]["Medium Word"];
break;
case 3:
return GSScripts["Config"]["ExtraSettings"]["Hard Word"];
break;
}
}else if(symbol === "battleStyle"){
var battleSys = $gameSystem.getBattleSystem();
switch(battleSys){
case 'dtb':
default:
return GSScripts["Config"]["ExtraSettings"]["DTB Word"];
break;
case 'ctb':
return GSScripts["Config"]["ExtraSettings"]["CTB Word"];
break;
case 'atb':
return GSScripts["Config"]["ExtraSettings"]["ATB Word"];
break;
}
}
};