I'm using Yanfly's Equip Customize, Item Core, and Attach Augments plugins to make a tooltip script when equipping/unequipping items to a piece of armor. I've made modifications to the Equip Customize script and my specific modifications are posted below. I also have another script that displays a window whenever the item scene is accessed within this custom scene from the equip customize script.
The image below is a screenshot of the custom equip customize scene. It functions and behaves like the script normally would by default. What I want is for the window on the right to display information based on what is highlighted in the screenshot and for it to be updated in real-time whenever I scroll up and down through the items. I would also like for it to display the same information whenever I'm scrolling up and down the list of equippable items through the Attach Augments script. I can't imagine it being much more than 2 or 3 lines of code.
JavaScript:
function Scene_EquipArmaments() {
this.initialize.apply(this, arguments);
}
Scene_EquipArmaments.prototype = Object.create(Scene_Item.prototype);
Scene_EquipArmaments.prototype.constructor = Scene_EquipArmaments;
Scene_EquipArmaments.prototype.initialize = function() {
Scene_Item.prototype.initialize.call(this);
};
Scene_EquipArmaments.prototype.createCategoryWindow = function() {
Scene_Item.prototype.createCategoryWindow.call(this);
this._categoryWindow.deactivate();
this._categoryWindow.hide();
var wy = this._helpWindow.height;
this._commandWindow = new Window_EquipCommand(0, -300, 240);
this.addWindow(this._commandWindow);
this._commandWindow.deactivate();
var index = this._commandWindow.findSymbol('customize');
this._commandWindow.select(index);
};
Scene_EquipArmaments.prototype.item = function() {
return $gameTemp._customizeItem;
};
Scene_EquipArmaments.prototype.createItemWindow = function() {
Scene_Item.prototype.createItemWindow.call(this);
this._itemWindow._data = [$gameTemp._customizeItem];
this._itemWindow.select(1);
this._itemWindow.hide();
};
Scene_EquipArmaments.prototype.createActionWindow2 = function() {
Scene_Item.prototype.createActionWindow2.call(this);
this.setCustomizedItem();
};
Scene_EquipArmaments.prototype.setCustomizedItem = function() {
this._helpWindow.setItem(this.item());
this._statusWindow.setItem(this.item());
this._infoWindow.setItem(this.item());
this._itemActionWindow.setItem(this.item());
if ($gameTemp._itemActionIndex) {
this._itemActionWindow.select($gameTemp._itemActionIndex);
}
};
Scene_EquipArmaments.prototype.createCardDescriptions = function() {
Scene_Item.prototype.createCardDescriptions.call(this);
};
Scene_EquipArmaments.prototype.onActionCancel = function() {
$gameTemp._customizeItem = null;
$gameTemp._customizeReturning = true;
$gameTemp._equipCustomize = false;
SceneManager.pop();
};
Scene_EquipArmaments.prototype.onUpgradeFullReset = function() {
ItemManager._fullReset = false;
this.onActionCancel();
};
JavaScript:
function Window_CardDescriptions() {
this.initialize.apply(this, arguments);
}
Window_CardDescriptions.prototype = Object.create(Window_Base.prototype);
Window_CardDescriptions.prototype.constructor = Window_CardDescriptions;
Window_CardDescriptions.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this._lastItem = null; // Track the last selected item
};
Window_CardDescriptions.prototype.update = function() {
Window_Base.prototype.update.call(this);
this.opacity = 255;
var equipScene = SceneManager._scene; // Reference to the equip scene
var itemWindow = equipScene._itemWindow; // Reference to the item window in the equip scene
var selectedItem = itemWindow.item(); // Retrieve the selected item
if (this._lastItem !== selectedItem) {
this._lastItem = selectedItem;
this.refresh();
}
};
Window_CardDescriptions.prototype.refresh = function() {
this.contents.clear();
var equipScene = SceneManager._scene; // Reference to the equip scene
var itemWindow = equipScene._itemWindow; // Reference to the item window in the equip scene
var selectedItem = itemWindow.item(); // Retrieve the selected item
console.log(selectedItem); // Output the selected item to the console
// Check if the item exists and its ID is 101
if (selectedItem && selectedItem.id === 101) {
// Draw weapon-specific content
this.drawText("Avalo", 0, 0, this.contents.width, "center");
} else if (selectedItem && selectedItem.id === 102) {
// Draw weapon-specific content
this.drawText("Avaega", 0, 0, this.contents.width, "center");
} else if (selectedItem && selectedItem.id === 103) {
// Draw weapon-specific content
this.drawText("Avagigos", 0, 0, this.contents.width, "center");
} else if (selectedItem && selectedItem.id === 104) {
// Draw weapon-specific content
this.drawText("Vyrkalo", 0, 0, this.contents.width, "center");
} else if (selectedItem && DataManager.isArmor(selectedItem)) {
// Draw armor-specific content
this.drawText("This is an armor.", 0, 0, this.contents.width, "center");
} else {
// Draw default content
this.drawText("No item selected.", 0, 0, this.contents.width, "center");
}
};
The image below is a screenshot of the custom equip customize scene. It functions and behaves like the script normally would by default. What I want is for the window on the right to display information based on what is highlighted in the screenshot and for it to be updated in real-time whenever I scroll up and down through the items. I would also like for it to display the same information whenever I'm scrolling up and down the list of equippable items through the Attach Augments script. I can't imagine it being much more than 2 or 3 lines of code.