Hello! Good evening.
You see, I was trying to "Modify" an already made Menu, I managed to move a few things around, my biggest complication is the following:
How can I make Instead of the Iconset Icons, use individual Icons placed in the Pictures Folder?
I tried to replicate the Notetag that the Plugin has, but I can't use its references outside of what is established, even changing the names and making them match.
The Following Code is the one that is in charge of creating the Inventory
And this other one is the one with the NoteTag and shows an Image
This is the Link to the Menu: http://zelindrodeveloper.blogspot.com/2016/02/rmmv-plugins-only-character-survivor.html
You see, I was trying to "Modify" an already made Menu, I managed to move a few things around, my biggest complication is the following:
How can I make Instead of the Iconset Icons, use individual Icons placed in the Pictures Folder?
I tried to replicate the Notetag that the Plugin has, but I can't use its references outside of what is established, even changing the names and making them match.
The Following Code is the one that is in charge of creating the Inventory
JavaScript:
//-----------------------------------------------------------------------------
// Window_OcsMenuItems
//
class Window_OcsMenuItems extends Window_ItemList {
constructor(x, y, width, height) {
super();
this.initialize(x, y, width, height);
}
makeItemList() {
this._data = $gameParty.allItems().filter(function(item) {
return this.includes(item);
}, this);
if (this.includes(null)) {
this._data.push(null);
}
}
includes(item) {
if (this._category === "keyItem") {
return DataManager.isItem(item) && item.itypeId === 2;
} else {
if (DataManager.isItem(item) && item.itypeId === 1) {
return true;
} else if (DataManager.isWeapon(item)) {
return true;
} else if (DataManager.isArmor(item)) {
return true;
} else {
return false;
}
}
}
playOkSound() {}
isEnabled(item) {
const Actor = $gameParty.members()[0];
if (DataManager.isWeapon(item)) {
return Actor.canEquip(item);
} else {
return Actor.canUse(item);
}
}
drawItemNumber(item, x, y, width) {
if (this.needsNumber()) {
this.drawText($gameParty.numItems(item), x, y, width, "right");
}
}
drawItemName(item, x, y, width) {
width = width || 312;
if (item) {
var iconBoxWidth = Window_Base._iconWidth + 4;
this.resetTextColor();
this.drawIcon(item.iconIndex, x, y);
}
}
maxCols() {
return 2;
}
}
And this other one is the one with the NoteTag and shows an Image
JavaScript:
//-----------------------------------------------------------------------------
// Window_OcsMenuItemHelp
//
class Window_OcsMenuItemHelp extends Window_Help {
constructor() {
super();
this.initialize();
}
initialize() {
const width = 417;
const height = 400;
Window_Base.prototype.initialize.call(this, 0, 220, width, height);
this._text = "";
this._item = null;
}
drawImage() {
if (this._item) {
if (typeof this._item.meta.menu_imgs !== "undefined") {
this._logo = new Sprite();
this._logo.bitmap = ImageManager.loadPicture(this._item.meta.menu_imgs);
this.addChild(this._logo);
this._logo.x = 144;
this._logo.y = 80;
}
}
}
setItem(item) {
this._item = item;
this.setText(item ? item.description : "");
}
setText(text) {
this._text = this.chunkString(text, 26);
this.refresh();
}
chunkString(str, n) {
const ret = [];
for (let i = 0; i < str.length; i += n) ret.push(str.substr(i, n));
return ret.map(val => val.replace(/^\s+/g, "")).join("\n");
}
refresh() {
this.contents.clear();
this.removeChild(this._logo);
this.drawTextEx(this._text, this.textPadding() - 1, 220);
this.drawImage();
}
clear() {
this.setText("");
this.removeChild(this._logo);
}
}
This is the Link to the Menu: http://zelindrodeveloper.blogspot.com/2016/02/rmmv-plugins-only-character-survivor.html