Skip to content
Snippets Groups Projects
Commit d58fbd63 authored by Arkerthan's avatar Arkerthan
Browse files

Improve scheduled fight settings

parent d8cfe6f3
No related branches found
No related tags found
1 merge request!11287Fix pit scheduled fights when slaves are sold
......@@ -69,8 +69,8 @@ App.Facilities.Pit.pit = function() {
if (V.pit.slavesFighting !== null) {
const [slave1, slave2] = V.pit.slavesFighting;
el.append(`You have scheduled `, App.UI.DOM.slaveDescriptionDialog(getSlave(slave1)), ` and `,
contextualIntro(getSlave(slave1), getSlave(slave2), true), " to fight this week.");
el.append(`You have scheduled `, App.UI.DOM.referenceSlaveWithPreview(getSlave(slave1), SlaveFullName(getSlave(slave1))), ` and `,
App.UI.DOM.referenceSlaveWithPreview(getSlave(slave2), SlaveFullName(getSlave(slave2))), " to fight this week.");
App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link(`Cancel it`, () => {
V.pit.slavesFighting = null;
......
......@@ -24,21 +24,23 @@ App.Facilities.Pit.workaround = function() {
);
for (const slave of V.slaves) {
const div = document.createElement("div");
if (V.pit.slavesFighting.includes(slave.ID)) {
App.UI.DOM.appendNewElement("div", f, SlaveFullName(slave), ['indent']);
div.append("Assign");
} else {
App.UI.DOM.appendNewElement("div", f, App.UI.DOM.link(SlaveFullName(slave), () => {
div.append(App.UI.DOM.link("Assign", () => {
if (V.pit.slavesFighting.length > 1) {
V.pit.slavesFighting.shift();
}
V.pit.slavesFighting.push(slave.ID);
V.passageSwitchHandler = () => { };
V.passageSwitchHandler = () => {
};
App.UI.reload();
V.passageSwitchHandler = passageHandler;
}), ['indent']);
}));
}
div.append(" ", App.UI.DOM.referenceSlaveWithPreview(slave, SlaveFullName(slave)));
f.append(div);
}
function passageHandler() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment