[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Suggestions ➜ Wrap input?

Wrap input?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 

Posted by Neva   USA  (117 posts)  Bio
Date Reply #15 on Tue 29 Nov 2011 09:49 AM (UTC)
Message
Just to kinda clarify purpose, here:

I have my output set to wrap at 80 chars. The game tells people, "Wrap at 80 chars, or things may not look right to you," and sets guidelines like, "This thing should be about X lines long," where that actually means 80X characters. But my input box naturally wraps at the screen width, which is more like 160 characters on this computer and markedly more on that on my other one, so I have to mentally figure out--okay, this thing should be five lines at 80, so 2.5 lines on my laptop screen. (And I'm not even sure how many on my big monitor.) This other thing should be no more than twenty lines at 80... etc. A lot of it is about preventing too much spam or blocks of things people won't read, or else general guidelines for how much detail something should have. I typically, until this point, have pasted stuff into a text editor that I can set to wrap at 80, because that much math in my head is just annoying.

Pretty much no input MUSH servers will include line breaks; we have to replace them with %R's.

So, that part said! I finally got the chance to try this and... it doesn't work. After poking at it, I was able to determine that basically, the input window just doesn't see \n as a line break. Have you actually been running this, Fiendish? Is it displaying okay for you?

(The same text pasted into Notepad++ shows the line feeds, but not in regular old Notepad, so I'm guessing this has to do with the default Windows edit control.)
Top

Posted by Neva   USA  (117 posts)  Bio
Date Reply #16 on Tue 29 Nov 2011 10:33 AM (UTC)
Message
Also noticed in the process that this kills undo. Hmm...
Top

Posted by Neva   USA  (117 posts)  Bio
Date Reply #17 on Tue 29 Nov 2011 01:04 PM (UTC)
Message
Okay, so, I'm not going to upload this because it doesn't work very well, but long story short, switching to using \r\r\n instead of just \n and then changing around some of the checks and stuff makes it work as far as that goes, but again, the undo becomes completely broken and as far as I can tell, that's controlled by something I don't think scripting can touch?

It seems like it would be considerably easier in the long run to just set a margin on the edit box in the program based on the same basic calculations that figure out how many characters can fit when you're wrapping to screen on the output?

(Not that I know anything about C++, but a little cursory Googling implies this should be possible, although it also implies that I would have to evidently drop $800 for the right to have the libraries to actually compile MUSHclient, and... not today.)
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #18 on Tue 29 Nov 2011 02:17 PM (UTC)
Message
Neva said:

So, that part said! I finally got the chance to try this and... it doesn't work. After poking at it, I was able to determine that basically, the input window just doesn't see \n as a line break. Have you actually been running this, Fiendish? Is it displaying okay for you?

Well damn. Yes I tried it and it works for me...in Wine. If it won't work the same way in both Wine and Windows, then I don't know what to suggest yet. I had thought that \r\r\n was displaying garbage characters for me on the input bar in Wine, but I'll try that again.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Neva   USA  (117 posts)  Bio
Date Reply #19 on Tue 29 Nov 2011 03:06 PM (UTC)
Message
I'm guessing that in Wine, it's just emulating the Windows edit control, so it behaves a little differently.

I'm glad at least you're on Linux, I didn't think of that at first and I was having some definite hair-tearing-out time wondering why the heck it would break for me if I couldn't imagine how you possibly wrote it without ever running the thing!

At least as far as my purposes go, aside from a weird bit still where the second line for some reason cuts off early, I think the script is basically workable, but I'm not sure about the wrap-versus-undo tradeoff. Will have to see.
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #20 on Tue 29 Nov 2011 08:15 PM (UTC)
Message
This overall issue I addressed when writing my Area Editor something like 10 years ago.

What I did then was (for builders keying in room descriptions) let you type into a free-format edit box. Then there was a button that let you do the wrapping at the last moment. Like this:



The box was designed so it would wrap at column 80 anyway (with soft wraps, that is as you typed it would re-wrap). But then if you hit the "Wrap to Edge" button it would convert them to hard wraps (that is, put the newlines in).

Now I don't know if this helps a little or not at all, but is this the sort of thing you have in mind? You are of course free to download the Area Editor and just use it as a "text wrapper".

The other thing you might do is use the Lua utils.editbox function. You can set up various things there (like fixed-pitch font, exact box size etc.). By carefully setting that up you could make a box that wraps "softly" at 80 columns (or 79 or whatever) and then when you hit OK it does the hard wrap for you, and sends it.

Presumably this careful wrapping is not needed all the time, but doing things like descriptions, etc.?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Neva   USA  (117 posts)  Bio
Date Reply #21 on Wed 30 Nov 2011 02:21 PM (UTC)
Message
Pose length is also a potential issue, so pretty much all the time, yeah. I already have a text editor I can and do paste into pretty regularly, but it seems like a very bad solution to the problem.

On the other hand, since it turns out impoverished students *can* get access to Visual Studio for free... I think I have it working. Once I'm sure of that, I'll contribute it back!
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #22 on Wed 30 Nov 2011 11:02 PM (UTC)
Message
Well that would be nice. :)

However MUSHclient uses MFC which isn't part of the free Visual Studio, funny about that.

The problem from the window point of view is that the MUSHclient "world" frame is split into two parts (one above the other) using a Splitter class. The splitting is a horizontal line, so whatever the size of one window, the other one is the same (unless there was some third split or something).

I think a plugin that showed an edit box (utils.editbox) which you could call up when required (eg. F5 or something) would probably be the easiest way to do it. Just make sure the box is the right size, and add the hard returns when finished, if required.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #23 on Wed 30 Nov 2011 11:49 PM (UTC)
Message
Out of curiosity, how do other people on this MUD handle the issue?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Neva   USA  (117 posts)  Bio
Date Reply #24 on Thu 01 Dec 2011 03:39 AM (UTC)
Message
I added a new thread in Dev, but just to do a last couple replies:

No, MFC isn't in Express. MS is now giving the *full* Visual Studio 2010 away to college students, though, evidently: https://www.dreamspark.com/ And despite my total lack of knowing C++, evidently the online help files and a bit of trial-and-error were good enough.

To get a little into specifics, the window itself is the same size it always was, but CEdit controls can have internal margin space that forces it to wrap somewhere before the end of the window, so that's all my little hack does. All of which I pretty much got to entirely on the basis of, "I'm pretty sure there must be some way to do this!" So I'm proud of myself. ;)

As far as other people on the game go, some folks just wing it, some people do the pasting thing, some people run with the client only taking up part of the window--I think I'm the only one who even knows what a Miniwindow is, in all likelihood--and a number of people use SimpleMU, which, while it doesn't wrap, has always had an informational box taking up part of the lower part of the window. So it's kinda all over the place. I figure at least some people will appreciate it, and I am happy as a clam, so.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


63,231 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]