#============================================================================== # タイトルのコマンドにヘルプをつけるスクリプト ver1.00 #------------------------------------------------------------------------------ #[導入上の注意] # 特になし # # 作成:ぶちょー # ホム:http://nyannyannyan.bake-neko.net # 著作:自分で作ったとか言わないで>< # 改造はご自由にどうぞ。 # リードミーとかに私の名前の載せたりするのは任意で。 #============================================================================== module TH HELPTEXT = ["本編を最初から開始します", # ニューゲーム "セーブデータから再開します", # コンティニュー "ゲームを終了します" # シャットダウン ] ALIGN = 1 # ヘルプテキストの文字揃え(0:左揃え,1:中央揃え,2:右揃え) POSITION = 0 # ウィンドウを上に表示するなら 0、下に表示するなら 1 OPACITY = 1 # ウィンドウ枠を表示するなら 0、表示しないなら 1 end #============================================================================== # ■ Window_TitleHelp #============================================================================== class Window_TitleHelp < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize y = TH::POSITION == 0 ? 0 : 360 super(0, y, 544, WLH + 32) self.opacity = TH::OPACITY == 0 ? 255 : 0 end #-------------------------------------------------------------------------- # ● テキスト設定 #-------------------------------------------------------------------------- def set_text(text, align = 0) if text != @text or align != @align self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 0, self.width - 40, WLH, text, align) @text = text @align = align end end end #============================================================================== # ■ Window_Command #============================================================================== class Window_Command < Window_Selectable #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help @help_window.set_text(TH::HELPTEXT[self.index], TH::ALIGN) end end #============================================================================== # ■ Scene_Title #============================================================================== class Scene_Title < Scene_Base #-------------------------------------------------------------------------- # ● 開始後処理 #-------------------------------------------------------------------------- alias title_help_post_start post_start def post_start title_help_post_start @help_window = Window_TitleHelp.new @help_window.viewport = @viewport @command_window.help_window = @help_window end #-------------------------------------------------------------------------- # ● 終了前処理 #-------------------------------------------------------------------------- alias title_help_pre_terminate pre_terminate def pre_terminate title_help_pre_terminate @help_window.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias title_help_update update def update title_help_update @help_window.update end #-------------------------------------------------------------------------- # ● コマンドウィンドウを閉じる #-------------------------------------------------------------------------- def close_command_window @command_window.close @help_window.close begin @command_window.update @help_window.update Graphics.update end until @command_window.openness == 0 && @help_window.openness == 0 end end