PDA

View Full Version : New Tab on Character sheets



mrdoom4341
December 21st, 2021, 12:17
Hey everyone
I've been trying to teach myself how to work with fantasy grounds and Lua and XML in general by making a little extension I'd like for a new campaign I'm gonna be running soon. The thing I need it to do is add a new tab to the character sheet but after I get the tab defined and all that it places it overlapping the Main tab on the character sheet. I've tried to make sense of the Buttongroup_tabs lua but I'm lost. If anyone can help out it'd be a great help! I just need to know if I'm doing my XML wrong or if I need to really pick apart the Lua and make script. Any advice or anything will be very helpful!

mattekure
December 21st, 2021, 13:40
Here is a breakdown of how I added tabs to the party sheet. the process will be very similar, you just need to adjust the templates used from the party sheet versions to the char sheet versions. I've tried to document the various pieces




<windowclass name="partysheet_host" merge="join"> ------This is the windowclass we are adding the tab to, and merging these changes into whats already there.
<sheetdata>
<sub_ps name="weather"> -------------This is where we define the new window that the tab will switch to. the charsheet template is sub_charsheet, the class is the windowclass of the new window.
<class>ps_weather</class>
</sub_ps>
<tabs_partysheet name="tabs"> ------------Here we are modifying the tabs section. on the char sheet it would be <tabs_charsheet name="tabs"> the only purpose of this is to run the script below.
<script>
function onInit()
super.onInit()
addTab("weather", "tab_weather") ------------------This addTab() is already defined in the templates we are using, so you dont need to define it yourself. The arguments are addTab("name of the window, in this case weather defined above", "the icon used for the new tab")
end
</script>
</tabs_partysheet>
</sheetdata>
</windowclass>

Trenloe
December 21st, 2021, 15:25
Moderator - moved to the Workshop forum, this is the best place to ask about coding in FG.

LordEntrails
December 21st, 2021, 16:06
There are a couple of threads on this that I believe show how to do this. I haven't followed the actual search results, but if this doesnt get you your answers let me know (I did this myself some time ago when playing around, but don't have a working extension to share now).
EDIT: huh, that didnt work. Here are the likely results;
https://www.fantasygrounds.com/forums/showthread.php%3F49652-Adding-tab-to-5e-character-sheet
https://www.fantasygrounds.com/forums/showthread.php?6557-Add-tab-to-character-sheet
https://fantasygrounds.com/forums/showthread.php?43722-Add-tab-to-character-sheet-(PFRPG)