From 37aab90ec4f58350b96df5ac6de4f6f6b5e8845c Mon Sep 17 00:00:00 2001 From: Bag <139614375+BagischandraK@users.noreply.github.com> Date: Sat, 21 Nov 2026 11:45:19 +0100 Subject: [PATCH 1/3] Add contributor user ID --- src/content/core/configs/userIds.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/core/configs/userIds.js b/src/content/core/configs/userIds.js index bd656c51..025392c0 100644 --- a/src/content/core/configs/userIds.js +++ b/src/content/core/configs/userIds.js @@ -45,6 +45,7 @@ export const CONTRIBUTOR_USER_IDS = [ '74884', // awkward222 '3774777796', // hhhhhhhf334 '4975603156', // KyoMarketing + '1718514709', // BagischandraK ]; export const TESTER_USER_IDS = [ From b668891f9c41e2153d7d5a474c91e84f9b88259c Mon Sep 17 00:00:00 2001 From: Bag <139614375+BagischandraK@users.noreply.github.com> Date: Sat, 21 Nov 2026 11:52:09 +0100 Subject: [PATCH 2/3] Add Rolimons game analytics link --- .github/workflows/prs.yml | 2 + public/Assets/locales/en.json | 4 ++ .../features/games/rolimonsGameLink.js | 56 +++++++++++++++++++ src/content/index.js | 2 + src/css/features/games/rolimonsGameLink.scss | 37 ++++++++++++ src/css/main.scss | 1 + 6 files changed, 102 insertions(+) create mode 100644 src/content/features/games/rolimonsGameLink.js create mode 100644 src/css/features/games/rolimonsGameLink.scss diff --git a/.github/workflows/prs.yml b/.github/workflows/prs.yml index ba820858..1b1bc415 100644 --- a/.github/workflows/prs.yml +++ b/.github/workflows/prs.yml @@ -79,6 +79,8 @@ jobs: for f in ${{ steps.changed.outputs.all_changed_files }}; do while read host; do [ -z "$host" ] && continue + # The game analytics button opens Rolimon's in a new tab. + [ "$host" = "www.rolimons.com" ] && continue if ! echo "$host" | grep -qE '(^|\.)(rovalra|roblox|rbxcdn|eslint|feross|github|opencollective|paulmillr|polar|registry\.npmjs|tidelift|i18next|locize|patreon)\.(com|org|sh)$'; then echo "::error file=$f::Disallowed link host: $host" BAD=1 diff --git a/public/Assets/locales/en.json b/public/Assets/locales/en.json index c9f01a14..c685fece 100644 --- a/public/Assets/locales/en.json +++ b/public/Assets/locales/en.json @@ -372,6 +372,10 @@ "games": { "failedToLoad": "Failed to load game" }, + "rolimonsGameLink": { + "label": "Rolimons", + "tooltip": "View this game's analytics on Rolimon's." + }, "gameBookmarks": { "bookmark": "Bookmark", "saved": "Bookmarked", diff --git a/src/content/features/games/rolimonsGameLink.js b/src/content/features/games/rolimonsGameLink.js new file mode 100644 index 00000000..5397e233 --- /dev/null +++ b/src/content/features/games/rolimonsGameLink.js @@ -0,0 +1,56 @@ +import { getAssets } from '../../core/assets.js'; +import { getPlaceIdFromUrl } from '../../core/idExtractor.js'; +import { observeElement } from '../../core/observer.js'; +import { t } from '../../core/locale/i18n.js'; +import { addTooltip } from '../../core/ui/tooltip.js'; + +const STATS_SELECTOR = '#game-details-about-tab-container .game-stat-container'; +const LINK_CONTAINER_CLASS = 'rovalra-rolimons-game-link-container'; + +function addRolimonsLink(statsContainer, labelText, tooltipText) { + if ( + statsContainer.dataset.rovalraRolimonsLink === 'true' || + !statsContainer.isConnected + ) { + return; + } + + const placeId = getPlaceIdFromUrl(); + if (!/^\d+$/.test(placeId || '')) return; + + statsContainer.dataset.rovalraRolimonsLink = 'true'; + + const link = document.createElement('a'); + link.className = 'btn-secondary-md rovalra-rolimons-game-link'; + link.href = `https://www.rolimons.com/game/${placeId}`; + link.target = '_blank'; + link.rel = 'noopener noreferrer'; + + const icon = document.createElement('img'); + icon.src = getAssets().rolimonsIcon; + icon.alt = ''; + link.appendChild(icon); + + const label = document.createElement('span'); + label.textContent = labelText; + link.appendChild(label); + + addTooltip(link, tooltipText, { position: 'top' }); + + const linkContainer = document.createElement('li'); + linkContainer.className = LINK_CONTAINER_CLASS; + linkContainer.appendChild(link); + statsContainer.appendChild(linkContainer); +} + +export async function init() { + const [label, tooltip] = await Promise.all([ + t('rolimonsGameLink.label'), + t('rolimonsGameLink.tooltip'), + ]); + observeElement( + STATS_SELECTOR, + (statsContainer) => addRolimonsLink(statsContainer, label, tooltip), + { multiple: true }, + ); +} diff --git a/src/content/index.js b/src/content/index.js index 41dbd93a..d882a976 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -114,6 +114,7 @@ import { init as initBadgeEarnedDate } from './features/games/badgeEarnedDate.js import { init as initBadgeSort } from './features/games/badgeSort.js'; import { init as initGameStatTimestamps } from './features/games/gameStatTimestamps.js'; import { init as initFreeBadgeQuota } from './features/games/freeBadgeQuota.js'; +import { init as initRolimonsGameLink } from './features/games/rolimonsGameLink.js'; import { init as initServerList } from './features/games/serverlist/serverlist.js'; import { initRecentServers } from './features/games/serverlist/recentservers.js'; import { init as initRegionPlayButton } from './features/games/RegionPlayButton.js'; @@ -432,6 +433,7 @@ const featureRoutes = [ initCatalogExplorer, initUnderReviewPill, initGameStatTimestamps, + initRolimonsGameLink, ], }, // private games and game pages diff --git a/src/css/features/games/rolimonsGameLink.scss b/src/css/features/games/rolimonsGameLink.scss new file mode 100644 index 00000000..1710ff2a --- /dev/null +++ b/src/css/features/games/rolimonsGameLink.scss @@ -0,0 +1,37 @@ +#game-details-about-tab-container + ul.game-stat-container[data-rovalra-rolimons-link='true'] { + display: flex; + flex-wrap: wrap; + height: auto; +} + +#game-details-about-tab-container li.rovalra-rolimons-game-link-container { + display: flex; + align-items: center; + justify-content: center; + flex: 0 0 100%; + width: 100%; + box-sizing: border-box; + margin: 8px 0 0; +} + +#game-details-about-tab-container a.rovalra-rolimons-game-link { + display: inline-flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: 8px; + min-width: 120px; + height: 40px; + padding: 0 12px; + box-sizing: border-box; + white-space: nowrap; + + img { + display: block; + width: 14px; + height: 19px; + object-fit: contain; + filter: grayscale(1) brightness(0) invert(0.82); + } +} diff --git a/src/css/main.scss b/src/css/main.scss index afdbf02f..2c31ccdc 100644 --- a/src/css/main.scss +++ b/src/css/main.scss @@ -44,6 +44,7 @@ @use 'features/games/gameBookmarks.scss'; @use 'features/games/events.scss'; @use 'features/games/hiddenBadges.scss'; +@use 'features/games/rolimonsGameLink.scss'; @use 'features/games/badgeLayoutToggle.scss'; @use 'features/games/badgeSort.scss'; @use 'features/groups/antibots.scss'; From cbcb1a08dfd2405cf7f521ea8b390b79774bbf15 Mon Sep 17 00:00:00 2001 From: Bag <139614375+BagischandraK@users.noreply.github.com> Date: Sat, 21 Nov 2026 12:31:12 +0100 Subject: [PATCH 3/3] Fix Rolimons tooltip wording --- public/Assets/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/Assets/locales/en.json b/public/Assets/locales/en.json index c685fece..903b352a 100644 --- a/public/Assets/locales/en.json +++ b/public/Assets/locales/en.json @@ -374,7 +374,7 @@ }, "rolimonsGameLink": { "label": "Rolimons", - "tooltip": "View this game's analytics on Rolimon's." + "tooltip": "View this game's analytics on Rolimons." }, "gameBookmarks": { "bookmark": "Bookmark",