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

113 lines
4.6 KiB
Ruby
Raw 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.1
# 対 応 RPGツクールVX Ace : RGSS3
# 制 作 者
# 配 布 元 http://cacaosoft.web.fc2.com/
# --------------------------------------------------------------------------
# == 概 要 ==
#
# 現在地をを表示するウィンドウを追加します。
#
# --------------------------------------------------------------------------
# == 注意事項 ==
#
# ※ このスクリプトの動作には、Custom Menu Base が必要です。
#
#
#******************************************************************************
#==============================================================================
# ◆ 設定項目
#==============================================================================
module CAO::CM::Location
#--------------------------------------------------------------------------
# ◇ ウィンドウの位置とサイズ
#--------------------------------------------------------------------------
WINDOW_X = 10 # x座標
WINDOW_Y = 405 # y座標
WINDOW_W = 280 # 横幅
WINDOW_H = 48 # 縦幅
#--------------------------------------------------------------------------
# ◇ システム文字
#--------------------------------------------------------------------------
VOCAB_LOCATION = "Location"
#--------------------------------------------------------------------------
# ◇ システム文字とマップ名の間の余白
#--------------------------------------------------------------------------
SPACING = 12
#--------------------------------------------------------------------------
# ◇ マップ名の表示位置
#--------------------------------------------------------------------------
ALIGNMENT = 0
#--------------------------------------------------------------------------
# ◇ ウィンドウの可視状態
#--------------------------------------------------------------------------
VISIBLE_BACKWINDOW = false
end
#/////////////////////////////////////////////////////////////////////////////#
# #
# 下記のスクリプトを変更する必要はありません。 #
# #
#/////////////////////////////////////////////////////////////////////////////#
class Window_MenuLocation < Window_Base
include CAO::CM::Location
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(WINDOW_X, WINDOW_Y, WINDOW_W, WINDOW_H)
self.opacity = VISIBLE_BACKWINDOW ? 255 : 0
refresh
end
#--------------------------------------------------------------------------
# ●
#--------------------------------------------------------------------------
def left
return @left ||= self.contents.text_size(VOCAB_LOCATION).width + SPACING
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
rect = self.contents.rect
rect.x = 4
rect.width -= 8
unless VOCAB_LOCATION.empty?
change_color(system_color)
draw_text(rect, VOCAB_LOCATION)
rect.x += left
rect.width -= left
end
change_color(normal_color)
# draw_text(rect, Langscore.translate_for_map($game_map.display_name), ALIGNMENT)
end
end
class Scene_Menu
#--------------------------------------------------------------------------
# ○ オプションウィンドウの作成
#--------------------------------------------------------------------------
alias _cao_cm_location_create_option_window create_option_window
def create_option_window
_cao_cm_location_create_option_window
@location_window = Window_MenuLocation.new
end
#--------------------------------------------------------------------------
# ○
#--------------------------------------------------------------------------
alias _cao_cm_location_check_refresh_window check_refresh_window
def check_refresh_window(command)
_cao_cm_location_check_refresh_window(command)
@location_window.refresh if command.refresh.include?(:map)
end
end