From d6fc041d906f9c1d709190e51d25af58f4a76797 Mon Sep 17 00:00:00 2001 From: PRO100KatYT <67335438+PRO100KatYT@users.noreply.github.com> Date: Sat, 10 Aug 2024 16:59:34 +0200 Subject: [PATCH] Use switch case for builds in getContentPages --- structure/functions.js | 112 ++++++++++++++++++++++++++--------------- 1 file changed, 72 insertions(+), 40 deletions(-) diff --git a/structure/functions.js b/structure/functions.js index 2300651..1de3ae9 100644 --- a/structure/functions.js +++ b/structure/functions.js @@ -247,53 +247,85 @@ function getContentPages(req) { const season = `season${memory.season}${memory.season >= 21 ? "00" : ""}`; backgrounds[0].stage = season; backgrounds[1].stage = season; - - if (memory.season == 10) { - backgrounds[0].stage = "seasonx"; - backgrounds[1].stage = "seasonx"; - } else if (memory.build == 11.31 || memory.build == 11.40) { - backgrounds[0].stage = "Winter19"; - backgrounds[1].stage = "Winter19"; - } else if (memory.build == 19.01) { - backgrounds[0].stage = "winter2021"; - backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp19-lobby-xmas-2048x1024-f85d2684b4af.png"; - contentpages.subgameinfo.battleroyale.image = "https://cdn2.unrealengine.com/19br-wf-subgame-select-512x1024-16d8bb0f218f.jpg"; - contentpages.specialoffervideo.bSpecialOfferEnabled = "true"; - } else if (memory.season == 20) { - backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp20-lobby-2048x1024-d89eb522746c.png"; - if (memory.build == 20.40) { + + switch (memory.season) { + + case 10: + backgrounds[0].stage = "seasonx"; + backgrounds[1].stage = "seasonx"; + break; + + case 20: + backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp20-lobby-2048x1024-d89eb522746c.png"; + break; + + case 21: + backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/s21-lobby-background-2048x1024-2e7112b25dc3.jpg"; + break; + + case 22: + backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp22-lobby-square-2048x2048-2048x2048-e4e90c6e8018.jpg"; + break; + + case 23: + backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp23-lobby-2048x1024-2048x1024-26f2c1b27f63.png"; + break; + + case 24: + backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-ch4s2-bp-lobby-4096x2048-edde08d15f7e.jpg"; + break; + + case 25: + backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/s25-lobby-4k-4096x2048-4a832928e11f.jpg"; + backgrounds[1].backgroundimage = "https://cdn2.unrealengine.com/fn-shop-ch4s3-04-1920x1080-785ce1d90213.png"; + break; + + case 27: + backgrounds[0].stage = "rufus"; + break; + + default: + backgrounds[0].stage = "defaultnotris"; + backgrounds[0].backgroundimage = "https://fortnite-public-service-prod11.ol.epicgames.com/images/lightlobbybg.png"; + + } + + switch (memory.build) { + + case 11.31: + case 11.40: + backgrounds[0].stage = "Winter19"; + backgrounds[1].stage = "Winter19"; + break; + + case 19.01: + backgrounds[0].stage = "winter2021"; + backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp19-lobby-xmas-2048x1024-f85d2684b4af.png"; + contentpages.subgameinfo.battleroyale.image = "https://cdn2.unrealengine.com/19br-wf-subgame-select-512x1024-16d8bb0f218f.jpg"; + contentpages.specialoffervideo.bSpecialOfferEnabled = "true"; + break; + + case 20.40: backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp20-40-armadillo-glowup-lobby-2048x2048-2048x2048-3b83b887cc7f.jpg"; - } - } else if (memory.season == 21) { - backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/s21-lobby-background-2048x1024-2e7112b25dc3.jpg"; - if (memory.build == 21.10) { + break; + + case 21.10: backgrounds[0].stage = "season2100"; - } - if (memory.build == 21.30) { + break; + + case 21.30: backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/nss-lobbybackground-2048x1024-f74a14565061.jpg"; backgrounds[0].stage = "season2130"; - } - } else if (memory.season == 22) { - backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp22-lobby-square-2048x2048-2048x2048-e4e90c6e8018.jpg"; - } else if (memory.season == 23) { - backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp23-lobby-2048x1024-2048x1024-26f2c1b27f63.png"; - if (memory.build == 23.10) { + break; + + case 23.10: backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-bp23-winterfest-lobby-square-2048x2048-2048x2048-277a476e5ca6.png"; contentpages.specialoffervideo.bSpecialOfferEnabled = "true"; - } - } else if (memory.season == 24) { - backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-ch4s2-bp-lobby-4096x2048-edde08d15f7e.jpg"; - } else if (memory.season == 25) { - backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/s25-lobby-4k-4096x2048-4a832928e11f.jpg"; - backgrounds[1].backgroundimage = "https://cdn2.unrealengine.com/fn-shop-ch4s3-04-1920x1080-785ce1d90213.png"; - if (memory.build == 25.11) { + break; + + case 25.11: backgrounds[0].backgroundimage = "https://cdn2.unrealengine.com/t-s25-14dos-lobby-4096x2048-2be24969eee3.jpg"; - } - } else if (memory.season == 27) { - backgrounds[0].stage = "rufus"; - } else { - backgrounds[0].stage = "defaultnotris"; - backgrounds[0].backgroundimage = "https://fortnite-public-service-prod11.ol.epicgames.com/images/lightlobbybg.png"; + } } catch (err) {}