Adding A Dont Show Homebrew Games Toggle To The Repo!!

I usually take a look at each homebrew to see if it looks interesting. I've found some really original and well-crafted ones, but also some I didn't like as much, things like "horror" or similar. So, I second this motion.
 
I do like homebrew, but the filter is a very sensible suggestion. We can probably brainstorm other useful filters down the line, too.
Yes, I also thought this could open the door to a more filtered and personalized Repo for each user. But, I couldn't think of any other
 
I think it could be a filter option, like the "no hacks" filter we have, but I wouldn't add it like the "Hide Adult Content" button. Homebrews are as much as valid as any other "old" game. These platforms keep receiving games to this day and it is important we don't ignore that. :D

The decision is up to spike, though. Homebrews "seem to be" a lot lately but just because I was uploading the ones I've played and knew about (mostly GBC ones), but I don't have that much anymore and if you compare it to the amount of "non homebrew" game we published, you'll see they are not that much. I'd say to just let it be.
 
I would like a filter option to only see normal roms and translations.

Homebrew and hacks are fun, but that's a secondary thing for me here.
 
I would like a filter option to only see normal roms and translations.

Homebrew and hacks are fun, but that's a secondary thing for me here.

Such a filter exists, if you go into the category of a specific system:

1762986545092.png


Doesn't seem to be able to filter this on the frontpage, though.
 
Ya know...

I don't know why each category doesn't have a toggle.
Myself, I can't stand visual novels... <yeah, yeah, get the pitchforks> But honestly, most of the time I want to play something, not read it or play a digital romance novel. And since I like to get Vita games, and there are a lot of VNs on the Vita, it would be nice to be able to just tick them off as well.
Adverage IT010.webp
 
Hold on, I'm not getting that option!
It's a custom blocklist script* for Greasemonkey/Tampermonkey that works on the repo pages. The darker black area with the script options is a right-click menu. That could have been made clearer, yeah.

*Thanks ChatGPT for making it for my non-coding ass. :D
 
It's a custom blocklist script* for Greasemonkey/Tampermonkey that works on the repo pages. The darker black area with the script options is a right-click menu. That could have been made clearer, yeah.

*Thanks ChatGPT for making it for my non-coding ass. :D
Cheers dude. I didn't even know what tampermonkey was, but now I've added a script to block hacks and homebrew.

If anyone else wants the script, this is it:

// ==UserScript==
// @Name CDRomance Custom Filters
// @namespace http://tampermonkey.net/
// @Version 1.0
// @description Adds filters to hide Rom Hacks and Homebrew content on CDRomance.
// @Author Gemini
// @match https://cdromance.org/*
// @GranT GM_addStyle
// ==/UserScript==

(function() {
'use strict';

// --- CONFIGURATION ---
// Selector for the main game container element.
const GAME_CONTAINER_SELECTOR = '.game-container';
// Selector for the wrapper where we will insert the new filters (the options bar).
const FILTER_BAR_SELECTOR = '.options';
// Selector for the Hack tag element within a game container.
const HACK_TAG_SELECTOR = '.bannertag.hack';
// Selector for the Homebrew tag element within a game container.
const HOMEBREW_TAG_SELECTOR = '.bannertag.homebrew';

// Helper function to get a value from localStorage
function getStoredValue(key, defaultValue) {
const stored = localStorage.getItem(key);
return stored === null ? defaultValue : (stored === 'true');
}

// Helper function to save a value to localStorage
function setStoredValue(key, value) {
localStorage.setItem(key, value);
}

// --- MAIN FILTER LOGIC ---
function applyFilters() {
const hideHacks = document.getElementById('hide-rom-hacks').checked;
const hideHomebrew = document.getElementById('hide-homebrew').checked;

// Save the current state to localStorage
setStoredValue('cdr_hide_rom_hacks', hideHacks);
setStoredValue('cdr_hide_homebrew', hideHomebrew);

// Iterate over all game containers
document.querySelectorAll(GAME_CONTAINER_SELECTOR).forEach(game => {
let shouldHide = false;

// Check for Rom Hacks
const isHack = game.querySelector(HACK_TAG_SELECTOR);
if (hideHacks && isHack) {
shouldHide = true;
}

// Check for Homebrew
const isHomebrew = game.querySelector(HOMEBREW_TAG_SELECTOR);
if (hideHomebrew && isHomebrew) {
shouldHide = true;
}

// Apply display style
game.style.display = shouldHide ? 'none' : 'block';
});

// The layout is a CSS Grid, so we may need to re-center the remaining items
// by forcing a reflow or using the existing CSS. Setting display: block is usually enough.
}

// --- INTERFACE CREATION ---
function createFilterInterface() {
const filterBar = document.querySelector(FILTER_BAR_SELECTOR);
if (!filterBar) {
console.error('Filter bar container not found.');
return;
}

// 1. Create a container for our new filters
const newFilterDiv = document.createElement('div');
newFilterDiv.className = 'custom-filters'; // Use this class for custom styling if needed

// 2. Add "Hide Rom Hacks" checkbox
const hideHacksState = getStoredValue('cdr_hide_rom_hacks', false);
newFilterDiv.innerHTML += `
<label style="margin-left: 10px; cursor: pointer;">
<input type="checkbox" id="hide-rom-hacks" ${hideHacksState ? 'checked' : ''} style="margin-right: 5px;">
Hide Rom Hacks
</label>
`;

// 3. Add "Hide Homebrew" checkbox
const hideHomebrewState = getStoredValue('cdr_hide_homebrew', false);
newFilterDiv.innerHTML += `
<label style="margin-left: 10px; cursor: pointer;">
<input type="checkbox" id="hide-homebrew" ${hideHomebrewState ? 'checked' : ''} style="margin-right: 5px;">
Hide Homebrew Roms
</label>
`;

// The existing filters are inside the div with class 'options'.
// We will prepend our new div to ensure it appears logically near the search bar.
filterBar.prepend(newFilterDiv);

// 4. Attach event listeners
document.getElementById('hide-rom-hacks').addEventListener('change', applyFilters);
document.getElementById('hide-homebrew').addEventListener('change', applyFilters);

// 5. Apply filters on initial load
applyFilters();
}

// --- EXECUTION ---
// Run the setup when the document is ready.
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', createFilterInterface);
} else {
createFilterInterface();
}

})();
 

Users who are viewing this thread

Connect with us

Support this Site

RGT relies on you to stay afloat. Help covering the site costs and get some pretty Level 7 perks too.

Featured Video

Latest Threads

What’s a video-game quote that stuck with you?

One of my favorites is this one from Solid Snake, powerful and timeless:

“Life isn't just about...
Read more

Why did Super Mario Bros. 3 take so long to reach overseas?

Obviously, there was the Mario 2 debacle, but is there any reason for Mario 3 not to have...
Read more

Stockholm Syndrom Manga/Manhwa/Manhua

Allow me to elucidate the concept I refer to as "Stockholm Syndrome Manga." It describes a...
Read more

ScummVM Games

Lately I've been playing some ScummVM games and I'm having a blast ngl. Point-and-Click games...
Read more

Online statistics

Members online
101
Guests online
595
Total visitors
696

Forum statistics

Threads
14,850
Messages
356,003
Members
895,378
Latest member
Shagocastigadoranal

Today's birthdays

Advertisers

Back
Top