查看: 15577|回复: 30

[RMVA发布] 一款简单易用的解谜游戏菜单

[复制链接]

梦石
0
星屑
9716
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2014-9-9 23:12:25 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
本帖最后由 cinderelmini 于 2015-11-15 17:57 编辑
  1. return if (使用了其他菜单类脚本 && 无法自行整合和兼容)的同学
复制代码
简单的解谜菜单-1.png 简单的解谜菜单.png

总之,就是我自己比较常用的解谜类菜单模式,
把Scene_Item的物品相关内容都搬到Scene_Menu里了,
因为只是针对普通的解谜设定,
所以物品请单纯地设置为关联公共事件的物品,
虽然是这样的设定,但一般(恢复类药品之类的需要选择对象)的物品还是可以使用的,
只不过,你需要自己设定后面的排版了(我才不是因为懒……)。

脚本如下(略长):
点击展开/收起
  1. =begin
  2. ===============================================================================
  3.   显示立绘以及简易的解谜菜单   By.椎名  2014-09-09
  4. ===============================================================================
  5.   【使用说明】
  6.   
  7.   一个简单的解谜游戏菜单,基本都是默认的窗口,
  8.   至于坐标宽度和列数之类的设置,请自行修改。
  9.   
  10.   直接main前insert可用。
  11.   与其他菜单类脚本冲突可能性极大,
  12.   不提供整合和兼容服务。
  13.   
  14.   
  15.   脚本中搜索:
  16.   ·“设置部分”开始设定各个项目
  17.     你可以在这里设定包含字号,立绘等一系列有关的项目。
  18.    
  19.   ·“脚本部分-Scene”查看Scene的修改内容
  20.     这里可以调整一部分窗口的坐标和宽度等。
  21.    
  22.   ·“脚本部分-Window”查看各个窗口的修改内容
  23.     这里只是对某些窗口内容的重新定义。
  24.    
  25.   ·“脚本部分-立绘”为新增的显示立绘脚本
  26.     立绘的窗口,默认设定是滑动和淡入,关闭滑动不淡入。
  27.     你也可以通过在这里设定坐标来达到从下方滑入画面的效果。
  28.   
  29.   
  30.   发现BUG欢迎随时回报。
  31.   
  32. =end


  33. #####################################
  34. # 设置部分
  35. #####################################

  36. module SHIINA
  37.   # 调整字号
  38.   FONT_SIZE = 18
  39.   
  40.   # 是否显示立绘
  41.   IMAGE = true
  42.   
  43.   # 固定的立绘(为false时立绘滚动效果)
  44.   LOCK_IMAGE = false
  45.   
  46.   # 立绘的滑动速度(立绘不固定时生效)
  47.   IMAGE_SLIDE_SPD = 10
  48.   
  49.   # 立绘文件名(放在picture文件夹内,赋值nil的话将使用队伍第一个角色的名字为名的图片)
  50.   IMAGE_NAME = "CS003CYA"
  51.   
  52.   # 是否使用物品分类选择
  53.   ITEM_TYPE = false
  54.   
  55.   # 加入武器和防具分类?(使用物品分类为true时生效)
  56.   WEAPON_ARMOR = false
  57.   
  58.   # 是否可以整队
  59.   FORMATION = false
  60.   
  61.   # 是否显示金钱窗口
  62.   GOLD = true
  63.   
  64.   # 是否显示人物的状态窗口
  65.   STATUS = true
  66.   
  67.   # 显示状态的情况下,是否显示队友(人物状态显示为true的时候生效)
  68.   PARTY_STATUS = false
  69.   
  70.   # 状态窗口内容高度(设置为false则返回默认高度)
  71.   STATUS_HEIGHT = 98
  72.   
  73.   # 状态窗口的显示项目,不显示的项目改为false或者nil,
  74.   STATUS_ITEM = [true,   # 脸图
  75.                  true,   # 名字
  76.                  true,   # 等级
  77.                  true,   # 状态图标
  78.                  true,   # 职业
  79.                  true,   # HP
  80.                  true    # MP
  81.                  ]
  82. end
  83.                
  84. # 重置整体字号
  85. Font.default_size = SHIINA::FONT_SIZE

  86. #----------------------设置部分结束----------------------#


  87. #####################################
  88. # 脚本部分-Scene
  89. #####################################
  90. #==============================================================================
  91. # ■ Scene_MenuBase
  92. #==============================================================================

  93. class Scene_MenuBase < Scene_Base
  94.   #--------------------------------------------------------------------------
  95.   # ● 生成帮助窗口
  96.   #--------------------------------------------------------------------------
  97.   def create_help_window
  98.     @help_window = Window_Help.new
  99.     @help_window.visible = false
  100.     @help_window.viewport = @viewport
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● 生成角色窗口
  104.   #--------------------------------------------------------------------------
  105.   def create_actor_window
  106.     @actor_window = Window_MenuActor.new
  107.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  108.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ● 获取当前选中的物品
  112.   #--------------------------------------------------------------------------
  113.   def item
  114.     @item_window.item
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ● 获取物品的使用者
  118.   #--------------------------------------------------------------------------
  119.   def user
  120.     $game_party.movable_members.max_by {|member| member.pha }
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 显示子窗口
  124.   #--------------------------------------------------------------------------
  125.   def show_sub_window(window)
  126.     width_remain = Graphics.width - window.width
  127.     window.x = 0
  128.     @viewport.rect.x = window.width
  129.     @viewport.rect.width = Graphics.width - window.width
  130.     window.show.activate
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 隐藏子窗口
  134.   #--------------------------------------------------------------------------
  135.   def hide_sub_window(window)
  136.     @viewport.rect.x = @viewport.ox = 0
  137.     @viewport.rect.width = Graphics.width
  138.     window.hide.deactivate
  139.     activate_item_window
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● 角色“确定”
  143.   #--------------------------------------------------------------------------
  144.   def on_actor_ok
  145.     if item_usable?
  146.       use_item
  147.     else
  148.       Sound.play_buzzer
  149.     end
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 角色“取消”
  153.   #--------------------------------------------------------------------------
  154.   def on_actor_cancel
  155.     hide_sub_window(@actor_window)
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● 确定物品
  159.   #--------------------------------------------------------------------------
  160.   def determine_item
  161.     if item.for_friend?
  162.       show_sub_window(@actor_window)
  163.       @actor_window.select_for_item(item)
  164.     else
  165.       use_item
  166.       activate_item_window
  167.     end
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # ● 启用物品窗口
  171.   #--------------------------------------------------------------------------
  172.   def activate_item_window
  173.     @item_window.refresh
  174.     @item_window.activate
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● 获取物品的使用目标数组
  178.   #--------------------------------------------------------------------------
  179.   def item_target_actors
  180.     if !item.for_friend?
  181.       []
  182.     elsif item.for_all?
  183.       $game_party.members
  184.     else
  185.       [$game_party.members[@actor_window.index]]
  186.     end
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 判定物品是否可以使用
  190.   #--------------------------------------------------------------------------
  191.   def item_usable?
  192.     user.usable?(item) && item_effects_valid?
  193.   end
  194.   #--------------------------------------------------------------------------
  195.   # ● 判定物品的效果是否有效
  196.   #--------------------------------------------------------------------------
  197.   def item_effects_valid?
  198.     item_target_actors.any? do |target|
  199.       target.item_test(user, item)
  200.     end
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● 对角色使用物品
  204.   #--------------------------------------------------------------------------
  205.   def use_item_to_actors
  206.     item_target_actors.each do |target|
  207.       item.repeats.times { target.item_apply(user, item) }
  208.     end
  209.   end
  210.   #--------------------------------------------------------------------------
  211.   # ● 使用物品
  212.   #--------------------------------------------------------------------------
  213.   def use_item
  214.     play_se_for_item
  215.     user.use_item(item)
  216.     use_item_to_actors
  217.     check_common_event
  218.     check_gameover
  219.     @actor_window.refresh
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # ● 公共事件预定判定
  223.   #    如果预约了事件的调用,则切换到地图画面。
  224.   #--------------------------------------------------------------------------
  225.   def check_common_event
  226.     SceneManager.goto(Scene_Map) if $game_temp.common_event_reserved?
  227.   end
  228. end



  229. #==============================================================================
  230. # ■ Scene_Menu
  231. #==============================================================================

  232. class Scene_Menu < Scene_MenuBase
  233.   #--------------------------------------------------------------------------
  234.   # ● 开始处理
  235.   #--------------------------------------------------------------------------
  236.   def start
  237.     super
  238.     create_image
  239.     create_gold_window if SHIINA::GOLD
  240.     create_command_window
  241.     create_status_window if SHIINA::STATUS
  242.     create_help_window
  243.     create_category_window
  244.     create_item_window
  245.     create_actor_window
  246.   end
  247.   
  248.   def create_image
  249.     @image = Image.new
  250.   end
  251.   
  252.   #--------------------------------------------------------------------------
  253.   # ● 生成指令窗口
  254.   #--------------------------------------------------------------------------
  255.   def create_command_window
  256.     @command_window = Window_MenuCommand.new
  257.     @command_window.y = SHIINA::GOLD ?
  258.                         @gold_window.y - @command_window.height :
  259.                         Graphics.height - @command_window.height
  260.    
  261.     @command_window.set_handler(:item,      method(:command_item))
  262.     @command_window.set_handler(:formation, method(:command_formation)) if SHIINA::FORMATION
  263.     @command_window.set_handler(:save,      method(:command_save))
  264.     @command_window.set_handler(:game_end,  method(:command_game_end))
  265.     @command_window.set_handler(:cancel,    method(:return_scene))
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● 生成金钱窗口
  269.   #--------------------------------------------------------------------------
  270.   def create_gold_window
  271.     @gold_window = Window_Gold.new
  272.     @gold_window.x = 0
  273.     @gold_window.y = Graphics.height - @gold_window.height
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● 生成状态窗口
  277.   #--------------------------------------------------------------------------
  278.   def create_status_window
  279.     @status_window = Window_MenuStatus.new(@command_window.width, 0)
  280.     @status_window.y = Graphics.height - @status_window.height
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # ● 生成分类窗口
  284.   #--------------------------------------------------------------------------
  285.   def create_category_window
  286.     @category_window = Window_ItemCategory.new
  287.     @category_window.viewport = @viewport
  288.     @category_window.help_window = @help_window
  289.     @category_window.y = @help_window.height
  290.     @category_window.deactivate
  291.     @category_window.visible = false
  292.     @category_window.set_handler(:ok,     method(:on_category_ok))
  293.     @category_window.set_handler(:cancel, method(:on_category_cancel))
  294.   end
  295.   #--------------------------------------------------------------------------
  296.   # ● 生成物品窗口
  297.   #--------------------------------------------------------------------------
  298.   def create_item_window
  299.     item_window_y      = @category_window.y + (SHIINA::ITEM_TYPE ? @category_window.height : 0)
  300.     item_window_height = Graphics.height - item_window_y - (Graphics.height - @command_window.y)
  301.     @item_window = Window_ItemList.new(@category_window.x, item_window_y, @command_window.width, item_window_height)
  302.     @item_window.viewport = @viewport
  303.     @item_window.help_window = @help_window
  304.     @item_window.deactivate
  305.     @item_window.visible = false
  306.     @item_window.set_handler(:ok,     method(:on_item_ok))
  307.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  308.     @category_window.item_window = @item_window
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # ● 指令“物品”
  312.   #--------------------------------------------------------------------------
  313.   def command_item
  314.     if SHIINA::ITEM_TYPE
  315.       @category_window.activate
  316.       @category_window.visible = true
  317.       @item_window.visible = true
  318.     else
  319.       @item_window.category = :item
  320.       @item_window.activate
  321.       @item_window.select_last
  322.       @item_window.visible = true
  323.       @help_window.visible = @item_window.visible
  324.     end
  325.   end
  326.   #--------------------------------------------------------------------------
  327.   # ● 指令“整队”
  328.   #--------------------------------------------------------------------------
  329.   def command_formation
  330.     return unless SHIINA::STATUS
  331.     @status_window.select_last
  332.     @status_window.activate
  333.     @status_window.set_handler(:ok,     method(:on_formation_ok))
  334.     @status_window.set_handler(:cancel, method(:on_formation_cancel))
  335.   end
  336.   #--------------------------------------------------------------------------
  337.   # ● 指令“存档”
  338.   #--------------------------------------------------------------------------
  339.   def command_save
  340.     SceneManager.call(Scene_Save)
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # ● 指令“结束游戏”
  344.   #--------------------------------------------------------------------------
  345.   def command_game_end
  346.     SceneManager.call(Scene_End)
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● 整队“确定”
  350.   #--------------------------------------------------------------------------
  351.   def on_formation_ok
  352.     if @status_window.pending_index >= 0
  353.       $game_party.swap_order(@status_window.index,
  354.                              @status_window.pending_index)
  355.       @status_window.pending_index = -1
  356.       @status_window.redraw_item(@status_window.index)
  357.     else
  358.       @status_window.pending_index = @status_window.index
  359.     end
  360.     @status_window.activate
  361.   end
  362.   #--------------------------------------------------------------------------
  363.   # ● 整队“取消”
  364.   #--------------------------------------------------------------------------
  365.   def on_formation_cancel
  366.     if @status_window.pending_index >= 0
  367.       @status_window.pending_index = -1
  368.       @status_window.activate
  369.     else
  370.       @status_window.unselect
  371.       @command_window.activate
  372.     end
  373.   end
  374.   #--------------------------------------------------------------------------
  375.   # ● 分类“确定”
  376.   #--------------------------------------------------------------------------
  377.   def on_category_ok
  378.     @item_window.activate
  379.     @item_window.select_last
  380.     @help_window.visible = @item_window.visible
  381.   end
  382.   #--------------------------------------------------------------------------
  383.   # ● 分类“取消”
  384.   #--------------------------------------------------------------------------
  385.   def on_category_cancel
  386.     @category_window.deactivate
  387.     @category_window.visible = false
  388.     @item_window.visible = false
  389.     @help_window.visible = @item_window.visible
  390.     @command_window.activate
  391.   end
  392.   #--------------------------------------------------------------------------
  393.   # ● 物品“确定”
  394.   #--------------------------------------------------------------------------
  395.   def on_item_ok
  396.     $game_party.last_item.object = item
  397.     determine_item
  398.   end
  399.   #--------------------------------------------------------------------------
  400.   # ● 物品“取消”
  401.   #--------------------------------------------------------------------------
  402.   def on_item_cancel
  403.     @item_window.unselect
  404.     if SHIINA::ITEM_TYPE
  405.       @category_window.activate
  406.       @help_window.visible = false
  407.     else
  408.       @item_window.visible = false
  409.       @help_window.visible = @item_window.visible
  410.       @command_window.activate
  411.     end
  412.   end
  413.   #--------------------------------------------------------------------------
  414.   # ● 播放使用物品声效
  415.   #--------------------------------------------------------------------------
  416.   def play_se_for_item
  417.     Sound.play_use_item
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # ● 使用物品
  421.   #--------------------------------------------------------------------------
  422.   def use_item
  423.     super
  424.     @item_window.redraw_current_item
  425.   end
  426. end

  427. #----------------------Scene部分结束----------------------#



  428. #####################################
  429. # 脚本部分-Window
  430. #####################################
  431. #==============================================================================
  432. # ■ Window_MenuCommand
  433. #------------------------------------------------------------------------------
  434. #  菜单画面中显示指令的窗口
  435. #==============================================================================

  436. class Window_MenuCommand < Window_Command
  437.   #--------------------------------------------------------------------------
  438.   # ● 向指令列表添加主要的指令
  439.   #--------------------------------------------------------------------------
  440.   def add_main_commands
  441.     add_command(Vocab::item,   :item,   main_commands_enabled)
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # ● 添加整队指令
  445.   #--------------------------------------------------------------------------
  446.   def add_formation_command
  447.     return unless SHIINA::FORMATION
  448.     add_command(Vocab::formation, :formation, formation_enabled)
  449.   end
  450. end

  451. #==============================================================================
  452. # ■ Window_ItemCategory
  453. #------------------------------------------------------------------------------
  454. #  物品画面和商店画面中,显示装备、所持物品等项目列表的窗口。
  455. #==============================================================================

  456. class Window_ItemCategory < Window_HorzCommand
  457.   #--------------------------------------------------------------------------
  458.   # ● 生成指令列表
  459.   #--------------------------------------------------------------------------
  460.   def make_command_list
  461.     add_command(Vocab::item,     :item)
  462.     add_command(Vocab::weapon,   :weapon) if SHIINA::WEAPON_ARMOR
  463.     add_command(Vocab::armor,    :armor) if SHIINA::WEAPON_ARMOR
  464.     add_command(Vocab::key_item, :key_item)
  465.   end
  466. end

  467. #==============================================================================
  468. # ■ Window_ItemList
  469. #------------------------------------------------------------------------------
  470. #  物品画面中,显示持有物品的窗口。
  471. #==============================================================================

  472. class Window_ItemList < Window_Selectable
  473.   #--------------------------------------------------------------------------
  474.   # ● 获取列数
  475.   #--------------------------------------------------------------------------
  476.   def col_max
  477.     return 1
  478.   end
  479. end

  480. #==============================================================================
  481. # ■ Window_MenuStatus
  482. #------------------------------------------------------------------------------
  483. #  菜单画面中,显示队伍成员状态的窗口
  484. #==============================================================================

  485. class Window_MenuStatus < Window_Selectable
  486.   #--------------------------------------------------------------------------
  487.   # ● 获取窗口的宽度
  488.   #--------------------------------------------------------------------------
  489.   def window_width
  490.     Graphics.width - 160
  491.   end
  492.   #--------------------------------------------------------------------------
  493.   # ● 最大数目
  494.   #--------------------------------------------------------------------------
  495.   def item_max
  496.     if SHIINA::PARTY_STATUS
  497.       return $game_party.members.size
  498.     else
  499.       return 1
  500.     end
  501.   end
  502.   #--------------------------------------------------------------------------
  503.   # ● 获取窗口的高度
  504.   #--------------------------------------------------------------------------
  505.   def window_height
  506.     item_max * item_height + standard_padding * 2
  507.   end
  508.   #--------------------------------------------------------------------------
  509.   # ● 绘制项目
  510.   #--------------------------------------------------------------------------
  511.   def draw_item(index)
  512.     unless SHIINA::PARTY_STATUS
  513.       return if index > 0
  514.     end
  515.     actor = $game_party.members[index]
  516.     enabled = $game_party.battle_members.include?(actor)
  517.     rect = item_rect(index)
  518.     draw_item_background(index)
  519.     draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled) if SHIINA::STATUS_ITEM[0]
  520.     draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
  521.   end
  522.   #--------------------------------------------------------------------------
  523.   # ● 绘制简单的状态
  524.   #--------------------------------------------------------------------------
  525.   def draw_actor_simple_status(actor, x, y)
  526.     draw_actor_name(actor, x, y)                       if SHIINA::STATUS_ITEM[1]
  527.     draw_actor_level(actor, x, y + line_height * 1)    if SHIINA::STATUS_ITEM[2]
  528.     draw_actor_icons(actor, x, y + line_height * 2)    if SHIINA::STATUS_ITEM[3]
  529.     draw_actor_class(actor, x + 120, y)                if SHIINA::STATUS_ITEM[4]
  530.     draw_actor_hp(actor, x + 120, y + line_height * 1) if SHIINA::STATUS_ITEM[5]
  531.     draw_actor_mp(actor, x + 120, y + line_height * 2) if SHIINA::STATUS_ITEM[6]
  532.   end
  533.   #--------------------------------------------------------------------------
  534.   # ● 获取项目的高度
  535.   #--------------------------------------------------------------------------
  536.   def item_height
  537.     if SHIINA::STATUS_HEIGHT
  538.       return SHIINA::STATUS_HEIGHT
  539.     else
  540.       return (Graphics.height - standard_padding * 2) / 4
  541.     end
  542.   end
  543. end

  544. #----------------------Window部分结束----------------------#


  545. #####################################
  546. # 脚本部分-立绘
  547. #####################################

  548. class Image < Window_Base
  549.   
  550.   def initialize(x=get_x, y=Graphics.height)
  551.     super(x, y, 24, 24)
  552.     @image = Sprite.new
  553.     @image.bitmap = Cache.picture(get_pic_name)
  554.     @image.ox = @image.bitmap.width/2
  555.     @image.oy = @image.bitmap.height
  556.     self.opacity = 0
  557.     self.contents_opacity = 0 unless SHIINA::LOCK_IMAGE
  558.     self.x = x
  559.     self.y = y
  560.     set
  561.     setn(Graphics.width - 32 * 4)
  562.   end
  563.   
  564.   def get_pic_name
  565.     SHIINA::IMAGE_NAME.nil? ? $game_party.members[0].name.to_s : SHIINA::IMAGE_NAME
  566.   end
  567.   
  568.   def get_x
  569.     SHIINA::LOCK_IMAGE ? Graphics.width - 32 * 4 : Graphics.width
  570.   end
  571.   
  572.   def spd
  573.     SHIINA::IMAGE_SLIDE_SPD
  574.   end
  575.   
  576.   def set(x=self.x, y=self.y)
  577.     self.x = x
  578.     self.y = y
  579.     @nx = x
  580.     @ny = y
  581.   end
  582.   
  583.   def setn(x=self.x, y=self.y)
  584.     @nx = x
  585.     @ny = y
  586.   end
  587.   
  588.   def x=(n); super(n); @image.x=n; end
  589.   def y=(n); super(n); @image.y=n; end
  590.   def z=(n); super(n); @image.z=n; end
  591.   def visible=(n); super(n); @image.visible=n; end
  592.   def contents_opacity=(n); super(n); @image.opacity=n; end
  593.   def dispose; super; @image.dispose; end
  594.   
  595.   def update
  596.     super
  597.     return if SHIINA::LOCK_IMAGE
  598.     update_slide
  599.   end
  600.   
  601.   def slide_over?
  602.     return (self.x==@nx && self.y=@ny)
  603.   end
  604.   
  605.   def update_slide
  606.     self.contents_opacity += 20 unless SHIINA::LOCK_IMAGE
  607.     return if slide_over?
  608.     if self.x + spd < @nx
  609.       self.x += spd
  610.     elsif self.x - spd > @nx
  611.       self.x -= spd
  612.     elsif self.x != @nx
  613.       self.x = @nx
  614.     end
  615.     if self.y + spd < @ny
  616.       self.y += spd
  617.     elsif self.y - spd > @ny
  618.       self.y -= spd
  619.     elsif self.y != @ny
  620.       self.y = @ny
  621.     end
  622.   end
  623.   
  624. end

  625. #----------------------立绘部分结束----------------------#

复制代码


※2015-11-15更新:
·增加了队友LR键(也就是pageup/pagedown)切换功能,取消了状态窗口多层显示队友功能。
·更改立绘类为Sprite并兼并进Window_MenuCommand里刷新和更新。
·修改了一处变量书写错误(手残。。)
V2版脚本如下(依然略长)
  1. =begin
  2. ===============================================================================
  3.   显示立绘以及简易的解谜菜单   By.椎名  2015-11-15
  4. ===============================================================================
  5.   【使用说明】
  6.   
  7.   一个简单的解谜游戏菜单,基本都是默认的窗口,
  8.   至于坐标宽度和列数之类的设置,请自行修改。
  9.   
  10.   直接main前insert可用。
  11.   与其他菜单类脚本冲突可能性极大,
  12.   不提供整合和兼容服务。
  13.   
  14.   
  15.   脚本中搜索:
  16.   ·“设置部分”开始设定各个项目
  17.     你可以在这里设定包含字号,立绘等一系列有关的项目。
  18.    
  19.   ·“脚本部分-Scene”查看Scene的修改内容
  20.     这里可以调整一部分窗口的坐标和宽度等。
  21.    
  22.   ·“脚本部分-Window”查看各个窗口的修改内容
  23.     这里只是对某些窗口内容的重新定义。
  24.    
  25.   ·“脚本部分-立绘”为新增的显示立绘脚本
  26.     立绘的窗口,默认设定是滑动和淡入,关闭滑动不淡入。
  27.     你也可以通过在这里设定坐标来达到从下方滑入画面的效果。
  28.   
  29.   
  30.   发现BUG欢迎随时回报。
  31.   
  32. =end


  33. #####################################
  34. # 设置部分
  35. #####################################

  36. module SHIINA
  37.   # 调整字号
  38.   FONT_SIZE = 18
  39.   
  40.   # 是否显示立绘
  41.   IMAGE = true
  42.   
  43.   # 固定的立绘(为false时立绘滚动和淡入效果)
  44.   LOCK_IMAGE = false
  45.   
  46.   # 立绘左右翻转(没错这是窝偷懒用的)(← ←结果偷懒不成。。但是还是留着吧)
  47.   IMAGE_MIRROR = false
  48.   
  49.   # 立绘的滑动速度(立绘不固定时生效)
  50.   IMAGE_SLIDE_SPD = 10
  51.   
  52.   # 立绘文件名(放在picture文件夹内,赋值nil的话将使用菜单当前角色的名字为名的图片)
  53.   IMAGE_NAME = nil
  54.   
  55.   # 是否使用物品分类选择
  56.   ITEM_TYPE = false
  57.   
  58.   # 加入武器和防具分类?(使用物品分类为true时生效)
  59.   WEAPON_ARMOR = false
  60.   
  61.   # 是否可以整队
  62.   FORMATION = false
  63.   
  64.   # 是否显示金钱窗口
  65.   GOLD = true
  66.   
  67.   # 是否显示人物的状态窗口
  68.   STATUS = true
  69.   
  70.   # 状态窗口内容高度(设置为false则返回默认高度)
  71.   STATUS_HEIGHT = 98
  72.   
  73.   # 状态窗口的显示项目,不显示的项目改为false或者nil,
  74.   STATUS_ITEM = [true,   # 脸图
  75.                  true,   # 名字
  76.                  true,   # 等级
  77.                  true,   # 状态图标
  78.                  true,   # 职业
  79.                  true,   # HP
  80.                  true    # MP
  81.                  ]
  82. end
  83.                
  84. # 重置整体字号
  85. Font.default_size = SHIINA::FONT_SIZE

  86. #----------------------设置部分结束----------------------#


  87. #####################################
  88. # 脚本部分-Scene
  89. #####################################
  90. #==============================================================================
  91. # ■ Scene_MenuBase
  92. #==============================================================================

  93. class Scene_MenuBase < Scene_Base
  94.   #--------------------------------------------------------------------------
  95.   # ● 生成帮助窗口
  96.   #--------------------------------------------------------------------------
  97.   def create_help_window
  98.     @help_window = Window_Help.new
  99.     @help_window.visible = false
  100.     @help_window.viewport = @viewport
  101.   end
  102.   #--------------------------------------------------------------------------
  103.   # ● 生成角色窗口
  104.   #--------------------------------------------------------------------------
  105.   def create_actor_window
  106.     @actor_window = Window_MenuActor.new
  107.     @actor_window.set_handler(:ok,     method(:on_actor_ok))
  108.     @actor_window.set_handler(:cancel, method(:on_actor_cancel))
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ● 获取当前选中的物品
  112.   #--------------------------------------------------------------------------
  113.   def item
  114.     @item_window.item
  115.   end
  116.   #--------------------------------------------------------------------------
  117.   # ● 获取物品的使用者(直接指向当前角色)
  118.   #--------------------------------------------------------------------------
  119.   def user
  120.     return @actor
  121. #~     $game_party.movable_members.max_by {|member| member.pha }
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 显示子窗口
  125.   #--------------------------------------------------------------------------
  126.   def show_sub_window(window)
  127.     width_remain = Graphics.width - window.width
  128.     window.x = 0
  129.     @viewport.rect.x = window.width
  130.     @viewport.rect.width = Graphics.width - window.width
  131.     window.show.activate
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 隐藏子窗口
  135.   #--------------------------------------------------------------------------
  136.   def hide_sub_window(window)
  137.     @viewport.rect.x = @viewport.ox = 0
  138.     @viewport.rect.width = Graphics.width
  139.     window.hide.deactivate
  140.     activate_item_window
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● 角色“确定”
  144.   #--------------------------------------------------------------------------
  145.   def on_actor_ok
  146.     if item_usable?
  147.       use_item
  148.     else
  149.       Sound.play_buzzer
  150.     end
  151.   end
  152.   #--------------------------------------------------------------------------
  153.   # ● 角色“取消”
  154.   #--------------------------------------------------------------------------
  155.   def on_actor_cancel
  156.     hide_sub_window(@actor_window)
  157.   end
  158.   #--------------------------------------------------------------------------
  159.   # ● 确定物品
  160.   #--------------------------------------------------------------------------
  161.   def determine_item
  162.     if item.for_friend?
  163.       show_sub_window(@actor_window)
  164.       @actor_window.select_for_item(item)
  165.     else
  166.       use_item
  167.       activate_item_window
  168.     end
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● 启用物品窗口
  172.   #--------------------------------------------------------------------------
  173.   def activate_item_window
  174.     @item_window.refresh
  175.     @item_window.activate
  176.   end
  177.   #--------------------------------------------------------------------------
  178.   # ● 获取物品的使用目标数组
  179.   #--------------------------------------------------------------------------
  180.   def item_target_actors
  181.     if !item.for_friend?
  182.       []
  183.     elsif item.for_all?
  184.       $game_party.members
  185.     else
  186.       [$game_party.members[@actor_window.index]]
  187.     end
  188.   end
  189.   #--------------------------------------------------------------------------
  190.   # ● 判定物品是否可以使用
  191.   #--------------------------------------------------------------------------
  192.   def item_usable?
  193.     user.usable?(item) && item_effects_valid?
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 判定物品的效果是否有效
  197.   #--------------------------------------------------------------------------
  198.   def item_effects_valid?
  199.     item_target_actors.any? do |target|
  200.       target.item_test(user, item)
  201.     end
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● 对角色使用物品
  205.   #--------------------------------------------------------------------------
  206.   def use_item_to_actors
  207.     item_target_actors.each do |target|
  208.       item.repeats.times { target.item_apply(user, item) }
  209.     end
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ● 使用物品
  213.   #--------------------------------------------------------------------------
  214.   def use_item
  215.     play_se_for_item
  216.     user.use_item(item)
  217.     use_item_to_actors
  218.     check_common_event
  219.     check_gameover
  220.     @actor_window.refresh
  221.   end
  222.   #--------------------------------------------------------------------------
  223.   # ● 公共事件预定判定
  224.   #    如果预约了事件的调用,则切换到地图画面。
  225.   #--------------------------------------------------------------------------
  226.   def check_common_event
  227.     SceneManager.goto(Scene_Map) if $game_temp.common_event_reserved?
  228.   end
  229. end



  230. #==============================================================================
  231. # ■ Scene_Menu
  232. #==============================================================================

  233. class Scene_Menu < Scene_MenuBase
  234.   #--------------------------------------------------------------------------
  235.   # ● 开始处理
  236.   #--------------------------------------------------------------------------
  237.   def start
  238.     super
  239.     create_image
  240.     create_gold_window if SHIINA::GOLD
  241.     create_command_window
  242.     create_status_window if SHIINA::STATUS
  243.     create_help_window
  244.     create_category_window
  245.     create_item_window
  246.     create_actor_window
  247.   end
  248.   
  249.   #--------------------------------------------------------------------------
  250.   # ● 生成立绘
  251.   #--------------------------------------------------------------------------
  252.   def create_image
  253.     @image = Image.new(@actor)
  254.   end
  255.   
  256.   #--------------------------------------------------------------------------
  257.   # ● 生成指令窗口
  258.   #--------------------------------------------------------------------------
  259.   def create_command_window
  260.     @command_window = Window_MenuCommand.new
  261.     @command_window.y = SHIINA::GOLD ?
  262.                         @gold_window.y - @command_window.height :
  263.                         Graphics.height - @command_window.height
  264.    
  265.     @command_window.set_handler(:item,      method(:command_item))
  266.     @command_window.set_handler(:formation, method(:command_formation)) if SHIINA::FORMATION
  267.     @command_window.set_handler(:save,      method(:command_save))
  268.     @command_window.set_handler(:game_end,  method(:command_game_end))
  269.     @command_window.set_handler(:cancel,    method(:return_scene))
  270.     @command_window.set_handler(:pageup,    method(:prev_actor))
  271.     @command_window.set_handler(:pagedown,  method(:next_actor))
  272.     # 立绘塞进指令窗口
  273.     @command_window.image = @image
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● 生成金钱窗口
  277.   #--------------------------------------------------------------------------
  278.   def create_gold_window
  279.     @gold_window = Window_Gold.new
  280.     @gold_window.x = 0
  281.     @gold_window.y = Graphics.height - @gold_window.height
  282.   end
  283.   #--------------------------------------------------------------------------
  284.   # ● 生成状态窗口
  285.   #--------------------------------------------------------------------------
  286.   def create_status_window
  287.     @status_window = Window_MenuStatus.new(@command_window.width, 0)
  288.     @status_window.refresh_nanikore(@actor)
  289.     @status_window.y = Graphics.height - @status_window.height
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ● 生成分类窗口
  293.   #--------------------------------------------------------------------------
  294.   def create_category_window
  295.     @category_window = Window_ItemCategory.new
  296.     @category_window.viewport = @viewport
  297.     @category_window.help_window = @help_window
  298.     @category_window.y = @help_window.height
  299.     @category_window.deactivate
  300.     @category_window.visible = false
  301.     @category_window.set_handler(:ok,     method(:on_category_ok))
  302.     @category_window.set_handler(:cancel, method(:on_category_cancel))
  303.   end
  304.   #--------------------------------------------------------------------------
  305.   # ● 生成物品窗口
  306.   #--------------------------------------------------------------------------
  307.   def create_item_window
  308.     item_window_y      = @category_window.y + (SHIINA::ITEM_TYPE ? @category_window.height : 0)
  309.     item_window_height = Graphics.height - item_window_y - (Graphics.height - @command_window.y)
  310.     @item_window = Window_ItemList.new(@category_window.x, item_window_y, @command_window.width, item_window_height)
  311.     @item_window.viewport = @viewport
  312.     @item_window.help_window = @help_window
  313.     @item_window.deactivate
  314.     @item_window.visible = false
  315.     @item_window.set_handler(:ok,     method(:on_item_ok))
  316.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  317.     @category_window.item_window = @item_window
  318.   end
  319.   #--------------------------------------------------------------------------
  320.   # ● 指令“物品”
  321.   #--------------------------------------------------------------------------
  322.   def command_item
  323.     if SHIINA::ITEM_TYPE
  324.       @category_window.activate
  325.       @category_window.visible = true
  326.       @item_window.visible = true
  327.     else
  328.       @item_window.category = :item
  329.       @item_window.activate
  330.       @item_window.select_last
  331.       @item_window.visible = true
  332.       @help_window.visible = @item_window.visible
  333.     end
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 指令“整队”
  337.   #--------------------------------------------------------------------------
  338.   def command_formation
  339.     return unless SHIINA::STATUS
  340.     @status_window.select_last
  341.     @status_window.activate
  342.     @status_window.set_handler(:ok,     method(:on_formation_ok))
  343.     @status_window.set_handler(:cancel, method(:on_formation_cancel))
  344.   end
  345.   #--------------------------------------------------------------------------
  346.   # ● 指令“存档”
  347.   #--------------------------------------------------------------------------
  348.   def command_save
  349.     SceneManager.call(Scene_Save)
  350.   end
  351.   #--------------------------------------------------------------------------
  352.   # ● 指令“结束游戏”
  353.   #--------------------------------------------------------------------------
  354.   def command_game_end
  355.     SceneManager.call(Scene_End)
  356.   end
  357.   #--------------------------------------------------------------------------
  358.   # ● 整队“确定”
  359.   #--------------------------------------------------------------------------
  360.   def on_formation_ok
  361.     if @status_window.pending_index >= 0
  362.       $game_party.swap_order(@status_window.index,
  363.                              @status_window.pending_index)
  364.       @status_window.pending_index = -1
  365.       @status_window.redraw_item(@status_window.index)
  366.     else
  367.       @status_window.pending_index = @status_window.index
  368.     end
  369.     @status_window.activate
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # ● 整队“取消”
  373.   #--------------------------------------------------------------------------
  374.   def on_formation_cancel
  375.     if @status_window.pending_index >= 0
  376.       @status_window.pending_index = -1
  377.       @status_window.activate
  378.     else
  379.       @status_window.unselect
  380.       @command_window.activate
  381.     end
  382.   end
  383.   #--------------------------------------------------------------------------
  384.   # ● 分类“确定”
  385.   #--------------------------------------------------------------------------
  386.   def on_category_ok
  387.     @item_window.activate
  388.     @item_window.select_last
  389.     @help_window.visible = @item_window.visible
  390.   end
  391.   #--------------------------------------------------------------------------
  392.   # ● 分类“取消”
  393.   #--------------------------------------------------------------------------
  394.   def on_category_cancel
  395.     @category_window.deactivate
  396.     @category_window.visible = false
  397.     @item_window.visible = false
  398.     @help_window.visible = @item_window.visible
  399.     @command_window.activate
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● 物品“确定”
  403.   #--------------------------------------------------------------------------
  404.   def on_item_ok
  405.     $game_party.last_item.object = item
  406.     determine_item
  407.   end
  408.   #--------------------------------------------------------------------------
  409.   # ● 物品“取消”
  410.   #--------------------------------------------------------------------------
  411.   def on_item_cancel
  412.     @item_window.unselect
  413.     if SHIINA::ITEM_TYPE
  414.       @category_window.activate
  415.       @help_window.visible = false
  416.     else
  417.       @item_window.visible = false
  418.       @help_window.visible = @item_window.visible
  419.       @command_window.activate
  420.     end
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ● 播放使用物品声效
  424.   #--------------------------------------------------------------------------
  425.   def play_se_for_item
  426.     Sound.play_use_item
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● 使用物品
  430.   #--------------------------------------------------------------------------
  431.   def use_item
  432.     super
  433.     @item_window.redraw_current_item
  434.   end
  435.   #--------------------------------------------------------------------------
  436.   # ● 添加切换角色定义(刷新立绘和人物信息窗口)
  437.   #--------------------------------------------------------------------------
  438.   # 上一个角色
  439.   alias image_prev_actor prev_actor
  440.   def prev_actor
  441.     image_prev_actor
  442.     @command_window.activate
  443.     @command_window.select_last
  444.     @command_window.refresh_image(@actor)
  445.     @status_window.refresh_nanikore(@actor)
  446.   end
  447.   # 下一个角色
  448.   alias image_next_actor next_actor
  449.   def next_actor
  450.     image_next_actor
  451.     @command_window.activate
  452.     @command_window.select_last
  453.     @command_window.refresh_image(@actor)
  454.     @status_window.refresh_nanikore(@actor)
  455.   end
  456. end

  457. #----------------------Scene部分结束----------------------#



  458. #####################################
  459. # 脚本部分-Window
  460. #####################################
  461. #==============================================================================
  462. # ■ Window_MenuCommand
  463. #------------------------------------------------------------------------------
  464. #  菜单画面中显示指令的窗口
  465. #==============================================================================

  466. class Window_MenuCommand < Window_Command
  467.   # 立绘图像
  468.   attr_accessor  :image
  469.   #--------------------------------------------------------------------------
  470.   # ● 向指令列表添加主要的指令
  471.   #--------------------------------------------------------------------------
  472.   def add_main_commands
  473.     add_command(Vocab::item,   :item,   main_commands_enabled)
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # ● 添加整队指令
  477.   #--------------------------------------------------------------------------
  478.   def add_formation_command
  479.     return unless SHIINA::FORMATION
  480.     add_command(Vocab::formation, :formation, formation_enabled)
  481.   end
  482.   #--------------------------------------------------------------------------
  483.   # ● 刷新立绘
  484.   #--------------------------------------------------------------------------
  485.   def refresh_image(actor)
  486.     @image.refresh(actor)
  487.   end
  488.   #--------------------------------------------------------------------------
  489.   # ● 更新立绘
  490.   #--------------------------------------------------------------------------
  491.   alias image_update update
  492.   def update
  493.     image_update
  494.     @image.update if @image
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ● 释放里立绘
  498.   #--------------------------------------------------------------------------
  499.   alias image_dispose dispose
  500.   def dispose
  501.     image_dispose
  502.     @image.dispose
  503.   end
  504. end

  505. #==============================================================================
  506. # ■ Window_ItemCategory
  507. #------------------------------------------------------------------------------
  508. #  物品画面和商店画面中,显示装备、所持物品等项目列表的窗口。
  509. #==============================================================================

  510. class Window_ItemCategory < Window_HorzCommand
  511.   #--------------------------------------------------------------------------
  512.   # ● 生成指令列表
  513.   #--------------------------------------------------------------------------
  514.   def make_command_list
  515.     add_command(Vocab::item,     :item)
  516.     add_command(Vocab::weapon,   :weapon) if SHIINA::WEAPON_ARMOR
  517.     add_command(Vocab::armor,    :armor) if SHIINA::WEAPON_ARMOR
  518.     add_command(Vocab::key_item, :key_item)
  519.   end
  520. end

  521. #==============================================================================
  522. # ■ Window_ItemList
  523. #------------------------------------------------------------------------------
  524. #  物品画面中,显示持有物品的窗口。
  525. #==============================================================================

  526. class Window_ItemList < Window_Selectable
  527.   #--------------------------------------------------------------------------
  528.   # ● 获取列数
  529.   #--------------------------------------------------------------------------
  530.   def col_max
  531.     return 1
  532.   end
  533. end

  534. #==============================================================================
  535. # ■ Window_MenuStatus
  536. #------------------------------------------------------------------------------
  537. #  菜单画面中,显示队伍成员状态的窗口
  538. #==============================================================================

  539. class Window_MenuStatus < Window_Selectable
  540.   #--------------------------------------------------------------------------
  541.   # ● 获取窗口的宽度
  542.   #--------------------------------------------------------------------------
  543.   def window_width
  544.     Graphics.width - 160
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # ● 最大数目
  548.   #--------------------------------------------------------------------------
  549.   def item_max
  550.     return 1
  551.   end
  552.   #--------------------------------------------------------------------------
  553.   # ● 获取窗口的高度
  554.   #--------------------------------------------------------------------------
  555.   def window_height
  556.     item_max * item_height + standard_padding * 2
  557.   end
  558.   #--------------------------------------------------------------------------
  559.   # ● 刷新角色(为了位置refresh的结构只能另外写个了呢)
  560.   #--------------------------------------------------------------------------
  561.   def refresh_nanikore(actor)
  562.     @actor = actor
  563.     refresh
  564.   end
  565.   #--------------------------------------------------------------------------
  566.   # ● 刷新(直接描绘当前角色信息)
  567.   #--------------------------------------------------------------------------
  568.   def refresh
  569.     contents.clear
  570.     return unless @actor
  571.     index = 0
  572.     rect = item_rect(index)
  573.     draw_item_background(index)
  574.     draw_actor_face(@actor, rect.x + 1, rect.y + 1) if SHIINA::STATUS_ITEM[0]
  575.     draw_actor_simple_status(@actor, rect.x + 108, rect.y + line_height / 2)
  576.   end
  577.   #--------------------------------------------------------------------------
  578.   # ● 绘制项目(没用了呢)
  579.   #--------------------------------------------------------------------------
  580.   def draw_item(index); ; end
  581.   #--------------------------------------------------------------------------
  582.   # ● 绘制简单的状态
  583.   #--------------------------------------------------------------------------
  584.   def draw_actor_simple_status(actor, x, y)
  585.     draw_actor_name(actor, x, y)                       if SHIINA::STATUS_ITEM[1]
  586.     draw_actor_level(actor, x, y + line_height * 1)    if SHIINA::STATUS_ITEM[2]
  587.     draw_actor_icons(actor, x, y + line_height * 2)    if SHIINA::STATUS_ITEM[3]
  588.     draw_actor_class(actor, x + 120, y)                if SHIINA::STATUS_ITEM[4]
  589.     draw_actor_hp(actor, x + 120, y + line_height * 1) if SHIINA::STATUS_ITEM[5]
  590.     draw_actor_mp(actor, x + 120, y + line_height * 2) if SHIINA::STATUS_ITEM[6]
  591.   end
  592.   #--------------------------------------------------------------------------
  593.   # ● 获取项目的高度
  594.   #--------------------------------------------------------------------------
  595.   def item_height
  596.     if SHIINA::STATUS_HEIGHT
  597.       return SHIINA::STATUS_HEIGHT
  598.     else
  599.       return (Graphics.height - standard_padding * 2) / 4
  600.     end
  601.   end
  602. end

  603. #==============================================================================
  604. # ■ Window_MenuActor
  605. #------------------------------------------------------------------------------
  606. #  显示物品使用或技能使用的选择目标的窗口
  607. #==============================================================================

  608. class Window_MenuActor < Window_MenuStatus
  609.   #--------------------------------------------------------------------------
  610.   # ● 刷新(父上已经走上奇怪的路线,只能从爷爷那边搬过来→_→)
  611.   #--------------------------------------------------------------------------
  612.   def refresh
  613.     contents.clear
  614.     draw_all_items
  615.   end
  616.   #--------------------------------------------------------------------------
  617.   # ● 获取项目数
  618.   #--------------------------------------------------------------------------
  619.   def item_max
  620.     $game_party.members.size
  621.   end
  622.   #--------------------------------------------------------------------------
  623.   # ● 绘制项目
  624.   #--------------------------------------------------------------------------
  625.   def draw_item(index)
  626.     actor = $game_party.members[index]
  627.     enabled = $game_party.battle_members.include?(actor)
  628.     rect = item_rect(index)
  629.     draw_item_background(index)
  630.     draw_actor_face(actor, rect.x + 1, rect.y + 1) if SHIINA::STATUS_ITEM[0]
  631.     draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
  632.   end
  633. end
  634. #----------------------Window部分结束----------------------#


  635. #####################################
  636. # 脚本部分-立绘
  637. #####################################

  638. class Image < Sprite
  639.   
  640.   def initialize(actor, x=get_x, y=Graphics.height)
  641.     super(nil)
  642.     @actor = actor
  643.     self.mirror = SHIINA::IMAGE_MIRROR
  644.     self.bitmap = Cache.picture(get_pic_name)
  645.     self.oy = self.height
  646.     self.opacity = 0 unless SHIINA::LOCK_IMAGE
  647.     self.x = x
  648.     self.y = y
  649.     set
  650.     setn(0)
  651.   end
  652.   
  653.   def get_pic_name
  654.     actor_name = @actor ? @actor.name : $game_party.members[0].name
  655.     return SHIINA::IMAGE_NAME.nil? ? actor_name : SHIINA::IMAGE_NAME
  656.   end
  657.   
  658.   def refresh(actor)
  659.     @actor = actor
  660.     self.bitmap = Cache.picture(get_pic_name)
  661.     return if SHIINA::LOCK_IMAGE
  662.     self.opacity = 0
  663.     set(get_x)
  664.     setn(0)
  665.   end
  666.   
  667.   def get_x
  668.     SHIINA::LOCK_IMAGE ? 0 : 32 * 4
  669.   end
  670.   
  671.   def spd
  672.     SHIINA::IMAGE_SLIDE_SPD
  673.   end
  674.   
  675.   def set(x=self.x, y=self.y)
  676.     self.x = x
  677.     self.y = y
  678.     @nx = x
  679.     @ny = y
  680.   end
  681.   
  682.   def setn(x=self.x, y=self.y)
  683.     @nx = x
  684.     @ny = y
  685.   end
  686.   
  687.   def update
  688.     super
  689.     return if SHIINA::LOCK_IMAGE
  690.     update_slide
  691.   end
  692.   
  693.   def slide_over?
  694.     return (self.x==@nx && self.y=@ny)
  695.   end
  696.   
  697.   def update_slide
  698.     self.opacity += 20 unless SHIINA::LOCK_IMAGE
  699.     return if slide_over?
  700.     if self.x + spd < @nx
  701.       self.x += spd
  702.     elsif self.x - spd > @nx
  703.       self.x -= spd
  704.     elsif self.x != @nx
  705.       self.x = @nx
  706.     end
  707.     if self.y + spd < @ny
  708.       self.y += spd
  709.     elsif self.y - spd > @ny
  710.       self.y -= spd
  711.     elsif self.y != @ny
  712.       self.y = @ny
  713.     end
  714.   end
  715.   
  716. end

  717. #----------------------立绘部分结束----------------------#
复制代码




设置的部分在脚本开头,其他的我就不说什么了,有需要的话就抱走吧!
然后最后是范例一枚……(我能要一毛钱节操吗?……눈_눈,其实只需要脚本就可以的,范例只是来卖萌的……)
简单的解谜游戏菜单.zip (1.63 MB, 下载次数: 900)

※V2版范例一枚……(因为是V2我能要两毛钱节操吗?……눈_눈,依然只需要脚本就可以的,范例依然是来卖萌的……顺便好像范例里的脚本日期没更新……)
简单的解谜游戏菜单v2.zip (1.68 MB, 下载次数: 1302)

唔~~以上~

评分

参与人数 4星屑 +200 收起 理由
百里_飞柳 + 20 用过V1来塞糖,V2没放到脚本框里啦!.
天空の铃音 + 45 被一句话打发了!伤心!以后再也不想说这些.
zhy012003 + 15 不能更赞~&amp;lt;□:≡
喵呜喵5 + 120 100行的设置……

查看全部评分

梦石
0
星屑
287
在线时间
1580 小时
注册时间
2010-6-17
回帖
2818

开拓者贵宾

发表于 2014-9-9 23:50:58 | 显示全部楼层
沙发在卖萌 你说是不是啊 楼主

点评

恶意卖萌者,腰斩!  发表于 2014-9-10 11:39
快来点我一下,你会豁然开朗的
喵Kano特制
←开发中……

←暂时弃坑 电脑上资源全没
回复

使用道具 举报

梦石
0
星屑
348
在线时间
707 小时
注册时间
2012-6-18
回帖
999

开拓者整合系统大赛RMXP达人

发表于 2014-9-10 02:05:43 | 显示全部楼层
楼主!吾正想制作此类游戏!不止可否有兴趣一起做呢~

点评

制作请加油吧~我这边还有很多坑要填~以及最近也没办法填坑了~  发表于 2014-9-10 11:46
幻想天空原创计划委员会发起:幻想天空原创援助计划详情:https://afdian.net/@acgnz
回复

使用道具 举报

梦石
0
星屑
60
在线时间
306 小时
注册时间
2014-8-5
回帖
403
发表于 2014-9-21 10:41:38 | 显示全部楼层
试了一下效果还行。
  点我进入    
       ↓      
回复

使用道具 举报

梦石
0
星屑
9292
在线时间
2504 小时
注册时间
2011-5-20
回帖
14521

开拓者

发表于 2014-9-21 14:28:19 | 显示全部楼层
整队那些跑到哪里去了呢囧

点评

不是over而是一屏姨妈···影之书就是姨妈完了可以继续调查···不会随着时间淡去也不能消除(但是可以通过SL避免手贱多点出现满屏姨妈···)  发表于 2014-9-25 21:59
就是限制调查次数,然后到达规定次数就over?还是糊一屏姨妈继续游戏?如此的话,那么姨妈是不是通过时间经过淡去?  发表于 2014-9-23 23:45
话说可以再来个尸体派对里面那个调查加精神污染如果作死加到满就是一屏幕姨妈的玩意···有兴趣吗?  发表于 2014-9-23 21:54
长并不是因为整队的原因。。而是因为把Scene_MenuBase和Scene_ItemBase的内容放一起了。。  发表于 2014-9-21 23:43
- -|||如果没有整队那些的话我一定会吐槽——这么长的脚本,这么少的选项···  发表于 2014-9-21 15:39
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复

使用道具 举报

梦石
0
星屑
50
在线时间
5 小时
注册时间
2014-11-19
回帖
2
发表于 2014-11-19 13:01:26 | 显示全部楼层
谢谢楼主分享
回复

使用道具 举报

梦石
0
星屑
74
在线时间
205 小时
注册时间
2010-12-16
回帖
131
发表于 2015-1-4 09:02:23 | 显示全部楼层
虽然因为自己游戏已经有了两套菜单不敢再加了不过还是好顶赞~看起来相当清爽的菜单www( ̄∇ ̄)
想成为触的渣一枚Or觉得自己是渣的渣一枚。
回复

使用道具 举报

梦石
0
星屑
797
在线时间
11 小时
注册时间
2014-4-26
回帖
3
发表于 2015-3-18 02:45:19 来自手机 | 显示全部楼层
马克一下,最近打算制作恐怖游戏
回复

使用道具 举报

梦石
0
星屑
50
在线时间
30 小时
注册时间
2015-10-3
回帖
4
发表于 2015-11-14 15:17:22 | 显示全部楼层
马克; ;
回复

使用道具 举报

梦石
0
星屑
155
在线时间
149 小时
注册时间
2015-10-14
回帖
187
发表于 2015-12-1 21:59:23 | 显示全部楼层
这个菜单很实用呢,也很喜欢效果///
不过我遇到了以下问题:

1-怎么添加读档功能?
2-怎么使[回到标题]这个功能换成"场所移动"的这个功能?【因为我用的是事件标题

以上,就是这样 希望lz能帮忙解答QwQ

点评

原来是在这里改的啊...非常感谢!QwQ  发表于 2015-12-2 15:18
搜索 "跳过标题" 折叠没打开的时候好像不会被搜索到  发表于 2015-12-2 00:48
你打开这个页面,然后按Ctrl + F 然后搜索“一个不能返回标题的版本”  发表于 2015-12-2 00:47
这个帖子里有个跳过标题http://rm.66rpg.com/forum.php?mod=redirect&goto=findpost&ptid=378738&pid=2600569  发表于 2015-12-2 00:47
填坑中
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部