#==============================================================================
# F10 - 变量窗口 - By芙蕾娅
#------------------------------------------------------------------------------
# ★ - 新增 ☆ - 修改 ■ - 删除 ● - 无变更
#==============================================================================
#==============================================================================
#佣兵等级,积分显示窗口 By 雷影
#代码来自芙蕾娅变量窗口的改写!
#==============================================================================
module Freya
# 初始游戏时是否显示窗口
BeginShow = false
# 变量ID
WindowVariableID = 60
#$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 # 佣兵等级
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
alias vw_initialize initialize
def initialize
vw_initialize
@variable_show_text = "佣兵积分"
@variable_show_text2 = "佣兵等级"
@variable_show = Freya::BeginShow
#怎么写才不会出错啊??
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 150
end
def window_height
return 75
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
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
$_PS0["Window_Base_textcolor"] = 20150508
#==============================================================================
# [PS0] 通用配置模块
#==============================================================================
module PS0
module Window_Base_textcolor
Color1 = Color.new(255, 255, 255, 255)
Color2 = Color.new(128, 255, 255, 255)
Color3 = Color.new(128, 128, 255, 255)
Color4 = Color.new(255, 255, 128, 255)
Color5 = Color.new(128, 255, 128, 255)
Color6 = Color.new(255, 128, 128, 255)
Color7 = Color.new(255, 255, 0, 255)
Color8 = Color.new(255, 0, 255, 255)
Color9 = Color.new(255, 0, 0, 255)
end
end
def refresh
contents.clear
temp = $game_variables ? $game_variables[60] : []
case temp
when 0..49
color = PS0::Window_Base_textcolor::Color1
renk = "F"
when 50..99
color = PS0::Window_Base_textcolor::Color2
renk = 'E'
when 100..199
color = PS0::Window_Base_textcolor::Color3
renk = 'D'
when 200..399
color = PS0::Window_Base_textcolor::Color4
renk = 'C'
when 400..599
color = PS0::Window_Base_textcolor::Color5
renk = 'B'
when 600..799
color = PS0::Window_Base_textcolor::Color6
renk = 'A'
when 800..999
color = PS0::Window_Base_textcolor::Color7
renk = 'S'
when 1000..1200
color = PS0::Window_Base_textcolor::Color8
renk = 'SS'
else
color = PS0::Window_Base_textcolor::Color9
renk = 'SSS'
end
@variable_show_text3 = renk
draw_text(0, line_height/4, contents.width, line_height, $game_system.variable_show_text2) #显示佣兵等级文字
change_color(color) #等级文字变色
draw_text(0, line_height/4, contents.width, line_height, @variable_show_text3,2) #显示佣兵等级
change_color(Color.new(255, 255, 255))
draw_text(0, line_height*1, contents.width, line_height, $game_variables[Freya::WindowVariableID],2)#显示佣兵积分的变量
draw_text(0, line_height*1, contents.width, line_height, $game_system.variable_show_text)#显示佣兵积分字样
contents.font.size = Font.default_size
reset_font_settings
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-128 #窗口位置
end
end