TheoAllen

Balloon patch

May 7th, 2014
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.74 KB | None | 0 0
  1. class Game_Message  
  2.   Unused_Char = [
  3.   /\\$/,
  4.   /\\./,
  5.   /\\\|/,
  6.   /\\>/,
  7.   /\\</,
  8.   /\\^/,
  9.   ]
  10.  
  11.   def convert_escape_characters(text)
  12.     result = text.to_s.clone
  13.     Unused_Char.each do |regex|
  14.       result.gsub!(regex) {""}
  15.     end
  16.     result.gsub!(/\\/)            { "\e" }
  17.     result.gsub!(/\e\e/)          { "\\" }
  18.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  19.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  20.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  21.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  22.     result.gsub!(/\eC\[(\d+)\]/i) { "" }        # Destroy change color code
  23.     result.gsub!(/\eI\[(\d+)\]/i) { "      " }  # Destroy draw icon
  24.     result
  25.   end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment