king-exit/Scripts/_.49.rb
2024-09-06 11:45:39 -05:00

114 lines
4.7 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::Gold
#--------------------------------------------------------------------------
# ◇ ウィンドウの位置とサイズ
#--------------------------------------------------------------------------
WINDOW_X = 10 # x座標
WINDOW_Y = 430 # y座標
WINDOW_W = 194 # 横幅
#--------------------------------------------------------------------------
# ◇ 所持金の名前
#--------------------------------------------------------------------------
VOCAB_GOLD = "Money"
#--------------------------------------------------------------------------
# ◇ アイコンの番号
#--------------------------------------------------------------------------
ICON_INDEX = nil
#--------------------------------------------------------------------------
# ◇ 通貨単位の有無
#--------------------------------------------------------------------------
VISIBLE_SYSTEM = true
#--------------------------------------------------------------------------
# ◇ ウィンドウの可視状態
#--------------------------------------------------------------------------
VISIBLE_BACKWINDOW = false
end
#/////////////////////////////////////////////////////////////////////////////#
# #
# 下記のスクリプトを変更する必要はありません。 #
# #
#/////////////////////////////////////////////////////////////////////////////#
class Window_MenuGold < Window_Gold
include CAO::CM::Gold
#--------------------------------------------------------------------------
# ○ ウィンドウ幅の取得
#--------------------------------------------------------------------------
def window_width
return WINDOW_W
end
#--------------------------------------------------------------------------
# ○ 通貨単位つき数値(所持金など)の描画
#--------------------------------------------------------------------------
def draw_currency_value(value, unit, x, y, width)
if ICON_INDEX
draw_icon(ICON_INDEX, x, y + (line_height - 24) / 2)
x += 24
width -= 24
end
cx = text_size(unit).width
change_color(normal_color)
draw_text(x, y, width - cx - 2, line_height, value, 2)
if VISIBLE_SYSTEM
change_color(system_color)
draw_text(x, y, width, line_height, VOCAB_GOLD) if VOCAB_GOLD
draw_text(x, y, width, line_height, unit, 2)
end
end
end
class Scene_Menu
#--------------------------------------------------------------------------
# ○ オプションウィンドウの作成
#--------------------------------------------------------------------------
alias _cao_cm_gold_create_option_window create_option_window
def create_option_window
_cao_cm_gold_create_option_window
create_gold_window
end
#--------------------------------------------------------------------------
# ○ ゴールドウィンドウの作成
#--------------------------------------------------------------------------
def create_gold_window
@gold_window = Window_MenuGold.new
@gold_window.x = CAO::CM::Gold::WINDOW_X
@gold_window.y = CAO::CM::Gold::WINDOW_Y
@gold_window.opacity = CAO::CM::Gold::VISIBLE_BACKWINDOW ? 255 : 0
end
#--------------------------------------------------------------------------
# ○
#--------------------------------------------------------------------------
alias _cao_cm_gold_check_refresh_window check_refresh_window
def check_refresh_window(command)
_cao_cm_gold_check_refresh_window(command)
@gold_window.refresh if command.refresh.include?(:gold)
end
end