add Neopets ID to layer support modal

This commit is contained in:
Emi Matchu 2020-08-14 22:09:52 -07:00
parent 380cbf543b
commit aa6ce12bbe
5 changed files with 18 additions and 0 deletions

View file

@ -132,6 +132,8 @@ function ItemLayerSupportModal({
<Metadata> <Metadata>
<MetadataLabel>DTI ID:</MetadataLabel> <MetadataLabel>DTI ID:</MetadataLabel>
<MetadataValue>{itemLayer.id}</MetadataValue> <MetadataValue>{itemLayer.id}</MetadataValue>
<MetadataLabel>Neopets ID:</MetadataLabel>
<MetadataValue>{itemLayer.remoteId}</MetadataValue>
<MetadataLabel>Zone:</MetadataLabel> <MetadataLabel>Zone:</MetadataLabel>
<MetadataValue> <MetadataValue>
{itemLayer.zone.label} ({itemLayer.zone.id}) {itemLayer.zone.label} ({itemLayer.zone.id})

View file

@ -118,6 +118,7 @@ export const itemAppearanceFragment = gql`
fragment ItemAppearanceForOutfitPreview on ItemAppearance { fragment ItemAppearanceForOutfitPreview on ItemAppearance {
layers { layers {
id id
remoteId # HACK: This is for Support tools, but other views don't need it
svgUrl svgUrl
imageUrl(size: SIZE_600) imageUrl(size: SIZE_600)
swfUrl # HACK: This is for Support tools, but other views don't need it swfUrl # HACK: This is for Support tools, but other views don't need it

View file

@ -101,7 +101,14 @@ const typeDefs = gql`
# Cache for 1 week (unlikely to change) # Cache for 1 week (unlikely to change)
type AppearanceLayer @cacheControl(maxAge: 604800) { type AppearanceLayer @cacheControl(maxAge: 604800) {
# The DTI ID. Guaranteed unique across all layers of all types.
id: ID! id: ID!
# The Neopets ID. Guaranteed unique across layers of the _same_ type, but
# not of different types. That is, it's allowed and common for an item
# layer and a pet layer to have the same remoteId.
remoteId: ID!
zone: Zone! zone: Zone!
imageUrl(size: LayerImageSize): String imageUrl(size: LayerImageSize): String
@ -326,6 +333,10 @@ const resolvers = {
}, },
}, },
AppearanceLayer: { AppearanceLayer: {
bodyId: async ({ id }, _, { swfAssetLoader }) => {
const layer = await swfAssetLoader.load(id);
return layer.remoteId;
},
bodyId: async ({ id }, _, { swfAssetLoader }) => { bodyId: async ({ id }, _, { swfAssetLoader }) => {
const layer = await swfAssetLoader.load(id); const layer = await swfAssetLoader.load(id);
return layer.bodyId; return layer.bodyId;

View file

@ -71,6 +71,7 @@ describe("Item", () => {
appearanceOn(speciesId: "54", colorId: "75") { appearanceOn(speciesId: "54", colorId: "75") {
layers { layers {
id id
remoteId
imageUrl(size: SIZE_600) imageUrl(size: SIZE_600)
svgUrl svgUrl
zone { zone {

View file

@ -9,6 +9,7 @@ Object {
Object { Object {
"id": "37128", "id": "37128",
"imageUrl": "https://impress-asset-images.s3.amazonaws.com/object/000/000/014/14856/600x600.png?v2-1587653266000", "imageUrl": "https://impress-asset-images.s3.amazonaws.com/object/000/000/014/14856/600x600.png?v2-1587653266000",
"remoteId": "14856",
"svgUrl": null, "svgUrl": null,
"zone": Object { "zone": Object {
"depth": 30, "depth": 30,
@ -35,6 +36,7 @@ Object {
Object { Object {
"id": "37129", "id": "37129",
"imageUrl": "https://impress-asset-images.s3.amazonaws.com/object/000/000/014/14857/600x600.png?v2-0", "imageUrl": "https://impress-asset-images.s3.amazonaws.com/object/000/000/014/14857/600x600.png?v2-0",
"remoteId": "14857",
"svgUrl": null, "svgUrl": null,
"zone": Object { "zone": Object {
"depth": 44, "depth": 44,
@ -61,6 +63,7 @@ Object {
Object { Object {
"id": "30203", "id": "30203",
"imageUrl": "https://impress-asset-images.s3.amazonaws.com/object/000/000/006/6829/600x600.png?v2-0", "imageUrl": "https://impress-asset-images.s3.amazonaws.com/object/000/000/006/6829/600x600.png?v2-0",
"remoteId": "6829",
"svgUrl": null, "svgUrl": null,
"zone": Object { "zone": Object {
"depth": 3, "depth": 3,