Larhalt
December 28th, 2015, 14:35
Hello,
I'm trying to make an hidden field that will show when an icon is clicked.
I took an existing code from spell list that work good; when you click on the icon in the circle, the hidden fields appears
12357
And this is the code I found that (maybe) do that.
<button_toggle name="activatecombat">
<anchored>
<to>shortcut</to>
<position>left</position>
<offset>2,0</offset>
<size>
<width>20</width>
</size>
</anchored>
<icon>indicator_expanddown</icon>
<script>
function onValueChanged()
window.onCombatSectionToggle(getValue());
end
</script>
</button_toggle>
function onCombatSectionToggle(show)
speedlabel.setVisible(show);
speed.setVisible(show);
damagelabel.setVisible(show);
damageframe.setVisible(show);
damagedice.setVisible(show);
damagebonus.setVisible(show);
end
But when I try to use in the file that I need (record_char_combat) with the code
12358
<button_toggle name="weapondetails">
<anchored>
<to>damagebonus_l</to>
<position>right</position>
<offset>2,0</offset>
<size>
<width>20</width>
</size>
</anchored>
<icon>indicator_expanddown</icon>
<script>
function onValueChanged()
window.onWeaponProp(getValue());
end
</script>
</button_toggle>
function onWeaponProp(show)
prop.setVisible(show);
end
I have this error
Script Error: [string "weapondetails"]:1: attempt to call field 'onWeaponProp' (a nil value)
There's something that I miss? I already trying to check in 4E ruleset, but can't find it.
Thank you
I'm trying to make an hidden field that will show when an icon is clicked.
I took an existing code from spell list that work good; when you click on the icon in the circle, the hidden fields appears
12357
And this is the code I found that (maybe) do that.
<button_toggle name="activatecombat">
<anchored>
<to>shortcut</to>
<position>left</position>
<offset>2,0</offset>
<size>
<width>20</width>
</size>
</anchored>
<icon>indicator_expanddown</icon>
<script>
function onValueChanged()
window.onCombatSectionToggle(getValue());
end
</script>
</button_toggle>
function onCombatSectionToggle(show)
speedlabel.setVisible(show);
speed.setVisible(show);
damagelabel.setVisible(show);
damageframe.setVisible(show);
damagedice.setVisible(show);
damagebonus.setVisible(show);
end
But when I try to use in the file that I need (record_char_combat) with the code
12358
<button_toggle name="weapondetails">
<anchored>
<to>damagebonus_l</to>
<position>right</position>
<offset>2,0</offset>
<size>
<width>20</width>
</size>
</anchored>
<icon>indicator_expanddown</icon>
<script>
function onValueChanged()
window.onWeaponProp(getValue());
end
</script>
</button_toggle>
function onWeaponProp(show)
prop.setVisible(show);
end
I have this error
Script Error: [string "weapondetails"]:1: attempt to call field 'onWeaponProp' (a nil value)
There's something that I miss? I already trying to check in 4E ruleset, but can't find it.
Thank you