Jump to content

TechTree nodes icons


Recommended Posts

Hello,

I'm looking for what, in the game, links together the "icon" value of a RDNode to the real icon.

TechTree{
RDNode
{
id = start
title = Start
description = The technology we started out with.
cost = 0
hideEmpty = False
nodeName = node0_start
anyToUnlock = False
icon = RDicon_start <=== How does it match "R&D_node_icon_start.png" ???
pos = -2568,1199,-1
scale = 0.6
}

I've found that this value is not a filename, because even if it is close for some of them, you cannot achieve the match from the value to the images stored into GameData/Squad/PartList/SimpleIcons through a simple transformation.

A simple example that made me first think the icon is the filename is the "Science Tech" node that uses the last icon file (by alphabetic order) RDicon_telescope.png

It matches the "icon" value as "RDicon_telescope". I expected then it was the filename without its expansion.

Then I realized that some "R&D_node_icon_*" files requires that "R&D_node_icon_*" part to be replaced to "RDicon_*".

Finally I came to the "Basic Rocketry" tech node (the first in the config not to fit my rules) and the transformation is not trivial at all. You cannot, by general operation on strings, go from "RDicon_rocketry-basic" to "R&D_node_icon_basicrocketry.png".

There must then be some kind of database that makes these matches. But I can't find where. I know it's not in any .cfg file but that's all I know.

Adding a node with a matching "icon" value and filename doesn't help, it changes the display to "R&D_node_icon_generic.png"

Does someone knows how to add a new icon into the tech tree ?

Thanks

Link to comment
Share on other sites

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

Hi.

So that means we require a plugin to add an icon ? Sounds like a good exercice to make a KSP plugin.

Thanks for the answer.

Link to comment
Share on other sites

Here I am again and I can't find a good way yet to make my plugin work.

I've managed, looking at different plugins such as module manager, tree toppler and tree loader, to come to this instance of my module : http://paste.ubuntu.com/11922597/

It is installed with ModuleManager and the following patch : http://paste.ubuntu.com/11922606/

The file GameData/Squad/PartList/SimpleIcons/R&D_node_icon_end.png is a copy of GameData/Squad/PartList/SimpleIcons/R&D_node_icon_start.png

This plugin changes the icon displayed at the top right part of the screen when I select the new R&D node (and here I found out it's ugly, it needs double the resolution) but fails at changing the display on the R&D tree.

Here are some logs produced by my plugin : http://paste.ubuntu.com/11922640/

The initial proposal from sarbian had either no effect or something needs an update and I have no clue about what to update.

I'll accept any piece of help :)

Thanks.

Edited by Grimly
Added plugin logs
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...