#==============================================================================
# ** Matt Core Addon VX ACE
#
# For use of Matt's Core VX ACE
# This script does Extra Random stuff for Matt's Core
# This is the first script for the addon system
# This script was developed after Matt Core update 1.0.2
#
#==============================================================================

class Scene_Equip < Scene_MenuBase
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
create_help_window
create_status_window
create_command_window
create_slot_window
create_item_window
end
#--------------------------------------------------------------------------
# * Create Status Window
#--------------------------------------------------------------------------
def create_status_window
@status_window = Window_EquipStatus.new(0, @help_window.height)
@status_window.viewport = @viewport
@status_window.actor = @actor
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
wx = @status_window.width
wy = @help_window.height
ww = Graphics.width - @status_window.width
@command_window = Window_EquipCommand.new(wx, wy, ww)
@command_window.viewport = @viewport
@command_window.help_window = @help_window
@command_window.set_handler(:equip, method(:command_equip))
@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 Slot Window
#--------------------------------------------------------------------------
def create_slot_window
wx = @status_window.width
wy = @command_window.y + @command_window.height
ww = Graphics.width - @status_window.width
@slot_window = Window_EquipSlot.new(wx, wy, ww)
@slot_window.viewport = @viewport
@slot_window.help_window = @help_window
@slot_window.status_window = @status_window
@slot_window.actor = @actor
@slot_window.set_handler(:ok, method(:on_slot_ok))
@slot_window.set_handler(:cancel, method(:on_slot_cancel))
end
#--------------------------------------------------------------------------
# * Create Item Window
#--------------------------------------------------------------------------
def create_item_window
wx = 0
wy = @slot_window.y + @slot_window.height
ww = Graphics.width
wh = Graphics.height - wy
@item_window = Window_EquipItem.new(wx, wy, ww, wh)
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.status_window = @status_window
@item_window.actor = @actor
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@slot_window.item_window = @item_window
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_equip
@slot_window.activate
@slot_window.select(0)
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_optimize
Sound.play_equip
@actor.optimize_equipments
@status_window.refresh
@slot_window.refresh
@command_window.activate
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_clear
Sound.play_equip
@actor.clear_equipments
@status_window.refresh
@slot_window.refresh
@command_window.activate
end
#--------------------------------------------------------------------------
# * Slot
#--------------------------------------------------------------------------
def on_slot_ok
@item_window.activate
@item_window.select(0)
end
#--------------------------------------------------------------------------
# * Slot
#--------------------------------------------------------------------------
def on_slot_cancel
@slot_window.unselect
@command_window.activate
end
#--------------------------------------------------------------------------
# * Item
#--------------------------------------------------------------------------
def on_item_ok
Sound.play_equip
@actor.change_equip(@slot_window.index, @item_window.item)
@slot_window.activate
@slot_window.refresh
@item_window.unselect
@item_window.refresh
end
#--------------------------------------------------------------------------
# * Item
#--------------------------------------------------------------------------
def on_item_cancel
@slot_window.activate
@item_window.unselect
end
#--------------------------------------------------------------------------
# * Change Actors
#--------------------------------------------------------------------------
def on_actor_change
@status_window.actor = @actor
@slot_window.actor = @actor
@item_window.actor = @actor
@command_window.activate
end
end


class Window_GameEnd < Window_Command
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0)
update_placement
self.openness = 0
open
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
return 160
end
#--------------------------------------------------------------------------
# * Update Window Position
#--------------------------------------------------------------------------
def update_placement
self.x = (Graphics.width - width) / 2
self.y = (Graphics.height - height) / 2
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::shutdown, :shutdown)
add_command(Vocab::cancel, :cancel)
end
end