Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Saving SpacesEdit (https://forums.graalonline.com/forums/showthread.php?t=134264301)

Astram 08-24-2011 04:17 AM

Saving SpacesEdit
 
Btw before reading, @ the title disregard the word Edit k.

How do you save spaces in a Multiline Edit. I mean, like the RC script editor, how when you press enter it saves the spaces you made. Like if I type
PHP Code:

function onCreated() {
  
temp."NOW WHEN I PRESS ENTER, 2 SPACES APPEAR UNDER IT AUTO";
  
temp."whatever";


So, if any of you know what I mean please help. Is there a boolean?
PHP Code:

savespaces true


fowlplay4 08-24-2011 04:49 AM

I guess you're talking about the auto-indenting that the RC's script editor already does.

Set: MLTextEditCtrlObject.autoindenting = true;

Astram 08-24-2011 04:58 AM

Quote:

Originally Posted by fowlplay4 (Post 1665078)
I guess you're talking about the auto-indenting that the RC's script editor already does.

PHP Code:

//#CLIENTSIDE
function MLTextEditCtrl.onKeyUp(keycode) {
  if (
keycode == VK_RETURN) {
    
// find the amount of spaces used in the last line
    // append the amount of spaces to the texteditctrl
  
}



Yes but, what I'm wondering is how to find the spaces and append them :P.

0PiX0 08-24-2011 05:24 AM

Quote:

Originally Posted by Astram (Post 1665081)
Yes but, what I'm wondering is how to find the spaces and append them :P.

I'm not sure if there is a better way to do it. This should work just fine.
PHP Code:

//appends all the spaces before any other text begins to the beginning of the next line
nextLine currentLine.substring(0currentLine.pos(currentLine.trim())) @ nextLine.trim(); 

e. Nevermind, as fowlplay suggested, use:
GuiMLTextEditCtrl.autoindenting - boolean - when pressing the return key, then it's automatically inserting the same number of spaces in front of the new line as in the previous line


All times are GMT +2. The time now is 01:07 AM.

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