Page 1 of 1

Howto: keep color in replace()

Posted: Thu Apr 21, 2011 4:44 pm
by Vadi
To keep colour in your replace(), just add this inbetween your select and replace functions:
Code: [show] | [select all] lua
  setBgColor(getBgColor())
  setFgColor(getFgColor())
For example, what was
Code: [show] | [select all] lua
selectString("Bob", 1)
replace("Bob the guy")
Now becomes
Code: [show] | [select all] lua
selectString("Bob", 1)
setBgColor(getBgColor())
setFgColor(getFgColor())
replace("Bob the wizard")

Re: Howto: keep color in replace()

Posted: Sun Apr 24, 2011 5:02 pm
by Rakon
What about lines that have different colours in them??

Re: Howto: keep color in replace()

Posted: Sun Apr 24, 2011 5:58 pm
by Vadi
Then this isn't applicable. If you'll be adding new text, how will a script know what colours to apply to the new wording?