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

Project1

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

[已经过期] 求大神改下脚本

[复制链接]

Lv4.逐梦者

梦石
4
星屑
2013
在线时间
442 小时
注册时间
2015-7-19
帖子
149
跳转到指定楼层
1
发表于 2016-4-15 20:17:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
VIPArcher的脚本:【UI界面】——一款清新的物品栏菜单,就是直接进如脚本,不要原来的菜单了。
@VIPArcher

无标题.png (564.75 KB, 下载次数: 21)

无标题.png

Lv3.寻梦者

梦石
0
星屑
1043
在线时间
233 小时
注册时间
2016-2-3
帖子
172

开拓者

2
发表于 2016-4-15 21:22:26 | 只看该作者
本人虽非大神,但懂点皮毛,今天就不幸地拿你的东西开刀...
但是前提在于你要把它贴出来啊。。。
究极半吊子
《重生学校》同人作:https://rpg.blue/thread-493882-1-1.html
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
4
星屑
2013
在线时间
442 小时
注册时间
2015-7-19
帖子
149
3
 楼主| 发表于 2016-4-15 22:06:46 | 只看该作者
本帖最后由 类人猿 于 2016-4-15 22:10 编辑
饿啊 发表于 2016-4-15 21:22
本人虽非大神,但懂点皮毛,今天就不幸地拿你的东西开刀...
但是前提在于你要把它贴出来啊。。。 ...


https://rpg.blue/thread-371790-1-1.html

VIPArcher的脚本,


附件无RGSS300.dll

小清新物品栏.zip

1.26 MB, 下载次数: 35

回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
4
星屑
2013
在线时间
442 小时
注册时间
2015-7-19
帖子
149
4
 楼主| 发表于 2016-4-15 22:07:45 | 只看该作者
饿啊 发表于 2016-4-15 21:22
本人虽非大神,但懂点皮毛,今天就不幸地拿你的东西开刀...
但是前提在于你要把它贴出来啊。。。 ...

#encoding:utf-8
#==============================================================================
# ■ 带有大图标,推展线索的物品栏
#------------------------------------------------------------------------------
# 适合解密类游戏的菜单,
# 脚本:VIPArcher
# 美工 && 创意:断电
#  -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。
#==============================================================================
# 使用说明:
# 物品备注栏备注 <image:文件名> 显示大图
# 物品备注栏备注 <no se> 使用不播放使用道具音效
# 物品备注栏备注 <clue:内容> 显示线索,支持控制符。
#==============================================================================
# ■ 设定部分
#==============================================================================
module VIPArcher
  BACKGROUND = "itembackground"   #背景图片文件名
  module Item_Help   #物品栏的帮助窗口
    X = 40                        # 窗口x坐标
    Y = 50                        # 窗口y坐标
    Width = 240                   # 窗口宽度
    Height = 72                   # 窗口高度
    Font_Outline = false          # 描边
    Font_Bold = false             # 粗体
    Font_Color = Color.new(0,0,0) # 字体颜色
    Font_Size = 20                # 字体大小
    Font_Name = "微软雅黑"        # 字体名称
  end
  module Item_Name  #物品的名称窗口
    X = 52                        # 窗口x坐标
    Y = 10                        # 窗口y坐标
    Width = 220                   # 窗口宽度
    Height = 52                   # 窗口高度
    Font_Outline = false          # 描边
    Font_Bold = false             # 粗体
    Font_Color = Color.new(0,0,0) # 字体颜色
    Font_Size = 28                # 字体大小
    Font_Name = "微软雅黑"        # 字体名称
  end
  module Item_List  #物品栏的列表窗口
    X = 282                       # 窗口x坐标
    Y = 100                       # 窗口y坐标
    Width = 220                   # 窗口宽度
    Height = 300                  # 窗口高度
    Font_Outline = false          # 描边
    Font_Bold = false             # 粗体
    Font_Color = Color.new(0,0,0) # 字体颜色
    Font_Size = 28                # 字体大小
    Font_Name = "微软雅黑"        # 字体名称
    No_Number = false             #是否描绘物品个数
  end
  module Item_Note  #物品的备注信息窗口
    X = 40                        # 窗口x坐标
    Y = 116                       # 窗口y坐标
    Width = 240                   # 窗口宽度
    Height = 100                  # 窗口高度
    Regex = /<Clue:\s*(.*)>/im    # 正则匹配式
    Font_Outline = false          # 描边
    Font_Bold = false             # 粗体
    Font_Color = Color.new(0,0,0) # 字体颜色
    Font_Size = 20                # 字体大小
    Font_Name = "微软雅黑"        # 字体名称
  end
  module Item_Image  #物品的大图窗口
    X = 0                         # 窗口x坐标
    Y = 240                       # 窗口y坐标
    Width = 175                   # 窗口宽度
    Height = 175                  # 窗口高度
    Regex = /<Image:\s*(\S*)>/i   # 正则匹配式
  end
  module Item_Category  #物品的分类窗口
    X = Graphics.width - 255      # 窗口x坐标
    Y = 0                         # 窗口y坐标
    Width = 255                   # 窗口宽度
    Height = 100                  # 窗口高度
    #各分类的对应的图标文件名(分别对应着[道具,武器,贵重物品,防具])
    #这里有几项就有几个分类
    Category_Name = ["道具","收藏","线索"]
  end
end
module Cache
  #--------------------------------------------------------------------------
  # ● 获取物品栏图片
  #--------------------------------------------------------------------------  
  def self.ItemImage(filename)
    load_bitmap("Graphics/itemimage/", filename)
  end
end
class Window_Base < Window
  #----------------------------------------------------------------------
  # ● 绘制物品栏图片  
  #--------------------------------------------------------------------------
   def draw_itemimage(x, y, itemimage)
    bitmap = Cache.ItemImage(itemimage)
    contents.blt(x, y, bitmap, bitmap.rect)
    bitmap.dispose
  end
end
class Window_Selectable < Window_Base
  attr_reader   :item_image_window           # 图片窗口
  attr_reader   :item_name_window            # 名字窗口
  attr_reader   :item_note_window            # 名字窗口
  #--------------------------------------------------------------------------
  # ● 设置图片帮助窗口
  #--------------------------------------------------------------------------
  def item_image_window=(item_image_window)
    @item_image_window = item_image_window
  end
  #--------------------------------------------------------------------------
  # ● 设置名称帮助窗口
  #--------------------------------------------------------------------------
  def item_name_window=(item_name_window)
    @item_name_window = item_name_window
  end
  #--------------------------------------------------------------------------
  # ● 设置备注帮助窗口
  #--------------------------------------------------------------------------
  def item_note_window=(item_note_window)
    @item_note_window = item_note_window
  end
end
class Window_Help < Window_Base
  include VIPArcher::Item_Help
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(line_number = 2,width = Graphics.width)
    super(0, 0,width, fitting_height(line_number))
  end
  #--------------------------------------------------------------------------
  # ● 重置字体设置
  #--------------------------------------------------------------------------
  alias vip_20140921_rfs reset_font_settings
  def reset_font_settings
    vip_20140921_rfs
    if SceneManager.scene_is?(Scene_Item)
      contents.font.name = Font_Name
      contents.font.outline = Font_Outline
      contents.font.color.set(Font_Color)
      contents.font.size = Font_Size
      contents.font.bold = Font_Bold
    end
  end
end
#显示物品备注信息的窗口
class Window_Item_Note < Window_Base
  include VIPArcher::Item_Note
  #--------------------------------------------------------------------------
  # ● 设置内容
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 清除
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 设置物品
  #     item : 技能、物品等
  #--------------------------------------------------------------------------
  def set_item(item)
    item.note =~ Regex if item
    $1 == nil ? set_text("") : set_text($1)
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(0, 0, @text)
  end
  #--------------------------------------------------------------------------
  # ● 重置字体设置
  #--------------------------------------------------------------------------
  alias vip_20140921_rfs reset_font_settings
  def reset_font_settings
    vip_20140921_rfs
    if SceneManager.scene_is?(Scene_Item)
      contents.font.name = Font_Name
      contents.font.outline = Font_Outline
      contents.font.color.set(Font_Color)
      contents.font.size = Font_Size
      contents.font.bold = Font_Bold
    end
  end
end
#显示物品名称的窗口
class Window_Item_Name < Window_Base
  include VIPArcher::Item_Name
  #--------------------------------------------------------------------------
  # ● 设置内容
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 清除
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 设置物品
  #     item : 技能、物品等
  #--------------------------------------------------------------------------
  def set_item(item)
    set_text(item ? item.name : "")
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    contents.font.name = Font_Name
    contents.font.outline = Font_Outline
    contents.font.color.set(Font_Color)
    contents.font.size = Font_Size
    contents.font.bold = Font_Bold
    draw_text(4, 0, 220, line_height, @text, 0)
  end
end
#显示物品详细图片的窗口
class Window_Item_Image < Window_Base
  include VIPArcher::Item_Image
  #--------------------------------------------------------------------------
  # ● 设置内容
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 清除
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 设置物品
  #     item : 技能、物品等
  #--------------------------------------------------------------------------
  def set_item(item)
    item.note =~ Regex if item
    $1 == nil ? set_text("") : set_text($1)
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_itemimage(0,0,@text) if @text != ""
  end
end
#显示分类名字图片的窗口
class Window_Item_Category < Window_Base
  include VIPArcher::Item_Category
  def initialize(x, y, width, height)
    super
    @category_name = Category_Name[0]
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 设置分类图片
  #--------------------------------------------------------------------------
  def category_name=(category)
    return if @category_name == category
    @category_name = category
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新窗口
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_itemimage(0,0,@category_name)
  end
end
class Window_ItemList < Window_Selectable
  include VIPArcher::Item_List
  alias vip20140921_update_help update_help
  attr_accessor :category_id
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super
    @category_id = 0
    @category = :item #VIP
    @data = []
  end
  #--------------------------------------------------------------------------
  # ● 获取列数
  #--------------------------------------------------------------------------
  def col_max
    return scene_im? ? 1 : 2
  end
  #--------------------------------------------------------------------------
  # ● 获取行高
  #--------------------------------------------------------------------------
  def line_height
    return scene_im? ? 33 : 24
  end
  def scene_im?
    SceneManager.scene_is?(Scene_Item) ||
    SceneManager.scene_is?(Scene_Map)
  end
  #--------------------------------------------------------------------------
  # ● 绘制物品(取消半透明图标的y+4)
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, x, y + 4)
    change_color(normal_color)
    if SceneManager.scene_is?(Scene_Item) ||
      SceneManager.scene_is?(Scene_Map)
      contents.font.name = Font_Name
      contents.font.outline = Font_Outline
      contents.font.color.set(Font_Color)
      contents.font.size = Font_Size
      contents.font.bold = Font_Bold
    end
    draw_text(x + 24, y, width, line_height, item.name)
  end
  #--------------------------------------------------------------------------
  # ● 绘制物品个数
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item);end unless No_Number
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    vip20140921_update_help
    @item_image_window.set_item(item) if @item_image_window
    @item_name_window.set_item(item) if @item_name_window
    @item_note_window.set_item(item) if @item_note_window
  end
end
#==============================================================================
# ■ Scene_Item
#------------------------------------------------------------------------------
#  物品画面
#==============================================================================

class Scene_Item < Scene_ItemBase
  include VIPArcher
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    create_help_window
    create_item_window
    create_item_image_window
    create_item_name_window
    create_category_window
    create_item_note_window
    on_category_ok
    window_opacity
  end
  #--------------------------------------------------------------------------
  # ● 生成物品窗口
  #--------------------------------------------------------------------------
  def create_item_window
    x = Item_List::X
    y = Item_List::Y
    w = Item_List::Width
    h = Item_List::Height
    @item_window = Window_ItemList.new(x,y,w,h)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @item_window.set_handler(:ok,     method(:on_item_ok))
    @item_window.set_handler(:cancel, method(:return_scene))
    @item_window.set_handler(:pagedown, method(:next_category))
    @item_window.set_handler(:pageup,   method(:prev_category))
  end
  #分类窗口
  def create_category_window
    x = Item_Category::X
    y = Item_Category::Y
    w = Item_Category::Width
    h = Item_Category::Height
    @category_window = Window_Item_Category.new(x,y,w,h)
    @category_window.viewport = @viewport
  end
  #上一分类
  def prev_category
    size = Item_Category::Category_Name.size - 1
    @item_window.category_id == 0 ? @item_window.category_id = size : @item_window.category_id -= 1
    on_category_change
    @item_window.activate
    @item_window.index = 0
  end
  #下一分类
  def next_category
    size = Item_Category::Category_Name.size - 1
    @item_window.category_id == size ? @item_window.category_id = 0 : @item_window.category_id += 1
    on_category_change
    @item_window.activate
    @item_window.index = 0
  end
  #切换分类
  def on_category_change
    case @item_window.category_id
    when 0
      @item_window.category = :item
      @category_window.category_name = Item_Category::Category_Name[0]
    when 1
      @item_window.category = :weapon
      @category_window.category_name = Item_Category::Category_Name[1]
    when 2
      @item_window.category = :key_item
      @category_window.category_name = Item_Category::Category_Name[2]
    when 3
      @item_window.category = :armor
      @category_window.category_name = Item_Category::Category_Name[3]
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成帮助窗口
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Help.new(2,Item_Help::Width)
    @help_window.viewport = @viewport
    @help_window.x = Item_Help::X
    @help_window.y = Item_Help::Y
    @help_window.height = Item_Help::Height
  end
  #--------------------------------------------------------------------------
  # ● 生成物品图片窗口
  #--------------------------------------------------------------------------
  def create_item_image_window
    x = Item_Image::X
    y = Item_Image::Y
    w = Item_Image::Width
    h = Item_Image::Height
    @item_image_window = Window_Item_Image.new(x,y,w,h)
    @item_image_window.viewport = @viewport
    @item_window.item_image_window = @item_image_window
  end
  #--------------------------------------------------------------------------
  # ● 生成名称窗口
  #--------------------------------------------------------------------------
  def create_item_name_window
    x = Item_Name::X
    y = Item_Name::Y
    w = Item_Name::Width
    h = Item_Name::Height
    @item_name_window = Window_Item_Name.new(x,y,w,h)
    @item_name_window.viewport = @viewport
    @item_window.item_name_window = @item_name_window
  end
  #--------------------------------------------------------------------------
  # ● 备注信息窗口
  #--------------------------------------------------------------------------
  def create_item_note_window
    x = Item_Note::X
    y = Item_Note::Y
    w = Item_Note::Width
    h = Item_Note::Height
    @item_note_window = Window_Item_Note.new(x,y,w,h)
    @item_note_window.viewport = @viewport
    @item_window.item_note_window = @item_note_window
  end
  #--------------------------------------------------------------------------
  # ● 背景透明
  #--------------------------------------------------------------------------
  def window_opacity
    @item_window.opacity = 0
    @help_window.opacity = 0
    @item_image_window.opacity = 0
    @category_window.opacity = 0
    @item_name_window.opacity = 0
    @item_note_window.opacity = 0
  end
  #--------------------------------------------------------------------------
  # ● 生成背景
  #--------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = Cache.ItemImage(BACKGROUND)
  end
  #--------------------------------------------------------------------------
  # ● 释放背景
  #--------------------------------------------------------------------------
  def dispose_background
    @background_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 分类“确定”
  #--------------------------------------------------------------------------
  def on_category_ok
    @item_window.activate
    @item_window.select_last
    @item_window.refresh
    @help_window.set_item(item)  #VIP
    @item_image_window.set_item(item) #VIP
    @item_name_window.set_item(item) #VIP
    @item_note_window.set_item(item) #VIP
  end
  #--------------------------------------------------------------------------
  # ● 播放使用物品声效  SION
  #--------------------------------------------------------------------------
  def play_se_for_item
    Sound.play_use_item unless item.note.include? "<no se>"
  end
end

点评

大哥请用编辑功能的说。。。替版主说两句。。。还有,你可否把它复制到代码框里头....·  发表于 2016-4-16 10:46
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
4
星屑
2013
在线时间
442 小时
注册时间
2015-7-19
帖子
149
5
 楼主| 发表于 2016-4-15 22:08:26 | 只看该作者
饿啊 发表于 2016-4-15 21:22
本人虽非大神,但懂点皮毛,今天就不幸地拿你的东西开刀...
但是前提在于你要把它贴出来啊。。。 ...

#encoding:utf-8
#==============================================================================
# ■ 带有大图标,推展线索的物品栏
#------------------------------------------------------------------------------
# 适合解密类游戏的菜单,
# 脚本:VIPArcher
# 美工 && 创意:断电
#  -- 本脚本来自 https://rpg.blue 使用或转载请保留以上信息。
#==============================================================================
# 使用说明:
# 物品备注栏备注 <image:文件名> 显示大图
# 物品备注栏备注 <no se> 使用不播放使用道具音效
# 物品备注栏备注 <clue:内容> 显示线索,支持控制符。
#==============================================================================
# ■ 设定部分
#==============================================================================
module VIPArcher
  BACKGROUND = "itembackground"   #背景图片文件名
  module Item_Help   #物品栏的帮助窗口
    X = 40                        # 窗口x坐标
    Y = 50                        # 窗口y坐标
    Width = 240                   # 窗口宽度
    Height = 72                   # 窗口高度
    Font_Outline = false          # 描边
    Font_Bold = false             # 粗体
    Font_Color = Color.new(0,0,0) # 字体颜色
    Font_Size = 20                # 字体大小
    Font_Name = "微软雅黑"        # 字体名称
  end
  module Item_Name  #物品的名称窗口
    X = 52                        # 窗口x坐标
    Y = 10                        # 窗口y坐标
    Width = 220                   # 窗口宽度
    Height = 52                   # 窗口高度
    Font_Outline = false          # 描边
    Font_Bold = false             # 粗体
    Font_Color = Color.new(0,0,0) # 字体颜色
    Font_Size = 28                # 字体大小
    Font_Name = "微软雅黑"        # 字体名称
  end
  module Item_List  #物品栏的列表窗口
    X = 282                       # 窗口x坐标
    Y = 100                       # 窗口y坐标
    Width = 220                   # 窗口宽度
    Height = 300                  # 窗口高度
    Font_Outline = false          # 描边
    Font_Bold = false             # 粗体
    Font_Color = Color.new(0,0,0) # 字体颜色
    Font_Size = 28                # 字体大小
    Font_Name = "微软雅黑"        # 字体名称
    No_Number = false             #是否描绘物品个数
  end
  module Item_Note  #物品的备注信息窗口
    X = 40                        # 窗口x坐标
    Y = 116                       # 窗口y坐标
    Width = 240                   # 窗口宽度
    Height = 100                  # 窗口高度
    Regex = /<Clue:\s*(.*)>/im    # 正则匹配式
    Font_Outline = false          # 描边
    Font_Bold = false             # 粗体
    Font_Color = Color.new(0,0,0) # 字体颜色
    Font_Size = 20                # 字体大小
    Font_Name = "微软雅黑"        # 字体名称
  end
  module Item_Image  #物品的大图窗口
    X = 0                         # 窗口x坐标
    Y = 240                       # 窗口y坐标
    Width = 175                   # 窗口宽度
    Height = 175                  # 窗口高度
    Regex = /<Image:\s*(\S*)>/i   # 正则匹配式
  end
  module Item_Category  #物品的分类窗口
    X = Graphics.width - 255      # 窗口x坐标
    Y = 0                         # 窗口y坐标
    Width = 255                   # 窗口宽度
    Height = 100                  # 窗口高度
    #各分类的对应的图标文件名(分别对应着[道具,武器,贵重物品,防具])
    #这里有几项就有几个分类
    Category_Name = ["道具","收藏","线索"]
  end
end
module Cache
  #--------------------------------------------------------------------------
  # ● 获取物品栏图片
  #--------------------------------------------------------------------------  
  def self.ItemImage(filename)
    load_bitmap("Graphics/itemimage/", filename)
  end
end
class Window_Base < Window
  #----------------------------------------------------------------------
  # ● 绘制物品栏图片  
  #--------------------------------------------------------------------------
   def draw_itemimage(x, y, itemimage)
    bitmap = Cache.ItemImage(itemimage)
    contents.blt(x, y, bitmap, bitmap.rect)
    bitmap.dispose
  end
end
class Window_Selectable < Window_Base
  attr_reader   :item_image_window           # 图片窗口
  attr_reader   :item_name_window            # 名字窗口
  attr_reader   :item_note_window            # 名字窗口
  #--------------------------------------------------------------------------
  # ● 设置图片帮助窗口
  #--------------------------------------------------------------------------
  def item_image_window=(item_image_window)
    @item_image_window = item_image_window
  end
  #--------------------------------------------------------------------------
  # ● 设置名称帮助窗口
  #--------------------------------------------------------------------------
  def item_name_window=(item_name_window)
    @item_name_window = item_name_window
  end
  #--------------------------------------------------------------------------
  # ● 设置备注帮助窗口
  #--------------------------------------------------------------------------
  def item_note_window=(item_note_window)
    @item_note_window = item_note_window
  end
end
class Window_Help < Window_Base
  include VIPArcher::Item_Help
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(line_number = 2,width = Graphics.width)
    super(0, 0,width, fitting_height(line_number))
  end
  #--------------------------------------------------------------------------
  # ● 重置字体设置
  #--------------------------------------------------------------------------
  alias vip_20140921_rfs reset_font_settings
  def reset_font_settings
    vip_20140921_rfs
    if SceneManager.scene_is?(Scene_Item)
      contents.font.name = Font_Name
      contents.font.outline = Font_Outline
      contents.font.color.set(Font_Color)
      contents.font.size = Font_Size
      contents.font.bold = Font_Bold
    end
  end
end
#显示物品备注信息的窗口
class Window_Item_Note < Window_Base
  include VIPArcher::Item_Note
  #--------------------------------------------------------------------------
  # ● 设置内容
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 清除
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 设置物品
  #     item : 技能、物品等
  #--------------------------------------------------------------------------
  def set_item(item)
    item.note =~ Regex if item
    $1 == nil ? set_text("") : set_text($1)
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_text_ex(0, 0, @text)
  end
  #--------------------------------------------------------------------------
  # ● 重置字体设置
  #--------------------------------------------------------------------------
  alias vip_20140921_rfs reset_font_settings
  def reset_font_settings
    vip_20140921_rfs
    if SceneManager.scene_is?(Scene_Item)
      contents.font.name = Font_Name
      contents.font.outline = Font_Outline
      contents.font.color.set(Font_Color)
      contents.font.size = Font_Size
      contents.font.bold = Font_Bold
    end
  end
end
#显示物品名称的窗口
class Window_Item_Name < Window_Base
  include VIPArcher::Item_Name
  #--------------------------------------------------------------------------
  # ● 设置内容
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 清除
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 设置物品
  #     item : 技能、物品等
  #--------------------------------------------------------------------------
  def set_item(item)
    set_text(item ? item.name : "")
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    contents.font.name = Font_Name
    contents.font.outline = Font_Outline
    contents.font.color.set(Font_Color)
    contents.font.size = Font_Size
    contents.font.bold = Font_Bold
    draw_text(4, 0, 220, line_height, @text, 0)
  end
end
#显示物品详细图片的窗口
class Window_Item_Image < Window_Base
  include VIPArcher::Item_Image
  #--------------------------------------------------------------------------
  # ● 设置内容
  #--------------------------------------------------------------------------
  def set_text(text)
    if text != @text
      @text = text
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # ● 清除
  #--------------------------------------------------------------------------
  def clear
    set_text("")
  end
  #--------------------------------------------------------------------------
  # ● 设置物品
  #     item : 技能、物品等
  #--------------------------------------------------------------------------
  def set_item(item)
    item.note =~ Regex if item
    $1 == nil ? set_text("") : set_text($1)
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_itemimage(0,0,@text) if @text != ""
  end
end
#显示分类名字图片的窗口
class Window_Item_Category < Window_Base
  include VIPArcher::Item_Category
  def initialize(x, y, width, height)
    super
    @category_name = Category_Name[0]
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 设置分类图片
  #--------------------------------------------------------------------------
  def category_name=(category)
    return if @category_name == category
    @category_name = category
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新窗口
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    draw_itemimage(0,0,@category_name)
  end
end
class Window_ItemList < Window_Selectable
  include VIPArcher::Item_List
  alias vip20140921_update_help update_help
  attr_accessor :category_id
  #--------------------------------------------------------------------------
  # ● 初始化对象
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super
    @category_id = 0
    @category = :item #VIP
    @data = []
  end
  #--------------------------------------------------------------------------
  # ● 获取列数
  #--------------------------------------------------------------------------
  def col_max
    return scene_im? ? 1 : 2
  end
  #--------------------------------------------------------------------------
  # ● 获取行高
  #--------------------------------------------------------------------------
  def line_height
    return scene_im? ? 33 : 24
  end
  def scene_im?
    SceneManager.scene_is?(Scene_Item) ||
    SceneManager.scene_is?(Scene_Map)
  end
  #--------------------------------------------------------------------------
  # ● 绘制物品(取消半透明图标的y+4)
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    draw_icon(item.icon_index, x, y + 4)
    change_color(normal_color)
    if SceneManager.scene_is?(Scene_Item) ||
      SceneManager.scene_is?(Scene_Map)
      contents.font.name = Font_Name
      contents.font.outline = Font_Outline
      contents.font.color.set(Font_Color)
      contents.font.size = Font_Size
      contents.font.bold = Font_Bold
    end
    draw_text(x + 24, y, width, line_height, item.name)
  end
  #--------------------------------------------------------------------------
  # ● 绘制物品个数
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item);end unless No_Number
  #--------------------------------------------------------------------------
  # ● 更新帮助内容
  #--------------------------------------------------------------------------
  def update_help
    vip20140921_update_help
    @item_image_window.set_item(item) if @item_image_window
    @item_name_window.set_item(item) if @item_name_window
    @item_note_window.set_item(item) if @item_note_window
  end
end
#==============================================================================
# ■ Scene_Item
#------------------------------------------------------------------------------
#  物品画面
#==============================================================================

class Scene_Item < Scene_ItemBase
  include VIPArcher
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    create_help_window
    create_item_window
    create_item_image_window
    create_item_name_window
    create_category_window
    create_item_note_window
    on_category_ok
    window_opacity
  end
  #--------------------------------------------------------------------------
  # ● 生成物品窗口
  #--------------------------------------------------------------------------
  def create_item_window
    x = Item_List::X
    y = Item_List::Y
    w = Item_List::Width
    h = Item_List::Height
    @item_window = Window_ItemList.new(x,y,w,h)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @item_window.set_handler(:ok,     method(:on_item_ok))
    @item_window.set_handler(:cancel, method(:return_scene))
    @item_window.set_handler(:pagedown, method(:next_category))
    @item_window.set_handler(:pageup,   method(:prev_category))
  end
  #分类窗口
  def create_category_window
    x = Item_Category::X
    y = Item_Category::Y
    w = Item_Category::Width
    h = Item_Category::Height
    @category_window = Window_Item_Category.new(x,y,w,h)
    @category_window.viewport = @viewport
  end
  #上一分类
  def prev_category
    size = Item_Category::Category_Name.size - 1
    @item_window.category_id == 0 ? @item_window.category_id = size : @item_window.category_id -= 1
    on_category_change
    @item_window.activate
    @item_window.index = 0
  end
  #下一分类
  def next_category
    size = Item_Category::Category_Name.size - 1
    @item_window.category_id == size ? @item_window.category_id = 0 : @item_window.category_id += 1
    on_category_change
    @item_window.activate
    @item_window.index = 0
  end
  #切换分类
  def on_category_change
    case @item_window.category_id
    when 0
      @item_window.category = :item
      @category_window.category_name = Item_Category::Category_Name[0]
    when 1
      @item_window.category = :weapon
      @category_window.category_name = Item_Category::Category_Name[1]
    when 2
      @item_window.category = :key_item
      @category_window.category_name = Item_Category::Category_Name[2]
    when 3
      @item_window.category = :armor
      @category_window.category_name = Item_Category::Category_Name[3]
    end
  end
  #--------------------------------------------------------------------------
  # ● 生成帮助窗口
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Help.new(2,Item_Help::Width)
    @help_window.viewport = @viewport
    @help_window.x = Item_Help::X
    @help_window.y = Item_Help::Y
    @help_window.height = Item_Help::Height
  end
  #--------------------------------------------------------------------------
  # ● 生成物品图片窗口
  #--------------------------------------------------------------------------
  def create_item_image_window
    x = Item_Image::X
    y = Item_Image::Y
    w = Item_Image::Width
    h = Item_Image::Height
    @item_image_window = Window_Item_Image.new(x,y,w,h)
    @item_image_window.viewport = @viewport
    @item_window.item_image_window = @item_image_window
  end
  #--------------------------------------------------------------------------
  # ● 生成名称窗口
  #--------------------------------------------------------------------------
  def create_item_name_window
    x = Item_Name::X
    y = Item_Name::Y
    w = Item_Name::Width
    h = Item_Name::Height
    @item_name_window = Window_Item_Name.new(x,y,w,h)
    @item_name_window.viewport = @viewport
    @item_window.item_name_window = @item_name_window
  end
  #--------------------------------------------------------------------------
  # ● 备注信息窗口
  #--------------------------------------------------------------------------
  def create_item_note_window
    x = Item_Note::X
    y = Item_Note::Y
    w = Item_Note::Width
    h = Item_Note::Height
    @item_note_window = Window_Item_Note.new(x,y,w,h)
    @item_note_window.viewport = @viewport
    @item_window.item_note_window = @item_note_window
  end
  #--------------------------------------------------------------------------
  # ● 背景透明
  #--------------------------------------------------------------------------
  def window_opacity
    @item_window.opacity = 0
    @help_window.opacity = 0
    @item_image_window.opacity = 0
    @category_window.opacity = 0
    @item_name_window.opacity = 0
    @item_note_window.opacity = 0
  end
  #--------------------------------------------------------------------------
  # ● 生成背景
  #--------------------------------------------------------------------------
  def create_background
    @background_sprite = Sprite.new
    @background_sprite.bitmap = Cache.ItemImage(BACKGROUND)
  end
  #--------------------------------------------------------------------------
  # ● 释放背景
  #--------------------------------------------------------------------------
  def dispose_background
    @background_sprite.dispose
  end
  #--------------------------------------------------------------------------
  # ● 分类“确定”
  #--------------------------------------------------------------------------
  def on_category_ok
    @item_window.activate
    @item_window.select_last
    @item_window.refresh
    @help_window.set_item(item)  #VIP
    @item_image_window.set_item(item) #VIP
    @item_name_window.set_item(item) #VIP
    @item_note_window.set_item(item) #VIP
  end
  #--------------------------------------------------------------------------
  # ● 播放使用物品声效  SION
  #--------------------------------------------------------------------------
  def play_se_for_item
    Sound.play_use_item unless item.note.include? "<no se>"
  end
end
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-2-23 06:21

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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