diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index 257a61c5e15568f7fe7a9eceadeed03eedc5a6ff..d74ce99704edaeecbee02dbae69e93203cf8bafc 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);