note.each_line { |line|
if line =~ KMS_MiniMap::REGEX_NO_MINIMAP_NOTE # マップ非表示
@__minimap_show = false
end
}
end
#--------------------------------------------------------------------------
# ○ 表示迷你地图
#--------------------------------------------------------------------------
def minimap_show?
create_minimap_cache if @__minimap_show.nil?
return @__minimap_show
end
end
range_x.each { |x|
next unless x.between?(0, map_w)
range_y.each { |y|
next unless y.between?(0, map_h)
next if @passage_table[x, y] == 0
next if @wall_events.find { |e| e.x == x && e.y == y } # 壁
# グリッド描画サイズ算出
rect.set(0, 0, @grid_size, @grid_size)
rect.x = (x - @draw_range_begin.x) * @grid_size
rect.y = (y - @draw_range_begin.y) * @grid_size
flag = @passage_table[x, y]
if flag & 0x01 == 0 # 下通行不能
rect.height -= 1
end
if flag & 0x02 == 0 # 左通行不能
rect.x += 1
rect.width -= 1
end
if flag & 0x04 == 0 # 右通行不能
rect.width -= 1
end
if flag & 0x08 == 0 # 上通行不能
rect.y += 1
rect.height -= 1
end
bitmap.fill_rect(rect, KMS_MiniMap::FOREGROUND_COLOR)
}
}
end
#--------------------------------------------------------------------------
# ○ 移动イベントの描画
#--------------------------------------------------------------------------
def draw_map_move_event(bitmap)
rect = Rect.new(0, 0, @grid_size, @grid_size)
@move_events.each { |e|
rect.x = (e.x - @draw_range_begin.x) * @grid_size
rect.y = (e.y - @draw_range_begin.y) * @grid_size
bitmap.fill_rect(rect, KMS_MiniMap::MOVE_EVENT_COLOR)
}
end
#--------------------------------------------------------------------------
# ○ アニメーション更新
#--------------------------------------------------------------------------
def update_animation
if @showing
# フェードイン
self.opacity += 16
if opacity == 255
@showing = false
end
elsif @hiding
# フェードアウト
self.opacity -= 16
if opacity == 0
@hiding = false
end
end
end
#--------------------------------------------------------------------------
# ○ オブジェクト描画
#--------------------------------------------------------------------------
def draw_object
# 下准备
bitmap = @object_sprite.bitmap
bitmap.clear
rect = Rect.new(0, 0, @grid_size, @grid_size)
# オブジェクト描画
@object_list.each { |obj|
next unless in_draw_range?(obj.x, obj.y)
color = KMS_MiniMap::OBJECT_COLOR[obj.minimap_object_type - 1]
next if color.nil?
class Spriteset_Map
attr_reader :minimap
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias initialize_KMS_MiniMap initialize
def initialize
initialize_KMS_MiniMap
create_minimap
end
#--------------------------------------------------------------------------
# ○ ミニマップの作成
#--------------------------------------------------------------------------
def create_minimap
@minimap = Game_MiniMap.new(@tilemap)
@minimap.visible = $game_system.minimap_show && $game_map.minimap_show?
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
alias dispose_KMS_MiniMap dispose
def dispose
dispose_KMS_MiniMap
dispose_minimap
end
#--------------------------------------------------------------------------
# ○ ミニマップの解放
#--------------------------------------------------------------------------
def dispose_minimap
@minimap.dispose
@minimap = nil
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias update_KMS_MiniMap update
def update
update_KMS_MiniMap
update_minimap
end
#--------------------------------------------------------------------------
# ○ ミニマップ更新
#--------------------------------------------------------------------------
def minimap_show?
return $game_map.minimap_show? && $game_system.minimap_show
end
#--------------------------------------------------------------------------
# ○ ミニマップ更新
#--------------------------------------------------------------------------
def update_minimap
return if @minimap.nil?
# 表示切替
if minimap_show?
@minimap.visible = true
else
@minimap.visible = false
return
end
# フェード判定
case $game_map.minimap_fade
when Game_Map::MINIMAP_FADE_IN
@minimap.fadein
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
when Game_Map::MINIMAP_FADE_OUT
@minimap.fadeout
$game_map.minimap_fade = Game_Map::MINIMAP_FADE_NONE
end
@minimap.update
end
#--------------------------------------------------------------------------
# ○ ミニマップ全体をリフレッシュ
#--------------------------------------------------------------------------
def refresh_minimap
return if @minimap.nil?
@minimap.clear_passage_table_cache
@minimap.refresh
end
#--------------------------------------------------------------------------
# ○ ミニマップのオブジェクトを更新
#--------------------------------------------------------------------------
def update_minimap_object
@minimap.update_object_list unless @minimap.nil?
end
end