-
Notifications
You must be signed in to change notification settings - Fork 0
/
bentelk_CombatContextHelp.js
135 lines (92 loc) · 4.32 KB
/
bentelk_CombatContextHelp.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
/*:
* @plugindesc Adds a small, context-sensitive help window during combat.
* @author Ben Hendel-Doying
*
* @help There's nothing to configure.
*
* When in combat, a small window is shown above the character selection which
* contains text like "What will X do?" or "Choose a target." to make it crystal
* clear what you're doing in the moment.
*
* I added this because I observed players who are not familiar with RPG Maker were
* sometimes getting confused with input selection; it was not always clear to them
* what they were selecting.
*/
(function() {
const originalSceneBattleCreateAllWindows = Scene_Battle.prototype.createAllWindows;
Scene_Battle.prototype.createAllWindows = function() {
originalSceneBattleCreateAllWindows.call(this);
this.createContextHelpWindow();
};
Scene_Battle.prototype.createContextHelpWindow = function()
{
this._contextHelpWindow = new Window_Help(1);
this._contextHelpWindow.move(this._actorWindow.x, this._actorWindow.y - this._contextHelpWindow.height, 360, this._contextHelpWindow.height);
this._contextHelpWindow.setText('...');
this.addWindow(this._contextHelpWindow);
this._contextHelpWindow.hide();
};
// choosing what an ally will do
const originalSceneBattleStartActorCommandSelection = Scene_Battle.prototype.startActorCommandSelection;
Scene_Battle.prototype.startActorCommandSelection = function() {
originalSceneBattleStartActorCommandSelection.call(this);
this._contextHelpWindow.setText('What will ' + BattleManager.actor().name() + ' do?');
this._contextHelpWindow.show();
};
const originalSceneBattleStartPartyCommandSelection = Scene_Battle.prototype.startPartyCommandSelection;
Scene_Battle.prototype.startPartyCommandSelection = function() {
originalSceneBattleStartPartyCommandSelection.call(this);
this._contextHelpWindow.hide();
};
const originalSceneBattleEndCommandSelection = Scene_Battle.prototype.endCommandSelection;
Scene_Battle.prototype.endCommandSelection = function() {
originalSceneBattleEndCommandSelection.call(this);
this._contextHelpWindow.hide();
};
// choosing a skill
const originalSceneBattleCommandSkill = Scene_Battle.prototype.commandSkill;
Scene_Battle.prototype.commandSkill = function() {
originalSceneBattleCommandSkill.call(this);
this._contextHelpWindow.hide();
};
const originalSceneBattleOnSkillCancel = Scene_Battle.prototype.onSkillCancel;
Scene_Battle.prototype.onSkillCancel = function() {
originalSceneBattleOnSkillCancel.call(this);
this._contextHelpWindow.show();
};
// choosing an item
const originalSceneBattleCommandItem = Scene_Battle.prototype.commandItem;
Scene_Battle.prototype.commandItem = function() {
originalSceneBattleCommandItem.call(this);
this._contextHelpWindow.hide();
};
const originalSceneBattleOnItemCancel = Scene_Battle.prototype.onItemCancel;
Scene_Battle.prototype.onItemCancel = function() {
originalSceneBattleOnItemCancel.call(this);
this._contextHelpWindow.show();
};
// choosing a target enemy
const originalSceneSelectEnemySelection = Scene_Battle.prototype.selectEnemySelection;
Scene_Battle.prototype.selectEnemySelection = function() {
originalSceneSelectEnemySelection.call(this);
this._contextHelpWindow.setText('Choose a target.');
this._contextHelpWindow.show();
};
const originalSceneBattleOnEnemyCancel = Scene_Battle.prototype.onEnemyCancel;
Scene_Battle.prototype.onEnemyCancel = function() {
originalSceneBattleOnEnemyCancel.call(this);
this._contextHelpWindow.hide();
};
// choosing a target ally
const originalSceneSelectActorSelection = Scene_Battle.prototype.selectActorSelection;
Scene_Battle.prototype.selectActorSelection = function() {
originalSceneSelectActorSelection.call(this);
this._contextHelpWindow.setText('Choose a target.');
this._contextHelpWindow.show();
};
const originalSceneBattleOnActorCancel = Scene_Battle.prototype.onActorCancel;
Scene_Battle.prototype.onActorCancel = function() {
originalSceneBattleOnActorCancel.call(this);
this._contextHelpWindow.hide();
};
})();