Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Sorting Items in Shop Window
#4
Try this. Not sure if this is what you are looking for but trying replacing refresh method in Shop Buy with this.

Code:
def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   for goods_item in @shop_goods
     case goods_item[0]
     when 0
       item = $data_items[goods_item[1]]
     when 1
       item = $data_weapons[goods_item[1]]
     when 2
       item = $data_armors[goods_item[1]]
     end
     if item != nil
       @data.push(item)
     end
   end
   # Sort by Name
   @data.sort! { |a,b| a.name <=> b.name }
   # If item count is not 0, make a bit map and draw all items
   @item_max = @data.size
   if @item_max > 0
     self.contents = Bitmap.new(width - 32, row_max * 32)
     for i in 0...@item_max
       draw_item(i)
     end
   end
 end
Reply }


Messages In This Thread
Sorting Items in Shop Window - by Melana - 01-16-2018, 01:50 PM
RE: Sorting Items in Shop Window - by kyonides - 01-16-2018, 08:09 PM
RE: Sorting Items in Shop Window - by Melana - 01-16-2018, 11:40 PM
RE: Sorting Items in Shop Window - by BeJeremiah - 01-17-2018, 12:21 AM
RE: Sorting Items in Shop Window - by Melana - 01-17-2018, 12:55 AM
RE: Sorting Items in Shop Window - by BeJeremiah - 01-17-2018, 01:15 AM
RE: Sorting Items in Shop Window - by Melana - 01-17-2018, 01:35 AM
RE: Sorting Items in Shop Window - by BeJeremiah - 01-17-2018, 01:58 AM
RE: Sorting Items in Shop Window - by kyonides - 01-17-2018, 03:35 AM
RE: Sorting Items in Shop Window - by Melana - 01-17-2018, 04:02 PM
RE: Sorting Items in Shop Window - by DerVVulfman - 01-17-2018, 05:56 PM
RE: Sorting Items in Shop Window - by Melana - 01-18-2018, 01:02 AM
RE: Sorting Items in Shop Window - by DerVVulfman - 01-18-2018, 05:49 AM
RE: Sorting Items in Shop Window - by kyonides - 01-18-2018, 03:01 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Special Items Separate Menu Diorm 41 36,360 02-10-2018, 06:06 PM
Last Post: Diorm
   Shop Issues :P LunarBerry 4 7,315 11-23-2016, 02:53 AM
Last Post: LunarBerry
   Showing only specific skills in a window Melana 2 5,334 01-12-2016, 01:34 PM
Last Post: Melana
   Dargor's Large Party script and shop menu Simon Greedwell 2 6,033 08-28-2013, 10:12 PM
Last Post: Simon Greedwell
   Help with Shop Menu [RPG Maker XP] JackMonty 6 11,781 05-23-2013, 10:14 AM
Last Post: JackMonty
  Changing Window Styles in Game JackMonty 8 9,621 03-22-2013, 11:54 PM
Last Post: JackMonty
   Something I noticed about the Advanced Shop Status Window yamina-chan 5 9,090 08-21-2011, 09:16 PM
Last Post: yamina-chan
   [Atoa SBS] Changing the command window font MegaPowerNinja 3 7,593 04-12-2011, 10:23 PM
Last Post: Victor Sant
   Repositioning the actor command window. MegaPowerNinja 4 8,545 04-12-2011, 05:21 AM
Last Post: MegaPowerNinja
   Need Help on Making Battle Status Window riou 4 9,714 03-22-2011, 06:04 AM
Last Post: Victor Sant



Users browsing this thread: