赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 5 |
经验 | 0 |
最后登录 | 2024-3-7 |
在线时间 | 43 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 514
- 在线时间
- 43 小时
- 注册时间
- 2022-11-15
- 帖子
- 21
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
想要用事件打开此脚本 可是报错了 有没有大神帮帮呢
#==============================================================================
# ■ System
#------------------------------------------------------------------------------
#==============================================================================
module System
#============================================================================
# ■ Interface
#----------------------------------------------------------------------------
# 游戏界面。
#============================================================================
class Interface
#------------------------------------------------------------------------
# ● 生成仓库内容
#------------------------------------------------------------------------
def store_main
return if Picture.exist?($图表[27])
# 生成窗口
$data.store[0] = Array.new(20) if $data.store[0].nil?
@store_window = Window_Item.new($game_party.actors[0],$data.store[0])
@store_window.x,@store_window.y = 109,154
@store_window.z = 605
@store_item = Window_Item.new($game_party.actors[0])
@store_item.x,@store_item.y = 400,154
@store_item.z = 605
# 关联帮助窗口
@store_window.help_window = Window_Help.new
@store_item.help_window = Window_Help.new
# 生成窗口皮肤
$图表[27] = Picture.new("UI/仓库",113,141,600)
@store_button = []
@store_button[0] = Picture.new("UI/叉",662,146,600,[0,0,4,1])
@store_button[1] = Picture.new("UI/向下",233,411,600,[0,0,4,1])
@store_button[2] = Picture.new("UI/确定",272,411,600,[0,0,3,1])
@store_button[3] = Picture.new("UI/道具",550,385,600,[0,0,3,1])
@store_button[4] = Picture.new("UI/行囊",609,385,600,[0,0,3,1])
@store_button[5] = Picture.new("UI/确定",563,411,600,[0,0,3,1])
@store_button[6] = Picture.new("UI/锁定",0,0,-1)
@store_button[7] = Picture.new("UI/锁定",0,0,-1)
@item_number = @store_number = nil
@select_item = @select_store = nil
@goos = @store_button[3]
draw_text
end
#------------------------------------------------------------------------
# ● 刷新
#------------------------------------------------------------------------
def update_store
return if !Picture.exist?($图表[27])
@store_item.update
@store_window.update
store_select_item
for i in 0..5
System.update_button(@store_button,$事件)
if $事件[@store_button][1]
case i
when 0 # 退出
dispose_store
when 1 # 向下
when 2 # 确定
if @select_store != nil
if @goos == @store_button[3]
$data.pack[$data.empty($data.pack)] = @select_store
else
$data.wallet[$data.empty($data.wallet)] = @select_store
end
$data.store[0][@store_index] = nil
@store_window.refresh
@store_item.refresh
@store_button[6].z = -1
@select_store = @store_number = nil
draw_text
end
when 3 # 道具
@select_item = nil
@store_button[7].z = -1
@goos = @store_button[3]
@store_item.data = $data.pack
@store_item.refresh
when 4 # 行囊
@select_item = nil
@store_button[7].z = -1
@goos = @store_button[4]
@store_item.data = $data.wallet
@store_item.refresh
when 5 # 确定
if @select_item != nil
$data.store[0][$data.empty($data.store[0])] = @select_item
if @goos == @store_button[3]
$data.pack[@item_index] = nil
else
$data.wallet[@item_index] = nil
end
@store_window.refresh
@store_item.refresh
@store_button[7].z = -1
@select_item = @item_number = nil
draw_text
end
end
end
end
@goos.src_rect.set(86,0,43,22) if Picture.exist?(@goos)
end
#------------------------------------------------------------------------
# ● 刷新选中物品
#------------------------------------------------------------------------
def store_select_item
return if !Picture.exist?($图表[27])
# 激活物品窗口
if @store_item.active
# 获取物品
item = @store_item.item
# 当按下鼠标左键时
if Mouse.trigger?(0x01) and item != nil
# 选中物品
if @select_item != item
@select_item = item
@item_index = @store_item.index
@store_button[7].x = @store_item.index % 5 * 51 + 321 + 96
@store_button[7].y = @store_item.index / 5 * 51 + 105 + 66
@store_button[7].z = 600
@item_number = @select_item[1]
draw_text
end
end
elsif @store_window.active
# 获取物品
item = @store_window.item
# 当按下鼠标左键时
if Mouse.trigger?(0x01) and item != nil
# 选中物品
if @select_store != item
@select_store = item
@store_index = @store_window.index
@store_button[6].x = @store_window.index % 5 * 51 + 30 + 96
@store_button[6].y = @store_window.index / 5 * 51 + 105 + 66
@store_button[6].z = 600
@store_number = @select_store[1]
draw_text
end
end
end
end
#------------------------------------------------------------------------
# ● 描绘文字
#------------------------------------------------------------------------
def draw_text
$图表[27].bitmap.dispose
$图表[27].bitmap = Bitmap.new("UI/仓库")
$图表[27].bitmap.font = Font.new("黑体",16)
$图表[27].bitmap.font.color = Color.new(0,0,0,255)
# 仓库选中物品数量
$图表[27].bitmap.draw_text(75, 247, 148, 20, @store_number.to_s)
# 仓库编号
$图表[27].bitmap.draw_text(75, 271, 148, 20, 1.to_s)
# 行囊选中物品数量
$图表[27].bitmap.draw_text(376, 247, 148, 20, @item_number.to_s)
end
#------------------------------------------------------------------------
# ● 释放
#------------------------------------------------------------------------
def dispose_store
return if !Picture.exist?($图表[27])
Picture.dispose($图表[27])
Picture.dispose(@store_window)
Picture.dispose(@store_item)
for i in @store_button
Picture.dispose(i)
end
end
end
end[/pre] |
|