mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Chat improvement

Open MrDadosz opened this issue 7 years ago • 29 comments

Original issue

You can't now correct a typo at the beginning of a message and you have to delete everything, write it again or send a message with a typo. In the chat should be "|" character indicating position like in the console. You should be able to change location where you're typing with left/right arrow. If this idea were to be introduced, it would also be possible to remove characters by pressing the "Delete" key (but it should delete character after "|").

Almost every game has this option. Now sometimes is better to use console than chat, Chat should work exactly like a console, but introducing only this change would be a good improvement

Summary

MTA chat system could use some tweaking to make it more user-friendly.

Requested features

  • [x] Add input history (arrow up/down keys) (PR submitted at #755)
  • [ ] Add input cursor |
    • [ ] Add ability to remove characters ahead of the cursor (delete key)
    • [ ] Add ability to move input cursor when chat input is active (arrow left/right) and add word skipping (ctrl + arrow left/right)
    • [ ] Add ability to select ((ctrl +) shift + arrow left/right, or select all using ctrl + a), copy (ctrl + c), cut (ctrl + x) and paste (ctrl + v) current input
  • [ ] Add ability to select and copy text in the chatbox using mouse (including current chat input text)
  • [ ] Add auto-completion that can be provided client-side

MrDadosz avatar Jan 04 '19 15:01 MrDadosz

you can rewrite chat yourself using dx,cef or cegui like some dayz server did it

and add features which you want

CrosRoad95 avatar Jan 04 '19 15:01 CrosRoad95

I know,I can rewrite everything but it doesn't make sense. Chat in MTA is good but it lacks several functions and you can customize it in the game's settings. That would improve every server, not only mine.

MrDadosz avatar Jan 04 '19 15:01 MrDadosz

I agree that the chat input could do with some improvements.

qaisjp avatar Jan 04 '19 16:01 qaisjp

Having done server console input improvements recently I am going to look at this one as well.

patrikjuvonen avatar Jan 04 '19 16:01 patrikjuvonen

Support for basic selection manipulation and copy / paste keyboard shortcuts would be awesome too... :wink:

4O4 avatar Jan 04 '19 17:01 4O4

I personally think chat should be totally redone with more functions for server owners to customize it.

Wolfee-J avatar Jan 04 '19 17:01 Wolfee-J

Total rewrites are unnecessary!

qaisjp avatar Jan 04 '19 17:01 qaisjp

Total rewrites of 13+ year old code are.

Wolfee-J avatar Jan 04 '19 19:01 Wolfee-J

No, it is not. It almost never is. Refactor whenever you can because before you know it you'll be breaking more than you want and you'll spend more time fixing bugs/being feature complete than you would otherwise have. As a famous man once said:

It’s important to remember that when you start from scratch there is absolutely no reason to believe that you are going to do a better job than you did the first time.

Joel Spolsky wrote a great post on this matter, I suggest you give it a read. https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/

Deltanic avatar Jan 04 '19 21:01 Deltanic

I'm sorry but that's complete bull crap no matter how you take it. Not only do yo have in mind what could be improved over the previous system but there is also more collective experience to do a newer one. Refactoring old code ends up with a very poor, and unstable product a large chunk of the time.

Wolfee-J avatar Jan 05 '19 01:01 Wolfee-J

Okay Cody. I'm sure your vast experience means more than what helpful people are trying to tell you. Clearly you're the expert.

Deltanic avatar Jan 05 '19 02:01 Deltanic

Guys, I'm not saying which one of you is right because actually you both might be - this particular topic (rewrite vs refactor of legacy codebases) has been discussed by many individuals and companies over the world with different conclusions and it is not an easy and obvious problem. There is no silver bullet, it all depends on varying factors.

It seems however that you two don't like each other and you're starting to make the atmosphere toxic which might be discouraging for many current and potential contributors :) Why so serious? There is always a way to make discussions calm, fun and definitely more fruitful. Please either change the tone of your discussion or don't discuss publicly at all (especially if you hate each other). Thanks in advance :)

4O4 avatar Jan 05 '19 11:01 4O4

Explaining more deeper. making it behave just like the console functionality as mentioned. those also are rare ways used by people using their keyboards that's much useful. CTRL + A selects everything written, CTRL/Hold + Left/Right Arrows would make you travel faster within your text, Shift + Left/Right Arrows going to select the chosen direction to select faster, CTRL + A /+/ CTRL + X going to delete the sentence and copy it. those are so useful within all servers overall if they get implemented.

Haxardous avatar Jan 05 '19 21:01 Haxardous

Up and down arrows to traverse through history (like in F8 console) would also be useful — if for example you write a message that’s too long for /say, or you've been blocked from posting a message because you did it too quickly after a previous message, instead of having to rewrite all of it, you would open up the chatbox, press up and shorten it down or post again, etc.

Addlibs avatar Jan 06 '19 16:01 Addlibs

It would be also nice that you could select & copy text that was written on the chatbox. Also, what is the function of showing the cursor when chat is open if you can't do anything with it? Weird.

PlatinMTA avatar Feb 05 '19 00:02 PlatinMTA

Can't we somehow use a CEGUI EditBox?

Pirulax avatar Mar 08 '21 23:03 Pirulax

Maybe chat should be rewritten as default resource instead? Just like scoreboard is implemented as resource. Modern multiplayer mods have chats implemented as external scripts.

By implementing it as resource scripters could easily tweak it to own needs.

lopezloo avatar Jan 18 '22 03:01 lopezloo

Maybe chat should be rewritten as default resource instead? Just like scoreboard is implemented as resource. Modern mutliplayer mods have chats implemented as external scripts.

By implementing it as resource scripters could easily tweak it to own needs.

I think that's a bad idea.

PlatinMTA avatar Jan 18 '22 03:01 PlatinMTA

Maybe chat should be rewritten as default resource instead? Just like scoreboard is implemented as resource. Modern mutliplayer mods have chats implemented as external scripts. By implementing it as resource scripters could easily tweak it to own needs.

I think that's a bad idea.

Could you elaborate on why you think it's a bad idea from your standpoint? For me personally I'm mostly concerned over the performance but at the same time it would make it more easy for servers to customize. However there is no reason either why we can't have such a resource in place that you could use over the MTA version either way.

MegadreamsBE avatar Jan 18 '22 15:01 MegadreamsBE

It would be a big change for existing servers. Certainly not something you'd do on a whim. I don't recommend refactoring it out of MTA at this point.

patrikjuvonen avatar Jan 18 '22 15:01 patrikjuvonen

Could you elaborate on why you think it's a bad idea from your standpoint? For me personally I'm mostly concerned over the performance but at the same time it would make it more easy for servers to customize. However there is no reason either why we can't have such a resource in place that you could use over the MTA version either way.

  • Firstly, performance. I'm pretty sure that a resource that manages the Chat will perform worse than the current implementation.

  • Secondly, client configurations, they already exist. We should be looking for servers to be able to change the client chat instead.

  • Thirdly, backwards compatibility, and again, performance. Making showChat into an exported function is slow. Imagine if you used in the past other functions (in my case I use one that I can't remember the name for calculating where I should put some DX elements). It would also requiere to manually add the export part for those functions, functions I will argue are used by every server.

For my liking, the scoreboard resource should be a part of MTA and not a resource. You already can create your own chat by simply using showChat(false) and making your own. We could add a copy of the chat as a resource, I wouldn't really mind that, but it'll probably be a waste of time.

It's always advised to not do this because it's slow (dxDrawText without rendertargets gets worse every character, even a simple sentence can drop 5fps). I can't see problems like these happening with the current chat implementation. Scoreboard isn't a good example either, it performs kinda poorly. It has some nice customization tho.

(I would be more inclined in making the F11 map into a resource, it behaves kinda weird sometimes, and it lacks translation making users that don't speak english ask how it works and why they can't see it even when open [they have alpha at 0%]).

PlatinMTA avatar Jan 18 '22 21:01 PlatinMTA

Bump. MTA chat lacks of those features that would greatly enhance the user experience.

We can't currently select, delete, or edit individual words within a message without having to rewrite the entire message. This can be frustrating, specially when we're used to those features on other platforms.

It will undoubtedly make MTA chat a more user-friendly and efficient.

Dryxio avatar Feb 20 '23 15:02 Dryxio

In my opinion default chat should not be part of mta, rather it should be resource. Now instead we focusing on adding features that you can't achive/are hard to achive in lua we are adding fancy feature that few people wants

CrosRoad95 avatar Feb 20 '23 15:02 CrosRoad95

a browser-based or even a CEGUI-based chat would do.

Haxardous avatar Feb 20 '23 15:02 Haxardous

a browser-based or even a CEGUI-based chat would do.

In my opinion default chat should not be part of mta, rather it should be resource.

Valid points, but how do we proceed? Let's suppose all Chat features are stripped from MTA code and a new chatbox resource is made. How to make all servers use it?

Fernando-A-Rocha avatar Feb 20 '23 15:02 Fernando-A-Rocha

Let's suppose all Chat features are stripped from MTA code and a new chatbox resource is made. How to make all servers use it?

first, make "default chatbox resource", ship it with mta, give ~3 years to migration, delete old chat from code ( make some option to test how server/client will work without build in mta chat )

CrosRoad95 avatar Feb 20 '23 15:02 CrosRoad95

Let's suppose all Chat features are stripped from MTA code and a new chatbox resource is made. How to make all servers use it?

first, make "default chatbox resource", ship it with mta, give ~3 years to migration, delete old chat from code ( make some option to test how server/client will work without build in mta chat )

Waiting for people to migrate doesn't make sense. It should automatically use that new chatbox resource in MTA servers after a certain version.

Fernando-A-Rocha avatar Feb 20 '23 15:02 Fernando-A-Rocha

Let's suppose all Chat features are stripped from MTA code and a new chatbox resource is made. How to make all servers use it?

first, make "default chatbox resource", ship it with mta, give ~3 years to migration, delete old chat from code ( make some option to test how server/client will work without build in mta chat )

Waiting for people to migrate doesn't make sense. It should automatically use that new chatbox resource in MTA servers after a certain version.

mta should not touch resources folder at all, if you don't migrate after warnings, your problem. Browsers doing the same, they have 10000x greater user base, they can affect real businesses and they giving shorter window to migrate

CrosRoad95 avatar Feb 20 '23 15:02 CrosRoad95

If we want to finally overcome this problem, then it is time to develop a suitable solution. I personally think it wouldn't be a bad idea to remove the current implementation and import it as a default resource like the scoreboard, using CEGUI.

However, the owners of the servers should be given a lot of time to make the necessary changes and this would break backwards compatibility. Maybe it's best if we decide to refactor it, but we do it within the project so that the server owners don't have to make any changes.

Nico8345 avatar Jun 19 '24 22:06 Nico8345