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, confirm your email, resolve issues, 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 ➜ Miniwindows ➜ Mini-window for public chatter

Mini-window for public chatter

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


Pages: 1  2  3  4  5  6  7 8  9  

Posted by CincyMush   (15 posts)  Bio
Date Reply #90 on Sun 06 Jan 2013 08:31 PM (UTC)

Amended on Sun 06 Jan 2013 08:34 PM (UTC) by CincyMush

Message
I was looking through the code for a way to wipe the contents of the window and start over but nothing popped out to me as a good approach. Is it possible on a trigger to destroy clear the buffers and then recreate the window?

Thanks

Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #91 on Sun 06 Jan 2013 10:05 PM (UTC)
Message
Quote:
Is it possible on a trigger to destroy clear the buffers and then recreate the window?

Of course. That is exactly the right way to do it.

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

Posted by CincyMush   (15 posts)  Bio
Date Reply #92 on Mon 07 Jan 2013 02:12 AM (UTC)
Message
So did a WindowDestroy then reset the tables and forced the trigger back through the init function, seems to have done the trick.
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #93 on Tue 08 Jan 2013 09:55 PM (UTC)
Message
Depending on what you want to do, you could also use WindowRect to draw over everything with a single color, and use WindowDeleteAllHotspots to remove all the hotspots.

'Soludra' on Achaea

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

Posted by Oligo   (26 posts)  Bio
Date Reply #94 on Mon 01 Apr 2013 07:39 AM (UTC)
Message
This plugin is a godsend.
Thank you very much.

mud.arctic.org : 2700
Top

Posted by PJ   USA  (48 posts)  Bio
Date Reply #95 on Sat 11 Jan 2014 03:49 AM (UTC)
Message
Thanks much for putting this together!
Top

Posted by Graymane   USA  (14 posts)  Bio
Date Reply #96 on Fri 14 Mar 2014 06:02 PM (UTC)
Message
Hi, I'm in the process of trying to change over from tintin to MUSHclient. I really like the looks of it. Right now I'm adapting this chat mini-window to my MUD.

One thing I don't understand is that if I turn off echoing and type "say hello". I get the "You say 'hello' in the mini-window but I also get a new prompt with nothing on it from my mud. I'm not sure if that is something my mud is doing and I can't prevent or something coming from MUSHclient?

Example:

With echo ON:
<Some Prompt>
say hello
You say 'hello'
<Some Prompt>

Wth echo OFF:
<Some Prompt>
say hello
<Some Prompt>

How can I stop that second prompt? This happens when someone else is chatting and I capture in my log as well. I'll get the two prompts below. The first is when nothing has happened, then someone chats, it goes to my chat window but I still get a new prompt in the main window.

<Some Prompt>
<Some Prompt>

Can I stop the second prompt?
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #97 on Fri 14 Mar 2014 08:14 PM (UTC)
Message
This is a fairly common problem, because the MUD sends two prompts. You may have suppressed the "You say 'hello' " message but you haven't suppressed the second prompt.

One approach is to detect prompt lines in a trigger, omit them, and then in a script detect if the prompt has changed. If it is different, echo it (Note or ColourNote it). That suppresses multiple identical prompts.

- Nick Gammon

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

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #98 on Sun 16 Mar 2014 01:32 AM (UTC)
Message
Nick Gammon said:

One approach is to detect prompt lines in a trigger

Detecting prompts is a path to sin. Or more poetically, "Abandon all hope, ye who enter here."

It sounds to me like the game always sends a prompt after a chat, since other people's chats also initiate prompts. So you should just be masking out the next line from the mud after any chat.

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

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #99 on Sun 16 Mar 2014 10:27 AM (UTC)
Message
I didn't say it was a good approach. ;)

- Nick Gammon

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

Posted by Mat   (14 posts)  Bio
Date Reply #100 on Wed 02 Jul 2014 02:39 PM (UTC)
Message
I was hoping to ask how difficult you guys thought it would be to add the feature where you could click on an empty part of the scrollbar and have it scroll in that direction by one page.

Hope this hasn't already been done and I've missed it, but I haven't found it anywhere in the code or in the newer versions of the chat window plugin.

Let me know if you can if you believe this would be an easy thing to do or more work than its worth.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #101 on Wed 02 Jul 2014 04:02 PM (UTC)

Amended on Wed 02 Jul 2014 04:04 PM (UTC) by Fiendish

Message
Mat said:

I was hoping to ask how difficult you guys thought it would be to add the feature where you could click on an empty part of the scrollbar and have it scroll in that direction by one page.


For whom? For me it would be trivial.
But my feeling is that asking that question means my answer has to be "for you, difficult". If it weren't, you probably wouldn't be asking, right? You'd find the place where all the hotspots get constructed, see how the up/down buttons and mousewheel operate, and then add a hotspot in the scrollbar background rectangle that uses relative position between mouse and slider to determine page up vs page down, and then for up you'd do something like
lineStart = math.max(1, lineStart-WINDOW_LINES)
lineEnd = math.min(#lines, lineStart+WINDOW_LINES-1)
drawStuff()

and for down you'd do similar but in the other direction.

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

Posted by Mat   (14 posts)  Bio
Date Reply #102 on Wed 02 Jul 2014 05:35 PM (UTC)

Amended on Wed 02 Jul 2014 06:02 PM (UTC) by Mat

Message
Thanks very much for the help!

After a bit of time I got it up and running.
Gave me a bit of trouble trying to figure out why the scrollbar background hotspot was taking priority as if it were covering the scrollbar position indicator.
But after a quick search I read that it checks for priority of overlapping hotspots by alphabetical order, not by order in which they were added.

Renamed the hotspot_id to "scroller2" and it works like a charm.

Thanks again for the help!

Also, if curious:
Hotspot firsttime area:

WindowAddHotspot(Win, "scroller2", WINDOW_WIDTH-SCROLL_BAR_WIDTH, TITLE_HEIGHT+SCROLL_BAR_WIDTH, 0, WINDOW_HEIGHT-(SCROLL_BAR_WIDTH * 2), "MouseOver", "CancelMouseOver", "MouseDown", "CancelMouseDown", "MouseUp", "", 1, 0)

Hotspot after firsttime:

WindowMoveHotspot(Win, "scroller2", WINDOW_WIDTH-SCROLL_BAR_WIDTH, TITLE_HEIGHT+SCROLL_BAR_WIDTH, 0, WINDOW_HEIGHT-(2*SCROLL_BAR_WIDTH))

Within MouseDown:

	elseif (hotspot_id == "scroller2") then
		mouseY = WindowInfo (Win, 15)
		if (mouseY < barPos) then
			lineStart = math.max(1, lineStart-WINDOW_LINES)
			lineEnd = math.min(#lines, lineStart+WINDOW_LINES-2)
		else
			lineStart = #lines-WINDOW_LINES+2
			lineEnd = #lines
		end
		drawStuff()
Top

Posted by Kovarid   (15 posts)  Bio
Date Reply #103 on Thu 11 Dec 2014 09:06 PM (UTC)
Message
Just wanted to add that this does not properly load font/fontsize if you change it.
Small patch to fix it.

Change

BODY_FONT_NAME = "Dina"
BODY_FONT_SIZE = 8


To



BODY_FONT_NAME = GetVariable("bodyfont") or "Dina"
BODY_FONT_SIZE = tonumber(GetVariable("font_size") or 8)
Top

Posted by Donecce   (16 posts)  Bio
Date Reply #104 on Thu 15 Jan 2015 05:22 AM (UTC)
Message
There might be a better forum for this but I just wanted to say thank you for all the mini-window stuff! So much.

I've been trying to create a mini-window module, to teach myself Lua and to create widgets and stuff. It was crashing the client, seemingly at random, after I would try to resize things. It was probably my code but it hasn't crashed since I got version 4.96. So happy! Either way, thanks for the awesome client! It really is impressive how well Mushclient holds up to my repeated attempts to break it. So good. And free!
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.


362,149 views.

This is page 7, subject is 9 pages long:  [Previous page]  1  2  3  4  5  6  7 8  9  [Next page]

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

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