| 赞 | 664 |
| VIP | |
| 好人卡 | |
| 积分 | 345 |
| 经验 | |
| 最后登录 | 2024-7-10 |
| 在线时间 | 5096 小时 |
- 梦石
- 0
- 星屑
- 34467
- 在线时间
- 5096 小时
- 注册时间
- 2012-11-19
- 回帖
- 4715

|
发表于 2013-2-10 17:40:46
|
显示全部楼层
675482971@qq.co 发表于 2013-2-10 17:34 
下面那个脚本就是啊 我重新发了一个
脚本已改好,试试- #==============================================================================
- # ■ Window_EquipRight
- #------------------------------------------------------------------------------
- # 装备画面、显示角色现在装备的物品的窗口。
- #==============================================================================
- class Window_EquipRight < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(250, 64, 368, 192)
- self.contents = Bitmap.new(width - 32, height - 32)
- [url=home.php?mod=space&uid=95897]@actor[/url] = actor
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 获取物品
- #--------------------------------------------------------------------------
- def item
- return @data[self.index]
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @data = []
- @data.push($data_weapons[@actor.weapon_id])
- @data.push($data_armors[@actor.armor1_id])
- @data.push($data_armors[@actor.armor2_id])
- @data.push($data_armors[@actor.armor3_id])
- @data.push($data_armors[@actor.armor4_id])
- @item_max = @data.size
- self.contents.font.color = system_color
- self.contents.draw_text(4, 32 * 0, 92, 32, $data_system.words.weapon)
- self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.armor1)
- self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor2)
- self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor3)
- self.contents.draw_text(5, 32 * 4, 92, 32, $data_system.words.armor4)
- draw_item_name(@data[0], 50, 32 * 0)
- draw_item_name(@data[1], 92, 32 * 1)
- draw_item_name(@data[2], 92, 32 * 2)
- draw_item_name(@data[3], 92, 32 * 3)
- draw_item_name(@data[4], 92, 32 * 4)
- # 添加空白
- @data.push(nil)
- # 生成位图、描绘全部项目
- @item_max = @data.size
- self.contents = Bitmap.new(width - 32, row_max * 132)
- for i in 0...@item_max-1
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- #--------------------------------------------------------------------------
- def draw_item(index)
- item = @data[index]
- case item
- when RPG::Item
- number = $game_party.item_number(item.id)
- when RPG::Weapon
- number = $game_party.weapon_number(item.id)
- when RPG::Armor
- number = $game_party.armor_number(item.id)
- end
- if item.is_a?(RPG::Item) and
- $game_party.item_can_use?(item.id)
- self.contents.font.color = normal_color
- else
- self.contents.font.color = disabled_color
- end
- x = index % 4 * 50
- y = index / 4 * 50
- if item != nil
- rect = Rect.new(x, y, self.width / @column_max - 32, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- bitmap = RPG::Cache.icon(item.icon_name)
- opacity = self.contents.font.color == normal_color ? 255 : 255
- self.contents.blt(x, y, bitmap, Rect.new(-2, -2, 50, 100), opacity)
- self.contents.draw_text(x , y , 0, 0, item.name, 0)
- self.contents.draw_text(x + 15, y, 0, 0, "", 1)
- self.contents.draw_text(x + 25, y + 25, 24, 24, number.to_s, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新光标矩形
- #--------------------------------------------------------------------------
- def page_row_max
- # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
- return self.height/ 52
- end
- def update_cursor_rect
- if @index < 0
- self.cursor_rect.empty
- self.opacity = 0
- else
- @selected
- self.cursor_rect.set(index % 4 * 50,index / 4 * 49- self.oy , 42, 41)
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(self.item == nil ? "" : self.item.description)
- end
- end
复制代码 |
|