General: Stat control is a Spinner control with the
ability to add not only a SEND button, but a TEST
button. The TEST button works with a ROLL, which is
stored in the node, but only modifiable in the Design
panel. When the TEST button is clicked, the value in
the Spinner is substituted into the saved ROLL (a #
sign in the die roll is the substitution symbolic) and
the resulting Dice roll is sent to Chat -- the word Test
is inserted after the node's NAME in the output
string. Control is designed to take up as little screen
real estate as possible.
Example of roll substitution:
Stat Control instance named DX has a ROLL of "[#-
1d20+?]" DX value (in the Spinner) is 14.
"[14-1d20+?]" is what is sent to chat.
Final output looks like
(437) Player: DX Test:[14-1d20+?]->[14,-17,0]=-3
Files/Description:
forms.py - The bulk of the coding is there. Basically
three new classes have been added: Statctrl_handler,
Stat_panel, Statctrl_edit_panel. Two more imports
added:
import orpg.dirpath
from orpg.orpg_windows import *
core.py - Just added the method send_test_to_chat.
features.xml - added a statctrl node loader
statctrl.xml - base xml for the node
stat.gif - gif for node in gametree
send.gif - gif for send button on node's panel
test.gif - gif for test button on node's panel
icons.xml - added xml for new three new gif's above
Logged In: YES
user_id=670456
Can you attach files containing your code changes and misc.
files please.
Logged In: YES
user_id=735647
Not as useful as what's I'm up to now: a Stat-Listbox, but
still useful.
Those files created/changed for statctrl
Logged In: YES
user_id=670456
I plugged this in and tested it. I only have a couple of
comments on it.
The first one being with your changes to core.py, they are
unneeded. You should put the def
on_send_test_to_chat(self,evt) function into your
statctrl_handler class instead.. altering base classes
should be avoided whenever possible as a general rule.
The second comment would be to break the code out into its
own .py file instead of lumping it in with forms.py
The spinner feature is nice and seems to work well. nice job