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

Project1

 找回密码
 注册会员
搜索
查看: 1594|回复: 2
打印 上一主题 下一主题

[已经解决] 求教简易菜单的一个十分简单的问题 大虾说说咯

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
28 小时
注册时间
2012-5-5
帖子
16
跳转到指定楼层
1
发表于 2012-5-26 09:53:37 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

这里出现穿越现象   求教大虾们

下面是脚本:


‘‘──独行于2012-5-26 09:53补充以下内容

#============================================================================
# ○ VX·新简易菜单
#            -By.冰舞蝶恋
#----------------------------------------------------------------------------
#    用法神马的…不解释……
#============================================================================
class Scene_Menu
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 380)
    @mapwindow = Window_Draw_Mapname.new
    @status_window = Window_MenuStatus.new(160, 0)
  end
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @mapwindow.dispose
    @status_window.dispose
  end
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @mapwindow.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = "读档"# Vocab::continue
    s7 = Vocab::game_end
    @command_window = Window_Command.new(544, [s1, s2, s3, s4, s5, s6, s7], 7)
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # 如果队伍为空
      @command_window.draw_item(0, false)     # 无效化物品选项
      @command_window.draw_item(1, false)     # 无效化技能选项
      @command_window.draw_item(2, false)     # 无效化装备选项
      @command_window.draw_item(3, false)     # 无效化状态选项
    end
    if $game_system.save_disabled             # 如果禁止存档
      @command_window.draw_item(4, false)     # 无效化存档选项
    end
  end
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # 物品
        $scene = Scene_Item.new
      when 1,2,3  # 技能、装备、状态
        start_actor_selection
      when 4      # 存档
        $scene = Scene_File.new(true, false, false)
      when 5      # 读档
        $scene = Scene_File.new(false, false, false)
      when 6      # 结束
        $scene = Scene_End.new
      end
    end
  end
end
class Window_MenuStatus < Window_Selectable
  def initialize(x, y)
    super(x, y+56, 384, 416-56)
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_shortface(actor, 2, actor.index * 82 + 2, 92)
      x = 104
      y = actor.index * 82 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 120, y)
      draw_actor_level(actor, x, y + WLH * 1)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor, x + 120, y + WLH * 1)
    end
  end
  def update_cursor
    if @index < 0               
      self.cursor_rect.empty
    elsif @index < @item_max   
      self.cursor_rect.set(0, @index * 82, contents.width, 82)
    elsif @index >= 100         
      self.cursor_rect.set(0, (@index - 100) * 82, contents.width, 82)
    else                        
      self.cursor_rect.set(0, 0, contents.width, @item_max * 82)
    end
  end
end
class Window_Base
  def draw_shortface(face_name, face_index, x, y, size = 96)
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * 96 + (96 - size) / 2
    rect.y = face_index / 4 * 96 + (96 - size) / 2 + 16
    rect.width = size
    rect.height = size - 32
    self.contents.blt(x, y+8, bitmap, rect)
    bitmap.dispose
  end
  def draw_actor_shortface(actor, x, y, size = 96)
    draw_shortface(actor.face_name, actor.face_index, x, y, size)
  end
end
class Game_Map
  attr_reader   :map_id  
  def mapname
  $mapname = load_data("Data/MapInfos.rvdata")
  $mapname[@map_id].name
  end
end
class Window_Draw_Mapname < Window_Base
  def initialize
    super(0, 56, 160, 304)
    refresh
  end  
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 4, 160, WLH, "位置:")
    self.contents.font.color = normal_color
    self.contents.draw_text(4+8, WLH + 12, 160, WLH, $game_map.mapname.to_s)
  end
end
’’

Lv1.梦旅人

Mr.Gandum

梦石
0
星屑
226
在线时间
2070 小时
注册时间
2007-1-31
帖子
3039

贵宾

2
发表于 2012-5-26 11:28:05 | 只看该作者
最底下有个
  1. super(0,56,160,304)
复制代码
把304改改。
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
28 小时
注册时间
2012-5-5
帖子
16
3
 楼主| 发表于 2012-5-26 12:05:45 | 只看该作者
feizhaodan 发表于 2012-5-26 11:28
最底下有个把304改改。

嗯   搞定啦   谢谢    大虾你知道怎么将那个多货币系统获得其他货币时会有提示呢
回复

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-9-24 10:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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