rebf-gaiden/Scripts/_.61.rb
2025-04-28 13:11:11 -05:00

118 lines
No EOL
5.2 KiB
Ruby
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module PON_FONT
#--------------------------------------------------------------------------
# ● フォント設定スイッチ番号
#--------------------------------------------------------------------------
FONT_S = 26
#--------------------------------------------------------------------------
# ● スイッチがオンの時のフォント名
#--------------------------------------------------------------------------
ON_FONT = "みかちゃん"
#--------------------------------------------------------------------------
# ● スイッチがオフの時のフォント名(デフォルトのフォント名)
#--------------------------------------------------------------------------
OFF_FONT = "いろはマルみかみ Mediam"
#----------------------------------------------------------------------------
# ★ 設定ここまで
#----------------------------------------------------------------------------
Font.default_name = OFF_FONT
#--------------------------------------------------------------------------
# ● 現在のフォント名の取得
#--------------------------------------------------------------------------
def self.font_default_name
$game_switches[FONT_S] ? ON_FONT : OFF_FONT
end
end
#==============================================================================
# ■ DataManager
#------------------------------------------------------------------------------
#  データベースとゲームオブジェクトを管理するモジュールです。ゲームで使用する
# ほぼ全てのグローバル変数はこのモジュールで初期化されます。
#==============================================================================
class << DataManager
#--------------------------------------------------------------------------
# ● ロードの実行
#--------------------------------------------------------------------------
alias sw_font_change_load_game load_game
def load_game(index)
if sw_font_change_load_game(index)
Font.default_name = PON_FONT.font_default_name
true
else
false
end
end
end
#==============================================================================
# ■ Game_Switches
#------------------------------------------------------------------------------
#  スイッチを扱うクラスです。組み込みクラス Array のラッパーです。このクラス
# のインスタンスは $game_switches で参照されます。
#==============================================================================
class Game_Switches
#--------------------------------------------------------------------------
# ● スイッチの設定
# value : ON (true) / OFF (false)
#--------------------------------------------------------------------------
alias sw_font_change []=
def []=(switch_id, value)
sw_font_change(switch_id, value)
Font.default_name = PON_FONT.font_default_name if switch_id == PON_FONT::FONT_S
end
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
#  ゲーム中の全てのウィンドウのスーパークラスです。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias sw_font_change_initialize initialize
def initialize(x, y, width, height)
sw_font_change_initialize(x, y, width, height)
@font_switch = $game_switches[PON_FONT::FONT_S]
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias sw_font_change_update update
def update
update_font
sw_font_change_update
end
#--------------------------------------------------------------------------
# ● フレームフォント更新
#--------------------------------------------------------------------------
def update_font
@font_change_flag = false
if @font_switch != $game_switches[PON_FONT::FONT_S]
contents.font.name = Font.default_name
@font_switch = $game_switches[PON_FONT::FONT_S]
@font_change_flag = true
end
end
end
#==============================================================================
# ■ Window_Selectable
#------------------------------------------------------------------------------
#  カーソルの移動やスクロールの機能を持つウィンドウクラスです。
#==============================================================================
class Window_Selectable < Window_Base
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias sele_sw_font_change_update update
def update
sele_sw_font_change_update
refresh if @font_change_flag
end
end