mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-13 07:34:36 +01:00
Fix horny blur on installed mods
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cultivation",
|
||||
"version": "1.0.24",
|
||||
"version": "1.0.25",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^1.0.0-rc.5",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
},
|
||||
"package": {
|
||||
"productName": "Cultivation",
|
||||
"version": "1.0.24"
|
||||
"version": "1.0.25"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { invoke } from '@tauri-apps/api'
|
||||
import { dataDir } from '@tauri-apps/api/path'
|
||||
import DirInput from '../common/DirInput'
|
||||
import Menu from './Menu'
|
||||
import Tr, { getLanguages, translate } from '../../../utils/language'
|
||||
import Tr, { getLanguages } from '../../../utils/language'
|
||||
import { setConfigOption, getConfig, getConfigOption, Configuration } from '../../../utils/configuration'
|
||||
import Checkbox from '../common/Checkbox'
|
||||
import Divider from './Divider'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from 'react'
|
||||
import { ModData, PartialModData } from '../../../utils/gamebanana'
|
||||
import { getConfigOption } from '../../../utils/configuration'
|
||||
|
||||
import './ModTile.css'
|
||||
import Like from '../../../resources/icons/like.svg'
|
||||
@@ -18,6 +19,7 @@ interface IProps {
|
||||
}
|
||||
|
||||
interface IState {
|
||||
horny: boolean
|
||||
hover: boolean
|
||||
modEnabled: boolean
|
||||
}
|
||||
@@ -27,6 +29,7 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
super(props)
|
||||
|
||||
this.state = {
|
||||
horny: false,
|
||||
hover: false,
|
||||
modEnabled: false,
|
||||
}
|
||||
@@ -44,10 +47,13 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const horny = await getConfigOption('horny_mode')
|
||||
|
||||
if (!('id' in this.props.mod)) {
|
||||
// Partial mod
|
||||
this.setState({
|
||||
modEnabled: await modIsEnabled(this.props.mod.name),
|
||||
horny
|
||||
})
|
||||
|
||||
return
|
||||
@@ -55,6 +61,7 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
|
||||
this.setState({
|
||||
modEnabled: await modIsEnabled(String(this.props.mod.id)),
|
||||
horny
|
||||
})
|
||||
}
|
||||
|
||||
@@ -66,6 +73,7 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
this.setState(
|
||||
{
|
||||
modEnabled: !this.state.modEnabled,
|
||||
horny: !this.state.horny
|
||||
},
|
||||
() => {
|
||||
if (this.state.modEnabled) {
|
||||
@@ -108,7 +116,7 @@ export class ModTile extends React.Component<IProps, IState> {
|
||||
))}
|
||||
<img
|
||||
src={mod.images[0]}
|
||||
className={`ModImageInner ${'id' in mod && !this.props.horny && mod.nsfw ? 'nsfw' : ''} ${
|
||||
className={`ModImageInner ${'id' in mod && !this.state.horny && mod.nsfw ? 'nsfw' : ''} ${
|
||||
this.state.hover ? 'blur' : ''
|
||||
}`}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user