设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索

怎么样让葱式菜单的存档脚本失效,换成其他的。

查看数: 8000 | 评论数: 8 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2021-2-15 17:53

正文摘要:

就是说想要让葱式菜单自带的截图存档失效,换成下面这个截图存档,看一下图片,就是不要图片上这种存档模式,而是像这个截图脚本所述的那种。 [pre lang="ruby" file="截图存档"]#================================ ...

回复

alexncf125 发表于 2021-4-4 23:00:33
最初の結果 发表于 2021-4-4 22:26
我的是这样的,怎么弄?大佬,能教教我吗?

那请你去下载最新版本替换掉旧版后, 再按2L的方法注释
https://rpg.blue/thread-476318-1-1.html
最初の結果 发表于 2021-4-4 22:28:46
PLeaseS 发表于 2021-2-16 07:14
禁用存档,然后事件写一个?
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ◇ CONG'S EASY MENU ◇ 葱式解谜用简易菜单
  4. #------------------------------------------------------------------------------
  5. # By Conwsbn
  6. # http://congrm.lofter.com/
  7. #==============================================================================

  8. $imported = {} if $imported.nil?
  9. $imported[:congs_easy_menu] = true

  10. #==============================================================================
  11. # ■ Window_Base
  12. #==============================================================================
  13. class Window_Base < Window
  14.   #--------------------------------------------------------------------------
  15.   # ● 获取统一字体设置
  16.   #--------------------------------------------------------------------------
  17.   def easy_menu_font
  18.     contents.font.name = EASY_MENU_SET::Font_name
  19.     contents.font.size = EASY_MENU_SET::Font_size
  20.     contents.font.outline = EASY_MENU_SET::Font_outline
  21.     contents.font.shadow = EASY_MENU_SET::Font_shadow
  22.     contents.font.bold = EASY_MENU_SET::Font_bold
  23.     contents.font.italic = EASY_MENU_SET::Font_italic
  24.   end
  25. end

  26. #==============================================================================
  27. # ■ Window_Help
  28. #==============================================================================
  29. class Window_Help < Window_Base
  30.   #--------------------------------------------------------------------------
  31.   # ● 初始化对象
  32.   #--------------------------------------------------------------------------
  33.   def initialize(line_number = 2, width = Graphics.width)
  34.     super(0, 0, width, fitting_height(line_number))
  35.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  36.     self.opacity = EASY_MENU_SET::HELP_opacity
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 设置内容
  40.   #--------------------------------------------------------------------------
  41.   def set_text(text)
  42.     text.gsub!(/\\n/i) { "\n" }
  43.     if text != @text
  44.       @text = text
  45.       refresh
  46.     end
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 清除
  50.   #--------------------------------------------------------------------------
  51.   def clear
  52.     set_text("")
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 设置物品
  56.   #     item : 技能、物品等
  57.   #--------------------------------------------------------------------------
  58.   def set_item(item)
  59.     set_text(item ? item.description : "")
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 绘制带有控制符的文本内容
  63.   #--------------------------------------------------------------------------
  64.   def draw_text_ex(x, y, text)
  65.     reset_item_font_settings
  66.     text = convert_escape_characters(text)
  67.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  68.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● 物品帮助字体设置
  72.   #--------------------------------------------------------------------------
  73.   def reset_item_font_settings
  74.     return if @text_line
  75.     contents.font.name = EASY_MENU_SET::HELP_name
  76.     contents.font.size = EASY_MENU_SET::HELP_size
  77.     contents.font.outline = EASY_MENU_SET::HELP_outline
  78.     contents.font.shadow = EASY_MENU_SET::HELP_shadow
  79.     contents.font.bold = EASY_MENU_SET::HELP_bold
  80.     contents.font.italic = EASY_MENU_SET::HELP_italic
  81.     v = EASY_MENU_SET::HELP_color
  82.     change_color(Color.new(v[0], v[1], v[2]))
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 获取文字颜色
  86.   #--------------------------------------------------------------------------
  87.   def text_color(n)
  88.     v = EASY_MENU_SET::HELP_color
  89.     return Color.new(v[0], v[1], v[2]) if n == 0
  90.     return windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● 处理普通文字
  94.   #--------------------------------------------------------------------------
  95.   def process_normal_character(c, pos)
  96.     if (pos[:x] + contents.text_size(c).width) > contents.width
  97.       @text_line = true
  98.       process_new_line(c, pos)
  99.       @text_line = false
  100.       pos[:height] = calc_line_height(c)
  101.     end
  102.     text_width = text_size(c).width
  103.     draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
  104.     pos[:x] += text_width
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 刷新
  108.   #--------------------------------------------------------------------------
  109.   def refresh
  110.     contents.clear
  111.     draw_text_ex(4, 0, @text)
  112.   end
  113. end

  114. #==============================================================================
  115. # ■ Window_MenuCommand
  116. #==============================================================================
  117. class Window_MenuCommand < Window_Command
  118.   #--------------------------------------------------------------------------
  119.   # ● 初始化指令选择位置(类方法)
  120.   #--------------------------------------------------------------------------
  121.   def self.init_command_position(type = nil)
  122.     @@last_command_symbol = type
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● 初始化对象
  126.   #--------------------------------------------------------------------------
  127.   def initialize(sub = false)
  128.     @sub = sub
  129.     super(-24, EASY_MENU_SET::COMMAND[1])
  130.     self.opacity = 0
  131.     self.active = false
  132.     @show = false
  133.     @move_rx = @sub_ry = 0
  134.     @last_index = @index
  135.     update_placement unless @sub
  136.     select_last
  137.     refresh
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 获取标准的边距尺寸
  141.   #--------------------------------------------------------------------------
  142.   def standard_padding
  143.     return 0
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 显示动画前的设定
  147.   #--------------------------------------------------------------------------
  148.   def update_placement
  149.     self.x = -24 - window_width
  150.     self.contents_opacity = 0
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 获取窗口的宽度
  154.   #--------------------------------------------------------------------------
  155.   def window_width
  156.     return EASY_MENU_SET::COMMAND[2] + 24 + 24
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● 获取项目的宽度
  160.   #--------------------------------------------------------------------------
  161.   def item_width
  162.     width - 24
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● 获取间隔距离
  166.   #--------------------------------------------------------------------------
  167.   def line_spacing
  168.     return EASY_MENU_SET::COMMAND[4]
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● 获取行高
  172.   #--------------------------------------------------------------------------
  173.   def line_height
  174.     return EASY_MENU_SET::COMMAND[3] + line_spacing
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● 获取指令名称
  178.   #--------------------------------------------------------------------------
  179.   def set_command_name(v)
  180.     @name = []
  181.     for i in 0...EASY_MENU_SET::BUTTON.size
  182.       name = Vocab::item     if v[i][4] == :item
  183.       name = Vocab::key_item if v[i][4] == :key_item
  184.       name = Vocab::save     if v[i][4] == :save
  185.       name = Vocab::continue if v[i][4] == :continue
  186.       name = Vocab::game_end if v[i][4] == :game_end
  187.       @name[i] = v[i][1] ? v[i][1] : name
  188.     end
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● 获取显示状态
  192.   #--------------------------------------------------------------------------
  193.   def set_command_enabled(v)
  194.     @enabled = []
  195.     for i in 0...EASY_MENU_SET::BUTTON.size
  196.       enabled = main_commands_enabled         if v[i][4] == :item
  197.       enabled = main_commands_enabled         if v[i][4] == :key_item
  198.       enabled = save_enabled                  if v[i][4] == :save
  199.       enabled = DataManager.save_file_exists? if v[i][4] == :continue
  200.       enabled = true                          if v[i][4] == :game_end
  201.       @enabled[i] = enabled
  202.     end
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● 获取指令图标
  206.   #--------------------------------------------------------------------------
  207.   def set_command_icon(v)
  208.     @icon = []
  209.     for i in 0...EASY_MENU_SET::BUTTON.size
  210.       @icon[i] = v[i][2] if v[i][2]
  211.     end
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ● 获取选项的图标
  215.   #--------------------------------------------------------------------------
  216.   def command_icon(index)
  217.     @list[index][:ext]
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● 生成指令列表
  221.   #--------------------------------------------------------------------------
  222.   def make_command_list
  223.     v = EASY_MENU_SET::BUTTON
  224.     set_command_name(v)
  225.     set_command_icon(v)
  226.     set_command_enabled(v)
  227.     for i in 0...EASY_MENU_SET::BUTTON.size
  228.       add_command(@name[i], v[i][4], @enabled[i], @icon[i]) if v[i][0] or @sub
  229.     end
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ● 刷新
  233.   #--------------------------------------------------------------------------
  234.   def refresh
  235.     #clear_command_list
  236.     #make_command_list
  237.     create_contents
  238.     contents.clear
  239.     draw_all_items
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● 绘制项目
  243.   #--------------------------------------------------------------------------
  244.   def draw_item(index)
  245.     return if @sub && @index != index
  246.     easy_menu_font
  247.     rect = item_rect_for_text(index)
  248.     t_size = text_size(command_name(index))
  249.     mx = @index == index ? @sub ? 0 : @move_rx : 0
  250.     my = @sub ? @sub_ry : 0
  251.     ix = item_width - t_size.width - 28 + mx
  252.     iy = (line_height - t_size.height) / 2 + my
  253.     draw_background(index, rect, mx, my)
  254.     rect.x -= 24
  255.     rect.y -= (line_spacing / 2)
  256.     enabled = command_enabled?(index)
  257.     change_color(item_color(index), enabled)
  258.     rt = [rect.x + mx, rect.y + my, rect.width, rect.height]
  259.     draw_text(rt[0], rt[1], rt[2], rt[3], command_name(index), 2)
  260.     draw_icon(command_icon(index), rect.x + ix, rect.y + iy, enabled)
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 绘制底纹
  264.   #--------------------------------------------------------------------------
  265.   def draw_background(index, rect, x, y)
  266.     lh = line_height - line_spacing
  267.     bit = Cache.system(EASY_MENU_SET::COMMAND[0])
  268.     rx = bit.width - item_width
  269.     rect1 = Rect.new(rx, 0, item_width, 12)
  270.     rect2 = Rect.new(rx, 12, item_width, 12)
  271.     rect3 = Rect.new(rx, 36 - 12, item_width, 12)
  272.     d_rect = Rect.new(rect.x + x, rect.y + 12 + y, item_width, lh - 24)
  273.     self.contents.blt(rect.x + x, rect.y + y, bit, rect1)
  274.     self.contents.stretch_blt(d_rect, bit, rect2)
  275.     self.contents.blt(rect.x + x, rect.y + lh - 12 + y, bit, rect3)
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ● 字体颜色扩展
  279.   #--------------------------------------------------------------------------
  280.   def item_color(index)
  281.     co = EASY_MENU_SET::BUTTON[index][3]
  282.     return Color.new(co[0], co[1], co[2]) if @index == index
  283.     return Color.new(co[0], co[1], co[2], 200)
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ● 获取项目的绘制矩形
  287.   #--------------------------------------------------------------------------
  288.   def item_rect(index)
  289.     index = 0 if @sub
  290.     rect = Rect.new
  291.     rect.width = 4
  292.     rect.height = 24
  293.     rect.x = index % col_max * (item_width + spacing) + 32
  294.     rect.y = index / col_max * item_height + 4
  295.     rect
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● 获取项目的绘制矩形(内容用)
  299.   #--------------------------------------------------------------------------
  300.   def item_rect_for_text(index)
  301.     index = 0 if @sub
  302.     rect = Rect.new
  303.     rect.width = item_width
  304.     rect.height = item_height
  305.     rect.x = index % col_max * (item_width + spacing)
  306.     rect.y = index / col_max * item_height
  307.     rect
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● 展开动画的标志
  311.   #--------------------------------------------------------------------------
  312.   def show=(show)
  313.     if @show != show
  314.       @show = show
  315.     end
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 获取动画的标志
  319.   #--------------------------------------------------------------------------
  320.   def show
  321.     return @show
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● 更新画面
  325.   #--------------------------------------------------------------------------
  326.   def update
  327.     super
  328.     if @last_index != @index && !@show
  329.       @move_rx = 0
  330.       @last_index = @index
  331.     end
  332.     update_button if Input.dir4 > 0 or @move_rx < 24
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 按钮的改变动画
  336.   #--------------------------------------------------------------------------
  337.   def update_button
  338.     @move_rx += 4 if @move_rx < 24
  339.     refresh
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ● 按钮的还原动画
  343.   #--------------------------------------------------------------------------
  344.   def hide_button
  345.     @move_rx -= 4 if @move_rx > 0
  346.     refresh
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● 展开动画
  350.   #--------------------------------------------------------------------------
  351.   def open_button_window
  352.     self.x += (window_width + 24) / EASY_MENU_SET::TIME
  353.     self.contents_opacity += 255 / EASY_MENU_SET::TIME
  354.     refresh
  355.     @show = false if self.x >= -24
  356.     self.x = -24 if !@show
  357.     self.contents_opacity = 255 if !@show
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ● 关闭动画
  361.   #--------------------------------------------------------------------------
  362.   def close_button_window
  363.     @show = false if self.contents_opacity <= 0
  364.     if @move_rx > 0
  365.       hide_button
  366.     else
  367.       self.x -= (window_width + 24) / EASY_MENU_SET::TIME
  368.       self.contents_opacity -= 255 / EASY_MENU_SET::TIME
  369.       refresh
  370.     end
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● 进入子菜单的关闭动画
  374.   #--------------------------------------------------------------------------
  375.   def close_window_to_sub
  376.     if @move_rx > 0
  377.       hide_button
  378.       @sub_ry = @index / col_max * item_height
  379.     else
  380.       cursor_rect.empty
  381.       @show = false if @sub_ry <= 0
  382.       @sub_ry = 0 if !@show
  383.       @sub = true
  384.       @sub_ry = [(@sub_ry - ((EASY_MENU_SET::COMMAND[3] * index)) / 6), 0].max
  385.       refresh
  386.     end
  387.   end
  388. end

  389. #==============================================================================
  390. # ■ Scene_MenuBase
  391. #==============================================================================
  392. class Scene_MenuBase < Scene_Base
  393.   #--------------------------------------------------------------------------
  394.   # ● 结束处理
  395.   #--------------------------------------------------------------------------
  396.   alias easy_menu_terminate terminate
  397.   def terminate
  398.     easy_menu_terminate
  399.     dispose_rim
  400.     dispose_actor_cg
  401.     dispose_sub_button
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 生成背景
  405.   #--------------------------------------------------------------------------
  406.   def create_background
  407.     wall = EASY_MENU_SET::WALLPAPER
  408.     co = EASY_MENU_SET::BACKGROUND
  409.     @background_sprite = Sprite.new
  410.     bitmap = wall ? Cache.system(wall) : SceneManager.background_bitmap
  411.     @background_sprite.bitmap = bitmap
  412.     @background_sprite.color.set(co[0], co[1], co[2], co[3]) unless wall
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 绘制次背景图片
  416.   #--------------------------------------------------------------------------
  417.   def create_rim_background(bitmap, x, y)
  418.     @rim_sprite = Sprite.new
  419.     @rim_sprite.bitmap = Cache.system(bitmap) if bitmap
  420.     @rim_sprite.x = x; @rim_sprite.y = y
  421.     @rim_sprite.z = @background_sprite.z
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ● 释放次背景图片
  425.   #--------------------------------------------------------------------------
  426.   def dispose_rim
  427.     return if !@rim_sprite
  428.     @rim_sprite.bitmap.dispose
  429.     @rim_sprite.dispose
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 生成立绘精灵
  433.   #--------------------------------------------------------------------------
  434.   def create_actor_cg
  435.     v = EASY_MENU_SET::CG
  436.     return unless v[0]
  437.     @actor_cg = Sprite.new
  438.     @actor_cg.bitmap = Cache.system(v[0])
  439.     @actor_cg.x = v[1] + 2 * 7
  440.     @actor_cg.y = v[2]
  441.   end
  442.   #--------------------------------------------------------------------------
  443.   # ● 立绘的坐标判断
  444.   #--------------------------------------------------------------------------
  445.   def cg_x
  446.     v = EASY_MENU_SET::CG
  447.     return v[3] if v[4] == :l
  448.     return -(v[3]) if v[4] == :r
  449.     return 0
  450.   end
  451.   #--------------------------------------------------------------------------
  452.   # ● 释放立绘精灵
  453.   #--------------------------------------------------------------------------
  454.   def dispose_actor_cg
  455.     return if !@actor_cg
  456.     @actor_cg.bitmap.dispose
  457.     @actor_cg.dispose
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ● 展开动画的预设坐标
  461.   #--------------------------------------------------------------------------
  462.   def set_menu_xy
  463.     v = EASY_MENU_SET::CG
  464.     xx = 0
  465.     xx = -(EASY_MENU_SET::TIME * v[3]) if v[4] == :l
  466.     xx = EASY_MENU_SET::TIME * v[3] if v[4] == :r
  467.     @actor_cg.x = v[1] + xx
  468.     @actor_cg.opacity = 0
  469.     @rim_sprite.opacity = 0 if @rim_sprite
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # ● 重绘内用小标题
  473.   #--------------------------------------------------------------------------
  474.   def create_sub_button
  475.     @sub_window = Window_MenuCommand.new(true)
  476.     @sub_window.z = 300
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● 释放内用小标题
  480.   #--------------------------------------------------------------------------
  481.   def dispose_sub_button
  482.     @sub_window.dispose if @sub_window
  483.   end
  484. end

  485. #==============================================================================
  486. # ■ Scene_Menu
  487. #==============================================================================
  488. class Scene_Menu < Scene_MenuBase
  489.   #--------------------------------------------------------------------------
  490.   # ● 开始处理
  491.   #--------------------------------------------------------------------------
  492.   def start
  493.     super
  494.     v = EASY_MENU_SET::MENU_RIM
  495.     create_rim_background(v[0], v[1], v[2]) if v[0]
  496.     create_actor_cg
  497.     create_command_window
  498.     set_menu_xy
  499.     @sub_show = false
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ● 开始后处理
  503.   #--------------------------------------------------------------------------
  504.   def post_start
  505.     super
  506.     @command_window.show = true
  507.     begin
  508.       @actor_cg.x += cg_x
  509.       @actor_cg.opacity += (255 / EASY_MENU_SET::TIME)
  510.       @rim_sprite.opacity += (255 / EASY_MENU_SET::TIME) if @rim_sprite
  511.       @command_window.open_button_window
  512.       Graphics.update
  513.     end until @command_window.show == false
  514.     @command_window.activate
  515.     @actor_cg.opacity = 255
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ● 结束前处理
  519.   #--------------------------------------------------------------------------
  520.   def pre_terminate
  521.     super
  522.     t = 0
  523.     @command_window.show = true
  524.     begin
  525.       if @sub_show
  526.         t += 1 if t <= 6
  527.         @actor_cg.x += 2 if t <= 6
  528.         @command_window.close_window_to_sub
  529.       else
  530.         @actor_cg.x += -(cg_x)
  531.         @actor_cg.opacity -= 255 / EASY_MENU_SET::TIME
  532.         @rim_sprite.opacity -= 255 / EASY_MENU_SET::TIME if @rim_sprite
  533.         @command_window.close_button_window
  534.       end
  535.       Graphics.update
  536.     end until @command_window.show == false
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # ● 生成指令窗口
  540.   #--------------------------------------------------------------------------
  541.   def create_command_window
  542.     v = EASY_MENU_SET::BUTTON
  543.     @command_window = Window_MenuCommand.new
  544.     for i in 0...EASY_MENU_SET::BUTTON.size
  545.       type = :command_item     if v[i][4] == :item
  546.       type = :command_key_item if v[i][4] == :key_item
  547.       type = :command_save     if v[i][4] == :save
  548.       type = :command_load     if v[i][4] == :continue
  549.       type = :command_game_end if v[i][4] == :game_end
  550.       @command_window.set_handler(v[i][4], method(type)) if v[i][0]
  551.     end
  552.     @command_window.set_handler(:cancel,    method(:return_scene))
  553.   end
  554.   #--------------------------------------------------------------------------
  555.   # ● 指令“物品”
  556.   #--------------------------------------------------------------------------
  557.   def command_item
  558.     @sub_show = true
  559.     SceneManager.call(Scene_Item)
  560.     SceneManager.scene.prepare(:item)
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # ● 指令“贵重物品”
  564.   #--------------------------------------------------------------------------
  565.   def command_key_item
  566.     @sub_show = true
  567.     SceneManager.call(Scene_Item)
  568.     SceneManager.scene.prepare(:key_item)
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 指令“存档”
  572.   #--------------------------------------------------------------------------
  573.   def command_save
  574.     @sub_show = true
  575.     SceneManager.call(Scene_Save)
  576.   end
  577.   #--------------------------------------------------------------------------
  578.   # ● 指令“读档”
  579.   #--------------------------------------------------------------------------
  580.   def command_load
  581.     @sub_show = true
  582.     SceneManager.call(Scene_Load)
  583.   end
  584. end



  585. #==============================================================================
  586. # ■ SceneManager
  587. #==============================================================================
  588. module SceneManager
  589.   #--------------------------------------------------------------------------
  590.   # ● 模块的实例变量
  591.   #--------------------------------------------------------------------------
  592.   @save_bitmap = nil                # 存档用截图
  593.   #--------------------------------------------------------------------------
  594.   # ● 生成背景用的场景截图
  595.   #--------------------------------------------------------------------------
  596.   def self.snapshot_for_background(bitmap_blue = true)
  597.     @background_bitmap.dispose if @background_bitmap
  598.     @background_bitmap = Graphics.snap_to_bitmap
  599.     @background_bitmap.blur if bitmap_blue
  600.   end
  601.   #--------------------------------------------------------------------------
  602.   # ● 生成存档内的截图
  603.   #--------------------------------------------------------------------------
  604.   def self.snapshot_for_save_bitmap
  605.     v = EASY_MENU_SET::FILES_DETAILS_DATA
  606.     @save_bitmap.dispose if @save_bitmap
  607.     @save_bitmap = Bitmap.new(v[0][3], v[0][4])
  608.     rect = Rect.new(0, 0, v[0][3], v[0][4])
  609.     rect.x = $game_player.screen_x - rect.width / 2
  610.     rect.y = $game_player.screen_y - rect.height / 2 - 12
  611.     bitmap = Graphics.snap_to_bitmap
  612.     @save_bitmap.blt(0, 0, bitmap, rect)
  613.     bitmap.dispose
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # ● 获取存档内的截图
  617.   #--------------------------------------------------------------------------
  618.   def self.saves_bitmap
  619.     @save_bitmap
  620.   end
  621. end

  622. #==============================================================================
  623. # ■ Scene_Map
  624. #==============================================================================
  625. class Scene_Map < Scene_Base
  626.   #--------------------------------------------------------------------------
  627.   # ● 结束处理
  628.   #--------------------------------------------------------------------------
  629.   def terminate
  630.     super
  631.     type = EASY_MENU_SET::BACKGROUND[4]
  632.     type = true if SceneManager.scene_is?(Scene_Battle)
  633.     SceneManager.snapshot_for_background(type)
  634.     SceneManager.snapshot_for_save_bitmap
  635.     dispose_spriteset
  636.     perform_battle_transition if SceneManager.scene_is?(Scene_Battle)
  637.   end
  638. end


  639. #==============================================================================
  640. # ★ 物品界面
  641. #==============================================================================
  642. #==============================================================================
  643. # ■ Window_ItemList
  644. #==============================================================================
  645. class Window_ItemList < Window_Selectable
  646.   #--------------------------------------------------------------------------
  647.   # ● 初始化对象
  648.   #--------------------------------------------------------------------------
  649.   def initialize(x, y, width, height)
  650.     super
  651.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  652.     self.opacity = EASY_MENU_SET::ITEMLIST[2]
  653.     @category = :none
  654.     @data = []
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # ● 获取标准的边距尺寸
  658.   #--------------------------------------------------------------------------
  659.   def standard_padding
  660.     return 16
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # ● 获取列数
  664.   #--------------------------------------------------------------------------
  665.   def col_max
  666.     return 1
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # ● 绘制项目
  670.   #--------------------------------------------------------------------------
  671.   alias easy_menu_draw_item draw_item
  672.   def draw_item(index)
  673.     easy_menu_font
  674.     easy_menu_draw_item(index)
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # ● 绘制物品个数
  678.   #--------------------------------------------------------------------------
  679.   def draw_item_number(rect, item)
  680.     return if $game_party.item_number(item) <= 1
  681.     draw_text(rect, sprintf("%02d", $game_party.item_number(item)), 2)
  682.   end
  683.   #--------------------------------------------------------------------------
  684.   # ● 绘制物品名称
  685.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  686.   #--------------------------------------------------------------------------
  687.   def draw_item_name(item, x, y, enabled = true, width = 172)
  688.     return unless item
  689.     draw_icon(item.icon_index, x, y, enabled)
  690.     change_color(normal_color, enabled)
  691.     draw_text_ex(x + 24, y, item.name)
  692.     #draw_text(x + 24, y, width, line_height, item.name)
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ● 重置字体设置
  696.   #--------------------------------------------------------------------------
  697.   def reset_font_settings
  698.     change_color(normal_color)
  699.     easy_menu_font
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # ● 更新帮助内容
  703.   #--------------------------------------------------------------------------
  704.   def update_help
  705.     @help_window.set_item(item)
  706.     @big_icon.set_item(item.big_icon) if EASY_MENU_SET::BIGICON[0]
  707.   end
  708.   #--------------------------------------------------------------------------
  709.   # ● 设置物品窗口
  710.   #--------------------------------------------------------------------------
  711.   def big_icon=(big_icon)
  712.     @big_icon = big_icon
  713.     update
  714.   end
  715. end

  716. #==============================================================================
  717. # ■ BIG ICON
  718. #==============================================================================
  719. module Cache
  720.   def self.bigicon(filename)
  721.     load_bitmap(EASY_MENU_SET::BIGICON_Cache, filename)
  722.   end
  723. end

  724. #==============================================================================
  725. # ■ RPG::BaseItem
  726. #==============================================================================
  727. class RPG::BaseItem
  728.   #--------------------------------------------------------------------------
  729.   # ● 获取大图标
  730.   #--------------------------------------------------------------------------
  731.   def big_icon
  732.     self.note =~ /\<BigIcon (\w+)\>/i
  733.     $1.nil? ? "" : $1
  734.   end
  735. end

  736. #==============================================================================
  737. # ■ Window_Big_icon
  738. #==============================================================================
  739. class Window_Big_icon < Window_Base
  740.   #--------------------------------------------------------------------------
  741.   # ● 初始化对象
  742.   #--------------------------------------------------------------------------
  743.   def initialize(x, y, width, height)
  744.     super(x, y, width, height)
  745.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  746.     self.opacity = EASY_MENU_SET::BIGICON[6]
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # ● 设置内容
  750.   #--------------------------------------------------------------------------
  751.   def set_item(icon)
  752.     if icon != @icon
  753.       contents.clear
  754.       bitmap = Cache.bigicon(icon)
  755.       x = (contents.width - bitmap.width) / 2
  756.       y = (contents.height - bitmap.height) / 2
  757.       rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  758.       contents.blt(x, y, bitmap, rect)
  759.       @icon = icon
  760.     end
  761.   end
  762. end

  763. #==============================================================================
  764. # ■ Scene_ItemBase
  765. #==============================================================================
  766. class Scene_ItemBase < Scene_MenuBase
  767.   #--------------------------------------------------------------------------
  768.   # ● 生成角色窗口
  769.   #--------------------------------------------------------------------------
  770.   def create_actor_window
  771.     @actor_window = Window_MenuActor.new
  772.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  773.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  774.   end
  775.   #--------------------------------------------------------------------------
  776.   # ● 显示子窗口
  777.   #--------------------------------------------------------------------------
  778.   alias easy_menu_show_sub_window show_sub_window
  779.   def show_sub_window(window)
  780.     window.y = (Graphics.height - @actor_window.height) / 2
  781.     easy_menu_show_sub_window(window)
  782.     @actor_window.z = 200
  783.   end
  784. end

  785. #==============================================================================
  786. # ■ Scene_Item
  787. #==============================================================================
  788. class Scene_Item < Scene_ItemBase
  789.   #--------------------------------------------------------------------------
  790.   # ● 预处理
  791.   #--------------------------------------------------------------------------
  792.   def prepare(mode = :item)
  793.     @mode = mode
  794.   end
  795.   #--------------------------------------------------------------------------
  796.   # ● 开始处理
  797.   #--------------------------------------------------------------------------
  798.   def start
  799.     super
  800.     v = EASY_MENU_SET::ITEM_RIM
  801.     create_rim_background(v[0], v[1], v[2]) if v[0]
  802.     create_actor_cg unless EASY_MENU_SET::BIGICON[0]
  803.     create_help_window
  804.     create_big_icon_window if EASY_MENU_SET::BIGICON[0]
  805.     create_item_window
  806.     create_sub_button
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● 生成物品窗口
  810.   #--------------------------------------------------------------------------
  811.   def create_item_window
  812.     sp = EASY_MENU_SET::COMMAND[1]
  813.     iy = sp + EASY_MENU_SET::COMMAND[3] - 8
  814.     ih = Graphics.height - @help_window.height - sp - iy
  815.     @item_window = Window_ItemList.new(sp, iy, @help_window.width, ih)
  816.     @item_window.category = @mode
  817.     @item_window.viewport = @viewport
  818.     @item_window.help_window = @help_window
  819.     @item_window.big_icon = @big_icon_window if EASY_MENU_SET::BIGICON[0]
  820.     @item_window.set_handler(:ok,     method(:on_item_ok))
  821.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  822.     @item_window.index = 0
  823.     @item_window.activate
  824.   end
  825.   #--------------------------------------------------------------------------
  826.   # ● 生成帮助窗口
  827.   #--------------------------------------------------------------------------
  828.   def create_help_window
  829.     sp = EASY_MENU_SET::COMMAND[1]
  830.     v = EASY_MENU_SET::ITEMLIST
  831.     w = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  832.     @help_window = Window_Help.new(v[1], w)
  833.     @help_window.viewport = @viewport
  834.     @help_window.x = sp
  835.     @help_window.y = Graphics.height - @help_window.height - sp
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # ● 生成物品大图标
  839.   #--------------------------------------------------------------------------
  840.   def create_big_icon_window
  841.     sp = EASY_MENU_SET::COMMAND[1]
  842.     v = EASY_MENU_SET::BIGICON
  843.     b = []
  844.     if v[1]
  845.       b[0] = @help_window.width + sp
  846.       b[1] = sp + EASY_MENU_SET::COMMAND[3] - 8
  847.       b[2] = Graphics.width - b[0] - sp
  848.       b[3] = Graphics.height - b[1] - sp
  849.     else
  850.       b = [v[2], v[3], v[4], v[5]]
  851.     end
  852.     @big_icon_window = Window_Big_icon.new(b[0], b[1], b[2], b[3])
  853.     @big_icon_window.viewport = @viewport
  854.   end
  855.   #--------------------------------------------------------------------------
  856.   # ● 物品“取消”
  857.   #--------------------------------------------------------------------------
  858.   def on_item_cancel
  859.     @item_window.unselect
  860.     return_scene
  861.   end
  862. end


  863. #==============================================================================
  864. # ★ 存档界面
  865. #==============================================================================
  866. #==============================================================================
  867. # ■ Window_SaveFileList
  868. #------------------------------------------------------------------------------
  869. #  存档的选项窗口(左)
  870. #==============================================================================
  871. class Window_SaveFileList < Window_Selectable
  872.   #--------------------------------------------------------------------------
  873.   # ● 初始化对象
  874.   #--------------------------------------------------------------------------
  875.   def initialize(x, y, width, height)
  876.     super
  877.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  878.     self.opacity = EASY_MENU_SET::FILESLIST[4]
  879.     @symbol = nil
  880.     refresh
  881.     activate
  882.   end
  883.   #--------------------------------------------------------------------------
  884.   # ● 获取可显示的存档数目
  885.   #--------------------------------------------------------------------------
  886.   def visible_max
  887.     return EASY_MENU_SET::FILESLIST[1]
  888.   end
  889.   #--------------------------------------------------------------------------
  890.   # ● 获取项目的高度
  891.   #--------------------------------------------------------------------------
  892.   def item_height
  893.     (height - standard_padding * 2) / visible_max
  894.   end
  895.   #--------------------------------------------------------------------------
  896.   # ● 存档数量最大值
  897.   #--------------------------------------------------------------------------
  898.   def item_max
  899.     return EASY_MENU_SET::FILES_MAX
  900.   end
  901.   #--------------------------------------------------------------------------
  902.   # ● 绘制项目
  903.   #--------------------------------------------------------------------------
  904.   def draw_item(index)
  905.     header = DataManager.load_header(index)
  906.     rect = item_rect_for_text(index)
  907.     ry = (item_height - line_height) / 2
  908.     easy_menu_font
  909.     v = EASY_MENU_SET::FILESLIST
  910.     change_color(Color.new(v[3][0][0], v[3][0][1], v[3][0][2]), header)
  911.     icon_id = header ? v[2][1] : v[2][0]
  912.     draw_icon(icon_id, rect.x + 4, rect.y + ry)
  913.     text = @symbol == :save ? EASY_MENU_SET::SAVING : EASY_MENU_SET::LOADING
  914.     ing = @index == index && @symbol
  915.     name = ing ? text : (Vocab::File + " #{index + 1}")
  916.     draw_text(rect.x + 28, rect.y + ry, rect.width, line_height, name)
  917.     change_color(Color.new(v[3][1][0], v[3][1][1], v[3][1][2]), header)
  918.     draw_playtime(header, rect.x - 4, rect.y + ry, rect.width, 2)
  919.   end
  920.   #--------------------------------------------------------------------------
  921.   # ● 绘制游戏时间
  922.   #--------------------------------------------------------------------------
  923.   def draw_playtime(header, x, y, width, align)
  924.     text = header ? header[:playtime_s] : "—:—:—"
  925.     draw_text(x, y, width, line_height, text, 2)
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● 设置选择状态
  929.   #--------------------------------------------------------------------------
  930.   def set_files(symbol)
  931.     @symbol = symbol
  932.     refresh
  933.   end
  934. end


  935. #==============================================================================
  936. # ■ Window_FilesDetails
  937. #------------------------------------------------------------------------------
  938. #  存档的详细窗口(右)
  939. #==============================================================================
  940. class Window_FilesDetails < Window_Base
  941.   #--------------------------------------------------------------------------
  942.   # ● 初始化对象
  943.   #--------------------------------------------------------------------------
  944.   def initialize(x, y, width, height)
  945.     super(x, y, width, height)
  946.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  947.     self.opacity = EASY_MENU_SET::FILES_DETAILS[6]
  948.     @bitmaps = []
  949.     @header = []
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● 释放
  953.   #--------------------------------------------------------------------------
  954.   def dispose
  955.     for bitmap in @bitmaps
  956.       next if bitmap == nil or bitmap.disposed?
  957.       bitmap.dispose
  958.     end
  959.     super
  960.   end
  961.   #--------------------------------------------------------------------------
  962.   # ● 设置选择状态
  963.   #--------------------------------------------------------------------------
  964.   def set_select(select)
  965.     return if @select == select
  966.     @select = select
  967.     refresh(@select)
  968.   end
  969.   #--------------------------------------------------------------------------
  970.   # ● 读取文件
  971.   #--------------------------------------------------------------------------
  972.   def read_save_data(index)
  973.     @header[index] = DataManager.load_header(index)
  974.     @bitmaps[index].dispose if @bitmaps[index]
  975.     return unless EASY_MENU_SET::FILES_DETAILS_DATA[0][0]
  976.     @bitmaps[index] = DataManager.load_save_bitmap(index)
  977.   end
  978.   #--------------------------------------------------------------------------
  979.   # ● 刷新
  980.   #--------------------------------------------------------------------------
  981.   def refresh(index)
  982.     contents.clear
  983.     read_save_data(index)
  984.     v = EASY_MENU_SET::FILES_DETAILS_DATA
  985.     draw_background(@header[index], v)
  986.     return unless @header[index]
  987.     draw_save_bitmap(@header[index], index, v)
  988.     draw_party_characters(@header[index], index, v)
  989.     draw_party_faces(@header[index], index, v)
  990.   end
  991.   #--------------------------------------------------------------------------
  992.   # ● 绘制 底图
  993.   #--------------------------------------------------------------------------
  994.   def draw_background(header, v)
  995.     return unless v[3][0]
  996.     return if (!header && v[3][1] == false)
  997.     bitmap = Cache.system(v[3][2])
  998.     contents.blt(v[3][3], v[3][4], bitmap, Rect.new(0, 0, v[3][5], v[3][6]))
  999.   end
  1000.   #--------------------------------------------------------------------------
  1001.   # ● 绘制截图
  1002.   #--------------------------------------------------------------------------
  1003.   def draw_save_bitmap(header, index, v)
  1004.     return unless v[0][0]
  1005.     bitmap = @bitmaps[index]
  1006.     #bx = (width - standard_padding * 2 - bitmap.width) / 2
  1007.     contents.blt(v[0][1], v[0][2], bitmap, bitmap.rect)
  1008.   end
  1009.   #--------------------------------------------------------------------------
  1010.   # ● 绘制队伍角色行走图
  1011.   #--------------------------------------------------------------------------
  1012.   def draw_party_characters(header, index, v)
  1013.     return unless v[1][0]
  1014.     x = v[1][1]
  1015.     y = v[1][2]
  1016.     header[:characters].each_with_index do |data, i|
  1017.       draw_character(data[0], data[1], x + i * 48, y)
  1018.     end
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # ● 绘制队伍角色脸谱
  1022.   #--------------------------------------------------------------------------
  1023.   def draw_party_faces(header, index, v)
  1024.     return unless v[2][0]
  1025.     x = v[2][1]
  1026.     y = v[2][2]
  1027.     header[:characters].each_with_index do |data, i|
  1028.       bit = Cache.face(data[2])
  1029.       rx = bit.width / 4
  1030.       draw_face(data[2], data[3], x + i * rx, y)
  1031.     end
  1032.   end
  1033.   #--------------------------------------------------------------------------
  1034.   # ● 绘制角色肖像图
  1035.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  1036.   #--------------------------------------------------------------------------
  1037.   def draw_face(face_name, face_index, x, y, enabled = true)
  1038.     bitmap = Cache.face(face_name)
  1039.     w = bitmap.width / 4
  1040.     h = bitmap.height / 2
  1041.     rect = Rect.new(face_index % 4 * w, face_index / 4 * h, w, h)
  1042.     contents.blt(x + 4, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  1043.     bitmap.dispose
  1044.   end
  1045. end

  1046. #==============================================================================
  1047. # ■ Scene_File
  1048. #==============================================================================
  1049. class Scene_File < Scene_MenuBase
  1050.   #--------------------------------------------------------------------------
  1051.   # ● 开始处理
  1052.   #--------------------------------------------------------------------------
  1053.   def start
  1054.     super
  1055.     v = EASY_MENU_SET::FILES_RIM
  1056.     create_rim_background(v[0], v[1], v[2]) if v[0]
  1057.     create_actor_cg unless EASY_MENU_SET::FILES_DETAILS[0]
  1058.     create_help_window if EASY_MENU_SET::FILESLIST[5]
  1059.     create_savefile_windows
  1060.     create_details_window if EASY_MENU_SET::FILES_DETAILS[0]
  1061.     create_sub_button
  1062.     init_selection
  1063.   end
  1064.   #--------------------------------------------------------------------------
  1065.   # ● 结束处理
  1066.   #--------------------------------------------------------------------------
  1067.   def terminate
  1068.     super
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # ● 更新画面
  1072.   #--------------------------------------------------------------------------
  1073.   def update
  1074.     super
  1075.     @details_window.set_select(@savefile_window.index) if @details_window
  1076.   end
  1077.   #--------------------------------------------------------------------------
  1078.   # ● 生成帮助窗口
  1079.   #--------------------------------------------------------------------------
  1080.   def create_help_window
  1081.     sp = EASY_MENU_SET::COMMAND[1]
  1082.     v = EASY_MENU_SET::FILESLIST
  1083.     w = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  1084.     @help_window = Window_Help.new(1, w)
  1085.     @help_window.set_text(help_window_text)
  1086.     @help_window.x = sp
  1087.     @help_window.y = sp + EASY_MENU_SET::COMMAND[3] - 8
  1088.   end
  1089.   #--------------------------------------------------------------------------
  1090.   # ● 获取帮助窗口的文本
  1091.   #--------------------------------------------------------------------------
  1092.   def help_window_text
  1093.     return ""
  1094.   end
  1095.   #--------------------------------------------------------------------------
  1096.   # ● 生成存档文件窗口
  1097.   #--------------------------------------------------------------------------
  1098.   def create_savefile_windows
  1099.     sp = EASY_MENU_SET::COMMAND[1]
  1100.     hy = sp + EASY_MENU_SET::COMMAND[3] - 8
  1101.     sy = @help_window ? (@help_window.y + @help_window.height) : hy
  1102.     v = EASY_MENU_SET::FILESLIST
  1103.     sw = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  1104.     sh = Graphics.height - sy - sp
  1105.     @savefile_window = Window_SaveFileList.new(sp, sy, sw, sh)
  1106.     @savefile_window.set_handler(:ok,     method(:on_savefile_ok))
  1107.     @savefile_window.set_handler(:cancel, method(:on_savefile_cancel))
  1108.   end
  1109.   #--------------------------------------------------------------------------
  1110.   # ● 生成详细文件窗口
  1111.   #--------------------------------------------------------------------------
  1112.   def create_details_window
  1113.     sp = EASY_MENU_SET::COMMAND[1]
  1114.     v = EASY_MENU_SET::FILES_DETAILS
  1115.     d = []
  1116.     if v[1]
  1117.       d[0] = @savefile_window.width + sp
  1118.       d[1] = @help_window.y
  1119.       d[2] = Graphics.width - d[0] - sp
  1120.       d[3] = Graphics.height - d[1] - sp
  1121.     else
  1122.       d = [v[2], v[3], v[4], v[5]]
  1123.     end
  1124.     @details_window = Window_FilesDetails.new(d[0], d[1], d[2], d[3])
  1125.   end
  1126.   #--------------------------------------------------------------------------
  1127.   # ● 初始化选择状态
  1128.   #--------------------------------------------------------------------------
  1129.   def init_selection
  1130.     index = first_savefile_index
  1131.     @savefile_window.select(index)
  1132.     @details_window.set_select(index) if @details_window
  1133.   end
  1134. end


  1135. #==============================================================================
  1136. # ■ Scene_Save
  1137. #==============================================================================
  1138. class Scene_Save < Scene_File
  1139.   #--------------------------------------------------------------------------
  1140.   # ● 开始处理
  1141.   #--------------------------------------------------------------------------
  1142.   def start
  1143.     Window_MenuCommand::init_command_position(:save)
  1144.     super
  1145.   end
  1146.   #--------------------------------------------------------------------------
  1147.   # ● 确定存档文件
  1148.   #--------------------------------------------------------------------------
  1149.   def on_savefile_ok
  1150.     super
  1151.     if DataManager.save_game(@savefile_window.index)
  1152.       on_save_success
  1153.     else
  1154.       Sound.play_buzzer
  1155.     end
  1156.   end
  1157.   #--------------------------------------------------------------------------
  1158.   # ● 存档成功时的处理
  1159.   #--------------------------------------------------------------------------
  1160.   def on_save_success
  1161.     Sound.play_save
  1162.     @savefile_window.set_files(:save)
  1163.     @details_window.refresh(@savefile_window.index) if @details_window
  1164.     Graphics.wait(30)
  1165.     if EASY_MENU_SET::FILES_RETURN
  1166.       return_scene
  1167.     else
  1168.       @savefile_window.set_files(nil)
  1169.       @savefile_window.activate
  1170.     end
  1171.   end
  1172. end


  1173. #==============================================================================
  1174. # ■ Scene_Load
  1175. #==============================================================================
  1176. class Scene_Load < Scene_File
  1177.   #--------------------------------------------------------------------------
  1178.   # ● 开始处理
  1179.   #--------------------------------------------------------------------------
  1180.   def start
  1181.     Window_MenuCommand::init_command_position(:continue)
  1182.     super
  1183.   end
  1184.   #--------------------------------------------------------------------------
  1185.   # ● 确定读档文件
  1186.   #--------------------------------------------------------------------------
  1187.   def on_savefile_ok
  1188.     super
  1189.     if DataManager.load_game(@savefile_window.index)
  1190.       on_load_success
  1191.     else
  1192.       Sound.play_buzzer
  1193.     end
  1194.   end
  1195.   #--------------------------------------------------------------------------
  1196.   # ● 读档成功时的处理
  1197.   #--------------------------------------------------------------------------
  1198.   def on_load_success
  1199.     Sound.play_load
  1200.     @savefile_window.set_files(:continue)
  1201.     Graphics.wait(20)
  1202.     fadeout_all
  1203.     $game_system.on_after_load
  1204.     SceneManager.goto(Scene_Map)
  1205.   end
  1206. end


  1207. #==============================================================================
  1208. # ■ DataManager
  1209. #==============================================================================
  1210. module DataManager
  1211.   #--------------------------------------------------------------------------
  1212.   # ● 判定存档文件是否存在
  1213.   #--------------------------------------------------------------------------
  1214.   def self.save_file_exists?
  1215.     if savefile_folder == ""
  1216.       text = 'Save*.rvdata2'
  1217.     else
  1218.       text = savefile_folder + '/Save*.rvdata2'
  1219.     end
  1220.     !Dir.glob(text).empty?
  1221.   end
  1222.   #--------------------------------------------------------------------------
  1223.   # ● 存档文件的最大数
  1224.   #--------------------------------------------------------------------------
  1225.   def self.savefile_max
  1226.     max = EASY_MENU_SET::FILES_MAX ? EASY_MENU_SET::FILES_MAX : 16
  1227.     return max
  1228.   end
  1229.   #--------------------------------------------------------------------------
  1230.   # ● 生成父文件夹
  1231.   #--------------------------------------------------------------------------
  1232.   def self.savefile_folder
  1233.     return EASY_MENU_SET::FILES_NAME
  1234.   end
  1235.   #--------------------------------------------------------------------------
  1236.   # ● 生成文件名
  1237.   #     index : 文件索引
  1238.   #--------------------------------------------------------------------------
  1239.   def self.make_filename(index)
  1240.     filename = sprintf("Save%02d.rvdata2", index + 1)
  1241.     if savefile_folder == ""
  1242.       return filename
  1243.     else
  1244.       return savefile_folder + "/" + filename
  1245.     end
  1246.   end
  1247.   #--------------------------------------------------------------------------
  1248.   # ● 生成截图
  1249.   #--------------------------------------------------------------------------
  1250.   def self.make_save_bitmap
  1251.     bitmap = set_bitmap_array(SceneManager.saves_bitmap)
  1252.     bitmap
  1253.   end
  1254.   #--------------------------------------------------------------------------
  1255.   # ● 获取截图
  1256.   #--------------------------------------------------------------------------
  1257.   def self.load_save_bitmap(index)
  1258.     begin
  1259.       File.open(make_filename(index), "rb") do |file|
  1260.         Marshal.load(file)
  1261.         return read_bitmap_array(Marshal.load(file))
  1262.       end
  1263.     rescue
  1264.       return nil
  1265.     end
  1266.   end
  1267.   #--------------------------------------------------------------------------
  1268.   # ● 制作截图文件 by 老鹰
  1269.   #--------------------------------------------------------------------------
  1270.   def self.set_bitmap_array(bitmap)
  1271.     data = []
  1272.     bitmap.height.times do |i| # 行号
  1273.       data[i] = []
  1274.       bitmap.width.times do |j| # 列号
  1275.         color = bitmap.get_pixel(j, i)
  1276.         data[i][j] = [color.red, color.green, color.blue]
  1277.       end
  1278.     end
  1279.     data
  1280.   end
  1281.   #--------------------------------------------------------------------------
  1282.   # ● 获取截图文件 by 老鹰
  1283.   #--------------------------------------------------------------------------
  1284.   def self.read_bitmap_array(array)
  1285.     h = array.size # 行数
  1286.     w = array[0].size # 列数
  1287.     bitmap = Bitmap.new(w, h)
  1288.     h.times do |i|
  1289.       w.times do |j|
  1290.         data = array[i][j]
  1291.         color = Color.new(data[0], data[1], data[2])
  1292.         bitmap.set_pixel(j, i, color)
  1293.       end
  1294.     end
  1295.     bitmap
  1296.   end
  1297.   #--------------------------------------------------------------------------
  1298.   # ● 执行存档(没有错误处理)
  1299.   #--------------------------------------------------------------------------
  1300.   def self.save_game_without_rescue(index)
  1301.     unless FileTest.directory?(savefile_folder)
  1302.       Dir::mkdir(savefile_folder)
  1303.     end
  1304.     File.open(make_filename(index), "wb") do |file|
  1305.       $game_system.on_before_save
  1306.       Marshal.dump(make_save_header, file)
  1307.       Marshal.dump(make_save_bitmap, file)
  1308.       Marshal.dump(make_save_contents, file)
  1309.       @last_savefile_index = index
  1310.     end
  1311.     return true
  1312.   end
  1313.   #--------------------------------------------------------------------------
  1314.   # ● 执行读档(没有错误处理)
  1315.   #--------------------------------------------------------------------------
  1316.   def self.load_game_without_rescue(index)
  1317.     File.open(make_filename(index), "rb") do |file|
  1318.       Marshal.load(file)
  1319.       Marshal.load(file)
  1320.       extract_save_contents(Marshal.load(file))
  1321.       reload_map_if_updated
  1322.       @last_savefile_index = index
  1323.     end
  1324.     return true
  1325.   end
  1326. end

  1327. #==============================================================================
  1328. # ■ Game_Party
  1329. #==============================================================================
  1330. class Game_Party < Game_Unit
  1331.   #--------------------------------------------------------------------------
  1332.   # ● 存档文件显示用的角色图像信息
  1333.   #--------------------------------------------------------------------------
  1334.   def characters_for_savefile
  1335.     battle_members.collect do |actor|
  1336.       [actor.character_name, actor.character_index,
  1337.        actor.face_name, actor.face_index]
  1338.     end
  1339.   end
  1340. end


  1341. #==============================================================================
  1342. # ■ Window_MenuStatus
  1343. #==============================================================================
  1344. class Window_MenuStatus < Window_Selectable
  1345.   #--------------------------------------------------------------------------
  1346.   # ● 获取窗口的宽度
  1347.   #--------------------------------------------------------------------------
  1348.   def window_width
  1349.     Graphics.width - 160 - 96
  1350.   end
  1351.   #--------------------------------------------------------------------------
  1352.   # ● 获取窗口的高度
  1353.   #--------------------------------------------------------------------------
  1354.   def window_height
  1355.     Graphics.height > 416 ? 416 : Graphics.height
  1356.   end
  1357. end

  1358. #==============================================================================
  1359. # ■ Window_GameEnd
  1360. #==============================================================================
  1361. class Window_GameEnd < Window_Command
  1362.   #--------------------------------------------------------------------------
  1363.   # ● 初始化对象
  1364.   #--------------------------------------------------------------------------
  1365.   alias easy_menu_initialize initialize
  1366.   def initialize
  1367.     easy_menu_initialize
  1368.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  1369.   end
  1370. end
复制代码


大佬能教我一下吗?我这个好像不太一样,怎么弄才能让那个存档方面失效?
最初の結果 发表于 2021-4-4 22:27:48
alexncf125 发表于 2021-2-15 18:18
把·CONG'S EASY MENU由第1089行class Scene_File < Scene_MenuBase开始,
至到1374行module DataManager的 ...
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ◇ CONG'S EASY MENU ◇ 葱式解谜用简易菜单
  4. #------------------------------------------------------------------------------
  5. # By Conwsbn
  6. # http://congrm.lofter.com/
  7. #==============================================================================

  8. $imported = {} if $imported.nil?
  9. $imported[:congs_easy_menu] = true

  10. #==============================================================================
  11. # ■ Window_Base
  12. #==============================================================================
  13. class Window_Base < Window
  14.   #--------------------------------------------------------------------------
  15.   # ● 获取统一字体设置
  16.   #--------------------------------------------------------------------------
  17.   def easy_menu_font
  18.     contents.font.name = EASY_MENU_SET::Font_name
  19.     contents.font.size = EASY_MENU_SET::Font_size
  20.     contents.font.outline = EASY_MENU_SET::Font_outline
  21.     contents.font.shadow = EASY_MENU_SET::Font_shadow
  22.     contents.font.bold = EASY_MENU_SET::Font_bold
  23.     contents.font.italic = EASY_MENU_SET::Font_italic
  24.   end
  25. end

  26. #==============================================================================
  27. # ■ Window_Help
  28. #==============================================================================
  29. class Window_Help < Window_Base
  30.   #--------------------------------------------------------------------------
  31.   # ● 初始化对象
  32.   #--------------------------------------------------------------------------
  33.   def initialize(line_number = 2, width = Graphics.width)
  34.     super(0, 0, width, fitting_height(line_number))
  35.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  36.     self.opacity = EASY_MENU_SET::HELP_opacity
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 设置内容
  40.   #--------------------------------------------------------------------------
  41.   def set_text(text)
  42.     text.gsub!(/\\n/i) { "\n" }
  43.     if text != @text
  44.       @text = text
  45.       refresh
  46.     end
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 清除
  50.   #--------------------------------------------------------------------------
  51.   def clear
  52.     set_text("")
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 设置物品
  56.   #     item : 技能、物品等
  57.   #--------------------------------------------------------------------------
  58.   def set_item(item)
  59.     set_text(item ? item.description : "")
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 绘制带有控制符的文本内容
  63.   #--------------------------------------------------------------------------
  64.   def draw_text_ex(x, y, text)
  65.     reset_item_font_settings
  66.     text = convert_escape_characters(text)
  67.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  68.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● 物品帮助字体设置
  72.   #--------------------------------------------------------------------------
  73.   def reset_item_font_settings
  74.     return if @text_line
  75.     contents.font.name = EASY_MENU_SET::HELP_name
  76.     contents.font.size = EASY_MENU_SET::HELP_size
  77.     contents.font.outline = EASY_MENU_SET::HELP_outline
  78.     contents.font.shadow = EASY_MENU_SET::HELP_shadow
  79.     contents.font.bold = EASY_MENU_SET::HELP_bold
  80.     contents.font.italic = EASY_MENU_SET::HELP_italic
  81.     v = EASY_MENU_SET::HELP_color
  82.     change_color(Color.new(v[0], v[1], v[2]))
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 获取文字颜色
  86.   #--------------------------------------------------------------------------
  87.   def text_color(n)
  88.     v = EASY_MENU_SET::HELP_color
  89.     return Color.new(v[0], v[1], v[2]) if n == 0
  90.     return windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● 处理普通文字
  94.   #--------------------------------------------------------------------------
  95.   def process_normal_character(c, pos)
  96.     if (pos[:x] + contents.text_size(c).width) > contents.width
  97.       @text_line = true
  98.       process_new_line(c, pos)
  99.       @text_line = false
  100.       pos[:height] = calc_line_height(c)
  101.     end
  102.     text_width = text_size(c).width
  103.     draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
  104.     pos[:x] += text_width
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 刷新
  108.   #--------------------------------------------------------------------------
  109.   def refresh
  110.     contents.clear
  111.     draw_text_ex(4, 0, @text)
  112.   end
  113. end

  114. #==============================================================================
  115. # ■ Window_MenuCommand
  116. #==============================================================================
  117. class Window_MenuCommand < Window_Command
  118.   #--------------------------------------------------------------------------
  119.   # ● 初始化指令选择位置(类方法)
  120.   #--------------------------------------------------------------------------
  121.   def self.init_command_position(type = nil)
  122.     @@last_command_symbol = type
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● 初始化对象
  126.   #--------------------------------------------------------------------------
  127.   def initialize(sub = false)
  128.     @sub = sub
  129.     super(-24, EASY_MENU_SET::COMMAND[1])
  130.     self.opacity = 0
  131.     self.active = false
  132.     @show = false
  133.     @move_rx = @sub_ry = 0
  134.     @last_index = @index
  135.     update_placement unless @sub
  136.     select_last
  137.     refresh
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 获取标准的边距尺寸
  141.   #--------------------------------------------------------------------------
  142.   def standard_padding
  143.     return 0
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 显示动画前的设定
  147.   #--------------------------------------------------------------------------
  148.   def update_placement
  149.     self.x = -24 - window_width
  150.     self.contents_opacity = 0
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 获取窗口的宽度
  154.   #--------------------------------------------------------------------------
  155.   def window_width
  156.     return EASY_MENU_SET::COMMAND[2] + 24 + 24
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● 获取项目的宽度
  160.   #--------------------------------------------------------------------------
  161.   def item_width
  162.     width - 24
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● 获取间隔距离
  166.   #--------------------------------------------------------------------------
  167.   def line_spacing
  168.     return EASY_MENU_SET::COMMAND[4]
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● 获取行高
  172.   #--------------------------------------------------------------------------
  173.   def line_height
  174.     return EASY_MENU_SET::COMMAND[3] + line_spacing
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● 获取指令名称
  178.   #--------------------------------------------------------------------------
  179.   def set_command_name(v)
  180.     @name = []
  181.     for i in 0...EASY_MENU_SET::BUTTON.size
  182.       name = Vocab::item     if v[i][4] == :item
  183.       name = Vocab::key_item if v[i][4] == :key_item
  184.       name = Vocab::save     if v[i][4] == :save
  185.       name = Vocab::continue if v[i][4] == :continue
  186.       name = Vocab::game_end if v[i][4] == :game_end
  187.       @name[i] = v[i][1] ? v[i][1] : name
  188.     end
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● 获取显示状态
  192.   #--------------------------------------------------------------------------
  193.   def set_command_enabled(v)
  194.     @enabled = []
  195.     for i in 0...EASY_MENU_SET::BUTTON.size
  196.       enabled = main_commands_enabled         if v[i][4] == :item
  197.       enabled = main_commands_enabled         if v[i][4] == :key_item
  198.       enabled = save_enabled                  if v[i][4] == :save
  199.       enabled = DataManager.save_file_exists? if v[i][4] == :continue
  200.       enabled = true                          if v[i][4] == :game_end
  201.       @enabled[i] = enabled
  202.     end
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● 获取指令图标
  206.   #--------------------------------------------------------------------------
  207.   def set_command_icon(v)
  208.     @icon = []
  209.     for i in 0...EASY_MENU_SET::BUTTON.size
  210.       @icon[i] = v[i][2] if v[i][2]
  211.     end
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ● 获取选项的图标
  215.   #--------------------------------------------------------------------------
  216.   def command_icon(index)
  217.     @list[index][:ext]
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● 生成指令列表
  221.   #--------------------------------------------------------------------------
  222.   def make_command_list
  223.     v = EASY_MENU_SET::BUTTON
  224.     set_command_name(v)
  225.     set_command_icon(v)
  226.     set_command_enabled(v)
  227.     for i in 0...EASY_MENU_SET::BUTTON.size
  228.       add_command(@name[i], v[i][4], @enabled[i], @icon[i]) if v[i][0] or @sub
  229.     end
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ● 刷新
  233.   #--------------------------------------------------------------------------
  234.   def refresh
  235.     #clear_command_list
  236.     #make_command_list
  237.     create_contents
  238.     contents.clear
  239.     draw_all_items
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● 绘制项目
  243.   #--------------------------------------------------------------------------
  244.   def draw_item(index)
  245.     return if @sub && @index != index
  246.     easy_menu_font
  247.     rect = item_rect_for_text(index)
  248.     t_size = text_size(command_name(index))
  249.     mx = @index == index ? @sub ? 0 : @move_rx : 0
  250.     my = @sub ? @sub_ry : 0
  251.     ix = item_width - t_size.width - 28 + mx
  252.     iy = (line_height - t_size.height) / 2 + my
  253.     draw_background(index, rect, mx, my)
  254.     rect.x -= 24
  255.     rect.y -= (line_spacing / 2)
  256.     enabled = command_enabled?(index)
  257.     change_color(item_color(index), enabled)
  258.     rt = [rect.x + mx, rect.y + my, rect.width, rect.height]
  259.     draw_text(rt[0], rt[1], rt[2], rt[3], command_name(index), 2)
  260.     draw_icon(command_icon(index), rect.x + ix, rect.y + iy, enabled)
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 绘制底纹
  264.   #--------------------------------------------------------------------------
  265.   def draw_background(index, rect, x, y)
  266.     lh = line_height - line_spacing
  267.     bit = Cache.system(EASY_MENU_SET::COMMAND[0])
  268.     rx = bit.width - item_width
  269.     rect1 = Rect.new(rx, 0, item_width, 12)
  270.     rect2 = Rect.new(rx, 12, item_width, 12)
  271.     rect3 = Rect.new(rx, 36 - 12, item_width, 12)
  272.     d_rect = Rect.new(rect.x + x, rect.y + 12 + y, item_width, lh - 24)
  273.     self.contents.blt(rect.x + x, rect.y + y, bit, rect1)
  274.     self.contents.stretch_blt(d_rect, bit, rect2)
  275.     self.contents.blt(rect.x + x, rect.y + lh - 12 + y, bit, rect3)
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ● 字体颜色扩展
  279.   #--------------------------------------------------------------------------
  280.   def item_color(index)
  281.     co = EASY_MENU_SET::BUTTON[index][3]
  282.     return Color.new(co[0], co[1], co[2]) if @index == index
  283.     return Color.new(co[0], co[1], co[2], 200)
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ● 获取项目的绘制矩形
  287.   #--------------------------------------------------------------------------
  288.   def item_rect(index)
  289.     index = 0 if @sub
  290.     rect = Rect.new
  291.     rect.width = 4
  292.     rect.height = 24
  293.     rect.x = index % col_max * (item_width + spacing) + 32
  294.     rect.y = index / col_max * item_height + 4
  295.     rect
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● 获取项目的绘制矩形(内容用)
  299.   #--------------------------------------------------------------------------
  300.   def item_rect_for_text(index)
  301.     index = 0 if @sub
  302.     rect = Rect.new
  303.     rect.width = item_width
  304.     rect.height = item_height
  305.     rect.x = index % col_max * (item_width + spacing)
  306.     rect.y = index / col_max * item_height
  307.     rect
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● 展开动画的标志
  311.   #--------------------------------------------------------------------------
  312.   def show=(show)
  313.     if @show != show
  314.       @show = show
  315.     end
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 获取动画的标志
  319.   #--------------------------------------------------------------------------
  320.   def show
  321.     return @show
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● 更新画面
  325.   #--------------------------------------------------------------------------
  326.   def update
  327.     super
  328.     if @last_index != @index && !@show
  329.       @move_rx = 0
  330.       @last_index = @index
  331.     end
  332.     update_button if Input.dir4 > 0 or @move_rx < 24
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 按钮的改变动画
  336.   #--------------------------------------------------------------------------
  337.   def update_button
  338.     @move_rx += 4 if @move_rx < 24
  339.     refresh
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ● 按钮的还原动画
  343.   #--------------------------------------------------------------------------
  344.   def hide_button
  345.     @move_rx -= 4 if @move_rx > 0
  346.     refresh
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● 展开动画
  350.   #--------------------------------------------------------------------------
  351.   def open_button_window
  352.     self.x += (window_width + 24) / EASY_MENU_SET::TIME
  353.     self.contents_opacity += 255 / EASY_MENU_SET::TIME
  354.     refresh
  355.     @show = false if self.x >= -24
  356.     self.x = -24 if !@show
  357.     self.contents_opacity = 255 if !@show
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ● 关闭动画
  361.   #--------------------------------------------------------------------------
  362.   def close_button_window
  363.     @show = false if self.contents_opacity <= 0
  364.     if @move_rx > 0
  365.       hide_button
  366.     else
  367.       self.x -= (window_width + 24) / EASY_MENU_SET::TIME
  368.       self.contents_opacity -= 255 / EASY_MENU_SET::TIME
  369.       refresh
  370.     end
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● 进入子菜单的关闭动画
  374.   #--------------------------------------------------------------------------
  375.   def close_window_to_sub
  376.     if @move_rx > 0
  377.       hide_button
  378.       @sub_ry = @index / col_max * item_height
  379.     else
  380.       cursor_rect.empty
  381.       @show = false if @sub_ry <= 0
  382.       @sub_ry = 0 if !@show
  383.       @sub = true
  384.       @sub_ry = [(@sub_ry - ((EASY_MENU_SET::COMMAND[3] * index)) / 6), 0].max
  385.       refresh
  386.     end
  387.   end
  388. end

  389. #==============================================================================
  390. # ■ Scene_MenuBase
  391. #==============================================================================
  392. class Scene_MenuBase < Scene_Base
  393.   #--------------------------------------------------------------------------
  394.   # ● 结束处理
  395.   #--------------------------------------------------------------------------
  396.   alias easy_menu_terminate terminate
  397.   def terminate
  398.     easy_menu_terminate
  399.     dispose_rim
  400.     dispose_actor_cg
  401.     dispose_sub_button
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 生成背景
  405.   #--------------------------------------------------------------------------
  406.   def create_background
  407.     wall = EASY_MENU_SET::WALLPAPER
  408.     co = EASY_MENU_SET::BACKGROUND
  409.     @background_sprite = Sprite.new
  410.     bitmap = wall ? Cache.system(wall) : SceneManager.background_bitmap
  411.     @background_sprite.bitmap = bitmap
  412.     @background_sprite.color.set(co[0], co[1], co[2], co[3]) unless wall
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 绘制次背景图片
  416.   #--------------------------------------------------------------------------
  417.   def create_rim_background(bitmap, x, y)
  418.     @rim_sprite = Sprite.new
  419.     @rim_sprite.bitmap = Cache.system(bitmap) if bitmap
  420.     @rim_sprite.x = x; @rim_sprite.y = y
  421.     @rim_sprite.z = @background_sprite.z
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ● 释放次背景图片
  425.   #--------------------------------------------------------------------------
  426.   def dispose_rim
  427.     return if !@rim_sprite
  428.     @rim_sprite.bitmap.dispose
  429.     @rim_sprite.dispose
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 生成立绘精灵
  433.   #--------------------------------------------------------------------------
  434.   def create_actor_cg
  435.     v = EASY_MENU_SET::CG
  436.     return unless v[0]
  437.     @actor_cg = Sprite.new
  438.     @actor_cg.bitmap = Cache.system(v[0])
  439.     @actor_cg.x = v[1] + 2 * 7
  440.     @actor_cg.y = v[2]
  441.   end
  442.   #--------------------------------------------------------------------------
  443.   # ● 立绘的坐标判断
  444.   #--------------------------------------------------------------------------
  445.   def cg_x
  446.     v = EASY_MENU_SET::CG
  447.     return v[3] if v[4] == :l
  448.     return -(v[3]) if v[4] == :r
  449.     return 0
  450.   end
  451.   #--------------------------------------------------------------------------
  452.   # ● 释放立绘精灵
  453.   #--------------------------------------------------------------------------
  454.   def dispose_actor_cg
  455.     return if !@actor_cg
  456.     @actor_cg.bitmap.dispose
  457.     @actor_cg.dispose
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ● 展开动画的预设坐标
  461.   #--------------------------------------------------------------------------
  462.   def set_menu_xy
  463.     v = EASY_MENU_SET::CG
  464.     xx = 0
  465.     xx = -(EASY_MENU_SET::TIME * v[3]) if v[4] == :l
  466.     xx = EASY_MENU_SET::TIME * v[3] if v[4] == :r
  467.     @actor_cg.x = v[1] + xx
  468.     @actor_cg.opacity = 0
  469.     @rim_sprite.opacity = 0 if @rim_sprite
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # ● 重绘内用小标题
  473.   #--------------------------------------------------------------------------
  474.   def create_sub_button
  475.     @sub_window = Window_MenuCommand.new(true)
  476.     @sub_window.z = 300
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● 释放内用小标题
  480.   #--------------------------------------------------------------------------
  481.   def dispose_sub_button
  482.     @sub_window.dispose if @sub_window
  483.   end
  484. end

  485. #==============================================================================
  486. # ■ Scene_Menu
  487. #==============================================================================
  488. class Scene_Menu < Scene_MenuBase
  489.   #--------------------------------------------------------------------------
  490.   # ● 开始处理
  491.   #--------------------------------------------------------------------------
  492.   def start
  493.     super
  494.     v = EASY_MENU_SET::MENU_RIM
  495.     create_rim_background(v[0], v[1], v[2]) if v[0]
  496.     create_actor_cg
  497.     create_command_window
  498.     set_menu_xy
  499.     @sub_show = false
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ● 开始后处理
  503.   #--------------------------------------------------------------------------
  504.   def post_start
  505.     super
  506.     @command_window.show = true
  507.     begin
  508.       @actor_cg.x += cg_x
  509.       @actor_cg.opacity += (255 / EASY_MENU_SET::TIME)
  510.       @rim_sprite.opacity += (255 / EASY_MENU_SET::TIME) if @rim_sprite
  511.       @command_window.open_button_window
  512.       Graphics.update
  513.     end until @command_window.show == false
  514.     @command_window.activate
  515.     @actor_cg.opacity = 255
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ● 结束前处理
  519.   #--------------------------------------------------------------------------
  520.   def pre_terminate
  521.     super
  522.     t = 0
  523.     @command_window.show = true
  524.     begin
  525.       if @sub_show
  526.         t += 1 if t <= 6
  527.         @actor_cg.x += 2 if t <= 6
  528.         @command_window.close_window_to_sub
  529.       else
  530.         @actor_cg.x += -(cg_x)
  531.         @actor_cg.opacity -= 255 / EASY_MENU_SET::TIME
  532.         @rim_sprite.opacity -= 255 / EASY_MENU_SET::TIME if @rim_sprite
  533.         @command_window.close_button_window
  534.       end
  535.       Graphics.update
  536.     end until @command_window.show == false
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # ● 生成指令窗口
  540.   #--------------------------------------------------------------------------
  541.   def create_command_window
  542.     v = EASY_MENU_SET::BUTTON
  543.     @command_window = Window_MenuCommand.new
  544.     for i in 0...EASY_MENU_SET::BUTTON.size
  545.       type = :command_item     if v[i][4] == :item
  546.       type = :command_key_item if v[i][4] == :key_item
  547.       type = :command_save     if v[i][4] == :save
  548.       type = :command_load     if v[i][4] == :continue
  549.       type = :command_game_end if v[i][4] == :game_end
  550.       @command_window.set_handler(v[i][4], method(type)) if v[i][0]
  551.     end
  552.     @command_window.set_handler(:cancel,    method(:return_scene))
  553.   end
  554.   #--------------------------------------------------------------------------
  555.   # ● 指令“物品”
  556.   #--------------------------------------------------------------------------
  557.   def command_item
  558.     @sub_show = true
  559.     SceneManager.call(Scene_Item)
  560.     SceneManager.scene.prepare(:item)
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # ● 指令“贵重物品”
  564.   #--------------------------------------------------------------------------
  565.   def command_key_item
  566.     @sub_show = true
  567.     SceneManager.call(Scene_Item)
  568.     SceneManager.scene.prepare(:key_item)
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 指令“存档”
  572.   #--------------------------------------------------------------------------
  573.   def command_save
  574.     @sub_show = true
  575.     SceneManager.call(Scene_Save)
  576.   end
  577.   #--------------------------------------------------------------------------
  578.   # ● 指令“读档”
  579.   #--------------------------------------------------------------------------
  580.   def command_load
  581.     @sub_show = true
  582.     SceneManager.call(Scene_Load)
  583.   end
  584. end



  585. #==============================================================================
  586. # ■ SceneManager
  587. #==============================================================================
  588. module SceneManager
  589.   #--------------------------------------------------------------------------
  590.   # ● 模块的实例变量
  591.   #--------------------------------------------------------------------------
  592.   @save_bitmap = nil                # 存档用截图
  593.   #--------------------------------------------------------------------------
  594.   # ● 生成背景用的场景截图
  595.   #--------------------------------------------------------------------------
  596.   def self.snapshot_for_background(bitmap_blue = true)
  597.     @background_bitmap.dispose if @background_bitmap
  598.     @background_bitmap = Graphics.snap_to_bitmap
  599.     @background_bitmap.blur if bitmap_blue
  600.   end
  601.   #--------------------------------------------------------------------------
  602.   # ● 生成存档内的截图
  603.   #--------------------------------------------------------------------------
  604.   def self.snapshot_for_save_bitmap
  605.     v = EASY_MENU_SET::FILES_DETAILS_DATA
  606.     @save_bitmap.dispose if @save_bitmap
  607.     @save_bitmap = Bitmap.new(v[0][3], v[0][4])
  608.     rect = Rect.new(0, 0, v[0][3], v[0][4])
  609.     rect.x = $game_player.screen_x - rect.width / 2
  610.     rect.y = $game_player.screen_y - rect.height / 2 - 12
  611.     bitmap = Graphics.snap_to_bitmap
  612.     @save_bitmap.blt(0, 0, bitmap, rect)
  613.     bitmap.dispose
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # ● 获取存档内的截图
  617.   #--------------------------------------------------------------------------
  618.   def self.saves_bitmap
  619.     @save_bitmap
  620.   end
  621. end

  622. #==============================================================================
  623. # ■ Scene_Map
  624. #==============================================================================
  625. class Scene_Map < Scene_Base
  626.   #--------------------------------------------------------------------------
  627.   # ● 结束处理
  628.   #--------------------------------------------------------------------------
  629.   def terminate
  630.     super
  631.     type = EASY_MENU_SET::BACKGROUND[4]
  632.     type = true if SceneManager.scene_is?(Scene_Battle)
  633.     SceneManager.snapshot_for_background(type)
  634.     SceneManager.snapshot_for_save_bitmap
  635.     dispose_spriteset
  636.     perform_battle_transition if SceneManager.scene_is?(Scene_Battle)
  637.   end
  638. end


  639. #==============================================================================
  640. # ★ 物品界面
  641. #==============================================================================
  642. #==============================================================================
  643. # ■ Window_ItemList
  644. #==============================================================================
  645. class Window_ItemList < Window_Selectable
  646.   #--------------------------------------------------------------------------
  647.   # ● 初始化对象
  648.   #--------------------------------------------------------------------------
  649.   def initialize(x, y, width, height)
  650.     super
  651.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  652.     self.opacity = EASY_MENU_SET::ITEMLIST[2]
  653.     @category = :none
  654.     @data = []
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # ● 获取标准的边距尺寸
  658.   #--------------------------------------------------------------------------
  659.   def standard_padding
  660.     return 16
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # ● 获取列数
  664.   #--------------------------------------------------------------------------
  665.   def col_max
  666.     return 1
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # ● 绘制项目
  670.   #--------------------------------------------------------------------------
  671.   alias easy_menu_draw_item draw_item
  672.   def draw_item(index)
  673.     easy_menu_font
  674.     easy_menu_draw_item(index)
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # ● 绘制物品个数
  678.   #--------------------------------------------------------------------------
  679.   def draw_item_number(rect, item)
  680.     return if $game_party.item_number(item) <= 1
  681.     draw_text(rect, sprintf("%02d", $game_party.item_number(item)), 2)
  682.   end
  683.   #--------------------------------------------------------------------------
  684.   # ● 绘制物品名称
  685.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  686.   #--------------------------------------------------------------------------
  687.   def draw_item_name(item, x, y, enabled = true, width = 172)
  688.     return unless item
  689.     draw_icon(item.icon_index, x, y, enabled)
  690.     change_color(normal_color, enabled)
  691.     draw_text_ex(x + 24, y, item.name)
  692.     #draw_text(x + 24, y, width, line_height, item.name)
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ● 重置字体设置
  696.   #--------------------------------------------------------------------------
  697.   def reset_font_settings
  698.     change_color(normal_color)
  699.     easy_menu_font
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # ● 更新帮助内容
  703.   #--------------------------------------------------------------------------
  704.   def update_help
  705.     @help_window.set_item(item)
  706.     @big_icon.set_item(item.big_icon) if EASY_MENU_SET::BIGICON[0]
  707.   end
  708.   #--------------------------------------------------------------------------
  709.   # ● 设置物品窗口
  710.   #--------------------------------------------------------------------------
  711.   def big_icon=(big_icon)
  712.     @big_icon = big_icon
  713.     update
  714.   end
  715. end

  716. #==============================================================================
  717. # ■ BIG ICON
  718. #==============================================================================
  719. module Cache
  720.   def self.bigicon(filename)
  721.     load_bitmap(EASY_MENU_SET::BIGICON_Cache, filename)
  722.   end
  723. end

  724. #==============================================================================
  725. # ■ RPG::BaseItem
  726. #==============================================================================
  727. class RPG::BaseItem
  728.   #--------------------------------------------------------------------------
  729.   # ● 获取大图标
  730.   #--------------------------------------------------------------------------
  731.   def big_icon
  732.     self.note =~ /\<BigIcon (\w+)\>/i
  733.     $1.nil? ? "" : $1
  734.   end
  735. end

  736. #==============================================================================
  737. # ■ Window_Big_icon
  738. #==============================================================================
  739. class Window_Big_icon < Window_Base
  740.   #--------------------------------------------------------------------------
  741.   # ● 初始化对象
  742.   #--------------------------------------------------------------------------
  743.   def initialize(x, y, width, height)
  744.     super(x, y, width, height)
  745.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  746.     self.opacity = EASY_MENU_SET::BIGICON[6]
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # ● 设置内容
  750.   #--------------------------------------------------------------------------
  751.   def set_item(icon)
  752.     if icon != @icon
  753.       contents.clear
  754.       bitmap = Cache.bigicon(icon)
  755.       x = (contents.width - bitmap.width) / 2
  756.       y = (contents.height - bitmap.height) / 2
  757.       rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  758.       contents.blt(x, y, bitmap, rect)
  759.       @icon = icon
  760.     end
  761.   end
  762. end

  763. #==============================================================================
  764. # ■ Scene_ItemBase
  765. #==============================================================================
  766. class Scene_ItemBase < Scene_MenuBase
  767.   #--------------------------------------------------------------------------
  768.   # ● 生成角色窗口
  769.   #--------------------------------------------------------------------------
  770.   def create_actor_window
  771.     @actor_window = Window_MenuActor.new
  772.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  773.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  774.   end
  775.   #--------------------------------------------------------------------------
  776.   # ● 显示子窗口
  777.   #--------------------------------------------------------------------------
  778.   alias easy_menu_show_sub_window show_sub_window
  779.   def show_sub_window(window)
  780.     window.y = (Graphics.height - @actor_window.height) / 2
  781.     easy_menu_show_sub_window(window)
  782.     @actor_window.z = 200
  783.   end
  784. end

  785. #==============================================================================
  786. # ■ Scene_Item
  787. #==============================================================================
  788. class Scene_Item < Scene_ItemBase
  789.   #--------------------------------------------------------------------------
  790.   # ● 预处理
  791.   #--------------------------------------------------------------------------
  792.   def prepare(mode = :item)
  793.     @mode = mode
  794.   end
  795.   #--------------------------------------------------------------------------
  796.   # ● 开始处理
  797.   #--------------------------------------------------------------------------
  798.   def start
  799.     super
  800.     v = EASY_MENU_SET::ITEM_RIM
  801.     create_rim_background(v[0], v[1], v[2]) if v[0]
  802.     create_actor_cg unless EASY_MENU_SET::BIGICON[0]
  803.     create_help_window
  804.     create_big_icon_window if EASY_MENU_SET::BIGICON[0]
  805.     create_item_window
  806.     create_sub_button
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● 生成物品窗口
  810.   #--------------------------------------------------------------------------
  811.   def create_item_window
  812.     sp = EASY_MENU_SET::COMMAND[1]
  813.     iy = sp + EASY_MENU_SET::COMMAND[3] - 8
  814.     ih = Graphics.height - @help_window.height - sp - iy
  815.     @item_window = Window_ItemList.new(sp, iy, @help_window.width, ih)
  816.     @item_window.category = @mode
  817.     @item_window.viewport = @viewport
  818.     @item_window.help_window = @help_window
  819.     @item_window.big_icon = @big_icon_window if EASY_MENU_SET::BIGICON[0]
  820.     @item_window.set_handler(:ok,     method(:on_item_ok))
  821.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  822.     @item_window.index = 0
  823.     @item_window.activate
  824.   end
  825.   #--------------------------------------------------------------------------
  826.   # ● 生成帮助窗口
  827.   #--------------------------------------------------------------------------
  828.   def create_help_window
  829.     sp = EASY_MENU_SET::COMMAND[1]
  830.     v = EASY_MENU_SET::ITEMLIST
  831.     w = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  832.     @help_window = Window_Help.new(v[1], w)
  833.     @help_window.viewport = @viewport
  834.     @help_window.x = sp
  835.     @help_window.y = Graphics.height - @help_window.height - sp
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # ● 生成物品大图标
  839.   #--------------------------------------------------------------------------
  840.   def create_big_icon_window
  841.     sp = EASY_MENU_SET::COMMAND[1]
  842.     v = EASY_MENU_SET::BIGICON
  843.     b = []
  844.     if v[1]
  845.       b[0] = @help_window.width + sp
  846.       b[1] = sp + EASY_MENU_SET::COMMAND[3] - 8
  847.       b[2] = Graphics.width - b[0] - sp
  848.       b[3] = Graphics.height - b[1] - sp
  849.     else
  850.       b = [v[2], v[3], v[4], v[5]]
  851.     end
  852.     @big_icon_window = Window_Big_icon.new(b[0], b[1], b[2], b[3])
  853.     @big_icon_window.viewport = @viewport
  854.   end
  855.   #--------------------------------------------------------------------------
  856.   # ● 物品“取消”
  857.   #--------------------------------------------------------------------------
  858.   def on_item_cancel
  859.     @item_window.unselect
  860.     return_scene
  861.   end
  862. end


  863. #==============================================================================
  864. # ★ 存档界面
  865. #==============================================================================
  866. #==============================================================================
  867. # ■ Window_SaveFileList
  868. #------------------------------------------------------------------------------
  869. #  存档的选项窗口(左)
  870. #==============================================================================
  871. class Window_SaveFileList < Window_Selectable
  872.   #--------------------------------------------------------------------------
  873.   # ● 初始化对象
  874.   #--------------------------------------------------------------------------
  875.   def initialize(x, y, width, height)
  876.     super
  877.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  878.     self.opacity = EASY_MENU_SET::FILESLIST[4]
  879.     @symbol = nil
  880.     refresh
  881.     activate
  882.   end
  883.   #--------------------------------------------------------------------------
  884.   # ● 获取可显示的存档数目
  885.   #--------------------------------------------------------------------------
  886.   def visible_max
  887.     return EASY_MENU_SET::FILESLIST[1]
  888.   end
  889.   #--------------------------------------------------------------------------
  890.   # ● 获取项目的高度
  891.   #--------------------------------------------------------------------------
  892.   def item_height
  893.     (height - standard_padding * 2) / visible_max
  894.   end
  895.   #--------------------------------------------------------------------------
  896.   # ● 存档数量最大值
  897.   #--------------------------------------------------------------------------
  898.   def item_max
  899.     return EASY_MENU_SET::FILES_MAX
  900.   end
  901.   #--------------------------------------------------------------------------
  902.   # ● 绘制项目
  903.   #--------------------------------------------------------------------------
  904.   def draw_item(index)
  905.     header = DataManager.load_header(index)
  906.     rect = item_rect_for_text(index)
  907.     ry = (item_height - line_height) / 2
  908.     easy_menu_font
  909.     v = EASY_MENU_SET::FILESLIST
  910.     change_color(Color.new(v[3][0][0], v[3][0][1], v[3][0][2]), header)
  911.     icon_id = header ? v[2][1] : v[2][0]
  912.     draw_icon(icon_id, rect.x + 4, rect.y + ry)
  913.     text = @symbol == :save ? EASY_MENU_SET::SAVING : EASY_MENU_SET::LOADING
  914.     ing = @index == index && @symbol
  915.     name = ing ? text : (Vocab::File + " #{index + 1}")
  916.     draw_text(rect.x + 28, rect.y + ry, rect.width, line_height, name)
  917.     change_color(Color.new(v[3][1][0], v[3][1][1], v[3][1][2]), header)
  918.     draw_playtime(header, rect.x - 4, rect.y + ry, rect.width, 2)
  919.   end
  920.   #--------------------------------------------------------------------------
  921.   # ● 绘制游戏时间
  922.   #--------------------------------------------------------------------------
  923.   def draw_playtime(header, x, y, width, align)
  924.     text = header ? header[:playtime_s] : "—:—:—"
  925.     draw_text(x, y, width, line_height, text, 2)
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● 设置选择状态
  929.   #--------------------------------------------------------------------------
  930.   def set_files(symbol)
  931.     @symbol = symbol
  932.     refresh
  933.   end
  934. end


  935. #==============================================================================
  936. # ■ Window_FilesDetails
  937. #------------------------------------------------------------------------------
  938. #  存档的详细窗口(右)
  939. #==============================================================================
  940. class Window_FilesDetails < Window_Base
  941.   #--------------------------------------------------------------------------
  942.   # ● 初始化对象
  943.   #--------------------------------------------------------------------------
  944.   def initialize(x, y, width, height)
  945.     super(x, y, width, height)
  946.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  947.     self.opacity = EASY_MENU_SET::FILES_DETAILS[6]
  948.     @bitmaps = []
  949.     @header = []
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● 释放
  953.   #--------------------------------------------------------------------------
  954.   def dispose
  955.     for bitmap in @bitmaps
  956.       next if bitmap == nil or bitmap.disposed?
  957.       bitmap.dispose
  958.     end
  959.     super
  960.   end
  961.   #--------------------------------------------------------------------------
  962.   # ● 设置选择状态
  963.   #--------------------------------------------------------------------------
  964.   def set_select(select)
  965.     return if @select == select
  966.     @select = select
  967.     refresh(@select)
  968.   end
  969.   #--------------------------------------------------------------------------
  970.   # ● 读取文件
  971.   #--------------------------------------------------------------------------
  972.   def read_save_data(index)
  973.     @header[index] = DataManager.load_header(index)
  974.     @bitmaps[index].dispose if @bitmaps[index]
  975.     return unless EASY_MENU_SET::FILES_DETAILS_DATA[0][0]
  976.     @bitmaps[index] = DataManager.load_save_bitmap(index)
  977.   end
  978.   #--------------------------------------------------------------------------
  979.   # ● 刷新
  980.   #--------------------------------------------------------------------------
  981.   def refresh(index)
  982.     contents.clear
  983.     read_save_data(index)
  984.     v = EASY_MENU_SET::FILES_DETAILS_DATA
  985.     draw_background(@header[index], v)
  986.     return unless @header[index]
  987.     draw_save_bitmap(@header[index], index, v)
  988.     draw_party_characters(@header[index], index, v)
  989.     draw_party_faces(@header[index], index, v)
  990.   end
  991.   #--------------------------------------------------------------------------
  992.   # ● 绘制 底图
  993.   #--------------------------------------------------------------------------
  994.   def draw_background(header, v)
  995.     return unless v[3][0]
  996.     return if (!header && v[3][1] == false)
  997.     bitmap = Cache.system(v[3][2])
  998.     contents.blt(v[3][3], v[3][4], bitmap, Rect.new(0, 0, v[3][5], v[3][6]))
  999.   end
  1000.   #--------------------------------------------------------------------------
  1001.   # ● 绘制截图
  1002.   #--------------------------------------------------------------------------
  1003.   def draw_save_bitmap(header, index, v)
  1004.     return unless v[0][0]
  1005.     bitmap = @bitmaps[index]
  1006.     #bx = (width - standard_padding * 2 - bitmap.width) / 2
  1007.     contents.blt(v[0][1], v[0][2], bitmap, bitmap.rect)
  1008.   end
  1009.   #--------------------------------------------------------------------------
  1010.   # ● 绘制队伍角色行走图
  1011.   #--------------------------------------------------------------------------
  1012.   def draw_party_characters(header, index, v)
  1013.     return unless v[1][0]
  1014.     x = v[1][1]
  1015.     y = v[1][2]
  1016.     header[:characters].each_with_index do |data, i|
  1017.       draw_character(data[0], data[1], x + i * 48, y)
  1018.     end
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # ● 绘制队伍角色脸谱
  1022.   #--------------------------------------------------------------------------
  1023.   def draw_party_faces(header, index, v)
  1024.     return unless v[2][0]
  1025.     x = v[2][1]
  1026.     y = v[2][2]
  1027.     header[:characters].each_with_index do |data, i|
  1028.       bit = Cache.face(data[2])
  1029.       rx = bit.width / 4
  1030.       draw_face(data[2], data[3], x + i * rx, y)
  1031.     end
  1032.   end
  1033.   #--------------------------------------------------------------------------
  1034.   # ● 绘制角色肖像图
  1035.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  1036.   #--------------------------------------------------------------------------
  1037.   def draw_face(face_name, face_index, x, y, enabled = true)
  1038.     bitmap = Cache.face(face_name)
  1039.     w = bitmap.width / 4
  1040.     h = bitmap.height / 2
  1041.     rect = Rect.new(face_index % 4 * w, face_index / 4 * h, w, h)
  1042.     contents.blt(x + 4, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  1043.     bitmap.dispose
  1044.   end
  1045. end

  1046. #==============================================================================
  1047. # ■ Scene_File
  1048. #==============================================================================
  1049. class Scene_File < Scene_MenuBase
  1050.   #--------------------------------------------------------------------------
  1051.   # ● 开始处理
  1052.   #--------------------------------------------------------------------------
  1053.   def start
  1054.     super
  1055.     v = EASY_MENU_SET::FILES_RIM
  1056.     create_rim_background(v[0], v[1], v[2]) if v[0]
  1057.     create_actor_cg unless EASY_MENU_SET::FILES_DETAILS[0]
  1058.     create_help_window if EASY_MENU_SET::FILESLIST[5]
  1059.     create_savefile_windows
  1060.     create_details_window if EASY_MENU_SET::FILES_DETAILS[0]
  1061.     create_sub_button
  1062.     init_selection
  1063.   end
  1064.   #--------------------------------------------------------------------------
  1065.   # ● 结束处理
  1066.   #--------------------------------------------------------------------------
  1067.   def terminate
  1068.     super
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # ● 更新画面
  1072.   #--------------------------------------------------------------------------
  1073.   def update
  1074.     super
  1075.     @details_window.set_select(@savefile_window.index) if @details_window
  1076.   end
  1077.   #--------------------------------------------------------------------------
  1078.   # ● 生成帮助窗口
  1079.   #--------------------------------------------------------------------------
  1080.   def create_help_window
  1081.     sp = EASY_MENU_SET::COMMAND[1]
  1082.     v = EASY_MENU_SET::FILESLIST
  1083.     w = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  1084.     @help_window = Window_Help.new(1, w)
  1085.     @help_window.set_text(help_window_text)
  1086.     @help_window.x = sp
  1087.     @help_window.y = sp + EASY_MENU_SET::COMMAND[3] - 8
  1088.   end
  1089.   #--------------------------------------------------------------------------
  1090.   # ● 获取帮助窗口的文本
  1091.   #--------------------------------------------------------------------------
  1092.   def help_window_text
  1093.     return ""
  1094.   end
  1095.   #--------------------------------------------------------------------------
  1096.   # ● 生成存档文件窗口
  1097.   #--------------------------------------------------------------------------
  1098.   def create_savefile_windows
  1099.     sp = EASY_MENU_SET::COMMAND[1]
  1100.     hy = sp + EASY_MENU_SET::COMMAND[3] - 8
  1101.     sy = @help_window ? (@help_window.y + @help_window.height) : hy
  1102.     v = EASY_MENU_SET::FILESLIST
  1103.     sw = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  1104.     sh = Graphics.height - sy - sp
  1105.     @savefile_window = Window_SaveFileList.new(sp, sy, sw, sh)
  1106.     @savefile_window.set_handler(:ok,     method(:on_savefile_ok))
  1107.     @savefile_window.set_handler(:cancel, method(:on_savefile_cancel))
  1108.   end
  1109.   #--------------------------------------------------------------------------
  1110.   # ● 生成详细文件窗口
  1111.   #--------------------------------------------------------------------------
  1112.   def create_details_window
  1113.     sp = EASY_MENU_SET::COMMAND[1]
  1114.     v = EASY_MENU_SET::FILES_DETAILS
  1115.     d = []
  1116.     if v[1]
  1117.       d[0] = @savefile_window.width + sp
  1118.       d[1] = @help_window.y
  1119.       d[2] = Graphics.width - d[0] - sp
  1120.       d[3] = Graphics.height - d[1] - sp
  1121.     else
  1122.       d = [v[2], v[3], v[4], v[5]]
  1123.     end
  1124.     @details_window = Window_FilesDetails.new(d[0], d[1], d[2], d[3])
  1125.   end
  1126.   #--------------------------------------------------------------------------
  1127.   # ● 初始化选择状态
  1128.   #--------------------------------------------------------------------------
  1129.   def init_selection
  1130.     index = first_savefile_index
  1131.     @savefile_window.select(index)
  1132.     @details_window.set_select(index) if @details_window
  1133.   end
  1134. end


  1135. #==============================================================================
  1136. # ■ Scene_Save
  1137. #==============================================================================
  1138. class Scene_Save < Scene_File
  1139.   #--------------------------------------------------------------------------
  1140.   # ● 开始处理
  1141.   #--------------------------------------------------------------------------
  1142.   def start
  1143.     Window_MenuCommand::init_command_position(:save)
  1144.     super
  1145.   end
  1146.   #--------------------------------------------------------------------------
  1147.   # ● 确定存档文件
  1148.   #--------------------------------------------------------------------------
  1149.   def on_savefile_ok
  1150.     super
  1151.     if DataManager.save_game(@savefile_window.index)
  1152.       on_save_success
  1153.     else
  1154.       Sound.play_buzzer
  1155.     end
  1156.   end
  1157.   #--------------------------------------------------------------------------
  1158.   # ● 存档成功时的处理
  1159.   #--------------------------------------------------------------------------
  1160.   def on_save_success
  1161.     Sound.play_save
  1162.     @savefile_window.set_files(:save)
  1163.     @details_window.refresh(@savefile_window.index) if @details_window
  1164.     Graphics.wait(30)
  1165.     if EASY_MENU_SET::FILES_RETURN
  1166.       return_scene
  1167.     else
  1168.       @savefile_window.set_files(nil)
  1169.       @savefile_window.activate
  1170.     end
  1171.   end
  1172. end


  1173. #==============================================================================
  1174. # ■ Scene_Load
  1175. #==============================================================================
  1176. class Scene_Load < Scene_File
  1177.   #--------------------------------------------------------------------------
  1178.   # ● 开始处理
  1179.   #--------------------------------------------------------------------------
  1180.   def start
  1181.     Window_MenuCommand::init_command_position(:continue)
  1182.     super
  1183.   end
  1184.   #--------------------------------------------------------------------------
  1185.   # ● 确定读档文件
  1186.   #--------------------------------------------------------------------------
  1187.   def on_savefile_ok
  1188.     super
  1189.     if DataManager.load_game(@savefile_window.index)
  1190.       on_load_success
  1191.     else
  1192.       Sound.play_buzzer
  1193.     end
  1194.   end
  1195.   #--------------------------------------------------------------------------
  1196.   # ● 读档成功时的处理
  1197.   #--------------------------------------------------------------------------
  1198.   def on_load_success
  1199.     Sound.play_load
  1200.     @savefile_window.set_files(:continue)
  1201.     Graphics.wait(20)
  1202.     fadeout_all
  1203.     $game_system.on_after_load
  1204.     SceneManager.goto(Scene_Map)
  1205.   end
  1206. end


  1207. #==============================================================================
  1208. # ■ DataManager
  1209. #==============================================================================
  1210. module DataManager
  1211.   #--------------------------------------------------------------------------
  1212.   # ● 判定存档文件是否存在
  1213.   #--------------------------------------------------------------------------
  1214.   def self.save_file_exists?
  1215.     if savefile_folder == ""
  1216.       text = 'Save*.rvdata2'
  1217.     else
  1218.       text = savefile_folder + '/Save*.rvdata2'
  1219.     end
  1220.     !Dir.glob(text).empty?
  1221.   end
  1222.   #--------------------------------------------------------------------------
  1223.   # ● 存档文件的最大数
  1224.   #--------------------------------------------------------------------------
  1225.   def self.savefile_max
  1226.     max = EASY_MENU_SET::FILES_MAX ? EASY_MENU_SET::FILES_MAX : 16
  1227.     return max
  1228.   end
  1229.   #--------------------------------------------------------------------------
  1230.   # ● 生成父文件夹
  1231.   #--------------------------------------------------------------------------
  1232.   def self.savefile_folder
  1233.     return EASY_MENU_SET::FILES_NAME
  1234.   end
  1235.   #--------------------------------------------------------------------------
  1236.   # ● 生成文件名
  1237.   #     index : 文件索引
  1238.   #--------------------------------------------------------------------------
  1239.   def self.make_filename(index)
  1240.     filename = sprintf("Save%02d.rvdata2", index + 1)
  1241.     if savefile_folder == ""
  1242.       return filename
  1243.     else
  1244.       return savefile_folder + "/" + filename
  1245.     end
  1246.   end
  1247.   #--------------------------------------------------------------------------
  1248.   # ● 生成截图
  1249.   #--------------------------------------------------------------------------
  1250.   def self.make_save_bitmap
  1251.     bitmap = set_bitmap_array(SceneManager.saves_bitmap)
  1252.     bitmap
  1253.   end
  1254.   #--------------------------------------------------------------------------
  1255.   # ● 获取截图
  1256.   #--------------------------------------------------------------------------
  1257.   def self.load_save_bitmap(index)
  1258.     begin
  1259.       File.open(make_filename(index), "rb") do |file|
  1260.         Marshal.load(file)
  1261.         return read_bitmap_array(Marshal.load(file))
  1262.       end
  1263.     rescue
  1264.       return nil
  1265.     end
  1266.   end
  1267.   #--------------------------------------------------------------------------
  1268.   # ● 制作截图文件 by 老鹰
  1269.   #--------------------------------------------------------------------------
  1270.   def self.set_bitmap_array(bitmap)
  1271.     data = []
  1272.     bitmap.height.times do |i| # 行号
  1273.       data[i] = []
  1274.       bitmap.width.times do |j| # 列号
  1275.         color = bitmap.get_pixel(j, i)
  1276.         data[i][j] = [color.red, color.green, color.blue]
  1277.       end
  1278.     end
  1279.     data
  1280.   end
  1281.   #--------------------------------------------------------------------------
  1282.   # ● 获取截图文件 by 老鹰
  1283.   #--------------------------------------------------------------------------
  1284.   def self.read_bitmap_array(array)
  1285.     h = array.size # 行数
  1286.     w = array[0].size # 列数
  1287.     bitmap = Bitmap.new(w, h)
  1288.     h.times do |i|
  1289.       w.times do |j|
  1290.         data = array[i][j]
  1291.         color = Color.new(data[0], data[1], data[2])
  1292.         bitmap.set_pixel(j, i, color)
  1293.       end
  1294.     end
  1295.     bitmap
  1296.   end
  1297.   #--------------------------------------------------------------------------
  1298.   # ● 执行存档(没有错误处理)
  1299.   #--------------------------------------------------------------------------
  1300.   def self.save_game_without_rescue(index)
  1301.     unless FileTest.directory?(savefile_folder)
  1302.       Dir::mkdir(savefile_folder)
  1303.     end
  1304.     File.open(make_filename(index), "wb") do |file|
  1305.       $game_system.on_before_save
  1306.       Marshal.dump(make_save_header, file)
  1307.       Marshal.dump(make_save_bitmap, file)
  1308.       Marshal.dump(make_save_contents, file)
  1309.       @last_savefile_index = index
  1310.     end
  1311.     return true
  1312.   end
  1313.   #--------------------------------------------------------------------------
  1314.   # ● 执行读档(没有错误处理)
  1315.   #--------------------------------------------------------------------------
  1316.   def self.load_game_without_rescue(index)
  1317.     File.open(make_filename(index), "rb") do |file|
  1318.       Marshal.load(file)
  1319.       Marshal.load(file)
  1320.       extract_save_contents(Marshal.load(file))
  1321.       reload_map_if_updated
  1322.       @last_savefile_index = index
  1323.     end
  1324.     return true
  1325.   end
  1326. end

  1327. #==============================================================================
  1328. # ■ Game_Party
  1329. #==============================================================================
  1330. class Game_Party < Game_Unit
  1331.   #--------------------------------------------------------------------------
  1332.   # ● 存档文件显示用的角色图像信息
  1333.   #--------------------------------------------------------------------------
  1334.   def characters_for_savefile
  1335.     battle_members.collect do |actor|
  1336.       [actor.character_name, actor.character_index,
  1337.        actor.face_name, actor.face_index]
  1338.     end
  1339.   end
  1340. end


  1341. #==============================================================================
  1342. # ■ Window_MenuStatus
  1343. #==============================================================================
  1344. class Window_MenuStatus < Window_Selectable
  1345.   #--------------------------------------------------------------------------
  1346.   # ● 获取窗口的宽度
  1347.   #--------------------------------------------------------------------------
  1348.   def window_width
  1349.     Graphics.width - 160 - 96
  1350.   end
  1351.   #--------------------------------------------------------------------------
  1352.   # ● 获取窗口的高度
  1353.   #--------------------------------------------------------------------------
  1354.   def window_height
  1355.     Graphics.height > 416 ? 416 : Graphics.height
  1356.   end
  1357. end

  1358. #==============================================================================
  1359. # ■ Window_GameEnd
  1360. #==============================================================================
  1361. class Window_GameEnd < Window_Command
  1362.   #--------------------------------------------------------------------------
  1363.   # ● 初始化对象
  1364.   #--------------------------------------------------------------------------
  1365.   alias easy_menu_initialize initialize
  1366.   def initialize
  1367.     easy_menu_initialize
  1368.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  1369.   end
  1370. end
复制代码
最初の結果 发表于 2021-4-4 22:26:58
alexncf125 发表于 2021-2-15 18:18
把·CONG'S EASY MENU由第1089行class Scene_File < Scene_MenuBase开始,
至到1374行module DataManager的 ...

我的是这样的,怎么弄?大佬,能教教我吗?
最初の結果 发表于 2021-4-4 22:25:43
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ◇ CONG'S EASY MENU ◇ 葱式解谜用简易菜单
  4. #------------------------------------------------------------------------------
  5. # By Conwsbn
  6. # http://congrm.lofter.com/
  7. #==============================================================================

  8. $imported = {} if $imported.nil?
  9. $imported[:congs_easy_menu] = true

  10. #==============================================================================
  11. # ■ Window_Base
  12. #==============================================================================
  13. class Window_Base < Window
  14.   #--------------------------------------------------------------------------
  15.   # ● 获取统一字体设置
  16.   #--------------------------------------------------------------------------
  17.   def easy_menu_font
  18.     contents.font.name = EASY_MENU_SET::Font_name
  19.     contents.font.size = EASY_MENU_SET::Font_size
  20.     contents.font.outline = EASY_MENU_SET::Font_outline
  21.     contents.font.shadow = EASY_MENU_SET::Font_shadow
  22.     contents.font.bold = EASY_MENU_SET::Font_bold
  23.     contents.font.italic = EASY_MENU_SET::Font_italic
  24.   end
  25. end

  26. #==============================================================================
  27. # ■ Window_Help
  28. #==============================================================================
  29. class Window_Help < Window_Base
  30.   #--------------------------------------------------------------------------
  31.   # ● 初始化对象
  32.   #--------------------------------------------------------------------------
  33.   def initialize(line_number = 2, width = Graphics.width)
  34.     super(0, 0, width, fitting_height(line_number))
  35.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  36.     self.opacity = EASY_MENU_SET::HELP_opacity
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 设置内容
  40.   #--------------------------------------------------------------------------
  41.   def set_text(text)
  42.     text.gsub!(/\\n/i) { "\n" }
  43.     if text != @text
  44.       @text = text
  45.       refresh
  46.     end
  47.   end
  48.   #--------------------------------------------------------------------------
  49.   # ● 清除
  50.   #--------------------------------------------------------------------------
  51.   def clear
  52.     set_text("")
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 设置物品
  56.   #     item : 技能、物品等
  57.   #--------------------------------------------------------------------------
  58.   def set_item(item)
  59.     set_text(item ? item.description : "")
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 绘制带有控制符的文本内容
  63.   #--------------------------------------------------------------------------
  64.   def draw_text_ex(x, y, text)
  65.     reset_item_font_settings
  66.     text = convert_escape_characters(text)
  67.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  68.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● 物品帮助字体设置
  72.   #--------------------------------------------------------------------------
  73.   def reset_item_font_settings
  74.     return if @text_line
  75.     contents.font.name = EASY_MENU_SET::HELP_name
  76.     contents.font.size = EASY_MENU_SET::HELP_size
  77.     contents.font.outline = EASY_MENU_SET::HELP_outline
  78.     contents.font.shadow = EASY_MENU_SET::HELP_shadow
  79.     contents.font.bold = EASY_MENU_SET::HELP_bold
  80.     contents.font.italic = EASY_MENU_SET::HELP_italic
  81.     v = EASY_MENU_SET::HELP_color
  82.     change_color(Color.new(v[0], v[1], v[2]))
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 获取文字颜色
  86.   #--------------------------------------------------------------------------
  87.   def text_color(n)
  88.     v = EASY_MENU_SET::HELP_color
  89.     return Color.new(v[0], v[1], v[2]) if n == 0
  90.     return windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)
  91.   end
  92.   #--------------------------------------------------------------------------
  93.   # ● 处理普通文字
  94.   #--------------------------------------------------------------------------
  95.   def process_normal_character(c, pos)
  96.     if (pos[:x] + contents.text_size(c).width) > contents.width
  97.       @text_line = true
  98.       process_new_line(c, pos)
  99.       @text_line = false
  100.       pos[:height] = calc_line_height(c)
  101.     end
  102.     text_width = text_size(c).width
  103.     draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
  104.     pos[:x] += text_width
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 刷新
  108.   #--------------------------------------------------------------------------
  109.   def refresh
  110.     contents.clear
  111.     draw_text_ex(4, 0, @text)
  112.   end
  113. end

  114. #==============================================================================
  115. # ■ Window_MenuCommand
  116. #==============================================================================
  117. class Window_MenuCommand < Window_Command
  118.   #--------------------------------------------------------------------------
  119.   # ● 初始化指令选择位置(类方法)
  120.   #--------------------------------------------------------------------------
  121.   def self.init_command_position(type = nil)
  122.     @@last_command_symbol = type
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● 初始化对象
  126.   #--------------------------------------------------------------------------
  127.   def initialize(sub = false)
  128.     @sub = sub
  129.     super(-24, EASY_MENU_SET::COMMAND[1])
  130.     self.opacity = 0
  131.     self.active = false
  132.     @show = false
  133.     @move_rx = @sub_ry = 0
  134.     @last_index = @index
  135.     update_placement unless @sub
  136.     select_last
  137.     refresh
  138.   end
  139.   #--------------------------------------------------------------------------
  140.   # ● 获取标准的边距尺寸
  141.   #--------------------------------------------------------------------------
  142.   def standard_padding
  143.     return 0
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 显示动画前的设定
  147.   #--------------------------------------------------------------------------
  148.   def update_placement
  149.     self.x = -24 - window_width
  150.     self.contents_opacity = 0
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 获取窗口的宽度
  154.   #--------------------------------------------------------------------------
  155.   def window_width
  156.     return EASY_MENU_SET::COMMAND[2] + 24 + 24
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● 获取项目的宽度
  160.   #--------------------------------------------------------------------------
  161.   def item_width
  162.     width - 24
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● 获取间隔距离
  166.   #--------------------------------------------------------------------------
  167.   def line_spacing
  168.     return EASY_MENU_SET::COMMAND[4]
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● 获取行高
  172.   #--------------------------------------------------------------------------
  173.   def line_height
  174.     return EASY_MENU_SET::COMMAND[3] + line_spacing
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● 获取指令名称
  178.   #--------------------------------------------------------------------------
  179.   def set_command_name(v)
  180.     @name = []
  181.     for i in 0...EASY_MENU_SET::BUTTON.size
  182.       name = Vocab::item     if v[i][4] == :item
  183.       name = Vocab::key_item if v[i][4] == :key_item
  184.       name = Vocab::save     if v[i][4] == :save
  185.       name = Vocab::continue if v[i][4] == :continue
  186.       name = Vocab::game_end if v[i][4] == :game_end
  187.       @name[i] = v[i][1] ? v[i][1] : name
  188.     end
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● 获取显示状态
  192.   #--------------------------------------------------------------------------
  193.   def set_command_enabled(v)
  194.     @enabled = []
  195.     for i in 0...EASY_MENU_SET::BUTTON.size
  196.       enabled = main_commands_enabled         if v[i][4] == :item
  197.       enabled = main_commands_enabled         if v[i][4] == :key_item
  198.       enabled = save_enabled                  if v[i][4] == :save
  199.       enabled = DataManager.save_file_exists? if v[i][4] == :continue
  200.       enabled = true                          if v[i][4] == :game_end
  201.       @enabled[i] = enabled
  202.     end
  203.   end
  204.   #--------------------------------------------------------------------------
  205.   # ● 获取指令图标
  206.   #--------------------------------------------------------------------------
  207.   def set_command_icon(v)
  208.     @icon = []
  209.     for i in 0...EASY_MENU_SET::BUTTON.size
  210.       @icon[i] = v[i][2] if v[i][2]
  211.     end
  212.   end
  213.   #--------------------------------------------------------------------------
  214.   # ● 获取选项的图标
  215.   #--------------------------------------------------------------------------
  216.   def command_icon(index)
  217.     @list[index][:ext]
  218.   end
  219.   #--------------------------------------------------------------------------
  220.   # ● 生成指令列表
  221.   #--------------------------------------------------------------------------
  222.   def make_command_list
  223.     v = EASY_MENU_SET::BUTTON
  224.     set_command_name(v)
  225.     set_command_icon(v)
  226.     set_command_enabled(v)
  227.     for i in 0...EASY_MENU_SET::BUTTON.size
  228.       add_command(@name[i], v[i][4], @enabled[i], @icon[i]) if v[i][0] or @sub
  229.     end
  230.   end
  231.   #--------------------------------------------------------------------------
  232.   # ● 刷新
  233.   #--------------------------------------------------------------------------
  234.   def refresh
  235.     #clear_command_list
  236.     #make_command_list
  237.     create_contents
  238.     contents.clear
  239.     draw_all_items
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● 绘制项目
  243.   #--------------------------------------------------------------------------
  244.   def draw_item(index)
  245.     return if @sub && @index != index
  246.     easy_menu_font
  247.     rect = item_rect_for_text(index)
  248.     t_size = text_size(command_name(index))
  249.     mx = @index == index ? @sub ? 0 : @move_rx : 0
  250.     my = @sub ? @sub_ry : 0
  251.     ix = item_width - t_size.width - 28 + mx
  252.     iy = (line_height - t_size.height) / 2 + my
  253.     draw_background(index, rect, mx, my)
  254.     rect.x -= 24
  255.     rect.y -= (line_spacing / 2)
  256.     enabled = command_enabled?(index)
  257.     change_color(item_color(index), enabled)
  258.     rt = [rect.x + mx, rect.y + my, rect.width, rect.height]
  259.     draw_text(rt[0], rt[1], rt[2], rt[3], command_name(index), 2)
  260.     draw_icon(command_icon(index), rect.x + ix, rect.y + iy, enabled)
  261.   end
  262.   #--------------------------------------------------------------------------
  263.   # ● 绘制底纹
  264.   #--------------------------------------------------------------------------
  265.   def draw_background(index, rect, x, y)
  266.     lh = line_height - line_spacing
  267.     bit = Cache.system(EASY_MENU_SET::COMMAND[0])
  268.     rx = bit.width - item_width
  269.     rect1 = Rect.new(rx, 0, item_width, 12)
  270.     rect2 = Rect.new(rx, 12, item_width, 12)
  271.     rect3 = Rect.new(rx, 36 - 12, item_width, 12)
  272.     d_rect = Rect.new(rect.x + x, rect.y + 12 + y, item_width, lh - 24)
  273.     self.contents.blt(rect.x + x, rect.y + y, bit, rect1)
  274.     self.contents.stretch_blt(d_rect, bit, rect2)
  275.     self.contents.blt(rect.x + x, rect.y + lh - 12 + y, bit, rect3)
  276.   end
  277.   #--------------------------------------------------------------------------
  278.   # ● 字体颜色扩展
  279.   #--------------------------------------------------------------------------
  280.   def item_color(index)
  281.     co = EASY_MENU_SET::BUTTON[index][3]
  282.     return Color.new(co[0], co[1], co[2]) if @index == index
  283.     return Color.new(co[0], co[1], co[2], 200)
  284.   end
  285.   #--------------------------------------------------------------------------
  286.   # ● 获取项目的绘制矩形
  287.   #--------------------------------------------------------------------------
  288.   def item_rect(index)
  289.     index = 0 if @sub
  290.     rect = Rect.new
  291.     rect.width = 4
  292.     rect.height = 24
  293.     rect.x = index % col_max * (item_width + spacing) + 32
  294.     rect.y = index / col_max * item_height + 4
  295.     rect
  296.   end
  297.   #--------------------------------------------------------------------------
  298.   # ● 获取项目的绘制矩形(内容用)
  299.   #--------------------------------------------------------------------------
  300.   def item_rect_for_text(index)
  301.     index = 0 if @sub
  302.     rect = Rect.new
  303.     rect.width = item_width
  304.     rect.height = item_height
  305.     rect.x = index % col_max * (item_width + spacing)
  306.     rect.y = index / col_max * item_height
  307.     rect
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● 展开动画的标志
  311.   #--------------------------------------------------------------------------
  312.   def show=(show)
  313.     if @show != show
  314.       @show = show
  315.     end
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 获取动画的标志
  319.   #--------------------------------------------------------------------------
  320.   def show
  321.     return @show
  322.   end
  323.   #--------------------------------------------------------------------------
  324.   # ● 更新画面
  325.   #--------------------------------------------------------------------------
  326.   def update
  327.     super
  328.     if @last_index != @index && !@show
  329.       @move_rx = 0
  330.       @last_index = @index
  331.     end
  332.     update_button if Input.dir4 > 0 or @move_rx < 24
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 按钮的改变动画
  336.   #--------------------------------------------------------------------------
  337.   def update_button
  338.     @move_rx += 4 if @move_rx < 24
  339.     refresh
  340.   end
  341.   #--------------------------------------------------------------------------
  342.   # ● 按钮的还原动画
  343.   #--------------------------------------------------------------------------
  344.   def hide_button
  345.     @move_rx -= 4 if @move_rx > 0
  346.     refresh
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● 展开动画
  350.   #--------------------------------------------------------------------------
  351.   def open_button_window
  352.     self.x += (window_width + 24) / EASY_MENU_SET::TIME
  353.     self.contents_opacity += 255 / EASY_MENU_SET::TIME
  354.     refresh
  355.     @show = false if self.x >= -24
  356.     self.x = -24 if !@show
  357.     self.contents_opacity = 255 if !@show
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # ● 关闭动画
  361.   #--------------------------------------------------------------------------
  362.   def close_button_window
  363.     @show = false if self.contents_opacity <= 0
  364.     if @move_rx > 0
  365.       hide_button
  366.     else
  367.       self.x -= (window_width + 24) / EASY_MENU_SET::TIME
  368.       self.contents_opacity -= 255 / EASY_MENU_SET::TIME
  369.       refresh
  370.     end
  371.   end
  372.   #--------------------------------------------------------------------------
  373.   # ● 进入子菜单的关闭动画
  374.   #--------------------------------------------------------------------------
  375.   def close_window_to_sub
  376.     if @move_rx > 0
  377.       hide_button
  378.       @sub_ry = @index / col_max * item_height
  379.     else
  380.       cursor_rect.empty
  381.       @show = false if @sub_ry <= 0
  382.       @sub_ry = 0 if !@show
  383.       @sub = true
  384.       @sub_ry = [(@sub_ry - ((EASY_MENU_SET::COMMAND[3] * index)) / 6), 0].max
  385.       refresh
  386.     end
  387.   end
  388. end

  389. #==============================================================================
  390. # ■ Scene_MenuBase
  391. #==============================================================================
  392. class Scene_MenuBase < Scene_Base
  393.   #--------------------------------------------------------------------------
  394.   # ● 结束处理
  395.   #--------------------------------------------------------------------------
  396.   alias easy_menu_terminate terminate
  397.   def terminate
  398.     easy_menu_terminate
  399.     dispose_rim
  400.     dispose_actor_cg
  401.     dispose_sub_button
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # ● 生成背景
  405.   #--------------------------------------------------------------------------
  406.   def create_background
  407.     wall = EASY_MENU_SET::WALLPAPER
  408.     co = EASY_MENU_SET::BACKGROUND
  409.     @background_sprite = Sprite.new
  410.     bitmap = wall ? Cache.system(wall) : SceneManager.background_bitmap
  411.     @background_sprite.bitmap = bitmap
  412.     @background_sprite.color.set(co[0], co[1], co[2], co[3]) unless wall
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 绘制次背景图片
  416.   #--------------------------------------------------------------------------
  417.   def create_rim_background(bitmap, x, y)
  418.     @rim_sprite = Sprite.new
  419.     @rim_sprite.bitmap = Cache.system(bitmap) if bitmap
  420.     @rim_sprite.x = x; @rim_sprite.y = y
  421.     @rim_sprite.z = @background_sprite.z
  422.   end
  423.   #--------------------------------------------------------------------------
  424.   # ● 释放次背景图片
  425.   #--------------------------------------------------------------------------
  426.   def dispose_rim
  427.     return if !@rim_sprite
  428.     @rim_sprite.bitmap.dispose
  429.     @rim_sprite.dispose
  430.   end
  431.   #--------------------------------------------------------------------------
  432.   # ● 生成立绘精灵
  433.   #--------------------------------------------------------------------------
  434.   def create_actor_cg
  435.     v = EASY_MENU_SET::CG
  436.     return unless v[0]
  437.     @actor_cg = Sprite.new
  438.     @actor_cg.bitmap = Cache.system(v[0])
  439.     @actor_cg.x = v[1] + 2 * 7
  440.     @actor_cg.y = v[2]
  441.   end
  442.   #--------------------------------------------------------------------------
  443.   # ● 立绘的坐标判断
  444.   #--------------------------------------------------------------------------
  445.   def cg_x
  446.     v = EASY_MENU_SET::CG
  447.     return v[3] if v[4] == :l
  448.     return -(v[3]) if v[4] == :r
  449.     return 0
  450.   end
  451.   #--------------------------------------------------------------------------
  452.   # ● 释放立绘精灵
  453.   #--------------------------------------------------------------------------
  454.   def dispose_actor_cg
  455.     return if !@actor_cg
  456.     @actor_cg.bitmap.dispose
  457.     @actor_cg.dispose
  458.   end
  459.   #--------------------------------------------------------------------------
  460.   # ● 展开动画的预设坐标
  461.   #--------------------------------------------------------------------------
  462.   def set_menu_xy
  463.     v = EASY_MENU_SET::CG
  464.     xx = 0
  465.     xx = -(EASY_MENU_SET::TIME * v[3]) if v[4] == :l
  466.     xx = EASY_MENU_SET::TIME * v[3] if v[4] == :r
  467.     @actor_cg.x = v[1] + xx
  468.     @actor_cg.opacity = 0
  469.     @rim_sprite.opacity = 0 if @rim_sprite
  470.   end
  471.   #--------------------------------------------------------------------------
  472.   # ● 重绘内用小标题
  473.   #--------------------------------------------------------------------------
  474.   def create_sub_button
  475.     @sub_window = Window_MenuCommand.new(true)
  476.     @sub_window.z = 300
  477.   end
  478.   #--------------------------------------------------------------------------
  479.   # ● 释放内用小标题
  480.   #--------------------------------------------------------------------------
  481.   def dispose_sub_button
  482.     @sub_window.dispose if @sub_window
  483.   end
  484. end

  485. #==============================================================================
  486. # ■ Scene_Menu
  487. #==============================================================================
  488. class Scene_Menu < Scene_MenuBase
  489.   #--------------------------------------------------------------------------
  490.   # ● 开始处理
  491.   #--------------------------------------------------------------------------
  492.   def start
  493.     super
  494.     v = EASY_MENU_SET::MENU_RIM
  495.     create_rim_background(v[0], v[1], v[2]) if v[0]
  496.     create_actor_cg
  497.     create_command_window
  498.     set_menu_xy
  499.     @sub_show = false
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # ● 开始后处理
  503.   #--------------------------------------------------------------------------
  504.   def post_start
  505.     super
  506.     @command_window.show = true
  507.     begin
  508.       @actor_cg.x += cg_x
  509.       @actor_cg.opacity += (255 / EASY_MENU_SET::TIME)
  510.       @rim_sprite.opacity += (255 / EASY_MENU_SET::TIME) if @rim_sprite
  511.       @command_window.open_button_window
  512.       Graphics.update
  513.     end until @command_window.show == false
  514.     @command_window.activate
  515.     @actor_cg.opacity = 255
  516.   end
  517.   #--------------------------------------------------------------------------
  518.   # ● 结束前处理
  519.   #--------------------------------------------------------------------------
  520.   def pre_terminate
  521.     super
  522.     t = 0
  523.     @command_window.show = true
  524.     begin
  525.       if @sub_show
  526.         t += 1 if t <= 6
  527.         @actor_cg.x += 2 if t <= 6
  528.         @command_window.close_window_to_sub
  529.       else
  530.         @actor_cg.x += -(cg_x)
  531.         @actor_cg.opacity -= 255 / EASY_MENU_SET::TIME
  532.         @rim_sprite.opacity -= 255 / EASY_MENU_SET::TIME if @rim_sprite
  533.         @command_window.close_button_window
  534.       end
  535.       Graphics.update
  536.     end until @command_window.show == false
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # ● 生成指令窗口
  540.   #--------------------------------------------------------------------------
  541.   def create_command_window
  542.     v = EASY_MENU_SET::BUTTON
  543.     @command_window = Window_MenuCommand.new
  544.     for i in 0...EASY_MENU_SET::BUTTON.size
  545.       type = :command_item     if v[i][4] == :item
  546.       type = :command_key_item if v[i][4] == :key_item
  547.       type = :command_save     if v[i][4] == :save
  548.       type = :command_load     if v[i][4] == :continue
  549.       type = :command_game_end if v[i][4] == :game_end
  550.       @command_window.set_handler(v[i][4], method(type)) if v[i][0]
  551.     end
  552.     @command_window.set_handler(:cancel,    method(:return_scene))
  553.   end
  554.   #--------------------------------------------------------------------------
  555.   # ● 指令“物品”
  556.   #--------------------------------------------------------------------------
  557.   def command_item
  558.     @sub_show = true
  559.     SceneManager.call(Scene_Item)
  560.     SceneManager.scene.prepare(:item)
  561.   end
  562.   #--------------------------------------------------------------------------
  563.   # ● 指令“贵重物品”
  564.   #--------------------------------------------------------------------------
  565.   def command_key_item
  566.     @sub_show = true
  567.     SceneManager.call(Scene_Item)
  568.     SceneManager.scene.prepare(:key_item)
  569.   end
  570.   #--------------------------------------------------------------------------
  571.   # ● 指令“存档”
  572.   #--------------------------------------------------------------------------
  573.   def command_save
  574.     @sub_show = true
  575.     SceneManager.call(Scene_Save)
  576.   end
  577.   #--------------------------------------------------------------------------
  578.   # ● 指令“读档”
  579.   #--------------------------------------------------------------------------
  580.   def command_load
  581.     @sub_show = true
  582.     SceneManager.call(Scene_Load)
  583.   end
  584. end



  585. #==============================================================================
  586. # ■ SceneManager
  587. #==============================================================================
  588. module SceneManager
  589.   #--------------------------------------------------------------------------
  590.   # ● 模块的实例变量
  591.   #--------------------------------------------------------------------------
  592.   @save_bitmap = nil                # 存档用截图
  593.   #--------------------------------------------------------------------------
  594.   # ● 生成背景用的场景截图
  595.   #--------------------------------------------------------------------------
  596.   def self.snapshot_for_background(bitmap_blue = true)
  597.     @background_bitmap.dispose if @background_bitmap
  598.     @background_bitmap = Graphics.snap_to_bitmap
  599.     @background_bitmap.blur if bitmap_blue
  600.   end
  601.   #--------------------------------------------------------------------------
  602.   # ● 生成存档内的截图
  603.   #--------------------------------------------------------------------------
  604.   def self.snapshot_for_save_bitmap
  605.     v = EASY_MENU_SET::FILES_DETAILS_DATA
  606.     @save_bitmap.dispose if @save_bitmap
  607.     @save_bitmap = Bitmap.new(v[0][3], v[0][4])
  608.     rect = Rect.new(0, 0, v[0][3], v[0][4])
  609.     rect.x = $game_player.screen_x - rect.width / 2
  610.     rect.y = $game_player.screen_y - rect.height / 2 - 12
  611.     bitmap = Graphics.snap_to_bitmap
  612.     @save_bitmap.blt(0, 0, bitmap, rect)
  613.     bitmap.dispose
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # ● 获取存档内的截图
  617.   #--------------------------------------------------------------------------
  618.   def self.saves_bitmap
  619.     @save_bitmap
  620.   end
  621. end

  622. #==============================================================================
  623. # ■ Scene_Map
  624. #==============================================================================
  625. class Scene_Map < Scene_Base
  626.   #--------------------------------------------------------------------------
  627.   # ● 结束处理
  628.   #--------------------------------------------------------------------------
  629.   def terminate
  630.     super
  631.     type = EASY_MENU_SET::BACKGROUND[4]
  632.     type = true if SceneManager.scene_is?(Scene_Battle)
  633.     SceneManager.snapshot_for_background(type)
  634.     SceneManager.snapshot_for_save_bitmap
  635.     dispose_spriteset
  636.     perform_battle_transition if SceneManager.scene_is?(Scene_Battle)
  637.   end
  638. end


  639. #==============================================================================
  640. # ★ 物品界面
  641. #==============================================================================
  642. #==============================================================================
  643. # ■ Window_ItemList
  644. #==============================================================================
  645. class Window_ItemList < Window_Selectable
  646.   #--------------------------------------------------------------------------
  647.   # ● 初始化对象
  648.   #--------------------------------------------------------------------------
  649.   def initialize(x, y, width, height)
  650.     super
  651.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  652.     self.opacity = EASY_MENU_SET::ITEMLIST[2]
  653.     @category = :none
  654.     @data = []
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # ● 获取标准的边距尺寸
  658.   #--------------------------------------------------------------------------
  659.   def standard_padding
  660.     return 16
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # ● 获取列数
  664.   #--------------------------------------------------------------------------
  665.   def col_max
  666.     return 1
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # ● 绘制项目
  670.   #--------------------------------------------------------------------------
  671.   alias easy_menu_draw_item draw_item
  672.   def draw_item(index)
  673.     easy_menu_font
  674.     easy_menu_draw_item(index)
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # ● 绘制物品个数
  678.   #--------------------------------------------------------------------------
  679.   def draw_item_number(rect, item)
  680.     return if $game_party.item_number(item) <= 1
  681.     draw_text(rect, sprintf("%02d", $game_party.item_number(item)), 2)
  682.   end
  683.   #--------------------------------------------------------------------------
  684.   # ● 绘制物品名称
  685.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  686.   #--------------------------------------------------------------------------
  687.   def draw_item_name(item, x, y, enabled = true, width = 172)
  688.     return unless item
  689.     draw_icon(item.icon_index, x, y, enabled)
  690.     change_color(normal_color, enabled)
  691.     draw_text_ex(x + 24, y, item.name)
  692.     #draw_text(x + 24, y, width, line_height, item.name)
  693.   end
  694.   #--------------------------------------------------------------------------
  695.   # ● 重置字体设置
  696.   #--------------------------------------------------------------------------
  697.   def reset_font_settings
  698.     change_color(normal_color)
  699.     easy_menu_font
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # ● 更新帮助内容
  703.   #--------------------------------------------------------------------------
  704.   def update_help
  705.     @help_window.set_item(item)
  706.     @big_icon.set_item(item.big_icon) if EASY_MENU_SET::BIGICON[0]
  707.   end
  708.   #--------------------------------------------------------------------------
  709.   # ● 设置物品窗口
  710.   #--------------------------------------------------------------------------
  711.   def big_icon=(big_icon)
  712.     @big_icon = big_icon
  713.     update
  714.   end
  715. end

  716. #==============================================================================
  717. # ■ BIG ICON
  718. #==============================================================================
  719. module Cache
  720.   def self.bigicon(filename)
  721.     load_bitmap(EASY_MENU_SET::BIGICON_Cache, filename)
  722.   end
  723. end

  724. #==============================================================================
  725. # ■ RPG::BaseItem
  726. #==============================================================================
  727. class RPG::BaseItem
  728.   #--------------------------------------------------------------------------
  729.   # ● 获取大图标
  730.   #--------------------------------------------------------------------------
  731.   def big_icon
  732.     self.note =~ /\<BigIcon (\w+)\>/i
  733.     $1.nil? ? "" : $1
  734.   end
  735. end

  736. #==============================================================================
  737. # ■ Window_Big_icon
  738. #==============================================================================
  739. class Window_Big_icon < Window_Base
  740.   #--------------------------------------------------------------------------
  741.   # ● 初始化对象
  742.   #--------------------------------------------------------------------------
  743.   def initialize(x, y, width, height)
  744.     super(x, y, width, height)
  745.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  746.     self.opacity = EASY_MENU_SET::BIGICON[6]
  747.   end
  748.   #--------------------------------------------------------------------------
  749.   # ● 设置内容
  750.   #--------------------------------------------------------------------------
  751.   def set_item(icon)
  752.     if icon != @icon
  753.       contents.clear
  754.       bitmap = Cache.bigicon(icon)
  755.       x = (contents.width - bitmap.width) / 2
  756.       y = (contents.height - bitmap.height) / 2
  757.       rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  758.       contents.blt(x, y, bitmap, rect)
  759.       @icon = icon
  760.     end
  761.   end
  762. end

  763. #==============================================================================
  764. # ■ Scene_ItemBase
  765. #==============================================================================
  766. class Scene_ItemBase < Scene_MenuBase
  767.   #--------------------------------------------------------------------------
  768.   # ● 生成角色窗口
  769.   #--------------------------------------------------------------------------
  770.   def create_actor_window
  771.     @actor_window = Window_MenuActor.new
  772.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  773.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  774.   end
  775.   #--------------------------------------------------------------------------
  776.   # ● 显示子窗口
  777.   #--------------------------------------------------------------------------
  778.   alias easy_menu_show_sub_window show_sub_window
  779.   def show_sub_window(window)
  780.     window.y = (Graphics.height - @actor_window.height) / 2
  781.     easy_menu_show_sub_window(window)
  782.     @actor_window.z = 200
  783.   end
  784. end

  785. #==============================================================================
  786. # ■ Scene_Item
  787. #==============================================================================
  788. class Scene_Item < Scene_ItemBase
  789.   #--------------------------------------------------------------------------
  790.   # ● 预处理
  791.   #--------------------------------------------------------------------------
  792.   def prepare(mode = :item)
  793.     @mode = mode
  794.   end
  795.   #--------------------------------------------------------------------------
  796.   # ● 开始处理
  797.   #--------------------------------------------------------------------------
  798.   def start
  799.     super
  800.     v = EASY_MENU_SET::ITEM_RIM
  801.     create_rim_background(v[0], v[1], v[2]) if v[0]
  802.     create_actor_cg unless EASY_MENU_SET::BIGICON[0]
  803.     create_help_window
  804.     create_big_icon_window if EASY_MENU_SET::BIGICON[0]
  805.     create_item_window
  806.     create_sub_button
  807.   end
  808.   #--------------------------------------------------------------------------
  809.   # ● 生成物品窗口
  810.   #--------------------------------------------------------------------------
  811.   def create_item_window
  812.     sp = EASY_MENU_SET::COMMAND[1]
  813.     iy = sp + EASY_MENU_SET::COMMAND[3] - 8
  814.     ih = Graphics.height - @help_window.height - sp - iy
  815.     @item_window = Window_ItemList.new(sp, iy, @help_window.width, ih)
  816.     @item_window.category = @mode
  817.     @item_window.viewport = @viewport
  818.     @item_window.help_window = @help_window
  819.     @item_window.big_icon = @big_icon_window if EASY_MENU_SET::BIGICON[0]
  820.     @item_window.set_handler(:ok,     method(:on_item_ok))
  821.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  822.     @item_window.index = 0
  823.     @item_window.activate
  824.   end
  825.   #--------------------------------------------------------------------------
  826.   # ● 生成帮助窗口
  827.   #--------------------------------------------------------------------------
  828.   def create_help_window
  829.     sp = EASY_MENU_SET::COMMAND[1]
  830.     v = EASY_MENU_SET::ITEMLIST
  831.     w = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  832.     @help_window = Window_Help.new(v[1], w)
  833.     @help_window.viewport = @viewport
  834.     @help_window.x = sp
  835.     @help_window.y = Graphics.height - @help_window.height - sp
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # ● 生成物品大图标
  839.   #--------------------------------------------------------------------------
  840.   def create_big_icon_window
  841.     sp = EASY_MENU_SET::COMMAND[1]
  842.     v = EASY_MENU_SET::BIGICON
  843.     b = []
  844.     if v[1]
  845.       b[0] = @help_window.width + sp
  846.       b[1] = sp + EASY_MENU_SET::COMMAND[3] - 8
  847.       b[2] = Graphics.width - b[0] - sp
  848.       b[3] = Graphics.height - b[1] - sp
  849.     else
  850.       b = [v[2], v[3], v[4], v[5]]
  851.     end
  852.     @big_icon_window = Window_Big_icon.new(b[0], b[1], b[2], b[3])
  853.     @big_icon_window.viewport = @viewport
  854.   end
  855.   #--------------------------------------------------------------------------
  856.   # ● 物品“取消”
  857.   #--------------------------------------------------------------------------
  858.   def on_item_cancel
  859.     @item_window.unselect
  860.     return_scene
  861.   end
  862. end


  863. #==============================================================================
  864. # ★ 存档界面
  865. #==============================================================================
  866. #==============================================================================
  867. # ■ Window_SaveFileList
  868. #------------------------------------------------------------------------------
  869. #  存档的选项窗口(左)
  870. #==============================================================================
  871. class Window_SaveFileList < Window_Selectable
  872.   #--------------------------------------------------------------------------
  873.   # ● 初始化对象
  874.   #--------------------------------------------------------------------------
  875.   def initialize(x, y, width, height)
  876.     super
  877.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  878.     self.opacity = EASY_MENU_SET::FILESLIST[4]
  879.     @symbol = nil
  880.     refresh
  881.     activate
  882.   end
  883.   #--------------------------------------------------------------------------
  884.   # ● 获取可显示的存档数目
  885.   #--------------------------------------------------------------------------
  886.   def visible_max
  887.     return EASY_MENU_SET::FILESLIST[1]
  888.   end
  889.   #--------------------------------------------------------------------------
  890.   # ● 获取项目的高度
  891.   #--------------------------------------------------------------------------
  892.   def item_height
  893.     (height - standard_padding * 2) / visible_max
  894.   end
  895.   #--------------------------------------------------------------------------
  896.   # ● 存档数量最大值
  897.   #--------------------------------------------------------------------------
  898.   def item_max
  899.     return EASY_MENU_SET::FILES_MAX
  900.   end
  901.   #--------------------------------------------------------------------------
  902.   # ● 绘制项目
  903.   #--------------------------------------------------------------------------
  904.   def draw_item(index)
  905.     header = DataManager.load_header(index)
  906.     rect = item_rect_for_text(index)
  907.     ry = (item_height - line_height) / 2
  908.     easy_menu_font
  909.     v = EASY_MENU_SET::FILESLIST
  910.     change_color(Color.new(v[3][0][0], v[3][0][1], v[3][0][2]), header)
  911.     icon_id = header ? v[2][1] : v[2][0]
  912.     draw_icon(icon_id, rect.x + 4, rect.y + ry)
  913.     text = @symbol == :save ? EASY_MENU_SET::SAVING : EASY_MENU_SET::LOADING
  914.     ing = @index == index && @symbol
  915.     name = ing ? text : (Vocab::File + " #{index + 1}")
  916.     draw_text(rect.x + 28, rect.y + ry, rect.width, line_height, name)
  917.     change_color(Color.new(v[3][1][0], v[3][1][1], v[3][1][2]), header)
  918.     draw_playtime(header, rect.x - 4, rect.y + ry, rect.width, 2)
  919.   end
  920.   #--------------------------------------------------------------------------
  921.   # ● 绘制游戏时间
  922.   #--------------------------------------------------------------------------
  923.   def draw_playtime(header, x, y, width, align)
  924.     text = header ? header[:playtime_s] : "—:—:—"
  925.     draw_text(x, y, width, line_height, text, 2)
  926.   end
  927.   #--------------------------------------------------------------------------
  928.   # ● 设置选择状态
  929.   #--------------------------------------------------------------------------
  930.   def set_files(symbol)
  931.     @symbol = symbol
  932.     refresh
  933.   end
  934. end


  935. #==============================================================================
  936. # ■ Window_FilesDetails
  937. #------------------------------------------------------------------------------
  938. #  存档的详细窗口(右)
  939. #==============================================================================
  940. class Window_FilesDetails < Window_Base
  941.   #--------------------------------------------------------------------------
  942.   # ● 初始化对象
  943.   #--------------------------------------------------------------------------
  944.   def initialize(x, y, width, height)
  945.     super(x, y, width, height)
  946.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  947.     self.opacity = EASY_MENU_SET::FILES_DETAILS[6]
  948.     @bitmaps = []
  949.     @header = []
  950.   end
  951.   #--------------------------------------------------------------------------
  952.   # ● 释放
  953.   #--------------------------------------------------------------------------
  954.   def dispose
  955.     for bitmap in @bitmaps
  956.       next if bitmap == nil or bitmap.disposed?
  957.       bitmap.dispose
  958.     end
  959.     super
  960.   end
  961.   #--------------------------------------------------------------------------
  962.   # ● 设置选择状态
  963.   #--------------------------------------------------------------------------
  964.   def set_select(select)
  965.     return if @select == select
  966.     @select = select
  967.     refresh(@select)
  968.   end
  969.   #--------------------------------------------------------------------------
  970.   # ● 读取文件
  971.   #--------------------------------------------------------------------------
  972.   def read_save_data(index)
  973.     @header[index] = DataManager.load_header(index)
  974.     @bitmaps[index].dispose if @bitmaps[index]
  975.     return unless EASY_MENU_SET::FILES_DETAILS_DATA[0][0]
  976.     @bitmaps[index] = DataManager.load_save_bitmap(index)
  977.   end
  978.   #--------------------------------------------------------------------------
  979.   # ● 刷新
  980.   #--------------------------------------------------------------------------
  981.   def refresh(index)
  982.     contents.clear
  983.     read_save_data(index)
  984.     v = EASY_MENU_SET::FILES_DETAILS_DATA
  985.     draw_background(@header[index], v)
  986.     return unless @header[index]
  987.     draw_save_bitmap(@header[index], index, v)
  988.     draw_party_characters(@header[index], index, v)
  989.     draw_party_faces(@header[index], index, v)
  990.   end
  991.   #--------------------------------------------------------------------------
  992.   # ● 绘制 底图
  993.   #--------------------------------------------------------------------------
  994.   def draw_background(header, v)
  995.     return unless v[3][0]
  996.     return if (!header && v[3][1] == false)
  997.     bitmap = Cache.system(v[3][2])
  998.     contents.blt(v[3][3], v[3][4], bitmap, Rect.new(0, 0, v[3][5], v[3][6]))
  999.   end
  1000.   #--------------------------------------------------------------------------
  1001.   # ● 绘制截图
  1002.   #--------------------------------------------------------------------------
  1003.   def draw_save_bitmap(header, index, v)
  1004.     return unless v[0][0]
  1005.     bitmap = @bitmaps[index]
  1006.     #bx = (width - standard_padding * 2 - bitmap.width) / 2
  1007.     contents.blt(v[0][1], v[0][2], bitmap, bitmap.rect)
  1008.   end
  1009.   #--------------------------------------------------------------------------
  1010.   # ● 绘制队伍角色行走图
  1011.   #--------------------------------------------------------------------------
  1012.   def draw_party_characters(header, index, v)
  1013.     return unless v[1][0]
  1014.     x = v[1][1]
  1015.     y = v[1][2]
  1016.     header[:characters].each_with_index do |data, i|
  1017.       draw_character(data[0], data[1], x + i * 48, y)
  1018.     end
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # ● 绘制队伍角色脸谱
  1022.   #--------------------------------------------------------------------------
  1023.   def draw_party_faces(header, index, v)
  1024.     return unless v[2][0]
  1025.     x = v[2][1]
  1026.     y = v[2][2]
  1027.     header[:characters].each_with_index do |data, i|
  1028.       bit = Cache.face(data[2])
  1029.       rx = bit.width / 4
  1030.       draw_face(data[2], data[3], x + i * rx, y)
  1031.     end
  1032.   end
  1033.   #--------------------------------------------------------------------------
  1034.   # ● 绘制角色肖像图
  1035.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  1036.   #--------------------------------------------------------------------------
  1037.   def draw_face(face_name, face_index, x, y, enabled = true)
  1038.     bitmap = Cache.face(face_name)
  1039.     w = bitmap.width / 4
  1040.     h = bitmap.height / 2
  1041.     rect = Rect.new(face_index % 4 * w, face_index / 4 * h, w, h)
  1042.     contents.blt(x + 4, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  1043.     bitmap.dispose
  1044.   end
  1045. end

  1046. #==============================================================================
  1047. # ■ Scene_File
  1048. #==============================================================================
  1049. class Scene_File < Scene_MenuBase
  1050.   #--------------------------------------------------------------------------
  1051.   # ● 开始处理
  1052.   #--------------------------------------------------------------------------
  1053.   def start
  1054.     super
  1055.     v = EASY_MENU_SET::FILES_RIM
  1056.     create_rim_background(v[0], v[1], v[2]) if v[0]
  1057.     create_actor_cg unless EASY_MENU_SET::FILES_DETAILS[0]
  1058.     create_help_window if EASY_MENU_SET::FILESLIST[5]
  1059.     create_savefile_windows
  1060.     create_details_window if EASY_MENU_SET::FILES_DETAILS[0]
  1061.     create_sub_button
  1062.     init_selection
  1063.   end
  1064.   #--------------------------------------------------------------------------
  1065.   # ● 结束处理
  1066.   #--------------------------------------------------------------------------
  1067.   def terminate
  1068.     super
  1069.   end
  1070.   #--------------------------------------------------------------------------
  1071.   # ● 更新画面
  1072.   #--------------------------------------------------------------------------
  1073.   def update
  1074.     super
  1075.     @details_window.set_select(@savefile_window.index) if @details_window
  1076.   end
  1077.   #--------------------------------------------------------------------------
  1078.   # ● 生成帮助窗口
  1079.   #--------------------------------------------------------------------------
  1080.   def create_help_window
  1081.     sp = EASY_MENU_SET::COMMAND[1]
  1082.     v = EASY_MENU_SET::FILESLIST
  1083.     w = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  1084.     @help_window = Window_Help.new(1, w)
  1085.     @help_window.set_text(help_window_text)
  1086.     @help_window.x = sp
  1087.     @help_window.y = sp + EASY_MENU_SET::COMMAND[3] - 8
  1088.   end
  1089.   #--------------------------------------------------------------------------
  1090.   # ● 获取帮助窗口的文本
  1091.   #--------------------------------------------------------------------------
  1092.   def help_window_text
  1093.     return ""
  1094.   end
  1095.   #--------------------------------------------------------------------------
  1096.   # ● 生成存档文件窗口
  1097.   #--------------------------------------------------------------------------
  1098.   def create_savefile_windows
  1099.     sp = EASY_MENU_SET::COMMAND[1]
  1100.     hy = sp + EASY_MENU_SET::COMMAND[3] - 8
  1101.     sy = @help_window ? (@help_window.y + @help_window.height) : hy
  1102.     v = EASY_MENU_SET::FILESLIST
  1103.     sw = v[0] > 0 ? v[0] : (Graphics.width / 2 - sp)
  1104.     sh = Graphics.height - sy - sp
  1105.     @savefile_window = Window_SaveFileList.new(sp, sy, sw, sh)
  1106.     @savefile_window.set_handler(:ok,     method(:on_savefile_ok))
  1107.     @savefile_window.set_handler(:cancel, method(:on_savefile_cancel))
  1108.   end
  1109.   #--------------------------------------------------------------------------
  1110.   # ● 生成详细文件窗口
  1111.   #--------------------------------------------------------------------------
  1112.   def create_details_window
  1113.     sp = EASY_MENU_SET::COMMAND[1]
  1114.     v = EASY_MENU_SET::FILES_DETAILS
  1115.     d = []
  1116.     if v[1]
  1117.       d[0] = @savefile_window.width + sp
  1118.       d[1] = @help_window.y
  1119.       d[2] = Graphics.width - d[0] - sp
  1120.       d[3] = Graphics.height - d[1] - sp
  1121.     else
  1122.       d = [v[2], v[3], v[4], v[5]]
  1123.     end
  1124.     @details_window = Window_FilesDetails.new(d[0], d[1], d[2], d[3])
  1125.   end
  1126.   #--------------------------------------------------------------------------
  1127.   # ● 初始化选择状态
  1128.   #--------------------------------------------------------------------------
  1129.   def init_selection
  1130.     index = first_savefile_index
  1131.     @savefile_window.select(index)
  1132.     @details_window.set_select(index) if @details_window
  1133.   end
  1134. end


  1135. #==============================================================================
  1136. # ■ Scene_Save
  1137. #==============================================================================
  1138. class Scene_Save < Scene_File
  1139.   #--------------------------------------------------------------------------
  1140.   # ● 开始处理
  1141.   #--------------------------------------------------------------------------
  1142.   def start
  1143.     Window_MenuCommand::init_command_position(:save)
  1144.     super
  1145.   end
  1146.   #--------------------------------------------------------------------------
  1147.   # ● 确定存档文件
  1148.   #--------------------------------------------------------------------------
  1149.   def on_savefile_ok
  1150.     super
  1151.     if DataManager.save_game(@savefile_window.index)
  1152.       on_save_success
  1153.     else
  1154.       Sound.play_buzzer
  1155.     end
  1156.   end
  1157.   #--------------------------------------------------------------------------
  1158.   # ● 存档成功时的处理
  1159.   #--------------------------------------------------------------------------
  1160.   def on_save_success
  1161.     Sound.play_save
  1162.     @savefile_window.set_files(:save)
  1163.     @details_window.refresh(@savefile_window.index) if @details_window
  1164.     Graphics.wait(30)
  1165.     if EASY_MENU_SET::FILES_RETURN
  1166.       return_scene
  1167.     else
  1168.       @savefile_window.set_files(nil)
  1169.       @savefile_window.activate
  1170.     end
  1171.   end
  1172. end


  1173. #==============================================================================
  1174. # ■ Scene_Load
  1175. #==============================================================================
  1176. class Scene_Load < Scene_File
  1177.   #--------------------------------------------------------------------------
  1178.   # ● 开始处理
  1179.   #--------------------------------------------------------------------------
  1180.   def start
  1181.     Window_MenuCommand::init_command_position(:continue)
  1182.     super
  1183.   end
  1184.   #--------------------------------------------------------------------------
  1185.   # ● 确定读档文件
  1186.   #--------------------------------------------------------------------------
  1187.   def on_savefile_ok
  1188.     super
  1189.     if DataManager.load_game(@savefile_window.index)
  1190.       on_load_success
  1191.     else
  1192.       Sound.play_buzzer
  1193.     end
  1194.   end
  1195.   #--------------------------------------------------------------------------
  1196.   # ● 读档成功时的处理
  1197.   #--------------------------------------------------------------------------
  1198.   def on_load_success
  1199.     Sound.play_load
  1200.     @savefile_window.set_files(:continue)
  1201.     Graphics.wait(20)
  1202.     fadeout_all
  1203.     $game_system.on_after_load
  1204.     SceneManager.goto(Scene_Map)
  1205.   end
  1206. end


  1207. #==============================================================================
  1208. # ■ DataManager
  1209. #==============================================================================
  1210. module DataManager
  1211.   #--------------------------------------------------------------------------
  1212.   # ● 判定存档文件是否存在
  1213.   #--------------------------------------------------------------------------
  1214.   def self.save_file_exists?
  1215.     if savefile_folder == ""
  1216.       text = 'Save*.rvdata2'
  1217.     else
  1218.       text = savefile_folder + '/Save*.rvdata2'
  1219.     end
  1220.     !Dir.glob(text).empty?
  1221.   end
  1222.   #--------------------------------------------------------------------------
  1223.   # ● 存档文件的最大数
  1224.   #--------------------------------------------------------------------------
  1225.   def self.savefile_max
  1226.     max = EASY_MENU_SET::FILES_MAX ? EASY_MENU_SET::FILES_MAX : 16
  1227.     return max
  1228.   end
  1229.   #--------------------------------------------------------------------------
  1230.   # ● 生成父文件夹
  1231.   #--------------------------------------------------------------------------
  1232.   def self.savefile_folder
  1233.     return EASY_MENU_SET::FILES_NAME
  1234.   end
  1235.   #--------------------------------------------------------------------------
  1236.   # ● 生成文件名
  1237.   #     index : 文件索引
  1238.   #--------------------------------------------------------------------------
  1239.   def self.make_filename(index)
  1240.     filename = sprintf("Save%02d.rvdata2", index + 1)
  1241.     if savefile_folder == ""
  1242.       return filename
  1243.     else
  1244.       return savefile_folder + "/" + filename
  1245.     end
  1246.   end
  1247.   #--------------------------------------------------------------------------
  1248.   # ● 生成截图
  1249.   #--------------------------------------------------------------------------
  1250.   def self.make_save_bitmap
  1251.     bitmap = set_bitmap_array(SceneManager.saves_bitmap)
  1252.     bitmap
  1253.   end
  1254.   #--------------------------------------------------------------------------
  1255.   # ● 获取截图
  1256.   #--------------------------------------------------------------------------
  1257.   def self.load_save_bitmap(index)
  1258.     begin
  1259.       File.open(make_filename(index), "rb") do |file|
  1260.         Marshal.load(file)
  1261.         return read_bitmap_array(Marshal.load(file))
  1262.       end
  1263.     rescue
  1264.       return nil
  1265.     end
  1266.   end
  1267.   #--------------------------------------------------------------------------
  1268.   # ● 制作截图文件 by 老鹰
  1269.   #--------------------------------------------------------------------------
  1270.   def self.set_bitmap_array(bitmap)
  1271.     data = []
  1272.     bitmap.height.times do |i| # 行号
  1273.       data[i] = []
  1274.       bitmap.width.times do |j| # 列号
  1275.         color = bitmap.get_pixel(j, i)
  1276.         data[i][j] = [color.red, color.green, color.blue]
  1277.       end
  1278.     end
  1279.     data
  1280.   end
  1281.   #--------------------------------------------------------------------------
  1282.   # ● 获取截图文件 by 老鹰
  1283.   #--------------------------------------------------------------------------
  1284.   def self.read_bitmap_array(array)
  1285.     h = array.size # 行数
  1286.     w = array[0].size # 列数
  1287.     bitmap = Bitmap.new(w, h)
  1288.     h.times do |i|
  1289.       w.times do |j|
  1290.         data = array[i][j]
  1291.         color = Color.new(data[0], data[1], data[2])
  1292.         bitmap.set_pixel(j, i, color)
  1293.       end
  1294.     end
  1295.     bitmap
  1296.   end
  1297.   #--------------------------------------------------------------------------
  1298.   # ● 执行存档(没有错误处理)
  1299.   #--------------------------------------------------------------------------
  1300.   def self.save_game_without_rescue(index)
  1301.     unless FileTest.directory?(savefile_folder)
  1302.       Dir::mkdir(savefile_folder)
  1303.     end
  1304.     File.open(make_filename(index), "wb") do |file|
  1305.       $game_system.on_before_save
  1306.       Marshal.dump(make_save_header, file)
  1307.       Marshal.dump(make_save_bitmap, file)
  1308.       Marshal.dump(make_save_contents, file)
  1309.       @last_savefile_index = index
  1310.     end
  1311.     return true
  1312.   end
  1313.   #--------------------------------------------------------------------------
  1314.   # ● 执行读档(没有错误处理)
  1315.   #--------------------------------------------------------------------------
  1316.   def self.load_game_without_rescue(index)
  1317.     File.open(make_filename(index), "rb") do |file|
  1318.       Marshal.load(file)
  1319.       Marshal.load(file)
  1320.       extract_save_contents(Marshal.load(file))
  1321.       reload_map_if_updated
  1322.       @last_savefile_index = index
  1323.     end
  1324.     return true
  1325.   end
  1326. end

  1327. #==============================================================================
  1328. # ■ Game_Party
  1329. #==============================================================================
  1330. class Game_Party < Game_Unit
  1331.   #--------------------------------------------------------------------------
  1332.   # ● 存档文件显示用的角色图像信息
  1333.   #--------------------------------------------------------------------------
  1334.   def characters_for_savefile
  1335.     battle_members.collect do |actor|
  1336.       [actor.character_name, actor.character_index,
  1337.        actor.face_name, actor.face_index]
  1338.     end
  1339.   end
  1340. end


  1341. #==============================================================================
  1342. # ■ Window_MenuStatus
  1343. #==============================================================================
  1344. class Window_MenuStatus < Window_Selectable
  1345.   #--------------------------------------------------------------------------
  1346.   # ● 获取窗口的宽度
  1347.   #--------------------------------------------------------------------------
  1348.   def window_width
  1349.     Graphics.width - 160 - 96
  1350.   end
  1351.   #--------------------------------------------------------------------------
  1352.   # ● 获取窗口的高度
  1353.   #--------------------------------------------------------------------------
  1354.   def window_height
  1355.     Graphics.height > 416 ? 416 : Graphics.height
  1356.   end
  1357. end

  1358. #==============================================================================
  1359. # ■ Window_GameEnd
  1360. #==============================================================================
  1361. class Window_GameEnd < Window_Command
  1362.   #--------------------------------------------------------------------------
  1363.   # ● 初始化对象
  1364.   #--------------------------------------------------------------------------
  1365.   alias easy_menu_initialize initialize
  1366.   def initialize
  1367.     easy_menu_initialize
  1368.     self.windowskin = Cache.system(EASY_MENU_SET::SKIN)
  1369.   end
  1370. end
复制代码
最初の結果 发表于 2021-4-4 22:24:32
好像不行,我的好像是改过的葱式菜单。
PLeaseS 发表于 2021-2-16 07:14:33
禁用存档,然后事件写一个?
alexncf125 发表于 2021-2-15 18:18:25
把·CONG'S EASY MENU由第1089行class Scene_File < Scene_MenuBase开始,
至到1374行module DataManager的end作结尾, 全部注释掉就对了
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-16 02:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表