-
Notifications
You must be signed in to change notification settings - Fork 0
/
bentelk_CustomFacePosition.js
53 lines (42 loc) · 1.55 KB
/
bentelk_CustomFacePosition.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
/*:
* @plugindesc Places message box faces above the message box window, instead of inside.
* @author Ben Hendel-Doying
*
* @help That's it!
*/
function BenTelk_Custom_Face() {
this.initialize.apply(this, arguments);
this.setBackgroundType(2);
}
BenTelk_Custom_Face.prototype = Object.create(Window_Base.prototype);
BenTelk_Custom_Face.prototype.constructor = BenTelk_Custom_Face;
BenTelk_Custom_Face.prototype.initialize = function(messageWindow) {
Window_Base.prototype.initialize.call(this, 0, messageWindow.y - 141, 180, 180);
this.padding = 0;
};
BenTelk_Custom_Face.prototype.drawMessageFace = function() {
this.drawFace($gameMessage.faceName(), $gameMessage.faceIndex(), 0, 0);
};
(function() {
Window_Message.prototype.drawMessageFace = function() {
this._customFace.drawMessageFace();
ImageManager.releaseReservation(this._imageReservationId);
};
Window_Message.prototype.newLineX = function() {
return 0;
};
let oldCreateSubWindows = Window_Message.prototype.createSubWindows;
Window_Message.prototype.createSubWindows = function() {
oldCreateSubWindows.call(this);
this._customFace = new BenTelk_Custom_Face(this);
this.addChild(this._customFace);
};
let oldTerminateMessage = Window_Message.prototype.terminateMessage;
Window_Message.prototype.terminateMessage = function() {
oldTerminateMessage.call(this);
this._customFace.contents.clear();
this.close();
this._goldWindow.close();
$gameMessage.clear();
};
})();