IceDragon200

[VXA]make_item_list

Nov 10th, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.44 KB | None | 0 0
  1.   def make_item_list(sort)
  2.     # // Method to make item list.
  3.     @data = $game_party.all_items.select { |item| include?(item) }
  4.     case sort
  5.     when :price_high then @data.sort_by!(&:price).reverse!
  6.     when :price_low  then @data.sort_by!(&:price)
  7.     when :a_z        then @data.sort_by! { |a| a.name.downcase }
  8.     when :z_a        then @data.sort_by! { |a| a.name.downcase }.reverse!
  9.     end
  10.     @data.push(nil) if include?(nil)
  11.   end
Advertisement
Add Comment
Please, Sign In to add comment