#--------------------------------------------------------------------------
#使用方法:事件内用脚本指令, 打入
# change_windowskin("素材名称")
#回复默认:
#change_windowskin
#--------------------------------------------------------------------------
$default_winskin = "Window" # 默认窗口外观
class Game_Interpreter
#--------------------------------------------------------------------------
# ● 更改窗口外观
#--------------------------------------------------------------------------
def change_windowskin(winskin=nil)
if winskin
# 设定素材名称
$game_system.windowskin_name = winskin
else
# 回复默认名称
$game_system.windowskin_name = $default_winskin
end
return true
end
end
class Game_System
#--------------------------------------------------------------------------
# ● 获取窗口外观名称
#--------------------------------------------------------------------------
def windowskin_name
if @windowskin_name == nil
return $default_winskin
else
return @windowskin_name
end
end
#--------------------------------------------------------------------------
# ● 更改窗口外观名称
#--------------------------------------------------------------------------
def windowskin_name=(winskin)
@windowskin_name = winskin
end
end
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
alias winskin_initialize initialize
def initialize(x, y, width, height)
winskin_initialize(x, y, width, height)
@windowskin_name = $game_system.windowskin_name
self.windowskin = Cache.system(@windowskin_name)
end
#--------------------------------------------------------------------------
# ● 更新窗口
#--------------------------------------------------------------------------
alias winskin_update update
def update
winskin_update
if $game_system.windowskin_name != @windowskin_name
@windowskin_name = $game_system.windowskin_name
self.windowskin = Cache.system(@windowskin_name)
end
end
end