PDA

View Full Version : Profanity FE and Quality of Life



Luxelle
08-31-2016, 06:48 PM
All right, Newsby is settling in with Profanity on my new Mac. It's been rock solid. I love it!

I'm wondering how to add a tad bit of functionality into the stream of text, though.

1. The main defined classes, whisper, speech, roomName, monsterbold, familiar, thoughts, voln ... did not colorize as much of the incoming text as I had hoped for!

So 'speech' only colors You say
... and the rest of the line/s default back to the same color as all the rest of the text.

Is there a way to get this to colorize the entire spoken line instead? (and the other relevant classes)

2. Is it possible to bring the Speech Window concept into Profanity? (whispers, all spoken words, yelling, group whispers, ooc whispers, and group ooc whispers). I keep mine in Stormfront just above the input line. It's extremely handy for conversations in busy rooms.

3. Editing on the input line is making me slightly nuts. What are the rules here? It seems a little bit slow to use the cursor back key to go back ALL those characters when I see an error that needs correcting at the beginning. The cmd/option left arrow key does not take me back to the beginning of the line, and once there to correct the error, cmd/option right arrow does not return me to the end. I do a fair amount of on the spot editing during live events and all. (cmd arrow is how my text editor works, option arrow is how my shell works)

4. Is there any way to put a line/barrier between the thoughts window area and the main area?

Thanks to everyone in advance. :)

~L

Tillmen
09-01-2016, 11:21 AM
1. The speech preset highlights everything inside the preset tag, for example:

<preset id='speech'>You <a exist="-10439655" coord="2524,1836" noun="help">say</a></preset>, "All hope is lost."

The game only puts the preset tag around "You say", so that's all that gets highlighted. You could create your own highlight to highlight the entire line. Something like this would likely highlight all speech, but might also highlight some non-speech if it includes a comma/space/quote and ends with a quote:


<highlight fg='whatever bg='whatever'>^[A-z][a-z]+ .*?, ".*?"$</highlight>

To avoid highlighting non-speech, you could go through the list of speech verbs and add all the first and third person versions, which sounds like a very annoying task. Here's a start to that:


<highlight fg='whatever bg='whatever'>^[A-z][a-z]+ .*?(?:say|says|whisper|whispers|accuse|accuses|etc ), ".*?"$</highlight>

Keep in mind that if the speech preset is set to a different color, "You say" will still show up as that color. Each bit of text can only have one foreground color and one background color. If two highlights match like in this case, the highlight affecting less text takes precedence. However, foreground and background are considered separately, so if no background is set the for the shorter highlight, the background for the longer highlight will still be in effect.

Whisper is part of the speech preset.

roomName highlights the entire roomName. Maybe you're looking for the roomDesc preset?

monsterBold highlights as much as other frontends do.

familiar, thoughts, and voln only highlights those things if they're in the main window, and they should highlight the whole line when that's the case.


2. To add a speech window, you just need to edit the layout. If you wanted the speech window to be three lines tall and above the input line, you first need to shorten the height of the main window by three lines.

Here's part of my config; yours might be different:

<window class='text' top='6' left='12' width='cols-12' height='lines-7' value='main' buffer-size='3000' />


You can tell this is the main window because of the value='main'. This causes all the main game text to be sent to this window.

When dealing with the top, left, width, and height of the windows, "cols" and "lines" are the only two variables. They refer the the total number of columns and lines in the terminal. These are needed for a layout to resize windows when the terminal changes sizes. As you might expect, making the main window three lines shorter would look like this:


<window class='text' top='6' left='12' width='cols-12' height='lines-10' value='main' buffer-size='3000' />


Now to put in the new window, we'll copy the left and width values. The top will simply be the top of the main window plus its height. And the height will of course be 3. Value will be speech, so that the speech stream gets sent there.


<window class='text' top='lines-4' left='12' width='cols-12' height='3' value='speech' buffer-size='3000' />


Another option is to just add the speech stream to your thought window, since windows can have more than one stream:



<window class='text' top='0' left='0' height='6' width='cols' value='lnet,thoughts,voln,speech' buffer-size='1000' />


I'm not sure if that's a good idea, but hey, you can do it.


3. For me, hitting the home or end keys sends me to the front or end of the line. ctrl+left and ctrl+right sends me one word to the left or right. However, different terminals use different key codes for these things. The relevant lines from the config file are:


<key id='home' action='cursor_home'/>
<key id='end' action='cursor_end'/>
<key id='545' action='cursor_word_left'/>
<key id='560' action='cursor_word_right'/>


If these aren't working because your terminal uses different keycodes, or if you'd just rather have it use that weird cmd/option key like you're used to, type ".keycode" into the frontend (and hit enter), and then hit the key combination you want. It might tell you the correct key code you need to stick into the "id" attribute to map it to the action you want. It's also possible that the cmd/option key works as its own key, and not a modifier that will give you a single key code for a cmd/option+other_key combination. In that case, you would need to do something like:



<key id='keycode_for_cmd/option'>
<key id='second_keycode' action='cursor_home'/>
<key id='third_keycode' action='cursor_end'/>
</key>


It's also possible that the terminal will not send that keycode to profanity at all, and it simply can't be used with that terminal.


4. Sure, add 1 to the top of the main window, and subtract 1 from its height.

Luxelle
09-01-2016, 05:24 PM
<3 Tillmen!

Thanks so much. I will play with it tonight when I get home from work.

Mogonis
09-01-2016, 05:45 PM
<3 Tillmen!

Thanks so much. I will play with it tonight when I get home from work.


http://az616578.vo.msecnd.net/files/2016/03/11/63593317527600369584479854_Michael%20title.png

Kaldonis
09-01-2016, 06:00 PM
As long as Tillmen is answering....wow every question with awesome detail about Profanity.

The number one thing I miss is whatever underlines things in rooms I can interact with? This would probably hit items in my inventory that aren't from the year 2000 as well, but it looks like ncurses can underline so we can keep it to that markup possibly, since highlighting sounds pretty ugly.

Luxelle
09-04-2016, 04:00 AM
Oh, underlines! Yes, I second that, pretty please.

BigWorm
09-04-2016, 04:39 AM
.keycode doesn't work for me. Complains that

--- Lich: could not find script 'keycode' in directory ...

I checked in the repo and there is not keycode script available.

Gnomad
09-04-2016, 09:57 AM
As long as Tillmen is answering....wow every question with awesome detail about Profanity.

The number one thing I miss is whatever underlines things in rooms I can interact with? This would probably hit items in my inventory that aren't from the year 2000 as well, but it looks like ncurses can underline so we can keep it to that markup possibly, since highlighting sounds pretty ugly.

I have a patch that does this (with colors; I'll look into ncurses underlines instead) and also cleans up the death window for the new death messages. I snuck a crasher in the death messages part, though, that I need to fix up before I submit a pull request. Just haven't had the time; life's a little busy.

edit: On that note, if anyone knows and can write up a quick overview of how the data for the SF popup menus work, I'd be thrilled to read it. Even when I try to log everything that gets sent to/from stormfront, it only seems to send coordinate data and stuff like 'menu item 1,3'; I can't seem to find the actual menu contents anywhere. Maybe this deserves its own thread.

Luxelle
09-04-2016, 07:19 PM
So ... er neverthemind. NOW it works. I swear, it did not work last night.

Luxelle
09-04-2016, 09:13 PM
So, the configs for the THOUGHTS, even the person's name at the beginning, is not coloring anything, anytime. It shows up as the same color of text as everything else.

Svardin: "Da Drakes Vanguard will Muster at our Headquarters in about twenty minutes fer fleet an squadron maneuvers.... (and more...)

Is the most recent thought. Here's what my config file says:



<preset id='thoughts' bg='66ccff' fg='000000'/>



and I tried making it a highlight, too ... but that's also failed:


<highlight bg='66ccff' fg='000000'>^[A-Z][a-z]+: "$</highlight>


So where did I go wrong with all of these, Please?

**

Kaldonis
09-06-2016, 09:42 AM
I have a patch that does this (with colors; I'll look into ncurses underlines instead) and also cleans up the death window for the new death messages. I snuck a crasher in the death messages part, though, that I need to fix up before I submit a pull request. Just haven't had the time; life's a little busy.

edit: On that note, if anyone knows and can write up a quick overview of how the data for the SF popup menus work, I'd be thrilled to read it. Even when I try to log everything that gets sent to/from stormfront, it only seems to send coordinate data and stuff like 'menu item 1,3'; I can't seem to find the actual menu contents anywhere. Maybe this deserves its own thread.

Sounds great. I've been using Profanity for several years now as-is so it's no rush.

I wonder for the death logs if there's anything interesting to be done. Like if I want to toggle highlights on ones that happen in certain towns or something...?

Gnomad
09-15-2016, 10:22 PM
Figured I'd throw this here from the officials since it's relevant. The nerve thing is annoying but what can you do? This made me think about adding code to try to poll nerve status from Lich, but that seemed like a lot of dependency trouble for not a lot of benefit.


In Profanity FE, the nerve injury and scar indication is not distinguished. It always looks like an injury.

I had asked Tillmen about this "bug" and he indicated to me that it was coming through the game feed that way, and he wasn't sure what hacks the Simu FEs do to get around this error. He said he considered it on a time but hadn't done anything about it.


It may be that the front-end parses the string and displays X color if "string == scar" wording and Y color if "string == wound" wording.
I know that some scars can hamper some activities--to include passive things, like experience absorption--in a similar fashion to a wound, so it may be "all wounds are wounds, even if it's an OLD wound [== scar]", all the time.


At least on the SF side, the "issue" is the XML the server sends. I've never bothered to log the wizard feed, but since Lich uses the XML feed, it's irrelevant.

Rank 2 leg wound: <image id="leftLeg" name="Scar2" cmd="cure left leg" tooltip="cure left leg" height="0" width="0"/>
Rank 2 leg scar: <image id="leftLeg" name="Injury2" cmd="cure left leg" tooltip="cure left leg" height="0" width="0"/>

vs.

Rank 2 nerve wound: <image id="nsys" name="Nsys2" cmd="cure nerves" tooltip="cure nerves" height="0" width="0"/>
Rank 2 nerve scar: <image id="nsys" name="Nsys2" cmd="cure nerves" tooltip="cure nerves" height="0" width="0"/>

It's not a bug per se. Stormfront is being told what image to load into the little picture of you on the side of your screen. It doesn't need to know whether the wound is a scar or not, just the name of the the image(s) to display on your little dude on the side of the screen. For most damage, wounds show up in red with a number from 1-3 (Injury1 - Injury3), while scars show up in orange with a number from 1-3 (Scar1 - Scar3). For nerve damage, a picture of your nervous system shows up in yellow, orange, or red, for minor, medium, major, regardless of whether it's a scar or a wound (Nsys1 - Nsys3).

The paper doll never distinguishes the two. If you have orange nerves and your radio setting is on "both", you have a rank 2 nerve, but there's no way to tell whether it's a scar or a wound without further interaction. That radio setting is actually a server-side feature, and tells the server what kind of wounds to send you: just wounds, just scars, or both. Then the server sends your client the image to display.

So, the roundabout answer: There is no hack. Everything is working as intended. Profanity is trying to add a feature (distinguishing between nerve scars and nerve wounds) that Stormfront doesn't have, and that the XML feed doesn't try support. Unsurprisingly, this doesn't work well.

To know your wounds exactly, whenever the XML reports a change in nerve wounds, Lich quietly types HEALTH (without showing the results to you) and does what Krakii suggests - it parses the wound strings to be able to tell whether Nsys2 is representing a scar or a wound this time. Profanity could do the same.

Luxelle
09-16-2016, 09:25 PM
All right, There's two things left that I can't figure out if they are working, or not.

In the xml config, thoughts show as:


<preset id='thoughts' fg='000000' bg='66ccff'/>

But thoughts are no differently colored than anything else, I know it's just the first part of the line that is supposed to be colored.

Also, the color for monsterbold shows up on the creatures, but not on GM text in other things that happen in the story window, which do show up on a StormFront monsterbolded message.

The latter may not apply to other bolded messaging, I'm not sure. But the thoughts should, right?

Thank you!
**

Gnomad
09-26-2016, 05:11 AM
I threw together a script (;drizzleback) that will put brackets around Stormfront links in any FE. Should be a help to people in this thread. Throw complaints (like the fact that the instructions always show up on run) in my script thread (http://forum.gsplayers.com/showthread.php?98882-My-minor-utility-scripts).

When life calms down, I'll get back to work on my profanity patch.