#CW-Crafting Image

1 messages · Page 1 of 1 (latest)

tardy hornet
#

I've tried to set uselocalimage to false and true, still can't see to get the images to work.

I have core_inventory, and the url is

core_inventory/html/img/

where do I change this?

river smelt
#

You'll also need to learn how to work with node projects and doing builds. good luck 👋

tardy hornet
#

Its weird, but before the update, it was working fine. I didnt have to change anything.... what is different with the new update?

#
  if (store.settings.useLocalImages) {
    return `nui://cw-crafting/images/${key}.png`;
  } else {
    if (store.settings.oxInventory) {
      return `nui://ox_inventory/web/images/${key}.png`;
    } else {
      return `nui://qb-inventory/html/images/${key}`;
    }
  }
};```

I changed this to the url, doesn't work lol. 

tried nui://core_inventory/html/img/${key}.png 

and also nui://core_inventory/html/img/${key}
#

export const getImageLink = (
  material: string | undefined,
  toMaterialsNameMap: Record<string, string>,
  metadata: any
) => {
  const store = useGlobalStore();
  let key = undefined;
  if (metadata?.image) {
    key = metadata.image
  } else {
    if (!material) {
      key = Object.keys(toMaterialsNameMap)[0];
    } else {
      key = material;
    }
  }

  if (store.settings.useLocalImages) {
    return `nui://cw-crafting/images/${key}.png`;
  } else {
    if (store.settings.oxInventory) {
      return `nui://ox_inventory/web/images/${key}.png`;
    } else {
      return `nui://core_inventory/html/img/${key}`;
    }
  }
};
#

The version that was working is version '2.0'

river smelt
#

Nothing has changed in this file for 9 months

#

Did you change, and also make a new build? of the html code?

tardy hornet
#

The code is the same. If you want I can send you what I had before lol. Not sure if something changed but it doesn’t matter what I do to the “getImageLink.ts” file. It doesn’t change anything. I’ve even tried to replace my url in each of the existing urls.

river smelt
#

Yes because to update the frontend you need to make a new build with Node.

#

As noted in the readme: No support at all for that type of development tho. One hell of a mess to give support for