class Rsrb::Model::Equipment::SidebarContainerListener
Attributes
player[R]
Public Class Methods
new(player)
click to toggle source
# File lib/rsrb/model/equipment.rb, line 108 def initialize(player) @player = player end
Public Instance Methods
items_changed(container)
click to toggle source
# File lib/rsrb/model/equipment.rb, line 121 def items_changed(container) send_weapon end
send_weapon()
click to toggle source
# File lib/rsrb/model/equipment.rb, line 125 def send_weapon weapon = player.equipment.items[3] if weapon name = weapon.definition.name send_sidebar name, weapon.id, find_sidebar_interface(name) else # No weapon wielded @player.io.send_sidebar_interface 0, 5855 @player.io.send_string 5857, "Unarmed" end end
slot_changed(container, slot)
click to toggle source
# File lib/rsrb/model/equipment.rb, line 112 def slot_changed(container, slot) send_weapon if slot == 3 end
slots_changed(container, slots)
click to toggle source
# File lib/rsrb/model/equipment.rb, line 116 def slots_changed(container, slots) slot = slots.find {|e| e == 3} send_weapon unless slot == nil end
Private Instance Methods
filter_name(name)
click to toggle source
# File lib/rsrb/model/equipment.rb, line 158 def filter_name(name) name = name.dup MATERIALS.each {|m| name.gsub!(Regexp.new(m), "") } name.strip end