Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # A small snippet which makes the actor selection window automatically close
- # itself after using an item if it was the last item of that kind in the
- # inventory.
- # Made by: Sixth
- #===============================================================================
- class Scene_Item < Scene_ItemBase
- alias sixth_zeroitem1222 start
- def start
- sixth_zeroitem1222
- @zero = false
- end
- alias sixth_zeroitem7765 on_item_ok
- def on_item_ok
- if @item_window.current_item_enabled? && @zero == false
- Sound.play_ok
- sixth_zeroitem7765
- elsif !@item_window.current_item_enabled? && @zero == false
- Sound.play_buzzer
- @item_window.activate
- else
- @item_window.activate
- @zero = false
- end
- end
- alias sixth_zeroitem3354 use_item
- def use_item
- sixth_zeroitem3354
- if item.is_a?(RPG::Item) && $game_party.item_number(item) == 0
- @zero = true
- @item_window.select(0)
- hide_sub_window(@actor_window)
- end
- end
- end
- class Window_ItemList < Window_Selectable
- def process_ok
- return super if $game_party.in_battle
- Input.update
- deactivate
- call_ok_handler
- end
- end
- #==============================================================================
- # !!END OF SCRIPT - OHH, NOES!!
- #==============================================================================
Add Comment
Please, Sign In to add comment