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
Zugg
MASTER


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

PostPosted: Wed Apr 01, 2009 10:23 pm   

More button goodness (mouse button states)
 
Buttons are getting even more love in the next version.

When defining multiple states for a button, you can now specify which mouse button and shift combination will activate the state. These "mouse button" states are not displayed in the normal drop-down menu for the button. If all of the button states have a mouse button assigned to it, then no menu is displayed for the button at all. You can also change the mouse button and shift state for the main button.

For example, you can create a button called "test" with a script of "main button". Clicking the left mouse button on this button will display "main button" as normal. Then, change the button to a Multistate button and set the first new button state to "right state" with a script of "right mouse" and in the Options tab you set the mouse button field to "Right".

Now, the above multistate button will still look the same as the single state button. But if you click the right mouse button over the button, it will display "right mouse" instead of "main button".

If you set a mouse-over ToolTip string for the main button, then the tooltip will be automatically modified to show the additional button states. If the above example, if the main tooltip is set to "tooltip", then the final mouse-over hint will be shown as:

tooltip
Right: right state

to help remind you what happens when you click various button/shift combinations on the button.

Now it's even easier than ever to assign multiple actions to a button and execute different scripts based upon different mouse button and shift combinations. This is something I've been wanting to add for a long time and just finally got in the mood to implement. Turned out to be easy to add, so that's why it made it into the next beta. I love easy and fun new features like this, and I hope you'll like it too!
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Sat Apr 18, 2009 2:27 pm   
 
Zugg wrote:
If you set a mouse-over ToolTip string for the main button, then the tooltip will be automatically modified to show the additional button states.

1) I believe if there are non-standard mouse states exist, the tooltip should be modified no matter whether the tooltip for the main button is present or no. Imagine the following button code:

Code:
<button type="Multistate" autosize="false" width="120" height="25" mousebtn="Left" priority="50" id="5">
  <caption>TEST!</caption>
  <state caption="WALK" mousebtn="Left">#SAY "WALK"</state>
  <state caption="RUN" mousebtn="CTRL-Left">#SAY "RUN"</state>
  <state caption="SLEEP" mousebtn="Right">#SAY "SLEEP"</state>
</button>


Now go on and try to figure out what other states do (or even are they exist - user can't see them) without looking into the editor. I think you should either force tooltip for non-standard mouse states or consider for the editor automatic addition of the single space character to the tooltip on settings save if a) the tooltip is empty and b) there is at least 1 non-standard mouse state defined.

2) If you have Ctrl+LMB or Shift+LMB mouse state defined you still must click twice: first time (with Ctrl or Shift) on the main button and then with or without Ctrl\Shift on one of the standard state caption (no matter which one - what a mess...). Can you change this to the same way you handle RMB click on a button or Alt+LMB (immediate state code execution)?
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Apr 20, 2009 5:17 pm   
 
1) So just add some text to the main button tooltip and then it will display the tooltip for all states. I don't want to force the tooltip to be *always* displayed because some people don't want any tooltips to display. But I've given you a very easy way to make the tooltip display, so I don't see the problem with that.

Remember that your main button state will still respond to the Left mouse button. So you don't need a separate state for the "Left" button. Typically the main button script will be used for the Left button and the main tooltip will give the help text for the left button function. So in your example, you don't need that extra "WALK" state.

2) I'll add that to the bug list, thanks.
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