Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Sorryfield): update presence for 1.11.0 update #8353

Merged
merged 8 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions websites/S/Sorryfield/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://schemas.premid.app/metadata/1.10",
"author": {
"id": "741973166364164099",
"name": "ihah"
"name": "rai_ny._."
},
"service": "Sorryfield",
"altnames": [
Expand All @@ -13,7 +13,7 @@
"ko_KR": "쏘리들은 노래방 곡 목록 사이트입니다. 그리고 리듬 게임 자바!를 플레이 할 수 있습니다."
},
"url": "sorry.daldal.so",
"version": "1.2.2",
"version": "1.2.3",
"logo": "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/logo.png",
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/thumbnail.png",
"color": "#1b3058",
Expand Down
58 changes: 37 additions & 21 deletions websites/S/Sorryfield/presence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ const enum Assets {
Logo = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/logo.png",
ChartSearch = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/0.jpg",
ChartHypoRanked = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/1.jpg",
ChartExponential = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/2.jpg",
ChartHard = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/3.jpg",
ChartIntermediate = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/4.jpg",
ChartEasy = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/5.jpg",
ChartByDifficulty = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/4.jpg",
ChartNew = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/6.jpg",
ChartHistory = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/7.jpg",
ChartPossession = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/8.jpg",
ChartHot = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/9.jpg",
ChartCold = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/10.jpg",
ChartMultiPlayer = "https://cdn.rcd.gg/PreMiD/websites/S/Sorryfield/assets/11.jpg",
ChartSpotlighted = "https://i.imgur.com/Tr2BDaQ.png",
}

presence.on("UpdateData", async () => {
Expand Down Expand Up @@ -150,21 +148,19 @@ presence.on("UpdateData", async () => {
imageKey = Assets.ChartHypoRanked;
menuName = "내 순위가 아래인 채보";
break;
case "EXPONENTIAL":
imageKey = Assets.ChartExponential;
menuName = "경지에 다다른 채보";
break;
case "HARD":
imageKey = Assets.ChartHard;
menuName = "어려운 채보";
break;
case "INTERMEDIATE":
imageKey = Assets.ChartIntermediate;
menuName = "적당한 채보";
break;
case "EASY":
imageKey = Assets.ChartEasy;
menuName = "쉬운 채보";
case "BY_DIFFICULTY":
imageKey = Assets.ChartByDifficulty;
menuName = "전체 채보";
for (let i = 0; i < 32; i++) {
if (
document
.querySelectorAll(".difficulty-bar>.item")
[i].getAttribute("data-active") === "true"
) {
menuName = `난도 ${i === 31 ? "30+" : i.toString()} 채보`;
break;
}
}
break;
case "NEW":
imageKey = Assets.ChartNew;
Expand All @@ -186,13 +182,29 @@ presence.on("UpdateData", async () => {
imageKey = Assets.ChartCold;
menuName = "요즘 안 북적이는 채보";
break;
case "SPOTLIGHTED":
imageKey = Assets.ChartSpotlighted;
menuName = "오늘의 픽";
break;
case "MULTIPLAYER":
imageKey = Assets.ChartMultiPlayer;
presenceData.details = "자바! 멀티플레이어";
presenceData.state = "방 선택 중";
break;
}
if (menuName !== "") presenceData.state = `채보 선택 중: ${menuName}`;
if (menuName !== "") {
presenceData.state = `${
document
.querySelector(".mode-selection>.body>.mode-串")
.classList.contains("active")
? "串"
: document
.querySelector(".mode-selection>.body>.mode-本")
.classList.contains("active")
? "本"
: "雙"
} 채보 선택 중: ${menuName}`;
}

presenceData.largeImageKey = imageKey;
presenceData.buttons = [{ label: "자바! 플레이하기", url: href }];
Expand Down Expand Up @@ -227,7 +239,11 @@ presence.on("UpdateData", async () => {
presenceData.buttons = [{ label: "리플레이 보기", url: href }];
} else if (pathname.includes("/shop")) presenceData.state = "상점";
else if (pathname.includes("/sync")) presenceData.state = "환경 설정";
else if (pathname === "/java/multiplayer") {
else if (pathname.includes("/ranking")) {
presenceData.state = `${
document.querySelector("h2").textContent
} 모드 짬 랭킹`;
} else if (pathname === "/java/multiplayer") {
presenceData.details = "자바! 멀티플레이어";
presenceData.largeImageKey = Assets.ChartMultiPlayer;
if (document.querySelector(".room-header")) {
Expand Down
Loading