03-14-2014, 10:57 PM
The returned value of @text... is that the segment that will print, or the leftover text of the previously saved text (thinking the latter).
I'm at work so Pseudo-Code here:
Note that I used gsub and not gsub! so I don't actually 'CUT' the string. That would be for later when you do the printing of the message.
I'm at work so Pseudo-Code here:
Code:
old_length=@text.size
@text.gsub(/([?.!][^\n\z"])/) { "#{$1}\005[#{$game_system.message.end_delay}]" }
new_length=@text.size
printed_length = old_length - new_length