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

Project1

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

选项窗口问题

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
222
在线时间
82 小时
注册时间
2007-6-26
帖子
262
跳转到指定楼层
1
发表于 2007-7-4 20:13:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
{/gg}添加了这个脚本后。发现我新加上去的选项(例如。偷窃)

战斗中有这个选项。但是没有字。{/fd}去掉这个脚本字又回来了。{/hx}请问在哪里修改呢?日文太王道了看不懂{/hx}
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


#==============================================================================
# ■ Window_Command
#
#     与Window_Command功能一致,不同点就是可以自己给定行、列的值,使菜单像轩辕剑
# 系列的排列……
#
# 举例:                            行  列               -命令列表-
#      Window_Command.new(160, ["攻击","法术","物品","绝技","防御","逃跑"],2)
#==============================================================================

#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
#  一般的命令选择行窗口。
#==============================================================================

class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#     width    : 每格的的宽
#     row      : 行数   自己根据命令数算好行列的值,否则^^b
#     column   : 列数
#     commands : 命令字符串序列
#--------------------------------------------------------------------------
def initialize(width, commands, column=1)
   row = commands.size / column
   # 由命令的个数计算出窗口的宽和高
   super(0, 0, width, row * 32 + 32)
   @item_max = commands.size
   @commands = commands
   @row = row
   @width_txt = (width-32)/column
   @column_max = column
   self.contents = Bitmap.new(width-32, @row * 32)
   refresh
   self.index = 0
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i, normal_color)
   end
end
#--------------------------------------------------------------------------
# ● 描绘项目
#     index : 项目编号
#     color : 文字色
#--------------------------------------------------------------------------
def draw_item(index, color)
   self.contents.font.color = color
   # 计算得出当前index所对应的内容所在的行
   row_index = index / @column_max
   # 根据余数得出所在的列
   for y in 0...@column_max
     if index % @column_max == y
       rect = Rect.new(y * @width_txt, 32 * row_index , @width_txt, 32)
       self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
       self.contents.draw_text(rect, @commands[index],1)
       break
     end
   end
end
#--------------------------------------------------------------------------
# ● 项目无效化
#     index : 项目编号
#--------------------------------------------------------------------------
def disable_item(index)
   draw_item(index, disabled_color)
end
#--------------------------------------------------------------------------
# ● 项目有效化
#     index : 项目编号
#--------------------------------------------------------------------------
def able_item(index)
   draw_item(index, normal_color)
end
  #--------------------------------------------------------------------------
  # ● 更新光标举行
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 光标位置不满 0 的情况下
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 获取当前的行
    row = @index / @column_max
    # 当前行被显示开头行前面的情况下
    if row < self.top_row
      # 从当前行向开头行滚动
      self.top_row = row
    end
    # 当前行被显示末尾行之后的情况下
    if row > self.top_row + (self.page_row_max - 1)
      # 从当前行向末尾滚动
      self.top_row = row - (self.page_row_max - 1)
    end
    # 计算光标的宽
    cursor_width = @width_txt
    # 计算光标坐标
    x = @index % @column_max * cursor_width
    y = @index / @column_max * 32 - self.oy
    # 更新国标矩形
    self.cursor_rect.set(x, y, @width_txt, 32)
  end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

Lv1.梦旅人

梦石
0
星屑
222
在线时间
82 小时
注册时间
2007-6-26
帖子
262
2
 楼主| 发表于 2007-7-4 20:13:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
{/gg}添加了这个脚本后。发现我新加上去的选项(例如。偷窃)

战斗中有这个选项。但是没有字。{/fd}去掉这个脚本字又回来了。{/hx}请问在哪里修改呢?日文太王道了看不懂{/hx}
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================


#==============================================================================
# ■ Window_Command
#
#     与Window_Command功能一致,不同点就是可以自己给定行、列的值,使菜单像轩辕剑
# 系列的排列……
#
# 举例:                            行  列               -命令列表-
#      Window_Command.new(160, ["攻击","法术","物品","绝技","防御","逃跑"],2)
#==============================================================================

#==============================================================================
# ■ Window_Command
#------------------------------------------------------------------------------
#  一般的命令选择行窗口。
#==============================================================================

class Window_Command < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对像
#     width    : 每格的的宽
#     row      : 行数   自己根据命令数算好行列的值,否则^^b
#     column   : 列数
#     commands : 命令字符串序列
#--------------------------------------------------------------------------
def initialize(width, commands, column=1)
   row = commands.size / column
   # 由命令的个数计算出窗口的宽和高
   super(0, 0, width, row * 32 + 32)
   @item_max = commands.size
   @commands = commands
   @row = row
   @width_txt = (width-32)/column
   @column_max = column
   self.contents = Bitmap.new(width-32, @row * 32)
   refresh
   self.index = 0
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i, normal_color)
   end
end
#--------------------------------------------------------------------------
# ● 描绘项目
#     index : 项目编号
#     color : 文字色
#--------------------------------------------------------------------------
def draw_item(index, color)
   self.contents.font.color = color
   # 计算得出当前index所对应的内容所在的行
   row_index = index / @column_max
   # 根据余数得出所在的列
   for y in 0...@column_max
     if index % @column_max == y
       rect = Rect.new(y * @width_txt, 32 * row_index , @width_txt, 32)
       self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
       self.contents.draw_text(rect, @commands[index],1)
       break
     end
   end
end
#--------------------------------------------------------------------------
# ● 项目无效化
#     index : 项目编号
#--------------------------------------------------------------------------
def disable_item(index)
   draw_item(index, disabled_color)
end
#--------------------------------------------------------------------------
# ● 项目有效化
#     index : 项目编号
#--------------------------------------------------------------------------
def able_item(index)
   draw_item(index, normal_color)
end
  #--------------------------------------------------------------------------
  # ● 更新光标举行
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # 光标位置不满 0 的情况下
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 获取当前的行
    row = @index / @column_max
    # 当前行被显示开头行前面的情况下
    if row < self.top_row
      # 从当前行向开头行滚动
      self.top_row = row
    end
    # 当前行被显示末尾行之后的情况下
    if row > self.top_row + (self.page_row_max - 1)
      # 从当前行向末尾滚动
      self.top_row = row - (self.page_row_max - 1)
    end
    # 计算光标的宽
    cursor_width = @width_txt
    # 计算光标坐标
    x = @index % @column_max * cursor_width
    y = @index / @column_max * 32 - self.oy
    # 更新国标矩形
    self.cursor_rect.set(x, y, @width_txt, 32)
  end
end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

Lv1.梦旅人

梦石
0
星屑
222
在线时间
82 小时
注册时间
2007-6-26
帖子
262
3
 楼主| 发表于 2007-7-5 01:39:48 | 只看该作者
更新了张问题图。{/gg}。就是加了以上的脚本`。。新添加的选项看不到文字。寻求帮助
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-9-21 23:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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