module RWSC
# 这里设定人物名称
Rwmc = ["小明", "小红", "小黄", "大狗",]
end
class Window_rwxx < Window_Base
#----------------------------------------------------------------------------
# * 初始化
#----------------------------------------------------------------------------
def initialize
super(120, 0, Graphics.width - 120, Graphics.height)
deactivate
end
#----------------------------------------------------------------------------
# * 更新内容
#----------------------------------------------------------------------------
def refresh(command_index = 0)
contents.clear
rwxx_list = rwxx_detal(command_index)
rwxx_list.each_with_index do |text, i|
cx = 0
cy = line_height * i
draw_text(cx, cy, contents.width, line_height, text, 0)
end
end
# 设置词条明细内容
def rwxx_detal(command_index = 0)
list = []
case command_index
when 0
# 明细1--------------------------------------
if $game_variables[1] < 30
list.push(" --未解锁---")
else
list.push("手段sad发送到方式打发沙发上打发斯蒂阿斯顿发送")
list.push("芬阿斯蒂芬sad发送到发达发达但是发多少")
end
list.push(" ")
if $game_variables[1] < 80
list.push(" --未解锁---")
else
list.push("士大夫十大发收到")
end
when 1
list.push("123123123")
when 2
list.push("123123123123")
when 3
list.push("123123123")
#...以此格式往下添加
end # 明细设定结束
return list
end
end
class Window_Rwmcleft < Window_Selectable
# 设定公开变量
attr_accessor :old_index
# 初始化
def initialize
super(0, 0, 120, Graphics.height)#Graphics.width, 48)
refresh
self.activate.select(0)
end
# 高度
def window_height
fitting_height(visible_line_number)#return 48#
end
# 最大项目数
def item_max
command_list.size#return 8#
end
# 可见列数
def visible_line_number
command_list.size#return 8#
end
# 获取选项列表
def command_list
return RWSC::Rwmc
end
# 绘制项目
def draw_item(index)
rect = item_rect_for_text(index)
draw_text(rect, command_list[index])
end
end
class Rwsc < Scene_MenuBase
#--------------------------------------------------------------------------
# ● 场景开始
#--------------------------------------------------------------------------
def start
super
create_list_window
create_right_window
end
#--------------------------------------------------------------------------
# ● 创建列表
#--------------------------------------------------------------------------
def create_list_window
@list_window = Window_Rwmcleft.new
@list_window.set_handler(:cancel, method(:return_scene))
end
#--------------------------------------------------------------------------
# ● 创建内容窗口
#--------------------------------------------------------------------------
def create_right_window
@right_window = Window_rwxx.new
end
# 更新所有窗口
def update_all_windows
super
update_left_right
end
# 更新左右窗口关联
def update_left_right
return unless @list_window.old_index != @list_window.index
@list_window.old_index = @list_window.index
@right_window.refresh(@list_window.index)
end
end