From d2eb941c24490a5b06ff18a729150d557d1430c4 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 14 Mar 2021 07:50:21 -0700 Subject: [PATCH] [WIP] Add bulk-add form to "Layers on all pets" It doesn't work yet though! Just form UI! --- .../support/AllItemLayersSupportModal.js | 100 +++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/src/app/WardrobePage/support/AllItemLayersSupportModal.js b/src/app/WardrobePage/support/AllItemLayersSupportModal.js index 891d5aa..c073ac3 100644 --- a/src/app/WardrobePage/support/AllItemLayersSupportModal.js +++ b/src/app/WardrobePage/support/AllItemLayersSupportModal.js @@ -1,14 +1,18 @@ import React from "react"; import { Box, + Button, Flex, Heading, + Input, Modal, ModalBody, ModalCloseButton, ModalContent, ModalHeader, ModalOverlay, + Select, + Tooltip, Wrap, WrapItem, } from "@chakra-ui/react"; @@ -20,6 +24,8 @@ import { import HangerSpinner from "../../components/HangerSpinner"; import { ErrorMessage, useCommonStyles } from "../../util"; import ItemSupportAppearanceLayer from "./ItemSupportAppearanceLayer"; +import { EditIcon } from "@chakra-ui/icons"; +import cachedZones from "../../cached-data/zones.json"; function AllItemLayersSupportModal({ item, isOpen, onClose }) { const { bodyBackground } = useCommonStyles(); @@ -28,7 +34,7 @@ function AllItemLayersSupportModal({ item, isOpen, onClose }) { - + Layers on all pets: {" "} @@ -38,6 +44,8 @@ function AllItemLayersSupportModal({ item, isOpen, onClose }) { + + @@ -46,6 +54,96 @@ function AllItemLayersSupportModal({ item, isOpen, onClose }) { ); } +function BulkAddBodySpecificAssetsForm() { + const zones = [...cachedZones].sort((a, b) => + `${a.label} (${a.id})`.localeCompare(`${b.label} (${b.id})`) + ); + + const [minAssetId, setMinAssetId] = React.useState(null); + const [selectedZoneId, setSelectedZoneId] = React.useState(zones[0].id); + + return ( + { + e.preventDefault(); + alert("TODO!"); + }} + > + + + When an item accidentally gets assigned to fit all bodies, this + tool can help you recover the original appearances, by assuming + the layer IDs are assigned to each species in alphabetical order. + + + This will only find layers that have already been modeled! + + + } + > + + + Bulk-add body-specific assets: + + + + setMinAssetId(e.target.value || null)} + /> + + + + + setMinAssetId(e.target.value ? Number(e.target.value) - 53 : null) + } + /> + + , assigned to + + + + + + ); +} + function AllItemLayersSupportModalContent({ item }) { const { loading, error, data } = useQuery( gql`