unblur when horny mode is on

This commit is contained in:
SpikeHD
2022-09-02 20:17:48 -07:00
parent 6eab66032b
commit 782e350ae5
2 changed files with 10 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import React from 'react' import React from 'react'
import { getConfigOption } from '../../../utils/configuration'
import { getInstalledMods, getMods, ModData, PartialModData } from '../../../utils/gamebanana' import { getInstalledMods, getMods, ModData, PartialModData } from '../../../utils/gamebanana'
import { LoadingCircle } from './LoadingCircle' import { LoadingCircle } from './LoadingCircle'
@@ -11,6 +12,7 @@ interface IProps {
} }
interface IState { interface IState {
horny: boolean
modList: ModData[] | null modList: ModData[] | null
installedList: installedList:
| { | {
@@ -25,6 +27,7 @@ export class ModList extends React.Component<IProps, IState> {
super(props) super(props)
this.state = { this.state = {
horny: false,
modList: null, modList: null,
installedList: null, installedList: null,
} }
@@ -60,8 +63,10 @@ export class ModList extends React.Component<IProps, IState> {
} }
const mods = await getMods(this.props.mode) const mods = await getMods(this.props.mode)
const horny = await getConfigOption('horny_mode')
this.setState({ this.setState({
horny,
modList: mods, modList: mods,
}) })
} }
@@ -81,7 +86,7 @@ export class ModList extends React.Component<IProps, IState> {
<ModTile path={mod.path} mod={mod.info} key={mod.info.name} onClick={this.downloadMod} /> <ModTile path={mod.path} mod={mod.info} key={mod.info.name} onClick={this.downloadMod} />
)) ))
: this.state.modList?.map((mod: ModData) => ( : this.state.modList?.map((mod: ModData) => (
<ModTile mod={mod} key={mod.id} onClick={this.downloadMod} /> <ModTile horny={this.state.horny} mod={mod} key={mod.id} onClick={this.downloadMod} />
))} ))}
</div> </div>
) : ( ) : (

View File

@@ -12,6 +12,7 @@ import { disableMod, enableMod, modIsEnabled } from '../../../utils/mods'
interface IProps { interface IProps {
mod: ModData | PartialModData mod: ModData | PartialModData
horny?: boolean
path?: string path?: string
onClick: (mod: ModData) => void onClick: (mod: ModData) => void
} }
@@ -107,7 +108,9 @@ export class ModTile extends React.Component<IProps, IState> {
))} ))}
<img <img
src={mod.images[0]} src={mod.images[0]}
className={`ModImageInner ${'id' in mod && mod.nsfw ? 'nsfw' : ''} ${this.state.hover ? 'blur' : ''}`} className={`ModImageInner ${'id' in mod && !this.props.horny && mod.nsfw ? 'nsfw' : ''} ${
this.state.hover ? 'blur' : ''
}`}
/> />
</div> </div>
<div className="ModInner"> <div className="ModInner">