def map_name
return if @mapinfo[@map_id].nil?
name = @mapinfo[@map_id].name
name.gsub!(/<r:([0-9]+)>/) { "" }
name.gsub!(/<g:([0-9]+)>/) { "" }
name.gsub!(/<b:([0-9]+)>/) { "" }
name.gsub!(/<gray:([0-9]+)>/) { "" }
return name
end
alias setup_rgss1 setup
def setup(map_id)
@mapinfo = load_data("Data/MapInfos.rxdata") if @mapinfo.nil?#兼容旧存档防错
if @mapinfo[map_id]
map_name = @mapinfo[map_id].name
map_name.gsub!(/<r:(-[0-9]+)>/) { "" }
red = $1.nil? ? 0 : $1.to_i
map_name.gsub!(/<r:([0-9]+)>/) { "" }
red = $1.nil? ? 0 : $1.to_i if red == 0
map_name.gsub!(/<g:(-[0-9]+)>/) { "" }
green = $1.nil? ? 0 : $1.to_i
map_name.gsub!(/<g:([0-9]+)>/) { "" }
green = $1.nil? ? 0 : $1.to_i if green == 0
map_name.gsub!(/<b:(-[0-9]+)>/) { "" }
blue = $1.nil? ? 0 : $1.to_i
map_name.gsub!(/<b:([0-9]+)>/) { "" }
blue = $1.nil? ? 0 : $1.to_i if blue == 0
map_name.gsub!(/<gray:(-[0-9]+)>/) { "" }
gray = $1.nil? ? 0 : $1.to_i
map_name.gsub!(/<gray:([0-9]+)>/) { "" }
gray = $1.nil? ? 0 : $1.to_i if gray == 0
if red.abs + green.abs + blue.abs + gray.abs != 0
tone = Tone.new(red,green,blue,gray)
$game_screen.start_tone_change(tone, 0)
end
end
setup_rgss1(map_id)
end