Thread: windowcontrol updates
-
December 24th, 2010, 15:57 #11
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,557
You would have to check each step in the chain to be sure. (i.e. check ModifierStack, then ModifierStack.control, then ...)
However, I believe in this case that the modifier stack is actually a control that is not tied to the database. (i.e. the stack does not need to be remembered between sessions.) Thus, the getDatabaseNode() call would return a nil value.
I had assumed that you were modifying that character sheet or combat tracker, in which all numerical and non-label string fields are tied to the database.
Perhaps you can give me an overview of what you are trying to accomplish exactly, and I can give you a better answer.
Regards,
JPG
-
December 24th, 2010, 16:12 #12
*facepalms* I'll bet you are exactly right.
What I'm doing is building a means of allowing my diepool code to recognize when the modstack code has changed it's value.- Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
- PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.
-
December 25th, 2010, 00:00 #13
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,557
In that case, you will need both the modifier stack and the dice pool to be global scripts, which can be accessed from anywhere inside the LUA code.
In most rulesets, this has already been done with the modifier stack (i.e. ModifierStack). You would just need to do it for the die pool management. Then, you would need to add an onValueChanged event handler in the relevant modifier stack control, which in turn would call the correct die pool manager code function.
Cheers,
JPG
-
December 25th, 2010, 08:29 #14
Ok. I'm almost entirely there. But I've run into a snag. There are multiple controls that need to be updated. Unfortunately the registerControl() function when used on the control itself doesn't work because it only registers the last control. And setting it on the underlying window would work, but then I'd have to create a list of all of the low and high pools on the entire sheet so that it can properly loop through and updated them each time. That just doesn't seem efficient to me.
Any thoughts on a good solution?- Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
- PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.
-
December 25th, 2010, 10:57 #15
Modify the registerControl function so that it adds the control to a Lua table, and then iterate over that table whenever the value changes?
-
December 25th, 2010, 10:58 #16
-
December 25th, 2010, 15:26 #17
Ooo. Thats an excellent idea!
Merry Christmas!- Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
- PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.
-
December 25th, 2010, 17:08 #18
That idea worked perfectly. Thank you Stuart.
- Trying to find a community Ruleset, Extension or Information on how to complete a process? Try FGRepository.
- PM Myself if you have new or updated community Rulesets, Extensions or Information that you'd like added to FGRepository.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks