ID:2088199
 
What's the right way to do chat interfaces these days when you want it to transparently overlay the map as part of your HUD? The 4.0 controls were responsive but don't integrate well. The same thing goes for the browser control as far as I can find. The client.image + maptext approach uses winset() commands but that's really sluggish. That's what I've implemented below but the input is so sluggish that I'm looking for alternatives. Is there a better way?





Sluggish in what way? Maybe there's something under the hood that'd be tweakable.
- My first whiny bit on all this is that it feels like this is something that should be a lot easier because the last thing in the world that I want to be doing is measuring line heights and font dimensions. I know... it is what it is but "waa..." all the same..

The sluggishness could certainly be from my design. I assumed it was from the round tripping winsets.

- I'm using Kaiochao's controller library to set all the key bindings. I switch over to the Chat controller when the player hits Enter.

- I look at the key pressed and if Shift is also pressed, I lookup the offset in a listOfCaps. Then I call this bit of code.

        ChatInput(var/char)
{
m_characters += char
overlays.Remove(m_ChatInput)
m_ChatInput.maptext = m_characters
overlays.Add(m_ChatInput)
}


On my local machine, there is just enough of a delay that you can tell it's a touch behind. I figure it will only get worse over the wire so I thought to ask.


Well you can definitely reduce appearance churn by setting overlays in one shot.

I don't know if Kaio's library is using set instant=1 on the key verbs, but if it isn't, it needs to be.

But one thing I didn't realize was the issue here was that you're not using any kind of built-in control for what you type, so all of the keyboard foo has to route through the server and back. I can't imagine any way for that not to be sluggish. I was thinking that the maptext was for chat output only, not so much for input.

Obviously this is the sort of situation the webclient would excel at, but I don't have any ideas offhand on how to do this with current functionality in a way that'd be easy. It does make me wonder, though, if there'd be some value in creating some kind of special pseudo-HTML tag that maptext could use to read and include the text from a local control.
In response to Lummox JR
Lummox JR wrote:
Well you can definitely reduce appearance churn by setting overlays in one shot.

I don't know if Kaio's library is using set instant=1 on the key verbs, but if it isn't, it needs to be.
He has it on.

But one thing I didn't realize was the issue here was that you're not using any kind of built-in control for what you type, so all of the keyboard foo has to route through the server and back. I can't imagine any way for that not to be sluggish. I was thinking that the maptext was for chat output only, not so much for input.

Yeah, not concerned about the output performance. I could add a popup/slide-in dialog but it's a bit kludgy.

Obviously this is the sort of situation the webclient would excel at, but I don't have any ideas offhand on how to do this with current functionality in a way that'd be easy. It does make me wonder, though, if there'd be some value in creating some kind of special pseudo-HTML tag that maptext could use to read and include the text from a local control.





It does make me wonder, though, if there'd be some value in creating some kind of special pseudo-HTML tag that maptext could use to read and include the text from a local control.

I'd personally build an altar to you and cut the hearts out of children for the ability to embed maptext text areas and scrollpanes.

I've already got a UIlib that handles maptext-based buttons, checkboxes, dropdown lists, and tabgroups.

Having scrolling built-in to maptext somehow and having input, text selection, copying and pasting, etc. built into maptext would be pretty massive for modern-looking games.
Aye. I'm open to suggestions as to specifics on the implementation.