Oberoten
January 16th, 2008, 13:25
I have a few small problems with a Windowlist I am using in my character-sheet.
First one would be that there is no description to the values if I drag them from the list... (And while I have the feeling that this is probably pretty EASY to fix... I haven't been able to figure it out. )
The second is more of a oddity, but I think it'd be easy to do a work-around.
If I create several empty lines, the numbers associated with them are not associated. And when I change one, others change as well. I imagine this has to do partially with the sorting algorithm and partially with the index for a blank line.
Either way... Is there any way to surpress the adding of new blank lines when you allready have one?
And finally... How to add all the XP costs together for it all to work properly?
<windowclass name="charsheet_skilllistitem">
<sizelimits>
<minimum>
<height>18</height>
</minimum>
</sizelimits>
<script file="scripts/charsheet_skilllistitem.lua" />
<sheetdata>
<stringfield name="label">
<anchored>
<left>
<anchor>left</anchor>
<offset>15</offset>
</left>
<top>
<anchor>top</anchor>
<offset>5</offset>
</top>
<size>
<width>180</width>
</size>
</anchored>
<font>sheetlabelsmall</font>
<frame>
<name>textline</name>
<offset>0,5,0,0</offset>
</frame>
<script>
function onEnter()
window.windowlist.addNewInstance(window.label.getV alue());
end
function onDeleteUp()
if getValue() == "" and window.ranks.getValue() == 0 then
local target = window.windowlist.getPrevWindow(window);
if target and target.label.getValue() == window.label.getValue() then
target.sublabel.setFocus();
end
window.getDatabaseNode().delete();
end
end
</script>
</stringfield>
<numberfield name="skill.level">
<anchored>
<left>
<anchor>left</anchor>
<offset>200</offset>
</left>
<top>
<anchor>top</anchor>
<offset>2</offset>
</top>
<size>
<width>25</width>
</size>
</anchored>
<script>
function onValueChanged()
local test;
local cost;
cost = window.getDatabaseNode().getChild("skill.cost").getValue()
test = window.getDatabaseNode().getChild("skill.level").getValue()
window.getDatabaseNode().getChild("skill.xp").setValue( cost*((test^2)/2 +(test/2)) );
end
function onEnter()
window.windowlist.addNewInstance(window.label.getV alue());
end
</script>
<stateframe>
<hover>
<name>sheetfocus</name>
<offset>6,7,7,5</offset>
</hover>
<drophilight>
<name>rowshade</name>
<offset>1,1,1,1</offset>
</drophilight>
</stateframe>
</numberfield>
<numberfield name="skill.cost">
<anchored>
<left>
<anchor>left</anchor>
<offset>230</offset>
</left>
<top>
<anchor>top</anchor>
<offset>2</offset>
</top>
<size>
<width>25</width>
</size>
</anchored>
<script>
function onValueChanged()
local test;
local cost;
cost = window.getDatabaseNode().getChild("skill.cost").getValue()
test = window.getDatabaseNode().getChild("skill.level").getValue()
window.getDatabaseNode().getChild("skill.xp").setValue( cost*((test^2)/2 +(test/2)) );
end
function onEnter()
window.windowlist.addNewInstance(window.label.getV alue());
end
</script>
<stateframe>
<hover>
<name>sheetfocus</name>
<offset>6,7,7,5</offset>
</hover>
<drophilight>
<name>rowshade</name>
<offset>1,1,1,1</offset>
</drophilight>
</stateframe>
</numberfield>
<numberfield name="skill.xp">
<anchored>
<left>
<anchor>left</anchor>
<offset>260</offset>
</left>
<top>
<anchor>top</anchor>
<offset>2</offset>
</top>
<size>
<width>25</width>
</size>
</anchored>
<stateframe>
<hover>
<name>sheetfocus</name>
<offset>6,7,7,5</offset>
</hover>
<drophilight>
<name>rowshade</name>
<offset>1,1,1,1</offset>
</drophilight>
</stateframe>
</numberfield>
</sheetdata>
</windowclass>
And then later on the Sheet i call it up with
<windowlist name="skilllist">
<bounds rect="25,200,700,250" />
<datasource>.skilllist</datasource>
<class>charsheet_skilllistitem</class>
<allowcreate />
<columns>
<filldown />
<width>350</width>
</columns>
<script file="scripts/charsheet_skilllist.lua" />
</windowlist>
First one would be that there is no description to the values if I drag them from the list... (And while I have the feeling that this is probably pretty EASY to fix... I haven't been able to figure it out. )
The second is more of a oddity, but I think it'd be easy to do a work-around.
If I create several empty lines, the numbers associated with them are not associated. And when I change one, others change as well. I imagine this has to do partially with the sorting algorithm and partially with the index for a blank line.
Either way... Is there any way to surpress the adding of new blank lines when you allready have one?
And finally... How to add all the XP costs together for it all to work properly?
<windowclass name="charsheet_skilllistitem">
<sizelimits>
<minimum>
<height>18</height>
</minimum>
</sizelimits>
<script file="scripts/charsheet_skilllistitem.lua" />
<sheetdata>
<stringfield name="label">
<anchored>
<left>
<anchor>left</anchor>
<offset>15</offset>
</left>
<top>
<anchor>top</anchor>
<offset>5</offset>
</top>
<size>
<width>180</width>
</size>
</anchored>
<font>sheetlabelsmall</font>
<frame>
<name>textline</name>
<offset>0,5,0,0</offset>
</frame>
<script>
function onEnter()
window.windowlist.addNewInstance(window.label.getV alue());
end
function onDeleteUp()
if getValue() == "" and window.ranks.getValue() == 0 then
local target = window.windowlist.getPrevWindow(window);
if target and target.label.getValue() == window.label.getValue() then
target.sublabel.setFocus();
end
window.getDatabaseNode().delete();
end
end
</script>
</stringfield>
<numberfield name="skill.level">
<anchored>
<left>
<anchor>left</anchor>
<offset>200</offset>
</left>
<top>
<anchor>top</anchor>
<offset>2</offset>
</top>
<size>
<width>25</width>
</size>
</anchored>
<script>
function onValueChanged()
local test;
local cost;
cost = window.getDatabaseNode().getChild("skill.cost").getValue()
test = window.getDatabaseNode().getChild("skill.level").getValue()
window.getDatabaseNode().getChild("skill.xp").setValue( cost*((test^2)/2 +(test/2)) );
end
function onEnter()
window.windowlist.addNewInstance(window.label.getV alue());
end
</script>
<stateframe>
<hover>
<name>sheetfocus</name>
<offset>6,7,7,5</offset>
</hover>
<drophilight>
<name>rowshade</name>
<offset>1,1,1,1</offset>
</drophilight>
</stateframe>
</numberfield>
<numberfield name="skill.cost">
<anchored>
<left>
<anchor>left</anchor>
<offset>230</offset>
</left>
<top>
<anchor>top</anchor>
<offset>2</offset>
</top>
<size>
<width>25</width>
</size>
</anchored>
<script>
function onValueChanged()
local test;
local cost;
cost = window.getDatabaseNode().getChild("skill.cost").getValue()
test = window.getDatabaseNode().getChild("skill.level").getValue()
window.getDatabaseNode().getChild("skill.xp").setValue( cost*((test^2)/2 +(test/2)) );
end
function onEnter()
window.windowlist.addNewInstance(window.label.getV alue());
end
</script>
<stateframe>
<hover>
<name>sheetfocus</name>
<offset>6,7,7,5</offset>
</hover>
<drophilight>
<name>rowshade</name>
<offset>1,1,1,1</offset>
</drophilight>
</stateframe>
</numberfield>
<numberfield name="skill.xp">
<anchored>
<left>
<anchor>left</anchor>
<offset>260</offset>
</left>
<top>
<anchor>top</anchor>
<offset>2</offset>
</top>
<size>
<width>25</width>
</size>
</anchored>
<stateframe>
<hover>
<name>sheetfocus</name>
<offset>6,7,7,5</offset>
</hover>
<drophilight>
<name>rowshade</name>
<offset>1,1,1,1</offset>
</drophilight>
</stateframe>
</numberfield>
</sheetdata>
</windowclass>
And then later on the Sheet i call it up with
<windowlist name="skilllist">
<bounds rect="25,200,700,250" />
<datasource>.skilllist</datasource>
<class>charsheet_skilllistitem</class>
<allowcreate />
<columns>
<filldown />
<width>350</width>
</columns>
<script file="scripts/charsheet_skilllist.lua" />
</windowlist>