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
Eiredrake
Beginner


Joined: 14 Jun 2005
Posts: 15

PostPosted: Sat Jun 27, 2009 6:51 pm   

'Can ya do this?' Options
 
Greetings all.

I've been pouring though help files, bbposts, faqs and stuff on the net about CMUD and I haven't found the answer to this question so I thought I'd just ask

1. Can you get the width of the current session window through a script?
I'd like to be able to format the output of one of my functions all perty. Have it centered in the window with borders, so that it looks like an actual table. I can make the assumption that the window is X characters wide (just like most muxes do). But if I resize the window, that's not going to be true. Is there any way to tell the width via code? (other than having to use win32 api)

2. Can you change the current font for the session window using script?
I'm dyslexic so I have a really hard time reading and comprehending blobs of text at times. This is especially true with fonts where the characters that are all the same width (Courier for example). Courier actually makes reading a table easy for me because everything lines up. However reading someone's elaborate two paragraph mux emit I'm just going to get lost in the text. For that sort of thing a non-proportional font like Arial makes it easier for me to read. So what I thought would be useful would be to format and display my tables in Courier and have my session window in Arial the rest of the time. Then just have a button to toggle between the two. So if I want to read a table just hit the button and it's displayed in Courier and easy to read. When I want to read someone's pose, I hit the button again and it shifts back to Arial.

3. Submenus.
I've been able to do it a couple of times by accident but I can't figure out the pattern. I have a menu, with a sub menu item under it. I want to put a sub menu under that so it looks like Deckers>>Deck>>Stats>>Set Bod

I've been dragging and dropping menu items all over the place and I can't see to consistently find the 'sweet spot' in dragging to actually get the menu to move under another submenu and using 'New Sub Menu' doesn't put it in the right place. Even if I have Stats selected, the new sub menu ends up under Deckers. I've tried editing the raw XML to put the thing in the right place but as soon as I hit save it just reverts back to it's previous position. Is there a way to change the order via code? Or how do I correctly drag/drop it so that it falls in the right space?

Are either of these things possible?
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Jun 27, 2009 9:08 pm   
 
Only way I know to change things like that in a zscript is using %pref function. I could be wrong so don't take my word for it. However, I set my toolbar locations and stuff using %pref in a script.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Sun Jun 28, 2009 7:01 am   
 
In the current beta 3.08 there is a new command #style, I have not used it but I believe you could use it to edit the default styles.
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Sun Jun 28, 2009 3:25 pm   
 
As for your first question, no, there's no way I know of to tell how wide your window is. I've thought about making output into fancy columns determined by the width of the window myself, but haven't found a way.
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Jun 29, 2009 5:49 pm   
 
1) Nope, no way to do that.

2) Use the FONT MXP tag like this:
#MXP "Normal text <FONT Arial>Arial text</FONT> back to normal"

3. Submenus

I am not able to reproduce any problems with sub-menus. I created several menu items, then clicked on one and selected New/Submenu and it was created in the correct place. Even dragging and dropping worked perfectly for me here. I even tried your exact example of Deckers>>Deck>>Stats>>Set Bod and clicked on Stats and selected New/Submenu and it properly created the item under Stats. So I'm not sure what is causing your problem with this and am not sure what to suggest. But if you still have this problem, post the XML for your menu so that I can load the XML and try it here.
Reply with quote
Eiredrake
Beginner


Joined: 14 Jun 2005
Posts: 15

PostPosted: Tue Jun 30, 2009 1:39 am   
 
Here's the XML
<menu priority="8" id="20">
<caption>Matrix</caption>
<menu priority="212" id="28">
<caption>BOD</caption>
<value>#VAR TEMP_ATTRIBUTE 0;

#PROMPT TEMP_ATTRIBUTE "Enter the value you would like to set for BOD"

#IF (@TEMP_ATTRIBUTE)
{
#IF (%isnumber(@TEMP_ATTRIBUTE))
{

}
}</value>
</menu>
<menu priority="214" id="27">
<caption>Set Statistics</caption>
</menu>
<menu priority="215" id="34"/>
<menu priority="216" id="21">
<caption>-</caption>
</menu>
<menu priority="221" id="22">
<caption>Properties</caption>
<value>SELECT_RUNNER %selword;
DISPLAY_RUNNER_STATISTICS;</value>
</menu>
</menu>


As you can see it's not really doing much of anything. I just can't get them in the right order. I did just take screen shots just to prove that I haven't lost my mind. Only thing I can think of is that I'm using Vista. I've actually had quite a lot of problems with CMUD on Vista. I haven't actually tried it on my XP box yet nor have I tired running it on Vista as the actual admin user. I'll give that a try and see if it makes a difference though I can't imagine creating a menu item requires special permissions.

As far as the menu I've tried cut/pasting the above XML. I've tried changing the priorities and ID's. I've tried typing in entirely new XML but none of it has the slightest effect. As soon as I save it goes back to what it was before. I've also been dragging and dropping them all over the place trying to put BOD underneath Set Statistics and it has happened by accident twice. I can't seem to get to happen again. I've also tried selecting one of the existing menus (Set Statistics) and using New>>New SubMenu and all that does is create a new menu item under Matrix.

In the above XML they should actually be in the order of :

Matrix
>Set Statistics
>>BOD
>-
>Properties

It actually comes out as
Matrix
>Set Statistics
>BOD
>-
>Properties
Reply with quote
Eiredrake
Beginner


Joined: 14 Jun 2005
Posts: 15

PostPosted: Tue Jun 30, 2009 1:41 am   
 
I am running it in XP compatibility mode.
Reply with quote
Eiredrake
Beginner


Joined: 14 Jun 2005
Posts: 15

PostPosted: Tue Jun 30, 2009 3:22 am   
 
Xp compatibility mode nor 'run as administrator' have any effect on behavior. Not that I was expecting any change.
Reply with quote
Eiredrake
Beginner


Joined: 14 Jun 2005
Posts: 15

PostPosted: Tue Jun 30, 2009 4:41 am   
 
Ok.. now I REALLY don't understand.

I created an entirely new menu tree and that one works fine.

The old one? Still didn't work. I ended up deleting it.

Color me confused.
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jun 30, 2009 4:54 pm   
 
Quote:
I am running it in XP compatibility mode.

That is generally a bad idea. But as you discovered, it didn't make any difference in this case. But please turn off this option for your CMUD. If you install CMUD into the default locations that the installer suggests (putting your data files into the %documents% area), then CMUD shouldn't have any problems with Vista. I use Vista 99% of the time here and for all of my development. The main issue with Vista is not installing to the correct directories, or having a custom or OEM Vista system that has the user permissions different from the defaults. Or, systems with DEP enabled (see the trouble article).

Looks like your previous menu was somehow corrupted. Maybe from an older version of CMUD? I used the XML that you gave and it still worked fine here. I'm glad to hear that creating a new menu somehow solved the problem.
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