Skip to content

Commit 236adb9

Browse files
authored
Merge pull request #47 from rpgtkoolmv/fix_face
fix lack of reserveFace
2 parents 86e7204 + 0c2e401 commit 236adb9

File tree

7 files changed

+21
-2
lines changed

7 files changed

+21
-2
lines changed

js/rpg_scenes/Scene_Menu.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Scene_Menu.prototype.createGoldWindow = function() {
4848

4949
Scene_Menu.prototype.createStatusWindow = function() {
5050
this._statusWindow = new Window_MenuStatus(this._commandWindow.width, 0);
51+
this._statusWindow.reserveFaceImages();
5152
this.addWindow(this._statusWindow);
5253
};
5354

js/rpg_scenes/Scene_Skill.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Scene_Skill.prototype.create = function() {
2121
this.createStatusWindow();
2222
this.createItemWindow();
2323
this.createActorWindow();
24+
};
25+
26+
Scene_Skill.prototype.start = function() {
27+
Scene_ItemBase.prototype.start.call(this);
2428
this.refreshActor();
2529
};
2630

@@ -41,6 +45,7 @@ Scene_Skill.prototype.createStatusWindow = function() {
4145
var ww = Graphics.boxWidth - wx;
4246
var wh = this._skillTypeWindow.height;
4347
this._statusWindow = new Window_SkillStatus(wx, wy, ww, wh);
48+
this._statusWindow.reserveFaceImages();
4449
this.addWindow(this._statusWindow);
4550
};
4651

js/rpg_scenes/Scene_Status.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ Scene_Status.prototype.create = function() {
2020
this._statusWindow.setHandler('cancel', this.popScene.bind(this));
2121
this._statusWindow.setHandler('pagedown', this.nextActor.bind(this));
2222
this._statusWindow.setHandler('pageup', this.previousActor.bind(this));
23+
this._statusWindow.reserveFaceImages();
2324
this.addWindow(this._statusWindow);
25+
};
26+
27+
Scene_Status.prototype.start = function() {
28+
Scene_MenuBase.prototype.start.call(this);
2429
this.refreshActor();
2530
};
2631

js/rpg_windows/Window_Base.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,3 +697,9 @@ Window_Base.prototype.canvasToLocalY = function(y) {
697697
}
698698
return y;
699699
};
700+
701+
Window_Base.prototype.reserveFaceImages = function() {
702+
$gameParty.members().forEach(function(actor) {
703+
ImageManager.reserveFace(actor.faceName());
704+
}, this);
705+
};

js/rpg_windows/Window_MenuStatus.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Window_MenuStatus.prototype.initialize = function(x, y) {
1616
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
1717
this._formationMode = false;
1818
this._pendingIndex = -1;
19-
this.loadImages();
2019
this.refresh();
2120
};
2221

js/rpg_windows/Window_Message.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Window_Message.prototype.initialize = function() {
2222
};
2323

2424
Window_Message.prototype.initMembers = function() {
25+
this._imageReservationId = Utils.generateRuntimeId();
2526
this._background = 0;
2627
this._positionType = 2;
2728
this._waitCount = 0;
@@ -251,11 +252,12 @@ Window_Message.prototype.newPage = function(textState) {
251252
};
252253

253254
Window_Message.prototype.loadMessageFace = function() {
254-
this._faceBitmap = ImageManager.loadFace($gameMessage.faceName());
255+
this._faceBitmap = ImageManager.reserveFace($gameMessage.faceName(), 0, this._imageReservationId);
255256
};
256257

257258
Window_Message.prototype.drawMessageFace = function() {
258259
this.drawFace($gameMessage.faceName(), $gameMessage.faceIndex(), 0, 0);
260+
ImageManager.releaseReservation(this._imageReservationId);
259261
};
260262

261263
Window_Message.prototype.newLineX = function() {

js/rpg_windows/Window_Status.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Window_Status.prototype.initialize = function() {
1414
var width = Graphics.boxWidth;
1515
var height = Graphics.boxHeight;
1616
Window_Selectable.prototype.initialize.call(this, 0, 0, width, height);
17+
this._actor = null;
1718
this.refresh();
1819
this.activate();
1920
};

0 commit comments

Comments
 (0)