赞 | 12 |
VIP | 107 |
好人卡 | 6 |
积分 | 4 |
经验 | 31122 |
最后登录 | 2024-6-29 |
在线时间 | 1606 小时 |
Lv2.观梦者 傻♂逼
- 梦石
- 0
- 星屑
- 374
- 在线时间
- 1606 小时
- 注册时间
- 2007-3-13
- 帖子
- 6562
 
|
发现问题!!!!
用以下脚本替换“窗口”,把图标改成了物品图标
使用色调实现灰色
- $item=
- [
- 1,2,3,4,5,6,
- 7,8,9,15,9,9,
- 9,9,9,9,9,9,
- 9,9,9,9,9,9
- ]
- class Window_Pr < Window_Base
- attr_accessor :index # index
- attr_accessor :hindex # index
- attr_accessor :hh # index
- def initialize #一行6个 4 行
- super(160, 300, 7 * 32, 5 * 32)
- self.contents = Bitmap.new(width - 32, height - 32)
- # self.index = 0
- @index = 0
- @hindex = 0
- @hh = 0
- @pic = []
- x = 16
- y = 1
- x = 16
- y = 1
- @pic = nil
- @pic = []
- for i in 1..24
- if i % 6 == 1
- y += 32
- x = 16
- end
- @pic[i-1] = Sprite.new
- @pic[i-1].x = x + 160
- @pic[i-1].y = y + 300 - 16
- @pic[i-1].z = 9999 * i
- if $game_party.item_number($item[i]) >= 1
- @pic[i-1].bitmap = RPG::Cache.icon($data_items[$item[i-1].to_i].icon_name)
- # @pic[i-1].bitmap.hue_change(0)
- else
- if $data_items[$item[i-1].to_i] == nil
- @pic[i-1].bitmap = RPG::Cache.icon("037-Item06")
- else
- @pic[i-1].bitmap = RPG::Cache.icon($data_items[$item[i-1].to_i].icon_name)
- end
- @pic[i-1].tone.set(0, 0, 0, 255) # = RPG::Cache.icon("037-Item06")
-
- end
- x += 32
- # refresh
- end
- refresh
- end
- def refresh
- self.cursor_rect.set(got_x(@hindex) - 18,got_y(@hh)-5,32, 32)
- end
- def got_x(hindex)
- x = 16
- x += hindex * 32
- return x
- end
- def got_y(hh)
- y = 1
- y += hh * 32
- return y
- end
- def update
- super
- if Input.repeat?(Input::UP)
- go_up
- end
- if Input.repeat?(Input::DOWN)
- go_down
- end
- if Input.repeat?(Input::LEFT)
- go_left
- end
- if Input.repeat?(Input::RIGHT)
- go_right
- end
- end
- def go_up
- if @hh == 0
- @hh = 3
- @index += 18
- else
- @index -= 6
- @hh -= 1
- end
- refresh
- end
- def go_down
- if @hh == 3
- @hh = 0
- @index -= 18
- else
- @hh += 1
- @index += 6
- end
- refresh
- end
- def go_left
- if @hindex == 0
- @hindex = 5
- @index += 5
- else
- @hindex -= 1
- @index -= 1
- end
- refresh
- end
- def go_right
- if @hindex == 5
- @hindex = 0
- @index -= 5
- else
- @hindex += 1
- @index += 1
- end
- refresh
- end
- def pic_cont
- for i in 1..24
- @pic[i-1].bitmap.dispose
- @pic[i-1].dispose
- end
- @pic = []
- @pic = nil
- end
- end
复制代码 |
|