Jump to content

Recommended Posts

Posted

Before I start rolling my own code, I thought I'd ask to make sure I'm not re-inventing the wheel. Is there an easy way (aka, a pre-existing function/class/method) for checking if an icon or texture file exists before registering it?

 

The use case I'm looking at is where my mod has a custom tool (call it cTool), and during postInit, the mod checks to see if any other mods have added custom tool materials. If so, my mod then auto-generates more cTools made with the added custom materials. These auto-generated cTools need icons; if I've heard of the mod, I may have already created an icon for custom-material cTool; if so, all well and good. However, if I haven't, I'd like the option to fall back to some generic-looking icon rather than tossing up a "Missing Texture" icon.

Posted

If you can already check for materials, and if you know what textures you already made, why do you need another check ?

Just give your generic icon to any tool left.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.