Initial import
This commit is contained in:
109
Scripts/RPG/Scene_Skill.rb
Normal file
109
Scripts/RPG/Scene_Skill.rb
Normal file
@@ -0,0 +1,109 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#==============================================================================
|
||||
# ** Scene_Skill
|
||||
#------------------------------------------------------------------------------
|
||||
# This class performs skill screen processing. Skills are handled as items for
|
||||
# the sake of process sharing.
|
||||
#==============================================================================
|
||||
|
||||
class Scene_Skill < Scene_ItemBase
|
||||
#--------------------------------------------------------------------------
|
||||
# * Start Processing
|
||||
#--------------------------------------------------------------------------
|
||||
def start
|
||||
super
|
||||
create_help_window
|
||||
create_command_window
|
||||
create_status_window
|
||||
create_item_window
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Create Command Window
|
||||
#--------------------------------------------------------------------------
|
||||
def create_command_window
|
||||
wy = @help_window.height
|
||||
@command_window = Window_SkillCommand.new(0, wy)
|
||||
@command_window.viewport = @viewport
|
||||
@command_window.help_window = @help_window
|
||||
@command_window.actor = @actor
|
||||
@command_window.set_handler(:skill, method(:command_skill))
|
||||
@command_window.set_handler(:cancel, method(:return_scene))
|
||||
@command_window.set_handler(:pagedown, method(:next_actor))
|
||||
@command_window.set_handler(:pageup, method(:prev_actor))
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Create Status Window
|
||||
#--------------------------------------------------------------------------
|
||||
def create_status_window
|
||||
y = @help_window.height
|
||||
@status_window = Window_SkillStatus.new(@command_window.width, y)
|
||||
@status_window.viewport = @viewport
|
||||
@status_window.actor = @actor
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Create Item Window
|
||||
#--------------------------------------------------------------------------
|
||||
def create_item_window
|
||||
wx = 0
|
||||
wy = @status_window.y + @status_window.height
|
||||
ww = Graphics.width
|
||||
wh = Graphics.height - wy
|
||||
@item_window = Window_SkillList.new(wx, wy, ww, wh)
|
||||
@item_window.actor = @actor
|
||||
@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))
|
||||
@command_window.skill_window = @item_window
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Get Skill's User
|
||||
#--------------------------------------------------------------------------
|
||||
def user
|
||||
@actor
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * [Skill] Command
|
||||
#--------------------------------------------------------------------------
|
||||
def command_skill
|
||||
@item_window.activate
|
||||
@item_window.select_last
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Item [OK]
|
||||
#--------------------------------------------------------------------------
|
||||
def on_item_ok
|
||||
@actor.last_skill.object = item
|
||||
determine_item
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Item [Cancel]
|
||||
#--------------------------------------------------------------------------
|
||||
def on_item_cancel
|
||||
@item_window.unselect
|
||||
@command_window.activate
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Play SE When Using Item
|
||||
#--------------------------------------------------------------------------
|
||||
def play_se_for_item
|
||||
Sound.play_use_skill
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Use Item
|
||||
#--------------------------------------------------------------------------
|
||||
def use_item
|
||||
super
|
||||
@status_window.refresh
|
||||
@item_window.refresh
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Change Actors
|
||||
#--------------------------------------------------------------------------
|
||||
def on_actor_change
|
||||
@command_window.actor = @actor
|
||||
@status_window.actor = @actor
|
||||
@item_window.actor = @actor
|
||||
@command_window.activate
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user