So in the plugin I'm making I'm currently making a new menu for combat that checks the current Actor's parameters for a stat, and if so adds a Splice command. For some reason upon selecting the new option, instead of the cursor leaving the Actor Command window I just get a second cursor. I'll post all the code I think is relevant from the plugin but I can't figure this out.
Code that adds the command
Code that runs when the 'splice' symbol is selected (I think I'm missing something here because this is where there becomes two cursors instead of one)
The Splice Window code itself
if you have any other questions or code requests I'll glady oblige
Code that adds the command
Code:
FugCBS.Window_ActorCommand_prototype_addSkillCommands =
Window_ActorCommand.prototype.addSkillCommands;
Window_ActorCommand.prototype.addSkillCommands = function() {
if (this._actor.comboSlots.length !== 0){
var name = FugCBS.Param.BattleName;
this.addCommand(name, 'splice', true);
}
FugCBS.Window_ActorCommand_prototype_addSkillCommands.call(this);
};
Code that runs when the 'splice' symbol is selected (I think I'm missing something here because this is where there becomes two cursors instead of one)
Code:
Scene_Battle.prototype.commandSplice = function() {
this._slotWindow.setActor(BattleManager.actor());
this._spliceWindow.setActor(BattleManager.actor());
this._spliceWindow.currentArray = [];
this._spliceWindow.curSlot = 0;
this._spliceWindow.refresh();
this._slotWindow.refresh();
this._spliceWindow.show();
this._helpWindow.show();
this._spliceWindow.activate();
this._spliceWindow.select(1);
};
The Splice Window code itself
Code:
//=============================================================================
// Window_BattleSplice
//=============================================================================
function Window_BattleSplice() {
this.initialize.apply(this, arguments);
};
Window_BattleSplice.prototype = Object.create(Window_SpliceStrain.prototype);
Window_BattleSplice.prototype.constructor = Window_BattleSplice;
Window_BattleSplice.prototype.initialize = function(x, y, width, height) {
Window_Selectable.prototype.initialize.call(this, x, y, width, height);
this._data = [];
this.curSlot = 0;
this.currentArray = [];
this.hide();
};
Window_BattleSplice.prototype.inventoryDNA = function(){
var array = [];
var list = $gameParty.items().length
for (var i = 0; i < list; i++) {
item = $gameParty.items()[i];
console.log(item);
if (item.isDNA){
array.push(item.id)};
}
return array
}
Window_BattleSplice.prototype.setActor = function(actor) {
if (this._actor === actor) return;
this._actor = actor;
this.refresh();
this.resetScroll();
};
Window_BattleSplice.prototype.makeItemList = function() {
console.log(this._actor);
if (this._actor) {
var data = this.inventoryDNA()|| [0];
} else {
data = [0];
}
this._data = [];
for (var i = 0; i < data.length; ++i) {
var strain = data[i];
if ($dataItems[strain]){
if (FugCBS.Param.RequireItem === "true"){
if ($dataItems[strain].isDNA && !this._actor.comboSlots.contains(strain) && $gameParty.hasItem($dataItems[strain])) {
this._data.push(strain);
}
} else {
if ($dataItems[strain].isDNA && !this._actor.comboSlots.contains(strain)) {
this._data.push(strain);
}
}
}
}
this._data.sort(function(a, b) { return a - b });
this._data.unshift({});
};
Window_BattleSplice.prototype.checkDNAInput = function(array){
skillId = DataManager.checkDNAInput.call(this, array);
if (skillId){
item = 1;
if (skillId.length === 1){
item = $dataSkills[skillId];
}
if (skillId.length > 1){
item = $dataSkills[Window_SpliceResult.prototype.processArray.call(this, skillId)];
}
this.currentSkillInput = item;
}
};
Window_BattleSplice.prototype.drawItem = function(index) {
var item = $dataItems[this._data[index]];
if (!item) item = {name: FugCBS.Param.inputName, iconIndex: 0};
var rect = this.itemRect(index);
this.changePaintOpacity(this.isEnabled(this._data[index]));
this.drawItemName(item, rect.x, rect.y, rect.width);
if (FugCBS.Param.consumeItems === "true" && item.name !== FugCBS.Param.inputName){
this.drawItemNumber(item, rect.x, rect.y, rect.width);
}
var rect = this.itemRectForText(index);
this.changePaintOpacity(true);
};
if you have any other questions or code requests I'll glady oblige