#==============================================================================
# F10 - 变量窗口 - By芙蕾娅
#------------------------------------------------------------------------------
# ★ - 新增 ☆ - 修改 ■ - 删除 ● - 无变更
#==============================================================================
module Freya
# 初始游戏时是否显示窗口
BeginShow = false
# 变量ID
WindowVariableID = 60
# 进度最大值的变量ID
#$game_system.variable_show = true
# 为显示进度窗口,要关闭则设把true设为false
end
#==============================================================================
# ■ Game_System
#------------------------------------------------------------------------------
# 处理系统附属数据的类。保存存档和菜单的禁止状态之类的数据。
# 本类的实例请参考 $game_system 。
#==============================================================================
class Game_System
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :variable_show_text # 佣兵积分
attr_accessor :variable_show # 进度窗口是否显示
attr_accessor :variable_show_text2 # 佣兵等级
attr_accessor :variable_show_text3 # Renk
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
alias vw_initialize initialize
def initialize
vw_initialize
@variable_show_text = "佣兵积分"
@variable_show_text2 = "佣兵等级"
@variable_show = Freya::BeginShow
@variable_show_text3 = "F"
#~ if $game_variables[60].between?(50, 99) #佣兵积分达到50~99时佣兵等级升级为E
#~ @variable_show_text3 = "E"
#~ end
#~ #怎么写才不会出错啊??
end
end
#==============================================================================
# ■ Window_Variable
#------------------------------------------------------------------------------
# 显示变量窗口
#==============================================================================
class Window_Variable < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0, window_width,window_height)
unless $game_system.variable_show
self.opacity = 0
self.contents_opacity = 0
end
refresh
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
return 140
end
def window_height
return 80
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
if $game_system.variable_show
self.opacity = 255
self.contents_opacity = 255
else
self.opacity = 0
self.contents_opacity = 0
end
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_text(contents.rect, $game_variables[Freya::WindowVariableID],2)#显示佣兵积分的变量
contents.font.size = 16
draw_text(contents.rect, $game_system.variable_show_text)#显示佣兵积分字样
draw_text(contents.rect, $game_system.variable_show_text2) #显示佣兵等级字样
draw_text(contents.rect, $game_system.variable_show_text3,2) #显示Renk
#上面的文字重叠了怎么改 才行?
contents.font.size = Font.default_size
end
end
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
# 地图画面
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# ● 生成所有窗口
#--------------------------------------------------------------------------
alias vw_create_all_windows create_all_windows
def create_all_windows
vw_create_all_windows
@variable_window = Window_Variable.new
@variable_window.y = Graphics.height - @variable_window.height-150
end
end