# ▼▲▼ XRXS20. 地名显示 1.01 ▼▲▼
# 汉化修改 by 黑暗骑士
#==============================================================================
# ■ Window_Map_Name
#------------------------------------------------------------------------------
# 这是一个显示的地图名称的窗口
#==============================================================================
class Window_Map_Name < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(460, 0, 180, 64)
self.contents = Bitmap.new(width-32, height-32)
@showing_time = 0
@text_color = Color.new(255,255,255,255) # 地名:描写文字色
end
#--------------------------------------------------------------------------
# ● 文本集
# text : 文字串显示在窗口
# align : 对齐(0 .左,1 .中心,2 .右)
#--------------------------------------------------------------------------
def set_text(text, align = 2)
# 如果文本和对准中的至少一个是从与上次不同
if text != @text or align != @align
# 重绘
self.contents.clear
@showing_time = 100
@text = text
@align = align
@actor = nil
self.contents_opacity = 255
x = 4
y = 0
self.contents.font.color = Color.new( 0, 0, 0, 192)
self.contents.draw_text(x+2, y+2, self.width - 40, 32, "-"+text+"-",align=1)
self.contents.font.color = Color.new( 64, 64, 64, 192)
self.contents.draw_text(x-1, y-1, self.width - 40, 32, "-"+text+"-", align=1)
self.contents.draw_text(x+1, y-1, self.width - 40, 32, "-"+text+"-", align=1)
self.contents.draw_text(x-1, y+1, self.width - 40, 32, "-"+text+"-", align=1)
self.contents.draw_text(x+1, y+1, self.width - 40, 32, "-"+text+"-", align=1)
self.contents.font.color = @text_color
self.contents.draw_text(x, y, self.width - 40, 32, "-"+text+"-", align=1)
else
@showing_time -= 1
if @showing_time < 16
# 开始淡出
self.contents_opacity = @showing_time * 16
elsif @showing_time <= 0
# 关闭你有一定的时间显示
self.contents.clear
end
end
self.visible = true
end
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
alias xrxs20_main main
def main
# 绘制地名窗口
@map_name_window = Window_Map_Name.new
@map_name_window.opacity = 0
# 取消
xrxs20_main
# 要释放的地方窗口的名称
@map_name_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias xrxs20_update update
def update
# 地图窗口刷新
@map_name_window.set_text($game_map.name,1)
xrxs20_update
end
end
#==============================================================================
# ■ Scene_Title
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
alias xrxs20_main main
def main
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
xrxs20_main
end
end
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ● 获取地图名称
#---------------------------------------------------------------------------
def name
$map_infos[@map_id]
end
end