From d1b40f34ee8dcb56a18209f5ffc418f6c59f3f06 Mon Sep 17 00:00:00 2001 From: buster scruggs <prettyleetemail@protonmail.com> Date: Tue, 21 Feb 2023 10:28:15 -0500 Subject: [PATCH] Replace ifs with ternary operator in FS titles --- src/js/utilsPC.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/js/utilsPC.js b/src/js/utilsPC.js index 4ac1a68b4ee..2f18d167e8f 100644 --- a/src/js/utilsPC.js +++ b/src/js/utilsPC.js @@ -468,23 +468,11 @@ globalThis.PCTitle = function() { } if (V.arcologies[0].FSAntebellumRevivalist >= V.FSLockinLevel * 0.9) { - if (V.PC.title === 1) { - titles.push(`Reclaimer of the Cause and Lord of ${V.arcologies[0].name}`); - } else { - titles.push(`Reclaimer of the Cause and Lady of ${V.arcologies[0].name}`); - } + titles.push(`Reclaimer of the Cause and ${V.PC.title === 1 ? 'Lord' : 'Lady'} of ${V.arcologies[0].name}`); } else if (V.arcologies[0].FSAntebellumRevivalist >= V.FSLockinLevel * 0.6) { - if (V.PC.title === 1) { - titles.push(`Lord of ${V.arcologies[0].name}`); - } else { - titles.push(`Lady of ${V.arcologies[0].name}`); - } + titles.push(`${V.PC.title === 1 ? 'Lord' : 'Lady'} of ${V.arcologies[0].name}`); } else if (V.arcologies[0].FSAntebellumRevivalist >= V.FSLockinLevel * 0.3) { - if (V.PC.title === 1) { - titles.push(`Son of the South`); - } else { - titles.push(`Daughter of the South`); - } + titles.push(`${V.PC.title === 1 ? 'Son' : 'Daughter'} of the South`); } const facilities = App.Entity.facilities; -- GitLab