Thread: Another Character Sheet Tab
-
July 8th, 2015, 05:04 #11
I have abused the sanity of many helpful people thru my lack of coding knowledge, patience and ability... to you all - you have my eternal gratitude for what that is worth.
For adding another Tab on the Char Sheet I think its all XML from memory... no need for LUA to add that extra sheet.
-
August 5th, 2015, 16:09 #12
- Join Date
- Oct 2014
- Posts
- 71
Hi, I've been learning a bit about coding and I believe I made some progress. I got the new tab, but FG tells me it couldn't find the window class I created, which is charsheet_espec. I edited the record_char to create the new tab and I specified the subwindow thing there too. Also created another xml file which contains the information for this new tab. But still FG tells me:
Ruleset Error: subwindow: Could not find windowclass (charsheet_espec) for control (specializations) in windowclass (charsheet)
Ruleset Warning: bitmapwidget: Logical icon (tab_espec) does not exist
And also this bitmapwidget error, I created the icon for the new tab and named it tab_espec inside the tabs folder. So anyways I'm stuck and hopefully you can help me here. I'll post two screenshots too
Thanks (:
Attachment 10675
Attachment 10676
-
August 5th, 2015, 16:33 #13
The windowclass below yours (char_spec_category_header) in that pic has a <frame> property while yours is missing that line (2nd line of the block). Is that required?
-
August 5th, 2015, 16:42 #14
Sounds like you haven't put this new file in an <includefile> statement in your extension/ruleset. Have a look at an ruleset base.xml file or an extension extension.xml file for some examples.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
August 5th, 2015, 18:27 #15
- Join Date
- Oct 2014
- Posts
- 71
Yes, I figured that out. Thanks Trenloe! You were totaly correct. It seems we are very close to complete this. I got another error. I copied the code from record_char_main, so in that tab I'll have the same utilities, but that generated another problem. It is duplicating the code, and I believe that's because of list_charmainattribute (correct me if i'm mistaken). So I went to template_char and added a list_charmainattribute2 like this:
<template name="list_charmaincategory2">
<windowlist>
<class>char_main_category2</class>
<datasource>.maincategorylist2</datasource>
<columns width="222" filldown="true"/>
<allowcreate />
<allowdelete />
<sortby><field>label</field></sortby>
<script>
function onListChanged()
update();
end
function update()
local sEdit = getName() .. "_iedit";
if window[sEdit] then
local bEdit = (window[sEdit].getValue() == 1);
for _,wCategory in ipairs(getWindows()) do
wCategory.idelete.setVisibility(bEdit);
wCategory.attributes_iadd.setVisible(bEdit);
wCategory.attributes.update(bEdit);
end
end
end
function addEntry(bFocus)
local w = createWindow();
if bFocus then
w.header.subwindow.label.setFocus();
end
return w;
end
</script>
</windowlist>
</template>
but it isn't enough. I gotta create char_main_category2 and .maincategorylist2 but I don't know where :T
-
August 6th, 2015, 18:30 #16
- Join Date
- Oct 2014
- Posts
- 71
I did it! Thanks for all the help!
Now it doesn't seem that hard xD. Anyways, the last step was to edit record_char_main and add a windowclass named char_main_category2, so I went back to template_char and used that windowclass.
Anyways I don't know, maybe someone tries to do the same thing so I'll paste the steps I did it:
First I edited record_char.xml > I created a subwindow and a tab
Then I created a .xml file with the codes I needed, in this case the same as the main tab (record_char_main.xml)
Then I included that xml, editting the 'base.xml' (ex: <includefile source="campaign/record_char_spec.xml" />)
In this step I got a problem because since the code was duplicated the new tab had the same information as the tab I copied from (which was the main tab)
Then I edited the record_char_main and added the new windowclasses I needed, same thing with record_char and that is (:
Thanks again for the patience, for the attention and everything. )))
-
August 6th, 2015, 19:05 #17
Glad you got it working.
Are you modifying the ruleset directly or using an extension?
If you're modifying the ruleset, make sure you rename the ruleset or make a copy so that future FG updated don't overwrite your work.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
August 6th, 2015, 19:07 #18
- Join Date
- Oct 2014
- Posts
- 71
I'm modifying the ruleset directly. I made a backup. Is if possible to achieve the same results using extensions?
-
August 6th, 2015, 19:17 #19
Absolutely, an extension would be the best way to do it. Check out the More Core Extension and https://www.fantasygrounds.com/forum...ight=extension
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks