Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # * Scene_Shop
- #===============================================================================
- class Scene_Shop
- #-----------------------------------------------------------------------------
- # * update_number
- # Prevents purchasing of items when OVERWEIGHT_PARTY is true and number
- # of items to buy would exceed maximum weight
- #-----------------------------------------------------------------------------
- alias item_weight_update_number update_number
- def update_number
- unless Weight::OVERWEIGHT_PARTY
- if Input.trigger?(Input::C) && @command_window.index == 0
- weight = @item.weight * @number_window.number
- weight += $game_party.total_weight
- if weight > $game_party.weight_capacity
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- end
- end
- item_weight_update_number
- end
- end
- #===============================================================================
- # * Window_ShopNumber
- #===============================================================================
- class Window_ShopNumber
- #-----------------------------------------------------------------------------
- # * refresh
- # Adds a weight display to the number screen at the shop
- #-----------------------------------------------------------------------------
- alias item_weight_refresh refresh
- def refresh
- item_weight_refresh
- weight = (@item.weight * @number) + $game_party.total_weight
- capacity = $game_party.weight_capacity
- self.contents.draw_text(4, 192, 72, 32, 'Weight:')
- color = weight > capacity ? crisis_color : normal_color
- self.contents.font.color = color
- self.contents.draw_text(76, 192, 64, 32, weight.to_s, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(144, 192, 64, 32, '/ ' + capacity.to_s)
- end
- end
Add Comment
Please, Sign In to add comment