Thread: Adding tab to 5e character sheet
-
June 16th, 2019, 17:50 #1
Adding tab to 5e character sheet
I want to add a new tab to the 5e character sheet, I have got the tab to display on the sheet but currently the tab name is blank. I have looked at the MoreCore extension as suggested in another thread, but that is using graphics for the tabs, from what I can tell the 5e ruleset doesn't do that, and I would like to keep the look consistent. Where do I look to find the tab names.
-
June 16th, 2019, 17:52 #2
I don't know specifically but if you search for the name of an existing one in the files you should find it.
If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php
-
June 16th, 2019, 23:20 #3
All rulesets use graphics for the tab names.
-
August 9th, 2020, 20:19 #4
- Join Date
- May 2018
- Location
- Midwest US
- Posts
- 121
I would love to do the same thing, but can't find where the xml looks for the tabs. If I were to do this in C# I would likely use reflection to just look for a type of file or property in the class. But I can't seem to find out how to create a new tab, it keeps crashing the load on me.
-
August 9th, 2020, 22:02 #5
I have never added one, but I've certainly had to write my own version of the \common\template_windows.xml templates for tabs_charsheet and tabs_recordsheet. That's the raw code that I overwrote because I needed to be notified when tabs changed and had to add that code in myself. The only reason I needed to do the xml's was because they are what point to the script file and I needed it to point to my version of it. I tell you this because all things with tabs start with these templates and the
Code:<script file="common/scripts/buttongroup_tabs.lua" />
Here is the relevant chunk of that xml that deals with tabs..
Code:<sub_charsheet name="main"> <class>charsheet_main</class> </sub_charsheet> <sub_charsheet name="skills"> <class>charsheet_skills</class> </sub_charsheet> <sub_charsheet name="abilities"> <class>charsheet_abilities</class> </sub_charsheet> <sub_charsheet name="inventory"> <class>charsheet_inventory</class> </sub_charsheet> <sub_charsheet name="notes"> <class>charsheet_notes</class> </sub_charsheet> <sub_charsheet name="logs"> <class>charsheet_logs</class> </sub_charsheet> <sub_charsheet name="actions"> <class>charsheet_actions</class> </sub_charsheet> <tabs_charsheet name="tabs"> <tab> <icon>tab_main</icon> <subwindow>main</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_notes</icon> <subwindow>notes</subwindow> </tab> <tab> <icon>tab_log</icon> <subwindow>logs</subwindow> </tab> <tab> <icon>tab_actions</icon> <subwindow>actions</subwindow> </tab> <activate>1</activate> </tabs_charsheet>
All the tab logic is buried in the tabs_charsheet template (remember I mentioned it earlier and the code tied into it).
I suspect to add a new tab you'd do something like this (not sure - don't blame if it doesn't work I've never done it - this is theory)...
In your extensions version of record_char.xml...
Code:<root> <!-- Add your stuff to the character sheet --> <windowclass name="charsheet" merge="join"> <sheetdata> <sub_charsheet name="YOUR_STUFF"> <class>charsheet_YOUR_STUFF</class> </sub_charsheet> <tabs_charsheet name="tabs" merge="join"> <tab> <icon>tab_YOUR_STUFF</icon> <subwindow>YOUR_STUFF</subwindow> </tab> </tabs_charsheet> </sheetdata> </windowclass> </root>
Now - none of this may work.
But that is my guess based on having had to rewrite parts of the core of it.
Then in your code you can mess around with the nitty gritty if you need to with stuff like this.
Code:local nActiveTab = window.parentcontrol.window.tabs.getIndex();
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
August 10th, 2020, 23:47 #6
- Join Date
- May 2018
- Location
- Midwest US
- Posts
- 121
Much appreciated. I should have dug a bit more before asking to be honest but this points me in the right direction.
When/If I get this working I will post how I did it.
-
August 11th, 2020, 18:14 #7
Edit - Sorry might be double information since I didn't refresh the page and see SilentRuin's response.
Creating a new tab onto the character sheet is done by adding a reference to the new tab in the campaign/record_char.xml file
Capture.PNG
As you can see in the image, it lists the subwindows that are going to be created and their associated windowclasses. Add your tab's own reference there and also add the graphic for the tab in the tabs_charsheet section of code. The icon is the graphic being used for the tab and subwindow points to the subwindow name.
This can work in reverse if you wish to remove a tab as well. Just delete the references in both sections and the tab will not appear on the character sheet.Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
August 11th, 2020, 18:45 #8Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
August 11th, 2020, 21:46 #9
Ah, well then what I described would be the fastest and easiest approach to adding tabs to the character sheet in my opinion.
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
August 13th, 2020, 01:30 #10
- Join Date
- May 2018
- Location
- Midwest US
- Posts
- 121
Your suggestions worked for the most part. So I have created the new tab (which is blank atm because I have not created a graphic) but it is not styling to the bottom of the tabs. It appears where the "Main" tab would be and the data is overlaying the tabs as I to through them. Right now I am just using a mock up of the Inventory tab as that will be the base.
The idea is to have a tab with the assets and property that a character has but is not currently carrying. In the current campaign the party has procured an old Manor House and they have rooms there that contain their valuables that are not convenient to carry. Some of them also have items in another player's bag of holding. The Inventory is getting cluttered and I was looking to reorganize it a bit.
I have been digging through all of the XML and see the styling for the pieces inside a given window but do not see a styling for the main framing of the character sheet.
So my extended record_char looks like this:
<windowclass name="charsheet" merge="join">
<sheetdata>
<sub_charsheet name="assets" merge="add">
<class>charsheet_assets</class>
</sub_charsheet>
<tabs_charsheet name="tabs" merge="add">
<tab>
<icon>tab_assets</icon>
<subwindow>assets</subwindow>
</tab>
</tabs_charsheet>
<close_charsheet />
<resize_charsheet />
</sheetdata>
</windowclass>
I assume that the merge="join" would only be required on the parent node but was being safe.Last edited by Slagmoth; August 13th, 2020 at 01:35.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks