TarynWinterblade
April 27th, 2007, 07:38
I've been updating a few of the rulesets my group uses (read: completely redesigning from the ground up, since that seems easiest). Let me start off by saying that the ability to use LUA is wonderful and that the new features are a godsend.
Sorta...
Except not having documentation... ;)
So, a few questions:
tabcontrol:
- Is this the only way to do subwindows now?
- Is there a way to switch it to a horizontal layout?
- How do you specify the spacing?
- Is there a way to get rid of the endcaps (other than making them completely blank pngs)
Accessing a subwindow's component:
One of my scripts pops up a window with some choices. Upon choosing something there, it closes the window, and changes the value in the database. I can't, however, figure out how to change the value on the main character sheet.
I have the following code in a script, but it fails because the portrait field is undefined:
local cs = Interface.findWindow("charsheet",getDatabaseNode())
if cs then
cs.main.portrait.setIcon("cs_p"..image)
end
... it starts off by finding the reference to the character sheet and storing it in the variable cs. If that's not nil (meaning it found it), then it tries to set the icon of the genericcontrol named portrait (defined in the subwindow 'main') to the appropriate image file. This fails, spitting out the error that the field 'portrait' is a nil value.
I've also tried just saying "cs.portait.setIcon(blahblah)", but that also fails, for the same reason.
Lastly, I've tried changing the line where it finds the windowinstance to read "local cs = Interface.findWindow("charsheet_main",getDatabaseNode())", but that fails to even find the window (I'm assuming because findWindow can only find a reference to a top level window, and charsheet_main - being a subwindow of charsheet - isn't.
Dynamic image references? File lists?
Is there any way to create a frame or icon during program execution rather than hardcoding it in a file?
Something like: "local img = new icon('path/to/img.png')"?
Also, tied in with this: is there any way to retrieve the contents of a folder, and is there any way to turn the results of that into icons / frame refs?
What I'm trying to accomplish with this: To provide a way to attach a portrait to my character sheet, as evidenced above. Right now, I have to hard code in all of the portraits beforehand. What I'd prefer is a way to just drop them into a folder and have them be able to be selected as options.
I know that we already have the small portraits, but what I'd like is to also have the ability to display a full-body image on the sheet (or something similar).
(I think that's all... phew...)
Edit, already: Is there an easy way to write to the console (for debugging purposes...)... right now, I've been writing it to the chat window... which gets annoying.
Thanks in advance,
-Taryn
Sorta...
Except not having documentation... ;)
So, a few questions:
tabcontrol:
- Is this the only way to do subwindows now?
- Is there a way to switch it to a horizontal layout?
- How do you specify the spacing?
- Is there a way to get rid of the endcaps (other than making them completely blank pngs)
Accessing a subwindow's component:
One of my scripts pops up a window with some choices. Upon choosing something there, it closes the window, and changes the value in the database. I can't, however, figure out how to change the value on the main character sheet.
I have the following code in a script, but it fails because the portrait field is undefined:
local cs = Interface.findWindow("charsheet",getDatabaseNode())
if cs then
cs.main.portrait.setIcon("cs_p"..image)
end
... it starts off by finding the reference to the character sheet and storing it in the variable cs. If that's not nil (meaning it found it), then it tries to set the icon of the genericcontrol named portrait (defined in the subwindow 'main') to the appropriate image file. This fails, spitting out the error that the field 'portrait' is a nil value.
I've also tried just saying "cs.portait.setIcon(blahblah)", but that also fails, for the same reason.
Lastly, I've tried changing the line where it finds the windowinstance to read "local cs = Interface.findWindow("charsheet_main",getDatabaseNode())", but that fails to even find the window (I'm assuming because findWindow can only find a reference to a top level window, and charsheet_main - being a subwindow of charsheet - isn't.
Dynamic image references? File lists?
Is there any way to create a frame or icon during program execution rather than hardcoding it in a file?
Something like: "local img = new icon('path/to/img.png')"?
Also, tied in with this: is there any way to retrieve the contents of a folder, and is there any way to turn the results of that into icons / frame refs?
What I'm trying to accomplish with this: To provide a way to attach a portrait to my character sheet, as evidenced above. Right now, I have to hard code in all of the portraits beforehand. What I'd prefer is a way to just drop them into a folder and have them be able to be selected as options.
I know that we already have the small portraits, but what I'd like is to also have the ability to display a full-body image on the sheet (or something similar).
(I think that's all... phew...)
Edit, already: Is there an easy way to write to the console (for debugging purposes...)... right now, I've been writing it to the chat window... which gets annoying.
Thanks in advance,
-Taryn