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: Add disableExtremeGames toggle in Config tab (#236) #299

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
"extApplications": "Application(s)",
"saveAndRestart": "Save and Restart",
"saveAndClose": "Save and Close",
"tagFilterGroupEditor": "Tag Filter Group Editor"
"tagFilterGroupEditor": "Tag Filter Group Editor",
"disableExtreme": "Disable Extreme Games",
"disableExtremeDesc": "Hides the option to edit Extreme tag filters, and itself."
},
"home": {
"updateHeader": "Launcher Update",
Expand Down Expand Up @@ -520,4 +522,4 @@
"screenshots": "Logos & Screenshots",
"screenshotsDesc": "Adds logos for Grid view and screenshots for all games."
}
}
}
14 changes: 13 additions & 1 deletion src/renderer/components/pages/ConfigPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ export class ConfigPage extends React.Component<ConfigPageProps, ConfigPageState
<p className='setting__title'>{strings.contentFiltersHeader}</p>
<div className='setting__body'>
{/* Show Extreme Games */}
{((!this.props.preferencesData.disableExtremeGames)) ? (
<ConfigBoxCheckbox
title={strings.disableExtreme}
description={strings.disableExtremeDesc}
checked={this.props.preferencesData.disableExtremeGames}
onToggle={this.onDisableExtremeChange} />
) : undefined }
{((!this.props.preferencesData.disableExtremeGames)) ? (
<ConfigBoxCheckbox
title={strings.extremeGames}
Expand Down Expand Up @@ -707,7 +714,12 @@ export class ConfigPage extends React.Component<ConfigPageProps, ConfigPageState
</div>
);
}

onDisableExtremeChange = (isChecked: boolean): void => {
updatePreferencesData({ disableExtremeGames: isChecked });
if (isChecked) {
updatePreferencesData({ browsePageShowExtreme: false });
}
}
onShowExtremeChange = (isChecked: boolean): void => {
updatePreferencesData({ browsePageShowExtreme: isChecked });
}
Expand Down
2 changes: 2 additions & 0 deletions src/shared/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ const langTemplate = {
'saveAndClose',
'browse',
'tagFilterGroupEditor',
'disableExtreme',
'disableExtremeDesc',
] as const,
home: [
'updateHeader',
Expand Down