PDA

View Full Version : Adding Tab/Category Icons via Extension?



shemantis
February 8th, 2016, 15:27
I've read through both of these threads:
https://www.fantasygrounds.com/forums/showthread.php?3994-How-do-I-modify-add-the-tabs-cycle-selection&highlight=tab+icon
https://www.fantasygrounds.com/forums/showthread.php?20375-New-Tab-Icons&highlight=tab+icon

And I can get it to work if I just edit the existing ruleset, but I'd rather have these new tab colors/icons as part of an extension.
I already have the extension made up (it's just some graphical changes), but I can't seem to figure out how to add the XML for the icons. I believe it should be (shortened for readability):


<icon name="tab_base15" file="graphics/tabs/tab_base15.png" />
<icon name="tab_base16" file="graphics/tabs/tab_base16.png" />
<icon name="tab_base15s" file="graphics/tabs/tab_base15s.png" />
<icon name="tab_base16s" file="graphics/tabs/tab_base16s.png" />
<icon name="tab_icon19" file="graphics/tabs/tab_icon19.png" />
<icon name="tab_icon20" file="graphics/tabs/tab_icon20.png" />


But when I put that into the graphics_misc.xml in the extension, it doesn't add anything.
I have the images in the right folder, and named correctly, but I am sure the code I am adding isn't correct...I just don't know HOW it's incorrect, LOL.

Thank you all, as usual.

Trenloe
February 8th, 2016, 16:29
There's a number of things you'll need to do:

Make sure the extension itself uses the graphics_misc.xml file in the extension via an <includefile> entry in your extension.xml. This will register the base <icon> references, but won't do anything with them unless they're actually used within the ruleset.
gameelements.xml in the CoreRPG ruleset has a <categoryselectionsettings> settings that lists the base and icon graphics for the tabs. you'll need to copy <categoryselectionsettings> into your extension.xml file and add your new definitions from step #1 above to this section.

shemantis
February 8th, 2016, 16:49
I do have the graphics_misc.xml included via <includefile> (I should have mentioned that in my oroginal post).

I have gotten the icons to show successfully by just editing the CoreRPG ruleset, but if I change the gameelements.xml there, won't that interfere/be removed with ruleset updates?
That's why I was hoping to make these changes via an extension.

Trenloe
February 8th, 2016, 16:54
Sorry, I didn't specifically mention that you should copy the <categoryselectionsettings> into your extension.xml and make your changes there.

shemantis
February 8th, 2016, 17:25
Sorry, I didn't specifically mention that you should copy the <categoryselectionsettings> into your extension.xml and make your changes there.

Okay, I get what you're saying now. I should have understood that from what you said, but I am still pretty new!
I added this to my extension.xml (copied from the ruleset's gameelements.xml). I added it after the <properties> closing tag that includes the rulesets the extension applies to, mostly because I wasn't sure where to add it.
Shortened for readability:


<categoryselectionsettings>
<iconposition normal="6,6" selected="6,4" />
<baseicon normal="tab_base1" selected="tab_base1s" />
<baseicon normal="tab_base2" selected="tab_base2s" />
<decalicon name="tab_icon1" />
<decalicon name="tab_icon2" />
</categoryselectionsettings>


But they still don't seem to be showing up when I click through the category tab icons/backgrounds. Would it help if I attached my extension.xml and my graphics?misc. xml?

Trenloe
February 8th, 2016, 17:33
Any changes to XML/includefiles/etc. need to be initiated within a <base> section (after <properties>) within extension.xml. Info on extensions here: https://www.fantasygrounds.com/modguide/extensions.xcp

If that doesn't work, then post your extension.xml file here (use the CODE formatting available through the "Go Advanced" button below.

shemantis
February 8th, 2016, 17:40
Adding the <categoryselectionsettings> under the <base> section worked perfectly.

Thank you so much. I am constantly impressed by how helpful people are on these forums (you personally have helped me on multiple occasions).

Trenloe
February 8th, 2016, 17:43
Adding the <categoryselectionsettings> under the <base> section worked perfectly.
Cool. Glad you got it working. :)

damned
February 8th, 2016, 23:53
@Trenloe - any ideas how to remove (some of) them instead of replacing them?
https://www.fantasygrounds.com/forums/showthread.php?28247-Limiting-Group-Icons-Tabs

Trenloe
February 9th, 2016, 00:01
@Trenloe - any ideas how to remove (some of) them instead of replacing them?
https://www.fantasygrounds.com/forums/showthread.php?28247-Limiting-Group-Icons-Tabs
Nope.