Initial import
This commit is contained in:
76
Scripts/RPG/Scene_Item.rb
Normal file
76
Scripts/RPG/Scene_Item.rb
Normal file
@@ -0,0 +1,76 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#==============================================================================
|
||||
# ** Scene_Item
|
||||
#------------------------------------------------------------------------------
|
||||
# This class performs the item screen processing.
|
||||
#==============================================================================
|
||||
|
||||
class Scene_Item < Scene_ItemBase
|
||||
#--------------------------------------------------------------------------
|
||||
# * Start Processing
|
||||
#--------------------------------------------------------------------------
|
||||
def start
|
||||
super
|
||||
create_help_window
|
||||
create_category_window
|
||||
create_item_window
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Create Category Window
|
||||
#--------------------------------------------------------------------------
|
||||
def create_category_window
|
||||
@category_window = Window_ItemCategory.new
|
||||
@category_window.viewport = @viewport
|
||||
@category_window.help_window = @help_window
|
||||
@category_window.y = @help_window.height
|
||||
@category_window.set_handler(:ok, method(:on_category_ok))
|
||||
@category_window.set_handler(:cancel, method(:return_scene))
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Create Item Window
|
||||
#--------------------------------------------------------------------------
|
||||
def create_item_window
|
||||
wy = @category_window.y + @category_window.height
|
||||
wh = Graphics.height - wy
|
||||
@item_window = Window_ItemList.new(0, wy, Graphics.width, wh)
|
||||
@item_window.viewport = @viewport
|
||||
@item_window.help_window = @help_window
|
||||
@item_window.set_handler(:ok, method(:on_item_ok))
|
||||
@item_window.set_handler(:cancel, method(:on_item_cancel))
|
||||
@category_window.item_window = @item_window
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Category [OK]
|
||||
#--------------------------------------------------------------------------
|
||||
def on_category_ok
|
||||
@item_window.activate
|
||||
@item_window.select_last
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Item [OK]
|
||||
#--------------------------------------------------------------------------
|
||||
def on_item_ok
|
||||
$game_party.last_item.object = item
|
||||
determine_item
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Item [Cancel]
|
||||
#--------------------------------------------------------------------------
|
||||
def on_item_cancel
|
||||
@item_window.unselect
|
||||
@category_window.activate
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Play SE When Using Item
|
||||
#--------------------------------------------------------------------------
|
||||
def play_se_for_item
|
||||
Sound.play_use_item
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Use Item
|
||||
#--------------------------------------------------------------------------
|
||||
def use_item
|
||||
super
|
||||
@item_window.redraw_current_item
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user