From d58fbd6338544d9067c6e721f2f4cfb6dc0e6894 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@mailbox.org> Date: Mon, 27 Feb 2023 12:24:45 +0100 Subject: [PATCH] Improve scheduled fight settings --- src/facilities/pit/pit.js | 4 ++-- src/facilities/pit/pitWorkaround.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/facilities/pit/pit.js b/src/facilities/pit/pit.js index 4b377f03414..15f070c61c0 100644 --- a/src/facilities/pit/pit.js +++ b/src/facilities/pit/pit.js @@ -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; diff --git a/src/facilities/pit/pitWorkaround.js b/src/facilities/pit/pitWorkaround.js index f0a40dcb0a0..b4f8fe0bcdc 100644 --- a/src/facilities/pit/pitWorkaround.js +++ b/src/facilities/pit/pitWorkaround.js @@ -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() { -- GitLab