Cmud, buttons and compass 07/23/2007 05:59 AM CDT
Just after Cmud was released I tried to create a compass for use in DR. It seems that there was a bug with the buttons within Cmud that was causing strange behavior. Now that we are up to ver 1.34 I was wondering a couple of things.

1) Has anyone gotten a compass working yet? If so what is the code?

2) Has the button issue been fixed?

The reason I ask is that I cannot recall what the bug was or did. I do remember that it made making a compass impossible.
Reply
Re: Cmud, buttons and compass 07/23/2007 08:29 AM CDT
Well, I have gotten a working compass (works thus far) so question 1 is not needed.

I took the compass setup from the finished zmud scripts in the zuggsoft forums (updated by Redytedy<sp>) and made a couple of modifications after I slapped it into Cmud.

#CLASS {Compass}
#TRIGGER {j} {#var compassdirections %replace( %gsl( j), "|~?", "");#IF %ismember( d, @compassdirections) {#VAR compassdown 1} {#VAR compassdown 0};#IF %ismember( e, @compassdirections) {#VAR compasseast 1} {#VAR compasseast 0};#IF %ismember( w, @compassdirections) {#VAR compasswest 1} {#VAR compasswest 0};#IF %ismember( n, @compassdirections) {#VAR compassnorth 1} {#VAR compassnorth 0};#IF %ismember( s, @compassdirections) {#VAR compasssouth 1} {#VAR compasssouth 0};#IF %ismember( se, @compassdirections) {#VAR compasssoutheast 1} {#VAR compasssoutheast 0};#IF %ismember( sw, @compassdirections) {#VAR compasssouthwest 1} {#VAR compasssouthwest 0};#IF %ismember( ne, @compassdirections) {#VAR compassnortheast 1} {#VAR compassnortheast 0};#IF %ismember( nw, @compassdirections) {#VAR compassnorthwest 1} {#VAR compassnorthwest 0};#IF %ismember( out, @compassdirections) {#VAR compassout 1} {#VAR compassout 0};#IF %ismember( u, @compassdirections) {#VAR compassup 1} {#VAR compassup 0}} "" {gsl}
#BUTTON 5 {OUT} {} {OUT} {} {} {compassout} {} {Size} {27} {24} {Pos} {24} {27} {} {110} {} {} "" {} {} {} {2}
#BUTTON 6 {NE} {} {NE} {} {} {compassnortheast} {} {Size} {27} {24} {Pos} {1} {54} {} {110} {} {} "" {} {} {} {2}
#BUTTON 7 {S} {} {S} {} {} {compasssouth} {} {Size} {27} {24} {Pos} {48} {27} {} {110} {} {} "" {} {} {} {2}
#BUTTON 8 {NW} {} {NW} {} {} {compassnorthwest} {} {Size} {27} {24} {Pos} {1} {1} {} {110} {} {} "" {} {} {} {2}
#BUTTON 9 {SE} {} {SE} {} {} {compasssoutheast} {} {Size} {27} {24} {Pos} {48} {54} {} {110} {} {} "" {} {} {} {2}
#BUTTON 10 {SW} {} {SW} {} {} {compasssouthwest} {} {Size} {27} {24} {Pos} {48} {1} {} {110} {} {} "" {} {} {} {2}
#BUTTON 11 {E} {} {E} {} {} {compasseast} {} {Size} {27} {24} {Pos} {24} {54} {} {110} {} {} "" {} {} {} {2}
#BUTTON 12 {UP} {} {UP} {} {} {compassup} {} {Size} {27} {36} {Pos} {1} {81} {} {110} {} {} "" {} {} {} {2}
#BUTTON 13 {DN} {} {DN} {} {} {compassdown} {} {Size} {27} {36} {Pos} {36} {81} {} {110} {} {} "" {} {} {} {2}
#BUTTON 14 {W} {} {W} {} {} {compasswest} {} {Size} {27} {24} {Pos} {24} {1} {} {110} {} {} "" {} {} {} {2}
#BUTTON 15 {N} {} {N} {} {} {compassnorth} {} {Size} {27} {24} {Pos} {1} {27} {} {110} {} {} "" {} {} {} {2}
#CLASS 0

Above is how it was originally.
I simply changed three things.
If you look at the button settings in the package editor there are two states.
Looking at the options panel for the selected button I changed the button color to black and the text color to gold.
Under the second state I simply changed the color to "transparent". This was done via the check box on the second states option page.


Sorry if this is in any way unclear, confusing, or sounds downright uneducated in any way. I just recently started back up in DR and CMud both and have yet to get myself back on track. (I forget these things far to quickly) :(
Reply
Re: Cmud, buttons and compass 07/23/2007 08:31 AM CDT
I neglected to mention that the settings on the first state of each button were just for my own preference. What seemed to make or break the compass was the second state's color option. The only way I got the compass to stay put was having the second state's option as transparent.
Reply