king-exit/Scripts/_.68.rb
2024-08-31 14:17:23 -05:00

195 lines
No EOL
7.5 KiB
Ruby

=begin
▼ 装備変更コマンドの削除 ver. 1.1
RPGツクールVXAce用スクリプト
制作 : 木星ペンギン
URL : http://woodpenguin.blog.fc2.com/
------------------------------------------------------------------------------
概要
□ 装備画面から「装備変更」というコマンドを削除します。
・装備コマンドと装備品一覧は上下キーで移動できるようになります。
・装備品一覧でキャンセルキーを押すと、メニュー画面に戻ります。
=end
#//////////////////////////////////////////////////////////////////////////////
#
# 設定項目なし
#
#//////////////////////////////////////////////////////////////////////////////
module WdTk
module SelectEX
#--------------------------------------------------------------------------
# ● カーソルを下に移動
#--------------------------------------------------------------------------
def cursor_down(wrap = false)
Input.update if wrap && row < row_max - 1 && handle?(:down)
super(wrap && !handle?(:down))
end
#--------------------------------------------------------------------------
# ● カーソルを上に移動
#--------------------------------------------------------------------------
def cursor_up(wrap = false)
Input.update if wrap && row > 0 && handle?(:up)
super(wrap && !handle?(:up))
end
#--------------------------------------------------------------------------
# ● カーソルを右に移動
#--------------------------------------------------------------------------
def cursor_right(wrap = false)
unless index % col_max == col_max - 1 && handle?(:right)
super(wrap)
Input.update if wrap
end
end
#--------------------------------------------------------------------------
# ● カーソルを左に移動
#--------------------------------------------------------------------------
def cursor_left(wrap = false)
unless index % col_max == 0 && handle?(:left)
super(wrap)
Input.update if wrap
end
end
#--------------------------------------------------------------------------
# ● 決定やキャンセルなどのハンドリング処理
#--------------------------------------------------------------------------
def process_handling
super
return unless open? && active
return process_down if handle?(:down) && Input.trigger?(:DOWN)
return process_up if handle?(:up) && Input.trigger?(:UP)
return process_right if handle?(:right) && Input.trigger?(:RIGHT)
return process_left if handle?(:left) && Input.trigger?(:LEFT)
end
#--------------------------------------------------------------------------
# ● 下ボタンが押されたときの処理
#--------------------------------------------------------------------------
def process_down
Sound.play_cursor
Input.update
deactivate
call_handler(:down)
end
#--------------------------------------------------------------------------
# ● 上ボタンが押されたときの処理
#--------------------------------------------------------------------------
def process_up
Sound.play_cursor
Input.update
deactivate
call_handler(:up)
end
#--------------------------------------------------------------------------
# ● 右ボタンが押されたときの処理
#--------------------------------------------------------------------------
def process_right
Sound.play_cursor
Input.update
deactivate
call_handler(:right)
end
#--------------------------------------------------------------------------
# ● 左ボタンが押されたときの処理
#--------------------------------------------------------------------------
def process_left
Sound.play_cursor
Input.update
deactivate
call_handler(:left)
end
end
@material ||= []
@material << :EquipCompact
def self.include?(sym)
@material.include?(sym)
end
end
#==============================================================================
# ■ Window_EquipCommand
#==============================================================================
class Window_EquipCommand
#--------------------------------------------------------------------------
# ● モジュール
#--------------------------------------------------------------------------
include WdTk::SelectEX
#--------------------------------------------------------------------------
# ☆ 桁数の取得
#--------------------------------------------------------------------------
def col_max; 2; end
#--------------------------------------------------------------------------
# ☆ コマンドリストの作成
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::optimize, :optimize)
add_command(Vocab::clear, :clear)
end
end
#==============================================================================
# ■ Window_EquipSlot
#==============================================================================
class Window_EquipSlot
#--------------------------------------------------------------------------
# ● モジュール
#--------------------------------------------------------------------------
include WdTk::SelectEX
end
#==============================================================================
# ■ Scene_Equip
#==============================================================================
class Scene_Equip < Scene_MenuBase
#--------------------------------------------------------------------------
# ● モジュール
#--------------------------------------------------------------------------
include WdTk::SelectEX
#--------------------------------------------------------------------------
# ◯ コマンドウィンドウの作成
#--------------------------------------------------------------------------
alias _wooden_eqcom_create_command_window create_command_window
def create_command_window
_wooden_eqcom_create_command_window
@command_window.set_handler(:up, method(:on_command_up))
@command_window.set_handler(:down, method(:on_command_down))
end
#--------------------------------------------------------------------------
# ◯ スロットウィンドウの作成
#--------------------------------------------------------------------------
alias _wooden_eqcom_create_slot_window create_slot_window
def create_slot_window
_wooden_eqcom_create_slot_window
@slot_window.set_handler(:cancel, method(:return_scene))
@slot_window.set_handler(:up, method(:active_command))
@slot_window.set_handler(:down, method(:active_command))
end
#--------------------------------------------------------------------------
# ● コマンド[上ボタン]
#--------------------------------------------------------------------------
def on_command_up
@command_window.unselect
@slot_window.activate.select(@slot_window.item_max - 1)
end
#--------------------------------------------------------------------------
# ● コマンド[下ボタン]
#--------------------------------------------------------------------------
def on_command_down
@command_window.unselect
@slot_window.activate.select(0)
end
#--------------------------------------------------------------------------
# ● コマンドウィンドウのアクティブ化
#--------------------------------------------------------------------------
def active_command
@slot_window.unselect
@command_window.activate.select(0)
end
end