mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 21:54:58 +00:00
Added Settings::DISABLE_IVS_AND_EVS, added text replacements for gender symbols
This commit is contained in:
@@ -74,7 +74,7 @@ end
|
||||
#===============================================================================
|
||||
FORMATREGEXP = /<(\/?)(c|c2|c3|o|fn|br|fs|i|b|r|pg|pog|u|s|icon|img|ac|ar|al|outln|outln2)(\s*\=\s*([^>]*))?>/i
|
||||
|
||||
def fmtescape(text)
|
||||
def fmtEscape(text)
|
||||
if text[/[&<>]/]
|
||||
text2 = text.gsub(/&/, "&")
|
||||
text2.gsub!(/</, "<")
|
||||
@@ -84,13 +84,20 @@ def fmtescape(text)
|
||||
return text
|
||||
end
|
||||
|
||||
# Modifies text; does not return a modified copy of it.
|
||||
def fmtReplaceEscapes(text)
|
||||
text.gsub!(/</, "<")
|
||||
text.gsub!(/>/, ">")
|
||||
text.gsub!(/'/, "'")
|
||||
text.gsub!(/"/, "\"")
|
||||
text.gsub!(/&/, "&")
|
||||
text.gsub!(/&m;/, "♂")
|
||||
text.gsub!(/&f;/, "♀")
|
||||
end
|
||||
|
||||
def toUnformattedText(text)
|
||||
text2 = text.gsub(FORMATREGEXP, "")
|
||||
text2.gsub!(/</, "<")
|
||||
text2.gsub!(/>/, ">")
|
||||
text2.gsub!(/'/, "'")
|
||||
text2.gsub!(/"/, "\"")
|
||||
text2.gsub!(/&/, "&")
|
||||
fmtReplaceEscapes(text2)
|
||||
return text2
|
||||
end
|
||||
|
||||
@@ -376,13 +383,7 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight =
|
||||
# realtextStart = oldtext[0, oldtext.length - realtext.length]
|
||||
# end
|
||||
textchunks.push(text)
|
||||
textchunks.each do |chunk|
|
||||
chunk.gsub!(/</, "<")
|
||||
chunk.gsub!(/>/, ">")
|
||||
chunk.gsub!(/'/, "'")
|
||||
chunk.gsub!(/"/, "\"")
|
||||
chunk.gsub!(/&/, "&")
|
||||
end
|
||||
textchunks.each { |chunk| fmtReplaceEscapes(chunk) }
|
||||
textlen = 0
|
||||
controls.each_with_index do |control, i|
|
||||
textlen += textchunks[i].scan(/./m).length
|
||||
|
||||
Reference in New Issue
Block a user