Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module RPG_FileTest
- def self.exist?(filename)
- dir,ext = File.dirname(filename) + '/', File.extname(filename)
- base = File.basename(filename, ext)
- if ['.png','.jpg','.bmp'].include?(ext.downcase)
- cache = defined?(Cache) ? Cache : RPG::Cache
- (cache.load_bitmap(dir,base) && true) rescue false
- elsif ['.rxdata','.rvdata','.rvdata2','.rb','.txt'].include?(ext.downcase)
- (load_data(filename) && true) rescue false
- else
- File.exist?(filename)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement