Jump to content

Custom Tech Tree Icons?


Recommended Posts

I have a custom tech tree item added via ModuleManager patch and have a custom icon that goes in the Squad/Resources/RDSimpleIcons folder at present. Can I place that icon somewhere else and still have it loaded by the game, or am I stuck placing it in that RDSimpleIcons folder?

Link to comment
Share on other sites

I'll post this here too since I've seen this question come up a few times.

This method works for waypoint icons, I haven't tried it with tech tree icons, but it should work.

You should be able to put them somewhere else, you just have to trick KSP into thinking that it's in the correct location: https://github.com/DMagic1/Orbital-Science/blob/master/Source/DMConfigLoader.cs#L316-L327

At least that's how it works with the waypoint icons, I'm pretty sure that tech tree icons should work the same way, just change the path location to fit.

Link to comment
Share on other sites

More something along the line of :


RDController.Instance.iconLoader.iconDictionary.Add("MyIcondName",new RUI.Icons.Simple.Icon("MyIcondName", texture));

Any idea when RDController.Instance becomes valid? Thus far I haven't had any luck trying to load a custom icon using that method. I have tried loading a [KSPAddon] and checking for the instance, but each time it is null.

Link to comment
Share on other sites

Any idea when RDController.Instance becomes valid? Thus far I haven't had any luck trying to load a custom icon using that method. I have tried loading a [KSPAddon] and checking for the instance, but each time it is null.

If it helps, there's a mod named TechManager that uses RDController. You may look through its source code .

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

×
×
  • Create New...