diff --git a/src/events/debugEvent.js b/src/events/debugEvent.js index 975f364209ddeeb80c0886b02015c0e7f298416a..a7cc04445b883b8c3e41520b4f897571ddc0c36a 100644 --- a/src/events/debugEvent.js +++ b/src/events/debugEvent.js @@ -67,9 +67,11 @@ App.Events.debugEvent = function(eventName) { slaveFails = slaveFails || !passed; App.UI.DOM.appendNewElement("div", slaveDiv, p.name || p.toString(), [passed ? "green" : "red", "indent"]); } - if (!slaveFails) { + if (event.actors.includes(slave.ID)) { + App.UI.DOM.appendNewElement("div", slaveDiv, App.UI.DOM.link("Remove this slave", removeCasted, [slave]), "indent"); + } else if (!slaveFails) { App.UI.DOM.appendNewElement("div", slaveDiv, App.UI.DOM.link("Choose this slave", castSlave, [slave, i]), "indent"); - } else if (displayOnlyValid) { + } else if (displayOnlyValid) { // Filter out slaves that are not valid continue; } App.UI.DOM.appendNewElement("hr", tab); @@ -85,6 +87,12 @@ App.Events.debugEvent = function(eventName) { $('#actorList').empty().append(makeActorList()); } + function removeCasted(slave) { + event.actors.delete(slave.ID); + $('#castList').empty().append(makeCastList()); + $('#actorList').empty().append(makeActorList()); + } + function testPredicate(outDiv, p, ...args) { let passed = false; try {