Skip to content

Update image preloading to handle external links#296

Open
DerHobbs wants to merge 4 commits intoVORPCORE:mainfrom
DerHobbs:main
Open

Update image preloading to handle external links#296
DerHobbs wants to merge 4 commits intoVORPCORE:mainfrom
DerHobbs:main

Conversation

@DerHobbs
Copy link
Contributor

@DerHobbs DerHobbs commented Mar 7, 2026

Type of change

[ ] Bug fix (non-breaking change which fixes an issue)

[x] New feature (non-breaking change which adds functionality)

[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

[ ] This change requires a documentation update

Motive for This Pull Request

Allow external image URLs for items.
Provide a brief explanation of why these changes are being proposed and what they aim to achieve.

Changed preloadImages to check if an image string starts with http:// or https://. If yes, it uses the link directly. If no, it loads from the local folder like normal.
Explain the necessity of these changes and how they will impact the framework or its users.

Players can craft their own custom food and drinks. Instead of making 100 different items in the database, I use one generic item and just put the image link in the metadata. This PR lets the UI actually show those external links. Really helpful for dynamic items, so you don't have to restart or add new images to the UI folder every time a player creates a new dish.

Test:
Spawned an item with a discord link in metadata -> image loaded fine.

Checked normal items -> loaded from the local folder as usual.

Spawned an item with a broken link -> showed the placeholder image.

[x] Tested with latest vorp scripts

[x] Tested with latest artifacts

Notes if any

Just a tiny quality of-life update.

DerHobbs added 4 commits March 7, 2026 22:30
Added functions to save and apply HUD position using localStorage. Updated image preloading and modified inventory item loading logic.
Refactor tooltip content generation and improve metadata documentation.
Removed custom comments and reorganized HUD position application.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant