RPTools.net
http://forums.rptools.net/

Need more help
http://forums.rptools.net/viewtopic.php?f=15&t=15952
Page 1 of 1

Author:  Ryuu Kage Desu [ Wed Sep 01, 2010 12:29 pm ]
Post subject:  Need more help

Ok, I finally got Abeille to open up and work. I've been looking at the topics here and elsewhere. Its all "french!" I get how to place the components. I just need to know how to place a "list" to choose from and link is options to an "info window" for the option and a "stat window" to calculate the values of all the options of the lists (six planed.)

Author:  jay [ Fri Sep 03, 2010 12:36 pm ]
Post subject:  Re: Need more help

The dnd 4e game settings file contains examples of what you want to do. Were you able to get the CT swing components in Abeille. Instructions are here. The component you are interested in is the net.rptools.chartool.ui.charsheet.component.CharSheetTable component. I talk about using this component here. There are ways to attach your tables of data directly to the tables of, but I am at work right now and I can't remember how off of the top of my head. I'll take a look when I get home and write that up in the adopters thread.

Sorry it took me so long to get back to you :(

Author:  jay [ Sat Sep 04, 2010 12:06 pm ]
Post subject:  Re: Need more help

I took a look at the code and here is how I display a table in a dialog off of a button:
Code:
JavaScript::
var Java = new JavaImporter(net.rptools.chartool.ui.charsheet.component, java.util,
                            net.rptools.chartool.model.property); 
with (Java) {
  var props = new Array("name", "type", "source", "level", "action", "prerequisite", "target", "attack", "defense", "hit");
  var hints = new HashMap();
  hints.put(Utils.HIDE_RECORDS_HINT, Utils.findKeys(rpController.getData().get("powers.powers")));
  hints.put(CharSheetUtils.CONTEXT_HINT, rpController.getData());
  hints.put(CharSheetUtils.PREFERENCES_HINT, 'dnd4e_modifyPowers');
  var dialog = CharSheetUtils.addToListFromGameSettingsTable(rpEvent.getSource(), "Add Powers",
                         "Select Powers to add to this combatant.", "power", props,
                         rpController.getData(), "powers.powers", hints);
}
In the 4e character form this is attached to the Add button over the powers table. It is the value of the actionScript property in Abeille. This will display a list of powers in the database to the user. The first argument is a component for parenting the dialog. The second is the title and the third is the instruction text. The fourth is the name of the database table. The props variable contains the list of properties to display as columns and is the fifth argument. The sixth is a reference to the combatant being edited and the seventh is the name of the property getting that will get the selected powers. The last one is hints that are used to set the context for running scripts and the name of the preferences for the created dialog so it shows up at the same place and size every time.

I don't have a way to display a table on just a panel. I've always accessed tables from a dialog that was attached to a button. I'll need to add support for that. How would that need to work to suit your purposes?

Author:  Ryuu Kage Desu [ Mon Oct 04, 2010 5:03 pm ]
Post subject:  Re: Need more help

It's ok that you took so long, I'm barely able to get back my self. I'll use what you've given me and see how it works, and get back when I can.
I would say that displaying a "drop down" table to select the options is what I envision, though making it work is the most important issue. As long as I can get each option to spit out a little info in to an info field (per option) and automatically calculate in to the lower fields (totals; AC, buying and selling prices, and so on)

Page 1 of 1 All times are UTC - 6 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/