mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-08-09 13:25:17 +00:00
Break up long strings automatically.
This commit is contained in:
@@ -2338,16 +2338,14 @@ class PackPartitions
|
||||
def text = getSingle(getSingle(getSingle(blk.value, 'VALUE').block, null, 'text').field, 'TEXT').text()
|
||||
|
||||
// Break up long strings into shorter chunks for PLASMA
|
||||
def chunks = text.findAll(/.{253}|.*/)
|
||||
def chunks = text.findAll(/.{253}|.*/).grep(~/.+/)
|
||||
chunks.eachWithIndex { chunk, idx ->
|
||||
if (chunk.length() > 0) {
|
||||
outIndented((idx == chunks.size()-1 && blk.@type == 'text_println') ? \
|
||||
'scriptDisplayStrNL(' : 'scriptDisplayStr(')
|
||||
emitString(chunk)
|
||||
out << ")\n"
|
||||
// Workaround for strings filling up the frame stack
|
||||
outIndented("tossStrings()\n")
|
||||
}
|
||||
outIndented((idx == chunks.size()-1 && blk.@type == 'text_println') ? \
|
||||
'scriptDisplayStrNL(' : 'scriptDisplayStr(')
|
||||
emitString(chunk)
|
||||
out << ")\n"
|
||||
// Workaround for strings filling up the frame stack
|
||||
outIndented("tossStrings()\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user