Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Functions to mimic chat input and to set cursor position in GuiMLTextEditCtrl (https://forums.graalonline.com/forums/showthread.php?t=78644)

Inverness 02-09-2008 07:01 AM

Functions to mimic chat input and to set cursor position in GuiMLTextEditCtrl
 
I've noticed in my creation of a custom chat system that things like showscriptstats don't work when setting player.chat and also the function of the text staying on what you said until you make a move doesn't work either.

I would like a function like chatinput(string) that would work the same way as if you were to type the text into the chat bar and hit enter. Basically if you did chatinput("showscriptstats") then that would display properly and if you did any other text it would stay that way until you move from your position. With this it would make the custom chat system easier to work with.

Also I'm using a GuiMLTextEditCtrl for the input in the chat system and would like a function to set the position of the cursor with in the text or simply a function to force it to the end of the line. This is because I implemented a chat input history by script and when switching the text with a previously entered text the cursor is set back at the beginning of the text. I did notice that pressing END moved the cursor to the end simply enough but it would be much simpler to have the function(s).

zokemon 02-09-2008 04:41 PM

showscriptstats calls something by use of the ChatBar.onAction() I'm pretty sure.

cbk1994 02-09-2008 05:04 PM

Couldn't you just modify ChatBar? That's what we did on Vesporia.

Inverness 02-09-2008 06:56 PM

Quote:

Originally Posted by cbkbud (Post 1374313)
Couldn't you just modify ChatBar? That's what we did on Vesporia.

Quote:

Originally Posted by Inverness
I'm using a GuiMLTextEditCtrl for the input in the chat system

Sometimes posts on Val are requiring lots of text so the MLTextEdit input is needed.

zokemon 02-09-2008 07:34 PM

Quote:

Originally Posted by Inverness (Post 1374324)
Sometimes posts on Val are requiring lots of text so the MLTextEdit input is needed.

Hmm... I don't know if it will work but you could try doing something like:
PHP Code:

new GuiMLTextEditCtrl("ChatBar") {
  
stuff();


Which should simply change the object type without removing the functions. I'm only guessing though, haven't tried it my self.

Inverness 02-09-2008 10:41 PM

I want solutions not workarounds.

cbk1994 02-09-2008 10:53 PM

Quote:

Originally Posted by Inverness (Post 1374347)
I want solutions not workarounds.

Good luck.

Admins 02-10-2008 03:40 PM

The function for the "chatinput" thing is protected and only works for privileged scripts, so that you cannot easily send a toall in the name of the player or similar stuff.
Will add the cursor-positioning in the next version

Crow 02-10-2008 03:42 PM

Quote:

Originally Posted by Stefan (Post 1374416)
The function for the "chatinput" thing is protected and only works for privileged scripts, so that you cannot easily send a toall in the name of the player or similar stuff.
Will add the cursor-positioning in the next version

Just take things like this out I guess? I would really like to see such a function.

cbk1994 02-10-2008 04:21 PM

Quote:

Originally Posted by Stefan (Post 1374416)
The function for the "chatinput" thing is protected and only works for privileged scripts, so that you cannot easily send a toall in the name of the player or similar stuff.
Will add the cursor-positioning in the next version

Just make a global IRC script added on login that you can use on any server on their IRC, or you could make guild IRC, etc.


All times are GMT +2. The time now is 10:49 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.