 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sun Nov 26, 2006 3:45 pm
[1.16] Button Variable Value. |
Two issues.
First issue.
In Zmud if you put a variable into the Variable Value field of a toggle button the button would maintain the same value as the variable in that field. Kinda the idea right? Boolean if the variable is true the button is pressed, and if the variable is false the button is up.
This allowed you to make each state into a push button by doing the following.
If the button is up. Place this into the value.
#if (@var=0) {Do this}
If the button is down. Place this into the value.
#if (@var=1) {Do that}
Then have triggers, or now events, Thanks Zugg, that change the state of the button between the two by changing the value of @var.
(This sort of thing is the main reason the button color not refreshing bugs me so.)
The way things are now working in cMud is that yes, if the value of the variable changes the button follows that state. However if you click the button it does not toggle back to the value of @var automatically, furthermore it cannot be changed by simply setting the @var to the correct value. As it already has the correct value. To get the button back into the proper state you either have to click it. Or set the variable to the wrong state and back to the correct state.
Second issue.
Apon giving up on using my get function inside the above mentioned buttons I decided to use a database variable instead. I mentioned in another thread that you cannot use @class/var/dbvar.key anymore. Well if you want to use a database var in the value field you have to encase it in (). So.
@class/var/dbvar.key
Does not work
@dbvar.key
Does not work
(@dbvar.key)
Works but has the limitation of the first issue. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Nov 26, 2006 5:58 pm |
The proper syntax is @/class/varname. That works for me.
@varname.key works fine for me:
#var dbvar.key test
#show @dbvar.key
The two don't like to be mixed, though, which I think has been reported already - if you try to do
#show @/test/dbvar.one
When dbvar has three keys called one, two and three with the values first, second and third, you get this output:
onefirsttwosecondthreethird.one
You can actually change the key name to anything you like and it just changes what's printed after the dot, which I guess means that the //module/class/var syntax isn't checking for key names properly. |
|
|
|
 |
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Sun Nov 26, 2006 6:36 pm |
| Quote: |
@varname.key works fine for me:
|
Thanks Fang. I stand corrected. I went back and tried again and that part did work for me. I was having another issue when I tried that.
And thanks again for the @/class/varname syntax.
That part never did make sense to me I get it now. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Nov 27, 2006 7:59 pm |
The button problem has been added to the bug list.
|
|
|
|
 |
|
|
|