mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 15:36:18 +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 bold>{ LocalizeText('wiredfurni.params.area_selection') }</Text>
|
||||||
<Text small>{ LocalizeText('wiredfurni.params.area_selection.info') }</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 &&
|
{ hasArea &&
|
||||||
<Text small>
|
<Text small>
|
||||||
{ LocalizeText('wiredfurni.pickfurnis.caption', [ 'count', 'limit' ], [ pickedCount.toString(), pickedLimit.toString() ]) }
|
{ 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 [ areaHeight, setAreaHeight ] = useState(0);
|
||||||
const [ filterExisting, setFilterExisting ] = useState(false);
|
const [ filterExisting, setFilterExisting ] = useState(false);
|
||||||
const [ invert, setInvert ] = useState(false);
|
const [ invert, setInvert ] = useState(false);
|
||||||
|
const [ excludeBots, setExcludeBots ] = useState(false);
|
||||||
|
const [ excludePets, setExcludePets ] = useState(false);
|
||||||
const { trigger = null, setIntParams } = useWired();
|
const { trigger = null, setIntParams } = useWired();
|
||||||
|
|
||||||
const save = useCallback(() =>
|
const save = useCallback(() =>
|
||||||
{
|
{
|
||||||
setIntParams([ rootX, rootY, areaWidth, areaHeight, filterExisting ? 1 : 0, invert ? 1 : 0 ]);
|
setIntParams([ rootX, rootY, areaWidth, areaHeight, filterExisting ? 1 : 0, invert ? 1 : 0, excludeBots ? 1 : 0, excludePets ? 1 : 0 ]);
|
||||||
}, [ rootX, rootY, areaWidth, areaHeight, filterExisting, invert, setIntParams ]);
|
}, [ rootX, rootY, areaWidth, areaHeight, filterExisting, invert, excludeBots, excludePets, setIntParams ]);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
@@ -74,6 +76,8 @@ export const WiredSelectorUsersAreaView: FC<{}> = props =>
|
|||||||
|
|
||||||
setFilterExisting(trigger.intData.length >= 5 && trigger.intData[4] === 1);
|
setFilterExisting(trigger.intData.length >= 5 && trigger.intData[4] === 1);
|
||||||
setInvert(trigger.intData.length >= 6 && trigger.intData[5] === 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 ]);
|
}, [ trigger ]);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
@@ -130,6 +134,24 @@ export const WiredSelectorUsersAreaView: FC<{}> = props =>
|
|||||||
onChange={ e => setInvert(e.target.checked) } />
|
onChange={ e => setInvert(e.target.checked) } />
|
||||||
<Text small>{ LocalizeText('wiredfurni.params.selector_option.1') }</Text>
|
<Text small>{ LocalizeText('wiredfurni.params.selector_option.1') }</Text>
|
||||||
</label>
|
</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>
|
</div>
|
||||||
</WiredActionBaseView>
|
</WiredActionBaseView>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user