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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: Fri Jun 29, 2007 4:10 am   

Menu buttons [1.34]
 
Do these exist/work yet? I might be doing it wrong, heh. I go to New -> New Button then I put text in the name field and select menu from the Type drop down, then go New -> New Button State and put text in that name field and repeat the last step a few times. Then I click on the button in the UI, and nothing happens, no drop down, it doesn't even perform the stuff in the value field of the main button.

EDIT: Left out a step.

EDIT 2: Put my version of CMUD in the title, in case there is any confusion.
_________________
EDIT: Image moved to Avatar FINALLY.

Last edited by Fuego Ledrey on Fri Jun 29, 2007 5:41 am; edited 2 times in total
Reply with quote
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: Fri Jun 29, 2007 4:22 am   
 
Apparently multistate button was what I was after, yay for playing around with settings, heh. But is this menu type button not supposed to work like I expected it to?...
_________________
EDIT: Image moved to Avatar FINALLY.
Reply with quote
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: Fri Jun 29, 2007 5:40 am   
 
    My button:

    Opponent Toggle
    ->Apostate
    ->Bard
    ->Druid
    ->%if(%numkeys(@opponents)>1, "NONE", "ALL")

Ok, after playing around with multistate I've run into a bug I think. I've put:
Code:
%if(%numkeys(@opponents)>1, "NONE", "ALL")

in the name field of one of the states of the button, as you can see. I expect to see either NONE or ALL when I click on Opponent Toggle (as well as Apostate/Bard/etc). I see the function, not evaluated. Bug?

I put the same code in a Menu, via New -> New Menu, New -> New Sub Menu, etc, and I get the expected results by right-clicking on the MUD output window and selecting Opponent Toggle from the menu. In other words, when I do this I see ALL, or NONE respectively.
_________________
EDIT: Image moved to Avatar FINALLY.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri Jun 29, 2007 1:35 pm   
 
The way I do this is I place the value of the %if into a variable and place the variable into the button.

Inside the i_offclass, i_onclass, and i_offbutton, i_onbutton aliases I set the respective variable so.

AllOpponents=%if(%numkeys(@opponents)>1, "NONE", "ALL")

Then place @AllOpponents as the label.

It is better to place a variable for the button label whenever possible if the label changes.
The same goes for status bar/window values. The screen repaints itself when a variable that is used
in one of these changes it's value.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Jun 29, 2007 5:19 pm   
 
The "menu" button is something left over from zMUD. It's been a while since I played with it, but if I remember correctly, you first set up a Class folder that contains several Menu items and then enable the "Class is a Submenu" option for the class. Then you create a Menu button and put the name of the Class folder into the Value field for the button. So the button itself only has a single state, and then points to the class folder that contains the other menu items. This allows a button to share the same menu as the right-click menu. It was a bit of a kludge and I'm not sure that anyone really uses this. But I've never done anything in CMUD to make it any more obvious.

For what you are doing, the Multi-state button is the way to go. The button caption should evaluate any expression, so I'm not sure why your %if expression isn't working. Using a variable is a good workaround, but I've added this to the bug list to investigate.
Reply with quote
makena
Apprentice


Joined: 11 Aug 2006
Posts: 100

PostPosted: Fri Jun 29, 2007 7:36 pm   
 
I have found similar problem with expansion in buttons names. I seem to remember a post about it not liking to expand beyond one level..
Reply with quote
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: Fri Jun 29, 2007 8:30 pm   
 
Thanks for the responses. I'm sure I can get something worked out.
_________________
EDIT: Image moved to Avatar FINALLY.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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