Added hide in sidebar option for custom tokens
This commit is contained in:
parent
8864ef4494
commit
49c18e8cf7
@ -39,18 +39,32 @@ function TokenSettings({
|
|||||||
my={1}
|
my={1}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<Box my={2}>
|
<Flex my={2}>
|
||||||
<Label>
|
<Box sx={{ flexGrow: 1 }}>
|
||||||
<Checkbox
|
<Label>
|
||||||
checked={token && token.isVehicle}
|
<Checkbox
|
||||||
disabled={!token || token.type === "default"}
|
checked={token && token.isVehicle}
|
||||||
onChange={(e) =>
|
disabled={!token || token.type === "default"}
|
||||||
onSettingsChange("isVehicle", e.target.checked)
|
onChange={(e) =>
|
||||||
}
|
onSettingsChange("isVehicle", e.target.checked)
|
||||||
/>
|
}
|
||||||
Vehicle / Mount
|
/>
|
||||||
</Label>
|
Vehicle / Mount
|
||||||
</Box>
|
</Label>
|
||||||
|
</Box>
|
||||||
|
<Box sx={{ flexGrow: 1 }}>
|
||||||
|
<Label>
|
||||||
|
<Checkbox
|
||||||
|
checked={token && token.hideInSidebar}
|
||||||
|
disabled={!token || token.type === "default"}
|
||||||
|
onChange={(e) =>
|
||||||
|
onSettingsChange("hideInSidebar", e.target.checked)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
Hide in Sidebar
|
||||||
|
</Label>
|
||||||
|
</Box>
|
||||||
|
</Flex>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<IconButton
|
<IconButton
|
||||||
|
@ -49,7 +49,7 @@ function Tokens({ onMapTokenStateCreate }) {
|
|||||||
>
|
>
|
||||||
<SimpleBar style={{ height: "calc(100% - 48px)", overflowX: "hidden" }}>
|
<SimpleBar style={{ height: "calc(100% - 48px)", overflowX: "hidden" }}>
|
||||||
{ownedTokens
|
{ownedTokens
|
||||||
.filter((token) => token.owner === userId)
|
.filter((token) => !token.hideInSidebar)
|
||||||
.map((token) => (
|
.map((token) => (
|
||||||
<ListToken
|
<ListToken
|
||||||
key={token.id}
|
key={token.id}
|
||||||
|
@ -65,6 +65,7 @@ function SelectTokensModal({ isOpen, onRequestClose }) {
|
|||||||
owner: userId,
|
owner: userId,
|
||||||
defaultSize: 1,
|
defaultSize: 1,
|
||||||
isVehicle: false,
|
isVehicle: false,
|
||||||
|
hideInSidebar: false,
|
||||||
});
|
});
|
||||||
setImageLoading(false);
|
setImageLoading(false);
|
||||||
};
|
};
|
||||||
|
@ -86,6 +86,7 @@ export const tokens = Object.keys(tokenSources).map((key) => ({
|
|||||||
type: "default",
|
type: "default",
|
||||||
defaultSize: getDefaultTokenSize(key),
|
defaultSize: getDefaultTokenSize(key),
|
||||||
isVehicle: false,
|
isVehicle: false,
|
||||||
|
hideInSidebar: false,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const unknownSource = unknown;
|
export const unknownSource = unknown;
|
||||||
|
Loading…
Reference in New Issue
Block a user