赞 | 2 |
VIP | 19 |
好人卡 | 10 |
积分 | 3 |
经验 | 57661 |
最后登录 | 2019-5-20 |
在线时间 | 574 小时 |
Lv2.观梦者
- 梦石
- 0
- 星屑
- 253
- 在线时间
- 574 小时
- 注册时间
- 2006-8-25
- 帖子
- 969
|
- #==============================================================================
- # ■ Window_EquipRight
- #------------------------------------------------------------------------------
- # 装备画面、显示角色现在装备的物品的窗口。
- #==============================================================================
- class Window_EquipRight < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # actor : 角色
- #--------------------------------------------------------------------------
- def initialize(actor)
- super(-1, 253, 312, 310 )
- self.contents = Bitmap.new(width - 32, height - 32)
- @actor = actor
- self.opacity = 0
- refresh
- 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(20, 1, 92, 32, $data_system.words.weapon)
- self.contents.draw_text(20, 37, 92, 32, $data_system.words.armor1)
- self.contents.draw_text(20, 76, 92, 32, $data_system.words.armor2)
- self.contents.draw_text(20, 115 , 92, 32, $data_system.words.armor3)
- self.contents.draw_text(20, 152, 92, 32, $data_system.words.armor4)
- draw_item_name(@data[0], 100, 1 )
- draw_item_name(@data[1], 100, 37 )
- draw_item_name(@data[2], 100, 76 )
- draw_item_name(@data[3], 100, 115 )
- draw_item_name(@data[4], 100, 152 )
- end
- #--------------------------------------------------------------------------
- # ● 刷新帮助文本
- #--------------------------------------------------------------------------
- def update_help
- @help_window.set_text(self.item == nil ? "" : self.item.description)
- 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 = self.width / @column_max - 32
- # 计算光标坐标
- x = @index % @column_max * (cursor_width + 32)
- y = @index / @column_max * 32 - self.oy
- # 更新国标矩形
- self.cursor_rect.set(x, y, cursor_width, 32)
- end
- ###########################################
- end
复制代码 |
|