Class: Scene_Item

Inherits:
Scene_ItemBase show all
Defined in:
Scene_Item.rb

Overview

** Scene_Item


This class performs the item screen processing.

Instance Method Summary (collapse)

Methods inherited from Scene_ItemBase

#activate_item_window, #check_common_event, #create_actor_window, #cursor_left?, #determine_item, #hide_sub_window, #item, #item_effects_valid?, #item_target_actors, #item_usable?, #on_actor_cancel, #on_actor_ok, #show_sub_window, #use_item_to_actors, #user

Methods inherited from Scene_MenuBase

#create_background, #create_help_window, #dispose_background, #next_actor, #on_actor_change, #prev_actor, #terminate

Methods inherited from Scene_Base

#check_gameover, #create_main_viewport, #dispose_all_windows, #dispose_main_viewport, #fadeout_all, #main, #perform_transition, #post_start, #pre_terminate, #return_scene, #scene_changing?, #terminate, #transition_speed, #update, #update_all_windows, #update_basic

Instance Method Details

- (Object) create_category_window


  • Create Category Window




20
21
22
23
24
25
26
27
# File 'Scene_Item.rb', line 20

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

- (Object) create_item_window


  • Create Item Window




31
32
33
34
35
36
37
38
39
40
# File 'Scene_Item.rb', line 31

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

- (Object) on_category_ok


  • Category [OK]




44
45
46
47
# File 'Scene_Item.rb', line 44

def on_category_ok
  @item_window.activate
  @item_window.select_last
end

- (Object) on_item_cancel


  • Item [Cancel]




58
59
60
61
# File 'Scene_Item.rb', line 58

def on_item_cancel
  @item_window.unselect
  @category_window.activate
end

- (Object) on_item_ok


  • Item [OK]




51
52
53
54
# File 'Scene_Item.rb', line 51

def on_item_ok
  $game_party.last_item.object = item
  determine_item
end

- (Object) play_se_for_item


  • Play SE When Using Item




65
66
67
# File 'Scene_Item.rb', line 65

def play_se_for_item
  Sound.play_use_item
end

- (Object) start


  • Start Processing




11
12
13
14
15
16
# File 'Scene_Item.rb', line 11

def start
  super
  create_help_window
  create_category_window
  create_item_window
end

- (Object) use_item


  • Use Item




71
72
73
74
# File 'Scene_Item.rb', line 71

def use_item
  super
  @item_window.redraw_current_item
end