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

128 lines
5.1 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 が必要です。
#
#
#******************************************************************************
#==============================================================================
# ◆ 設定項目
#==============================================================================
module CAO::CM::Help
#--------------------------------------------------------------------------
# ◇ ウィンドウの位置とサイズ
#--------------------------------------------------------------------------
WINDOW_X = 4 # x座標
WINDOW_Y = 0 # y座標
WINDOW_W = 536 # 横幅
WINDOW_H = 48 # 縦幅
#--------------------------------------------------------------------------
# ◇ 行数
#--------------------------------------------------------------------------
ROW_MAX = 1
#--------------------------------------------------------------------------
# ◇ ウィンドウの可視状態
#--------------------------------------------------------------------------
VISIBLE_BACKWINDOW = false
end
#/////////////////////////////////////////////////////////////////////////////#
# #
# 下記のスクリプトを変更する必要はありません。 #
# #
#/////////////////////////////////////////////////////////////////////////////#
class Window_MenuHelp < Window_Base
include CAO::CM::Help
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(WINDOW_X, WINDOW_Y, WINDOW_W, WINDOW_H)
self.opacity = VISIBLE_BACKWINDOW ? 255 : 0
@canvas = CAO::CM::Canvas.new(self)
end
#--------------------------------------------------------------------------
# ● 行の高さを取得
#--------------------------------------------------------------------------
def line_height
return contents_height / ROW_MAX
end
#--------------------------------------------------------------------------
# ● テキスト設定
#--------------------------------------------------------------------------
def set_text(text)
if text != @text
@text = text
refresh
end
end
#--------------------------------------------------------------------------
# ● クリア
#--------------------------------------------------------------------------
def clear
set_text("")
end
#--------------------------------------------------------------------------
# ● アイテム設定
# item : スキル、アイテム等
#--------------------------------------------------------------------------
def set_item(item)
set_text(item ? item.description : "")
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@canvas.draw_text_ex(4, 0, @text)
end
end
class Scene_Menu
#--------------------------------------------------------------------------
# ○ オプションウィンドウの作成
#--------------------------------------------------------------------------
alias _cao_cm_help_create_option_window create_option_window
def create_option_window
_cao_cm_help_create_option_window
@help_window = Window_MenuHelp.new
end
#--------------------------------------------------------------------------
# ○ オプションウィンドウの更新
#--------------------------------------------------------------------------
alias _cao_cm_help_update_command_window update_command_window
def update_command_window
_cao_cm_help_update_command_window
@help_window.set_item(@command_window.current_data)
if @subcommand_window && @subcommand_window.active
@help_window.set_item(@subcommand_window.current_data)
end
end
#--------------------------------------------------------------------------
# ○
#--------------------------------------------------------------------------
alias _cao_cm_help_check_refresh_window check_refresh_window
def check_refresh_window(command)
_cao_cm_help_check_refresh_window(command)
@help_window.refresh if command.refresh.include?(:help)
end
end