From 560b84b2f7be5b734b48319161c678945061adf1 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Thu, 23 Jul 2020 19:12:06 -0400 Subject: [PATCH] fix --- src/interaction/slaveInteract.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index 257a61c5e15..d74ce99704e 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -2179,7 +2179,10 @@ App.UI.SlaveInteract.rules = function(slave) { if (V.roomsPopulation <= V.rooms - 0.5) { choices.push({value: "luxurious"}); } else { - choices.push(App.UI.DOM.disabledLink(`Luxurious`, "No luxurious rooms available")); + choices.push({ + title: `Luxurious`, + disabled: ["No luxurious rooms available"] + }); } p.append(listChoices(choices, "living")); @@ -2302,8 +2305,14 @@ App.UI.SlaveInteract.rules = function(slave) { function listChoices(choices, property) { const links = []; for (const c of choices) { - if (typeof c == "object") { - const title = c.title || capFirstChar(c.value); + const title = c.title || capFirstChar(c.value); + if (c.disabled) { + links.push( + App.UI.DOM.disabledLink( + title, c.disabled + ) + ); + } else { links.push( App.UI.DOM.link( title, @@ -2313,8 +2322,6 @@ App.UI.SlaveInteract.rules = function(slave) { } ) ); - } else { // node - links.push(c); } } return App.UI.DOM.generateLinksStrip(links); -- GitLab