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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Tabbed scrolling miniwindow

Tabbed scrolling miniwindow

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


Pages: 1 2  3  4  

Posted by Xinefus   (106 posts)  [Biography] bio
Date Tue 11 Aug 2020 12:56 PM (UTC)

Amended on Tue 11 Aug 2020 03:23 PM (UTC) by Xinefus

Message
Ref: a. My beginnings - http://www.gammon.com.au/forum/?id=14661
b. Tabbed Miniwindow - https://www.gammon.com.au/forum/?id=14161
c. Scrolling Text - http://www.gammon.com.au/forum/?id=13916
d. Fiendish's tabbed miniwindow - https://github.com/fiendish/aardwolfclientpackage/blob/MUSHclient/MUSHclient/worlds/plugins/aard_channels_fiendish.xml
e. My miniwindow chat - https://github.com/DBNU-Braska/DBNU/blob/non-msdp/DBNU_Chat_Miniwindow.xml
f. my_chat.lua - https://github.com/DBNU-Braska/DBNU/blob/non-msdp/My_Chat_Window.lua

Good day!

I'm back at it again and as always a little lost.

I was looking into how Fiendish does his tabbed miniwindow over on Aardwolf (ref d), but that I believe is much too big of a jump for me from what I have right now, ref e/f.

Some background. I started with having a single miniwindow that had all the different channels being captured into it. I moved on to using a couple of different miniwindows, each with different channels. What I would like to do now is to be able to put these all back into '1' miniwindow that is tabbed.

Of course the way that Fiendish has done it is so elegant and works great for Aardworlf, though it's a huge jump.

Some of the features I would like right now are:

  • Scrolling text with mousewheel
  • resiseable miniwindow
  • add/remove tabs
  • selectable text within tabs (for copy/paste)


I think that the add/remove tabs part is probably not within my knowledge right now, I tried to read what Fiendish has done but with the untagged_channels, and non-channels bits, I got a bit overwhelmed when having to deal with so many different xml/lua files. Maybe I'm biting off too much at once.

I currently have a miniwindow that works and grabs all the info I want it to... I just can't select text (other than it copies the full line) nor does it mousewheel scroll.

Where should I start when it comes to working with this? I am unsure but believe that my current chat_miniwindow might be a bit out of date and may need to be redone to accommodate the features that I would like.

In my mind, I know this is completely possible, it's just taking me awhile to get things put into perspective. I thought if I would share my idea, I could get some insights and wisdom along with motivation to help me move forward.

Thanks for your help folks. (also for fiendish, whom received an unsolicited email from me, I apologise for that. You were kind and answered my questions, but I have stopped myself countless times from sending you more questions!... )
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Tue 11 Aug 2020 05:00 PM (UTC)

Amended on Tue 11 Aug 2020 05:18 PM (UTC) by Fiendish

Message
Selectable text in a miniwindow is a huge amount of work if you want to invent it from scratch, but you can use mine. It's entirely modular except for the dependency on my color functions, which you'd have to customize for any MUD that doesn't do color codes the same way Aardwolf does. It does wrapping, selecting, copying with or without color codes, wheel scrolling, scrolling while selection dragging, clickable hyperlinks, custom callbacks on display update, custom extendable right-click menu, and bold font display.

https://github.com/fiendish/aardwolfclientpackage/blob/MUSHclient/MUSHclient/lua/text_rect.lua
https://github.com/fiendish/aardwolfclientpackage/blob/MUSHclient/MUSHclient/worlds/plugins/aardwolf_colors.lua

My chat plugin binds the above to my vertical scrollbar module.

https://github.com/fiendish/aardwolfclientpackage/blob/MUSHclient/MUSHclient/lua/scrollbar.lua

I'd appreciate a mention if you use and enjoy them.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Xinefus   (106 posts)  [Biography] bio
Date Reply #2 on Tue 11 Aug 2020 06:53 PM (UTC)
Message
Fiendish said:

which you'd have to customize for any MUD that doesn't do color codes the same way Aardwolf does.


Looking at the two files, you said that I'd have to rewrite the custom colours to work with my specific MUD.

I suppose the colours.lua file is the best place to start...

In my specific MUD - the ANSI colours are called with the & (amp) prefix character and the xterm colours with the ` (tilde?) prefix character.

Like your file, &r would be red, and &R would be bright red (bold ansi).

For xterm, `y being dark yellow (i.e. ansi orange) and `Y being bright yellow (i.e. ansi bright yellow). You can also use xterm by using the full colour codes such as `[F005] being bright blue (i.e &B or ansi bright blue).

That being said, before I even get into the functions within the file, I seem to have an ansi prefix and a different xterm prefix. But I should be able to define an XTERM_PREFIX and redefine XTERM_CODE, right?

I don't believe I have a 300, 260, 250 pattern differences, only X_NONNUMERIC_PATTERN and X_DIGITS_CAPTURE_PATTERN.

What does TILDE_PATTERN define in your case?

Ok, enough questions for one post. I will upload my version of this to Git here: https://github.com/DBNU-Braska/DBNU/blob/non-msdp/DBNU_colours.lua

Thanks!
[Go to top] top

Posted by Xinefus   (106 posts)  [Biography] bio
Date Reply #3 on Tue 11 Aug 2020 08:13 PM (UTC)

Amended on Tue 11 Aug 2020 11:13 PM (UTC) by Xinefus

Message
To add some context,

All the channels that I am looking for, without colour tags, but at least what they look like:

https://github.com/DBNU-Braska/DBNU/blob/non-msdp/channel_text.txt

Here is my help colours. It's pretty close to a basic SMAUG.

https://github.com/DBNU-Braska/DBNU/blob/non-msdp/help_colours

And my xterm file:

https://github.com/DBNU-Braska/DBNU/blob/non-msdp/help_xterm

They have Kavir's snippet which adds xterm colour support.

https://github.com/Xavious/MSDP_Protocol_Handler
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #4 on Wed 12 Aug 2020 01:05 AM (UTC)

Amended on Wed 12 Aug 2020 01:08 AM (UTC) by Fiendish

Message
Xinefus said:

` (tilde?)

` is a backtick. ~ is a tilde.
Quote:

But I should be able to define an XTERM_PREFIX and redefine XTERM_CODE, right?

Sure

Quote:
What does TILDE_PATTERN define in your case?

For unimportant historical reasons, Aardwolf converts "@-" into "~".

Quote:
Ok, enough questions for one post.

That was only 3 questions.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Xinefus   (106 posts)  [Biography] bio
Date Reply #5 on Wed 12 Aug 2020 03:45 PM (UTC)
Message
Thanks for the info.

I'm looking at the aardwolf_colours.lua file and how it relates to text_rect.lua.

From what I can see, and from what I was able to test while logged into Aardwolf was that the colours.lua file enables the ability to copy/paste text/characters within the communications log WITH Aardwolf colourtags. When you right click you get either copy, copy no colour, or copy all.

I am not sure I have a use case that requires me to get the colour tag from the comm log. Thus, if I were to not need that functionality, would I be able to remove the functions used within text_rect.lua that call to aardwolf_colours.lua?

Some of the parts I'm seeing are

table.insert(s_text, StylesToColours(current_message))
         current_message = {}

and just have

table.insert(s_text, current_message)
         current_message = {}


I currently don't see a usecase in my MUD to have the ability to pull out/translate into colourtags.

Let me know what you think.
[Go to top] top

Posted by Xinefus   (106 posts)  [Biography] bio
Date Reply #6 on Thu 13 Aug 2020 11:55 AM (UTC)

Amended on Thu 13 Aug 2020 11:58 AM (UTC) by Xinefus

Message
Ref: https://github.com/DBNU-Braska/DBNU/tree/non-msdp

Sooo, I may have did a "daddy biiig mess" as my daughter would say.

I have went through the following files and made an effort to remove the requirement to do any colour formatting functions from within aardwolf_colors.lua.
I've renamed some of them, just so I can track which ones I am working on. I have also removed the parts that reference GMCP as I don't have that in the MUD at this time. Lastly, I have not updated the triggers yet, which is going to be the main method at the moment in how I will grab the MUD Channel texts.

The files I've went through and taken a look at are:

  • aardwolf_colors.lua
  • aard_channels_fiendish.xml
  • aard_miniwindow_z_order_monitor.xml
  • aard_register_on_z_create.lua
  • mw_theme_base.lua
  • repaint_buffer.xml
  • scrollbar.lua
  • text_rect.lua
  • aard_theme_controller.xml


I have moved/loaded all the files, to try and see if I could at least get the aard_channels_fiendish to load (and not do anything yet...), without success. There were a few bugs of where I didn't comment out the closing of an if/end etc, but now I am stuck with a different error and I don't know how to find it.

When I load DBNU_channels_fiendish.xml I get:
Line   87: Attribute name must start with letter or underscore, but starts with "-" (Cannot load)


I've looked through the code but cannot seem to locate this error at this time.

Is it too much to ask for someone to have a look at this for me? I'm using a fresh install of MUSHClient 5.06. I've added the above files into their respective folders.

If you want to have a look at it within my MUD, it can be found at: dbnumud.com:4321 I'm usually logged in and can be found as Braska(IMM IGN). I am not the owner of this one, but it is the primary one I am doing work on at this time.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #7 on Fri 14 Aug 2020 03:06 AM (UTC)
Message
You've tried to comment out a section of the plugin XML using Lua comment indicators instead of XML comment indicators. XML doesn't use -- for comments.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Xinefus   (106 posts)  [Biography] bio
Date Reply #8 on Fri 14 Aug 2020 04:32 PM (UTC)
Message
You are absolutely correct! Thank you for pointing that out.

I have a couple more errors and questions to ask.

First thing was that I had to add banker_round() to the file as it didn't seem to exist anywhere. I found a post on the forums here that had it, so I just used it from there.

The next thing I have now is that rightclick is not working correctly.

Error number: 0
Event:        Run-time error
Description:  C:\Program Files (x86)\MUSHclient\lua\text_rect.lua:844: attempt to index local 'ems' (a nil value)

stack traceback:

	C:\Program Files (x86)\MUSHclient\lua\text_rect.lua:844: in function 'rightClickMenu'

	C:\Program Files (x86)\MUSHclient\lua\text_rect.lua:659: in function <C:\Program Files (x86)\MUSHclient\lua\text_rect.lua:655>
Called by:    Function/Sub: TextRect.mouseUp called by Plugin DBNU_Chat_Capture_Miniwindow

Reason: Executing plugin DBNU_Chat_Capture_Miniwindow sub TextRect.mouseUp


When I take a look at text_rect, I can't seem to find the function that ems is supposed to be tied to

local ems = self.external_menu_string_generator()
--- (and further up the file) ---
function TextRect:setExternalMenuFunction(menu_string_generator, menu_result_function)
   self.external_menu_string_generator = menu_string_generator
   self.external_menu_result_function = menu_result_function
end


Where can I find this external... function? I looked throughout the client folders but didn't seem to be able to locate it..

Thanks!
[Go to top] top

Posted by Xinefus   (106 posts)  [Biography] bio
Date Reply #9 on Fri 14 Aug 2020 07:11 PM (UTC)
Message
I just finished adding in all of my triggers for each channel.

I went through and worked out which of my channels are non-channels vs channels like the original so that I could mimic the same functionality.

I give it a run, and first time logging in, I get:

Error number: 0
Event:        Run-time error
Description:  C:\Program Files (x86)\MUSHclient\lua\text_rect.lua:100: bad argument #1 to 'gmatch' (string expected, got table)

stack traceback:

	[C]: in function 'gmatch'

	C:\Program Files (x86)\MUSHclient\lua\text_rect.lua:100: in function 'findURLs'

	C:\Program Files (x86)\MUSHclient\lua\text_rect.lua:115: in function 'addStyles'

	[string "Plugin: DBNU_Chat_Capture_Miniwindow"]:704: in function 'storeTab'

	[string "Plugin: DBNU_Chat_Capture_Miniwindow"]:723: in function 'storeNonChannel'

	[string "Plugin: DBNU_Chat_Capture_Miniwindow"]:632: in function 'stampAndStore'

	[string "Plugin: DBNU_Chat_Capture_Miniwindow"]:685: in function <[string "Plugin: DBNU_Chat_Capture_Miniwindow"]:684>
Called by:    Function/Sub: chats called by trigger

Reason: processing trigger "Info" when matching line: "[Info] -> Alucard has joined the game!"


Looking at gmatch, it is being supplied a table from 'rex'?

Also, the matching line is NOT a url, so is it thinking it is for some reason?
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #10 on Fri 14 Aug 2020 11:03 PM (UTC)

Amended on Fri 14 Aug 2020 11:10 PM (UTC) by Fiendish

Message
Quote:
First thing was that I had to add banker_round() to the file as it didn't seem to exist anywhere.


It's round_banker, and I put it in my copy of commas.lua for some reason. I don't remember why.

Quote:
Where can I find this external... function?

You must have called setExternalMenuFunction in your plugin.

Quote:
Looking at gmatch, it is being supplied a table from 'rex'?

No it isn't. findURLs expects plain text, not a table. You've removed my color functions so now you have nothing converting the styles into plain text anymore. You can't just remove function calls and expect things to keep working without dealing with the results from your changes.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Xinefus   (106 posts)  [Biography] bio
Date Reply #11 on Sun 16 Aug 2020 09:32 PM (UTC)

Amended on Sun 16 Aug 2020 10:31 PM (UTC) by Xinefus

Message
Fiendish said:

You've removed my color functions so now you have nothing converting the styles into plain text anymore.

Point taken.

Is it possible that you could provide examples for the patterns within aardwolf_colors.lua?

I think I am going to have to modify some of the code to accommodate for how my MUD does ansi colour (using prefix "&") vs xterm colour (using prefix "`").

I tried looking at helpfiles within Aardwolf, but I can't seem to find an example of how it shows ansi vs xterm colours. (X_NONNUMERIC_PATTERN, X_THREEHUNDRED_PATTERN, X_TWOSIXTY_PATTERN, X_TWOFIFTYSIX_PATTERN, X_DIGITS_CAPTURE_PATTERN, X_ANY_DIGITS_PATTERN)

I am trying to understand how to make my own colourtostyles (and vice-versa) with the fact that not all my colours use the same prefix. In aardwolf_colors.lua it has
if code == XTERM_CODE then -- xterm 256 colors
already inside CODE_PREFIX. I think I need to modify mine here since my xterm colours are in the form `[%D%d%d%d].

If you look at the xterm helpfile ref'd earlier you can see that all my xterm colours are in the form `%s for a few presets, and then in the form `[(F or B)%d%d%d], so they are all in the form of 3 digits preceded by a F (foreground) or B (background).

Is that right? I'm trying to understand this correctly and write my own file based on the aardwolf one here.
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #12 on Tue 18 Aug 2020 06:43 AM (UTC)

Amended on Tue 18 Aug 2020 09:22 PM (UTC) by Fiendish

Message
Quote:
Is it possible that you could provide examples for the patterns within aardwolf_colors.lua?

I thought you said you weren't going to bother with colors at all? Anyway, you don't need to know how color codes work to extract plain text from styles as is needed for the findURLs function. Just iterate over the styles and pull out the .text fields and concatenate them.

Quote:
I tried looking at helpfiles within Aardwolf, but I can't seem to find an example of how it shows ansi vs xterm colours


`help colors`
http://www.aardwolf.com/wiki/index.php/Help/Colors
`help xterm`
http://www.aardwolf.com/wiki/index.php/Help/xterm

@r and @R and @b and @B etc. are regular colors.
@x1 and @x01 and @x001 are xterm colors. Aardwolf allowing non-zero-padded forms makes things more complicated.

Quote:
B (background)

Aardwolf doesn't do background colors. Good luck! The extra work to add background colors may be nontrivial.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Xinefus   (106 posts)  [Biography] bio
Date Reply #13 on Tue 18 Aug 2020 09:49 PM (UTC)
Message
Well, I really like your plugin. The more I can learn from it and actually implement it's capabilities, the better set I am for other plugins I want to write.

So, my mud has used Kavir's snippet to implement xterm 256 colours. Not a huge thing but there is a bit of a problem in that the sequencing of numbers used to show colors goes from 000-555 but in base 6. For example, the first set of colours uses 000-005, 010-015, 020-025, 030-035, 040-045, 050-055. Then it jumps to 100.. all the way to 155, then 200 to 255, up to 555.

All I have right now, is a box that won't grab text and throws an error when I right-click it. But hey, I have a box! And it's glorious!
[Go to top] top

Posted by Fiendish   USA  (2,514 posts)  [Biography] bio   Global Moderator
Date Reply #14 on Thu 20 Aug 2020 01:56 PM (UTC)

Amended on Thu 20 Aug 2020 04:26 PM (UTC) by Fiendish

Message
Well, I'd start by putting my color functions back in place and then replacing or updating only the ones that deal with codes. Some of those functions like TruncateStyles and strip_colours_from_styles are critical and not affected by different color code schemes.

The only part of text_rect that cares about color codes is the OPTIONAL addColorLine method and the OPTIONAL copying with color codes.

https://github.com/fiendish/aardwolfclientpackage
[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.


79,730 views.

This is page 1, subject is 4 pages long: 1 2  3  4  [Next page]

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 HostDash]