- Joined
- Sep 7, 2017
- Messages
- 23
- Reaction score
- 5
- First Language
- English
- Primarily Uses
- RMMV
I want to create two instances of Status Menu that would both operate on the same inputs, but take two different constructors. One would be used like most bust menu versions of a Main Menu, and the other would operate like a normal list of the party members, without the faces. I've somehow managed to make this (see attached) but I can't get the list view to display more entries, and iterating through $gameParty.members only displays the last party member, rather than the first. I'm aiming for something akin to the image labeled menumockup.png. The list in that mockup does not include meters mostly because I hadn't decided to include them yet. Please assume that I want the meters in the list window.
this is what I have relating to that window:
var _Scene_Menu_create = Scene_Menu.prototype.create;
Scene_Menu.prototype.create = function() {
_Scene_Menu_create.call(this);
this.createMeterWindow(this._statusWindow);
this.createListWindow(this._statusWindow1);
this._statusWindow.x = eval(bwX);
this._statusWindow.y = eval(bwY);
this._commandWindow.x = eval(comX);
this._commandWindow.y = eval(comY);
this._goldWindow.x = eval(goldX);
this._goldWindow.y = eval(goldY);
this._hpWindow.x = eval(hpX);
this._hpWindow.y = eval(hpY);
};
Scene_Menu.prototype.createListWindow = function(window) {
this._statusWindow1 = new Window_Party_List(0, 0, window);
this._statusWindow1.x = 420;
this._statusWindow1.y = 140;
this.addWindow(this._statusWindow1);
};
//=============================================================================
// Window_Party_List
//=============================================================================
function Window_Party_List() {
this.initialize.apply(this, arguments);
}
Window_Party_List.prototype = Object.create(Window_Base.prototype);
Window_Party_List.prototype.constructor = Window_Party_List;
Window_Party_List.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this._index = 0;
this._name = '';
this._actor = $gameParty.members()[this._index];
this._isWindow = false;
this.refresh();
};
Window_Party_List.prototype.windowWidth = function() {
return 379;
};
Window_Party_List.prototype.windowHeight = function() {
return this.itemHeight() * 5.6;
};
Window_Party_List.prototype.numVisibleRows = function() {
return Math.min($gameParty.maxItems(), sumListRows);
};
Window_Party_List.prototype.maxCols = function() {
return sumListColumns;
};
Window_Party_List.prototype.itemHeight = function() {
return sumItemHeight;
};
Window_Party_List.prototype.itemWidth = function() {
return sumItemWidth;
};
Window_Party_List.prototype.drawItem = function(index) {
this.drawItemBackground(index);
this.drawItemStatus(index);
};
Window_Party_List.prototype.drawItemStatus = function(index) {
var actor = $gameParty.members()[index];
var rect = this.itemRect(index);
var width = (rect.width / 3) - 20;
this.drawActorName(actor, rect.x + 10, rect.y, width);
this.drawActorHp(actor, rect.x + width + 30, rect.y, width);
this.drawActorMp(actor, rect.x + width * 2 + 50, rect.y, width);
};
Window_Party_List.prototype.refresh = function() {
var x = this.textPadding();
var y = 0;
var width = this.contents.width - this.textPadding() * 2;
var meterWidth = 20;
var actor = $gameParty.members()[this._index];
this._name = actor.name();
this.contents.clear();
this.drawActorName(actor, x, y);
this.drawActorHp(actor, x + (meterWidth*9), y, (width/4.5));
var i = 2;
this.drawActorMp(actor, x + (meterWidth*13), y, (width/4.5));
i += 1;
};
admittedly, a lot of this is jerry-rigged from limited knowledge of Javascript, the kinoar github, and other plugin's changes to the status menu that accomplished similar things, so while I can kinda follow along with what I wrote, I'm not 100 percent sure what I wrote that's necessary, or was stuff that was superfluous to my goal here. Any variables or parameters that are used in whatever function, but I didn't seem to define were defined at the top of my javascript file, so don't worry about that.
this is what I have relating to that window:
var _Scene_Menu_create = Scene_Menu.prototype.create;
Scene_Menu.prototype.create = function() {
_Scene_Menu_create.call(this);
this.createMeterWindow(this._statusWindow);
this.createListWindow(this._statusWindow1);
this._statusWindow.x = eval(bwX);
this._statusWindow.y = eval(bwY);
this._commandWindow.x = eval(comX);
this._commandWindow.y = eval(comY);
this._goldWindow.x = eval(goldX);
this._goldWindow.y = eval(goldY);
this._hpWindow.x = eval(hpX);
this._hpWindow.y = eval(hpY);
};
Scene_Menu.prototype.createListWindow = function(window) {
this._statusWindow1 = new Window_Party_List(0, 0, window);
this._statusWindow1.x = 420;
this._statusWindow1.y = 140;
this.addWindow(this._statusWindow1);
};
//=============================================================================
// Window_Party_List
//=============================================================================
function Window_Party_List() {
this.initialize.apply(this, arguments);
}
Window_Party_List.prototype = Object.create(Window_Base.prototype);
Window_Party_List.prototype.constructor = Window_Party_List;
Window_Party_List.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, y, width, height);
this._index = 0;
this._name = '';
this._actor = $gameParty.members()[this._index];
this._isWindow = false;
this.refresh();
};
Window_Party_List.prototype.windowWidth = function() {
return 379;
};
Window_Party_List.prototype.windowHeight = function() {
return this.itemHeight() * 5.6;
};
Window_Party_List.prototype.numVisibleRows = function() {
return Math.min($gameParty.maxItems(), sumListRows);
};
Window_Party_List.prototype.maxCols = function() {
return sumListColumns;
};
Window_Party_List.prototype.itemHeight = function() {
return sumItemHeight;
};
Window_Party_List.prototype.itemWidth = function() {
return sumItemWidth;
};
Window_Party_List.prototype.drawItem = function(index) {
this.drawItemBackground(index);
this.drawItemStatus(index);
};
Window_Party_List.prototype.drawItemStatus = function(index) {
var actor = $gameParty.members()[index];
var rect = this.itemRect(index);
var width = (rect.width / 3) - 20;
this.drawActorName(actor, rect.x + 10, rect.y, width);
this.drawActorHp(actor, rect.x + width + 30, rect.y, width);
this.drawActorMp(actor, rect.x + width * 2 + 50, rect.y, width);
};
Window_Party_List.prototype.refresh = function() {
var x = this.textPadding();
var y = 0;
var width = this.contents.width - this.textPadding() * 2;
var meterWidth = 20;
var actor = $gameParty.members()[this._index];
this._name = actor.name();
this.contents.clear();
this.drawActorName(actor, x, y);
this.drawActorHp(actor, x + (meterWidth*9), y, (width/4.5));
var i = 2;
this.drawActorMp(actor, x + (meterWidth*13), y, (width/4.5));
i += 1;
};
admittedly, a lot of this is jerry-rigged from limited knowledge of Javascript, the kinoar github, and other plugin's changes to the status menu that accomplished similar things, so while I can kinda follow along with what I wrote, I'm not 100 percent sure what I wrote that's necessary, or was stuff that was superfluous to my goal here. Any variables or parameters that are used in whatever function, but I didn't seem to define were defined at the top of my javascript file, so don't worry about that.
Attachments
-
725 KB Views: 8
-
67.5 KB Views: 8
