neonblack

get_picture_name

Feb 17th, 2013
186
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Game_Interpreter
  2.   def get_picture_name(name, emotion)
  3.     a = Dir.entries("Graphics/Pictures").select {|i| i =~ /%\[(\d+),?\s*?(\d*?)\]#{name}-#{emotion}/}
  4.     return !a.empty? ? a[0] : nil
  5.   end
  6. end
RAW Paste Data