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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Random Lua Questions
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Random Lua Questions

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


Pages: 1  2 

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #15 on Wed 01 Feb 2017 02:08 AM (UTC)
Message
Nah, it would make more sense to hack it into my own. I have some rather esoteric needs in this plugin or I would not have reinvented the wheel. :-/
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #16 on Wed 01 Feb 2017 04:41 AM (UTC)
Message
I enhanced the plugin a few times. Now it can handle embedded newlines when you go to add more lines. You can also change the font interactively.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #17 on Wed 01 Feb 2017 06:46 AM (UTC)
Message
The plugin is my old Previewer plugin which I use to simulate game commands. (Yay color codes, special syntactual identifiers or other complicated MUSH commands.)

It goes out of its way to resemble MUSHclient's own rendering as much as humanly possible. On its own that should not be too hard, but since I also combine this with applying spell-checking, red 'Word squiggles' to match misspelled words as well as the tracking of positions in the command window, the implementation tends to get rather complicated on a lot of different layers.

In theory, I ought to be able to split things like wrapping, rendering, spell-checking and other such happy stuff into perfectly individual functions... but they end up relying on each other just a bit too often in more or less subtle ways.

Besides, if I end up implementing it, I probably need to do so in a way that supports my architecture where all the visual stuff has been split off into its own module for maximum visual customizability. Which means I need to go back to figuring out how all of that worked, how it needs to change to support scrolling, and finally cry over the fact it probably wasn't worth it.

That plugin basically implements the client and server at the same time. It is an utter nightmare, yet I keep coming back to it every so often. xD
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #18 on Wed 01 Feb 2017 08:47 PM (UTC)
Message
If you have a function that draws the text (with whatever level of complexity) then scrolling basically just offsets the Y starting point (ie. you start drawing above the window).

So instead of starting at Y=0, you start at Y=-400 or whatever so that you don't actually see the part you have scrolled past.

Having done that you just draw a scroll bar with a thumb in the appropriate place.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


4,646 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] 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]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]