PDA

View Full Version : Custom Character Sheet - Draggable Links



damned
August 18th, 2014, 16:46
Im building a basic ruleset that is mostly concentrating on the character sheet.
I have several fields where I would like to be able to drag links into the field so that it shows the Name of the link and has the clickable Link icon so that you can view more info on that item.
In this case they are background characteristics and being able to view more info on them in game would be useful.
Can anyone point me towards an existing example I can learn from?

damned
August 18th, 2014, 16:51
I really only need 2 pieces of data in my target field - the Name and the Link.

Trenloe
August 18th, 2014, 17:48
Are these draggable links to a formattedtextcontrol or a windowlist control?

If it's a windowlist (I'm guessing it is) then have a look at the template "list_campaign" in the CoreRPG ruleset. This is the windowlist template used for the campaign lists (story, images and maps, etc.) so has a name and a link - which sounds like what you're looking for. Do a find-in-files for list_campaign to see where this is being used. For example, for the story list:


<list_campaign name="list">
<datasource>.</datasource>
<class>encountersmall</class>
<script>
function onDrop(x, y, draginfo)
if draginfo.isType("shortcut") then
return CampaignDataManager.handleDrop("encounter", draginfo);
end
end
</script>
</list_campaign>

Moon Wizard
August 18th, 2014, 18:27
We do something like this with the race and class fields in the 5E ruleset.

JPG

Zeus
August 18th, 2014, 19:20
Yes, as JPG has pointed out - check out the 5E ruleset charsheet, it provides fields for Race, Class, Background (including characteristics) that support drag/dropping of reference class, background and race module content. When dropped, the fields are populated with the name of the record and a window reference link. Clicking the window reference links open smaller sheets with detailed content. In the case of Backgrounds the characteristics are populated from rollable tables.

I suggest taking a look at the campaign/campaign_char*.xml and reference/ref_*.xml files in 5E.

damned
August 20th, 2014, 00:24
Just to clarify this is what Im trying to do...

https://www.fg-con.com/wp-content/uploads/2014/08/characteristics.jpg

@Zeus, @Moon Wizard - I went thru the 5E code but It didnt appear to take drag data in the fields that suggested it would eg Race? Am I looking at the wrong fields or will I need to run Par5e to be able to have the right drag data to drag to Race?

@Trenloe I will look at your suggested code next...

Zeus
August 20th, 2014, 10:15
@damned - 5E definitely supports drag/drop of Race, Backgrounds, Class, Weapons and Spells. Have a look at campaign/char_main.xml, in the window class script block you will find the onDrop handler that calls the LUA script campaign/scripts/manager_char.lua and the function addInfoDB() whenever a shortcut/window-referencelink (of type reference_background, reference_race and reference_class) is dropped on the main sheet. addInfoDB() calls a number of helper routines (again defined in manager_char.lua) to copy reference data to the char sheet.

And yes, the content must be prepared by PAR5E as there is no way to create reference content data through the FG UI at present.