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

126 lines
5.3 KiB
Ruby
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#******************************************************************************
#
# コマンドウィンドウ
#
# --------------------------------------------------------------------------
# バージョン 1.0.0
# 対 応 RPGツクールVX Ace : RGSS3
# 制 作 者
# 配 布 元 http://cacaosoft.web.fc2.com/
# --------------------------------------------------------------------------
# == 概 要 ==
#
# ウィンドウをベースとしたメニュー項目です。
#
# --------------------------------------------------------------------------
# == 注意事項 ==
#
# ※ このスクリプトの動作には、Custom Menu Base が必要です。
# ※ 項目の設定は、Custom Menu Base で行ってください。
#
#
#******************************************************************************
#==============================================================================
# ◆ 設定項目
#==============================================================================
module CAO::CM::Command
#--------------------------------------------------------------------------
# ◇ ウィンドウの位置・サイズ
#--------------------------------------------------------------------------
# 縦幅を nil にすると項目数に合わせます。
#--------------------------------------------------------------------------
WINDOW_X = 0 # x座標
WINDOW_Y = 36 # y座標
WINDOW_W = 640 # 横幅
WINDOW_H = 72 # 縦幅
#--------------------------------------------------------------------------
# ◇ 項目を横に並べる数
#--------------------------------------------------------------------------
COLUMN_MAX = 4
#--------------------------------------------------------------------------
# ◇ 横に項目が並ぶときの空白の幅
#--------------------------------------------------------------------------
SPACING = 8
#--------------------------------------------------------------------------
# ◇ 項目の表示位置
#--------------------------------------------------------------------------
# value : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
#--------------------------------------------------------------------------
ALIGNMENT = 1
#--------------------------------------------------------------------------
# ◇ ウィンドウの可視状態
#--------------------------------------------------------------------------
VISIBLE_BACKWINDOW = false
end
#/////////////////////////////////////////////////////////////////////////////#
# #
# 下記のスクリプトを変更する必要はありません。 #
# #
#/////////////////////////////////////////////////////////////////////////////#
class Window_MenuMainCommand < Window_CustomMenuCommand
include CAO::CM::Command
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(:main)
self.x = WINDOW_X
self.y = WINDOW_Y
self.opacity = VISIBLE_BACKWINDOW ? 255 : 0
end
#--------------------------------------------------------------------------
# ● ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
return WINDOW_W
end
#--------------------------------------------------------------------------
# ● ウィンドウ高さの取得
#--------------------------------------------------------------------------
def window_height
WINDOW_H || fitting_height(row_max)
end
#--------------------------------------------------------------------------
# ● 桁数の取得
#--------------------------------------------------------------------------
def col_max
return (COLUMN_MAX < 0) ? item_max : COLUMN_MAX
end
#--------------------------------------------------------------------------
# ● 横に項目が並ぶときの空白の幅を取得
#--------------------------------------------------------------------------
def spacing
return SPACING
end
#--------------------------------------------------------------------------
# ● アライメントの取得
#--------------------------------------------------------------------------
def alignment
return ALIGNMENT
end
end
class Scene_Menu
#--------------------------------------------------------------------------
# ○ コマンドウィンドウの作成
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_MenuMainCommand.new
@command_window.set_handler(:cancel, method(:return_scene))
@command_window.set_handlers(self)
end
#--------------------------------------------------------------------------
# ○
#--------------------------------------------------------------------------
alias _cao_cm_command_check_refresh_window check_refresh_window
def check_refresh_window(command)
_cao_cm_command_check_refresh_window(command)
@command_window.refresh if command.refresh.include?(:command)
end
end