So I finally decided to get off my ass and try writing my own plugins since I used to know my way around code back in high school programming classes. Anyway, here's an extension of PrimeHover's Warehouse plugin that I decided to write. It's pretty barebones, I just monkeyed off PH's Warehouse, it doesn't yet do what it's supposed to do, but for now my primary concern is getting the scene to run because I won't be able to test my actual codestuff if I can't even see the scene. I finally fixed all the bugs that appear in the console. But when I got rid of all of the bugs and called it again, nothing happened.
Here's what i think is the offending section:
Here's the entire code in case it helps:
P.S. Don't mind yet what the code does, my concern for now is getting a window to show up
Here's what i think is the offending section:
Code:
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'Maykeru') {
switch (args[0]) {
case 'ship':
Scene_ShipGoods.prototype.create;
SceneManager.push(Scene_ShipGoods);
break;
}
}
};
Here's the entire code in case it helps:
Code:
//=============================================================================
// Maykeru_ShipGoods
// by Maykeru / jmike / Michael Marcos
// Start Date: 2 July 2017
//=============================================================================
/*:
* @plugindesc Sells goods stored in a PH Warehouse // Describe your plugin
* @author Maykeru // your name goes here
*
* @param xxxxx //name of a parameter you want the user to edit
* @desc yyyyy //short description of the parameter
* @default zzzzz // set default value for the parameter
*/
(function() {
var parameters = PluginManager.parameters('Maykeru_ShipGoods');
var PHPlugins = PHW.requirePlugins(false, 'PHWarehouse');
var _shipGoods = Scene_MenuBase.prototype;
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'Maykeru') {
switch (args[0]) {
case 'ship':
Scene_ShipGoods.prototype.create;
SceneManager.push(Scene_ShipGoods);
break;
}
}
};
/* ---------------------------------------------------------- *
* WINDOW PROCESS *
* ---------------------------------------------------------- */
function Window_ShippingTitle() {
this.initialize.apply(this, arguments);
}
Window_ShippingTitle.prototype = Object.create(Window_Base.prototype);
Window_ShippingTitle.prototype.constructor = Window_ShippingTitle;
Window_ShippingTitle.prototype.initialize = function() {
Window_Base.prototype.initialize.call(this, 0, 0, Graphics.boxWidth, this.fittingHeight(1));
this.refresh();
};
Window_ShippingTitle.prototype.refresh = function() {
this.contents.clear();
this.changeTextColor(this.crisisColor());
this.drawText("Shipped Goods", 0, 0, Graphics.boxWidth, "center");
};
function Window_ShippingCategory() {
this.initialize.apply(this, arguments);
}
Window_ShippingCategory.prototype = Object.create(Window_ItemCategory.prototype);
Window_ShippingCategory.prototype.constructor = Window_ShippingCategory;
Window_ShippingCategory.prototype.initialize = function() {
Window_ItemCategory.prototype.initialize.call(this);
this.y = this.fittingHeight(3);
this.deselect();
this.deactivate();
};
Window_ShippingCategory.prototype.changeCategory = function() {
PHPlugins.PHWarehouse._lastCategory = this.currentSymbol() || "item";
};
Window_ShippingCategory.prototype.makeCommandList = function() {
this.addCommand(TextManager.item, 'item');
};
Window_ShippingCategory.prototype.setItemWindow = function(itemWindow) {
this._itemWindow = itemWindow;
this.update();
};
Window_ShippingCategory.prototype.update = function() {
Window_ItemCategory.prototype.update.call(this);
this.changeCategory();
this._itemWindow.refresh();
};
function Window_ShippingItemList() {
this.initialize.apply(this, arguments);
}
Window_ShippingItemList.prototype = Object.create(Window_ItemList.prototype);
Window_ShippingItemList.prototype.constructor = Window_ShippingItemList;
Window_ShippingItemList.prototype.initialize = function() {
Window_ItemList.prototype.initialize.call(this, 0, this.fittingHeight(5), Graphics.boxWidth, Graphics.boxHeight - this.fittingHeight(7));
};
Window_ShippingItemList.prototype.isCurrentItemEnabled = function() {
if (this._data.length > 0) {
if (PHPlugins.PHWarehouse._lastOption == 1 && PHPlugins.PHWarehouse.checkCapacity()) {
return true;
} else if (PHPlugins.PHWarehouse._lastOption == 0) {
return true;
} else {
return false;
}
}
return false;
};
Window_ShippingItemList.prototype.makeShippingItemList = function() {
var data = PHPlugins.PHWarehouse.getItems();
this._data = data.filter(function(item) {
if (PHPlugins.Params.PHWarehouseAllTogether == true) {
return this.includesWarehouseAll(item);
} else {
return this.includes(item);
}
}, this);
if (this.includes(null)) {
this._data.push(null);
}
};
Window_ShippingItemList.prototype.includesWarehouseAll = function(item) {
return ( (DataManager.isItem(item) && item.itypeId === 1) || (DataManager.isWeapon(item)) || (DataManager.isArmor(item)) || (DataManager.isItem(item) && item.itypeId === 2) );
};
Window_ShippingItemList.prototype.makeDepositAllItemList = function() {
this._data = $gameParty.allItems();
};
Window_ShippingItemList.prototype.loadItems = function() {
this.makeShippingItemList();
};
Window_ShippingItemList.prototype.drawItem = function(index) {
var item = this._data[index];
if (item) {
var numberWidth = this.numberWidth();
var rect = this.itemRect(index);
rect.width -= this.textPadding();
this.changePaintOpacity(PHPlugins.PHWarehouse.verifyItem(item));
this.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
if (PHPlugins.PHWarehouse._lastOption == 1) {
this.drawItemNumber(item, rect.x, rect.y, rect.width);
} else if (PHPlugins.PHWarehouse._lastOption == 0) {
this.drawWarehouseItemNumber(item, rect.x, rect.y, rect.width);
}
this.changePaintOpacity(1);
}
};
Window_ShippingItemList.prototype.drawWarehouseItemNumber = function(item, x, y, width) {
var qtty = PHPlugins.PHWarehouse.getQuantity(item);
if (typeof Yanfly !== "undefined") {
this.contents.fontSize = Yanfly.Param.ItemQuantitySize;
this.drawText('\u00d7' + qtty, x, y, width, 'right');
this.resetFontSettings();
} else {
this.drawText(':', x, y, width - this.textWidth('00'), 'right');
this.drawText(qtty, x, y, width, 'right');
}
};
Window_ShippingItemList.prototype.refresh = function() {
this.contents.clear();
this.loadItems();
this.drawAllItems();
};
Window_ShippingItemList.prototype.playOkSound = function() { };
/* ---------------------------------------------------------- *
* SCENE PROCESS *
* ---------------------------------------------------------- */
function Scene_ShipGoods() {
this.initialize.apply(this, arguments);
}
Scene_ShipGoods.prototype = Object.create(Scene_MenuBase.prototype);
Scene_ShipGoods.prototype.constructor = Scene_ShipGoods;
Scene_ShipGoods.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createTitle();
this.createCategory();
this.createItemList();
};
Scene_ShipGoods.prototype.createTitle = function() {
this._titleWindow = new Window_ShippingTitle();
this.addWindow(this._titleWindow);
};
Scene_ShipGoods.prototype.createCategory = function() {
this._categoryWindow = new Window_ShippingCategory();
this._categoryWindow.setHandler('cancel', this.popScene.bind(this));
this._categoryWindow.setHandler('ok', this.onCategoryOk.bind(this));
this.addWindow(this._categoryWindow);
};
Scene_ShipGoods.prototype.createItemList = function() {
this._itemWindow = new Window_ShippingItemList();
this._itemWindow.setHandler('ok', this.onItemOk.bind(this));
this._itemWindow.setHandler('cancel', this.onItemCancel.bind(this));
this.addWindow(this._itemWindow);
this._categoryWindow.setItemWindow(this._itemWindow);
};
Scene_ShipGoods.prototype.onCategoryOk = function() {
this._itemWindow.activate();
if (this._itemWindow._data.length > 0) {
this._itemWindow.select(0);
}
this._categoryWindow.deactivate();
};
Scene_ShipGoods.prototype.onCategoryCancel = function() {
this._categoryWindow.deselect();
};
Scene_ShipGoods.prototype.onItemCancel = function() {
this._itemWindow.deselect();
this._categoryWindow.activate();
};
Scene_ShipGoods.prototype.onItemOk = function() {
this._itemWindow.activate();
};
})();
P.S. Don't mind yet what the code does, my concern for now is getting a window to show up