mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
🔘 alllow/disallow PETS/BOTS Selector Users Area
This commit is contained in:
@@ -106,6 +106,11 @@ export const WiredActionFurniAreaView: FC<{}> = props =>
|
||||
<Text bold>{ LocalizeText('wiredfurni.params.area_selection') }</Text>
|
||||
<Text small>{ LocalizeText('wiredfurni.params.area_selection.info') }</Text>
|
||||
|
||||
{ hasArea &&
|
||||
<Text small>
|
||||
{ LocalizeText('wiredfurni.params.area_selection.selected', [ 'x', 'y', 'w', 'h' ], [ rootX.toString(), rootY.toString(), areaWidth.toString(), areaHeight.toString() ]) }
|
||||
</Text> }
|
||||
|
||||
{ hasArea &&
|
||||
<Text small>
|
||||
{ LocalizeText('wiredfurni.pickfurnis.caption', [ 'count', 'limit' ], [ pickedCount.toString(), pickedLimit.toString() ]) }
|
||||
|
||||
@@ -13,12 +13,14 @@ export const WiredSelectorUsersAreaView: FC<{}> = props =>
|
||||
const [ areaHeight, setAreaHeight ] = useState(0);
|
||||
const [ filterExisting, setFilterExisting ] = useState(false);
|
||||
const [ invert, setInvert ] = useState(false);
|
||||
const [ excludeBots, setExcludeBots ] = useState(false);
|
||||
const [ excludePets, setExcludePets ] = useState(false);
|
||||
const { trigger = null, setIntParams } = useWired();
|
||||
|
||||
const save = useCallback(() =>
|
||||
{
|
||||
setIntParams([ rootX, rootY, areaWidth, areaHeight, filterExisting ? 1 : 0, invert ? 1 : 0 ]);
|
||||
}, [ rootX, rootY, areaWidth, areaHeight, filterExisting, invert, setIntParams ]);
|
||||
setIntParams([ rootX, rootY, areaWidth, areaHeight, filterExisting ? 1 : 0, invert ? 1 : 0, excludeBots ? 1 : 0, excludePets ? 1 : 0 ]);
|
||||
}, [ rootX, rootY, areaWidth, areaHeight, filterExisting, invert, excludeBots, excludePets, setIntParams ]);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@@ -74,6 +76,8 @@ export const WiredSelectorUsersAreaView: FC<{}> = props =>
|
||||
|
||||
setFilterExisting(trigger.intData.length >= 5 && trigger.intData[4] === 1);
|
||||
setInvert(trigger.intData.length >= 6 && trigger.intData[5] === 1);
|
||||
setExcludeBots(trigger.intData.length >= 7 && trigger.intData[6] === 1);
|
||||
setExcludePets(trigger.intData.length >= 8 && trigger.intData[7] === 1);
|
||||
}, [ trigger ]);
|
||||
|
||||
useEffect(() =>
|
||||
@@ -130,6 +134,24 @@ export const WiredSelectorUsersAreaView: FC<{}> = props =>
|
||||
onChange={ e => setInvert(e.target.checked) } />
|
||||
<Text small>{ LocalizeText('wiredfurni.params.selector_option.1') }</Text>
|
||||
</label>
|
||||
|
||||
<label className="flex items-center gap-1">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="form-check-input"
|
||||
checked={ excludeBots }
|
||||
onChange={ e => setExcludeBots(e.target.checked) } />
|
||||
<Text small>{ LocalizeText('wiredfurni.params.selector_option.bot') }</Text>
|
||||
</label>
|
||||
|
||||
<label className="flex items-center gap-1">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="form-check-input"
|
||||
checked={ excludePets }
|
||||
onChange={ e => setExcludePets(e.target.checked) } />
|
||||
<Text small>{ LocalizeText('wiredfurni.params.selector_option.pet') }</Text>
|
||||
</label>
|
||||
</div>
|
||||
</WiredActionBaseView>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user