Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Tue Jun 16, 2009 9:13 pm   

[Fixed in 3.10][3.08]/[3.09] Toggle button in enabled/disable classes
 
Hi,

I have few buttons in class that I enable/disable to show/hide set of buttons (switches for my mud).
Button's variable is of course outside that class (always in scripts scope).

Code:
<button type="Toggle" variable="isSeqTransferON" autosize="false" width="83" height="18" autopos="false" left="-266" toolbar="4" color="black" textcolor="green" priority="168" id="3957">
  <caption>SeqTransf OFF</caption>
  <button color="black" textcolor="red" id="3958">
    <caption>SeqTransf ON</caption>
  </button>
</button>


BUG description:
1. isSeqTransferON variable has value 1 - so button is in state 1 -> pushed and has red-text and caption "SeqTransf ON".
2. Disable class which include that button
3. Enable class
4. Button is in state 1 still, but it is showed like "unpushed" and caption is "SeqTransf ON" but green color (which is defined for state 0)
(button should be pushed and red-text color for caption)

Rgds,
W.


Last edited by yelayon on Tue Jul 28, 2009 11:36 am; edited 2 times in total
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Jun 17, 2009 3:21 am   
 
Confirmed.

Another oddity, for a long while I couldn't even see the button and had to manually re-created. Because you specification (I'm sure the negative number in toolbar 4 has something to do with it) it didn't even show on screen. Manipulating the top/down/left/right well eventually get you to a visible combination.
_________________
Asati di tempari!
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Wed Jun 17, 2009 8:32 am   
 
It is not negative. I have position set to:
- align: right / top
- left: 265
- top: 1
- toolbar: 4

So negative numer in XML description is probably b/s right alignment.
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jun 17, 2009 3:14 pm   
 
Confirmed and added to bug list. Re-enabling the class causes the button to be displayed in it's zero-state mode instead of it's current state.

And yes, if you have the Align set to "right", then the XML stores the Left value as negative, which means 265 pixels from the right edge. So if Tech's screen was less than 265 pixels wide, then the button would be hidden off the left edge.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Wed Jun 17, 2009 4:37 pm   
 
INFO - workaround until bug will be fixed (for toggle type buttons, which has defined variable)
Code:
;enabling class
#CLASS GSModesButtons 1
;wait 1ms ... is stupid but.... required to work
#WAIT 1
;we need to change variable - cannot assign the same value, so we double negate value
#VARIABLE isAtomBeamON !@isAtomBeamON
#VARIABLE isAtomBeamON !@isAtomBeamON
and the buttons shows proper state - in real we twice toggled state (toggle buttons has only 2 states - 0 and 1)

Also tried #UPDATE, but it doesnt work
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Mon Jul 20, 2009 9:35 am   
 
Still exists in cMud 3.09
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jul 20, 2009 5:20 pm   
 
Yes, this bug is still on my bug list.
Reply with quote
yelayon
Novice


Joined: 15 Mar 2005
Posts: 42

PostPosted: Tue Jul 28, 2009 11:37 am   
 
Fixed in 3.10
_________________
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net