PDA

View Full Version : How to include an icon in an extension?



JMOxx75
October 24th, 2011, 02:35
I am modifying an extension for the Base Ruleset. I have a custom .png file to replace the "spells" label on the tab on the character sheet. If I name this icon tab_spells.png and place it in the ruleset icon folder it works. When I place it in the extension icon folder it doesn't.

In the extension.xml do you have to include it or define it somehow and if so, how? I tried the include statement and that didn't work.

VenomousFiligree
October 24th, 2011, 18:16
This thread (https://www.fantasygrounds.com/forums/showthread.php?t=15409) tells you how to replace a png, hopefully it should point you in the right direction.

Zeus
October 24th, 2011, 18:50
I am making an extension for the Base Ruleset. I have a custom .png file to replace the "spells" label on the tab on the character sheet. If I name this icon tab_spells.png and place it in the ruleset icon folder it works. When I place it in the extension icon folder it doesn't.

In the extension.xml do you have to include it or define it somehow and if so, how? I tried the include statement and that didn't work.

MurghBpurn - is spot on. Check out the thread for a step-by guide on creating your extension or modifying one of mine to customise your graphics.

Essentially though, in your extension, you need to override the icon definition that the ruleset you are using is using.

e.g. In the 4E ruleset, the Skills tab text on the charsheet is an icon called "tab_skills" called in the ruleset file charsheet_toplevel.xml.


<tabcontrol name="tabs">
<bounds>-22,50,18,492</bounds>
<tab>
<icon>tab_main</icon>
<subwindow>main</subwindow>
</tab>
<tab>
<icon>tab_combat</icon>
<subwindow>combat</subwindow>
</tab>
<tab>
<icon>tab_skills</icon>
<subwindow>skills</subwindow>
</tab>
<tab>
<icon>tab_abilities</icon>
<subwindow>abilities</subwindow>
</tab>
<tab>
<icon>tab_inventory</icon>
<subwindow>inventory</subwindow>
</tab>
<tab>
<icon>tab_powers</icon>
<subwindow>powers</subwindow>
</tab>
<tab>
<icon>tab_notes</icon>
<subwindow>notes</subwindow>
</tab>
<activate>1</activate>
</tabcontrol>

The icon "tab_skills" is defined in the ruleset file graphics.xml:


<icon name="tab_skills" file="graphics/tabs/tab_skills.png" />

So using the named icon definition above, you need to add an overridden definition to your extension:

e.g.

<icon name="tab_skills" file="graphics/tabs/[your custom .png image filename]" />

Then create the following folder structure inside your extension:

graphics/tabs

and place your [your custom .png image] within.

JMOxx75
October 24th, 2011, 23:52
Thanks for the info. I was including the icon in the extension.xml instead of making my own graphics.xml and including it in the extension.xml. Its working now.