PDA

View Full Version : Help: Saving Mutistate elements



Alanrockid
July 24th, 2016, 04:01
I'll try to be as much objective as possible to compensate for my poor english.

I'm currently modifying CoreRPG ruleset.

I am using multistate icons of dots to represent the main attributes and skills in my charsheet. Everything is working just fine, but everytime i reload the ruleset the dots are reset to empty state. I dont know how to assign a real numeric value to it or record its current values to avoid this problem. Here's a pic of the charsheet to explain better:

14805

Here is my dots template:


<template name="bolinhas">
<buttoncontrol>
<anchored position="insidetopright" width="125" height="11">
</anchored>
<state icon="atributo00" />
<state icon="atributo01" />
<state icon="atributo02" />
<state icon="atributo03" />
<state icon="atributo04" />
<state icon="atributo05" />
<state icon="atributo06" />
<state icon="atributo07" />
<state icon="atributo08" />
<state icon="atributo09" />
<state icon="atributo10" />
</buttoncontrol>
</template>

And here is the relevant part of the code where it is being used:


<bolinhas name="forca">
<anchored to="janela_atributos" offset="13,40"/>
<default>1</default>
</bolinhas>
<selo name="seloforca">
<font>ficha</font>
<anchored to="forca" offset="0,7" >
<right anchor="left" relation="relative" offset="-53,-1" />
</anchored>
<static>Força</static>
</selo>

So... can anyone help me? I thank you in advance!

Moon Wizard
July 24th, 2016, 04:40
It's because a "buttoncontrol" object is not tied to the database, so the information is not saved. It only exists while the window is open.

Try using "buttonfield" instead. It will create a number field in the database with the same name as your control's name.

Regards,
JPG

Alanrockid
July 24th, 2016, 04:47
I honestly did not think that the solution was that simple . Worked perfectly. Thank you very much! :D