=begin #=============================================================================== Title: HMS: Choice Display Mode Author: Hime Date: Apr 28, 2016 -------------------------------------------------------------------------------- ** Change log Apr 28, 2016 - Initial release -------------------------------------------------------------------------------- ** Terms of Use * Free to use in commercial, non-commercial projects * No real support. The script is provided as-is * Will do bug fixes, but no compatibility patches * Features may be requested but no guarantees, especially if it is non-trivial * Credits to HimeWorks in your project * Preserve this header -------------------------------------------------------------------------------- ** Description This script allows you to display choices in your message window, rather than in a separate window. You can choose to switch between them during the game as well. -------------------------------------------------------------------------------- ** Installation Place this below Materials and above Main. -------------------------------------------------------------------------------- ** Usage There are two choice display modes: :default - the default way where choices are shown separately :embed - choices are shown in the message window In the configuration, you can choose which mode will be used by default. You can use script calls to change the mode as well $game_message.choice_display_mode = :embed $game_message.choice_display_mode = :default You can also set the indentation, which is the number of pixels that all choices, in embed mode, will be indented by. This may be useful if you plan to have all choices indented, but don't want to manually do it yourself. Note: this script does not handle what happens if you have too many choices to display, but not enough room. #=============================================================================== =end $imported = {} if $imported.nil? $imported[:TH_HMSChoiceDisplayMode] = true #=============================================================================== # ** Rest of Script #=============================================================================== module TH module Choice_Display_Mode Indent = 36 Default_Mode = :default #=============================================================================== # #=============================================================================== end end class Game_Message attr_accessor :choice_display_mode alias :th_choice_display_mode_initialize :initialize def initialize th_choice_display_mode_initialize @choice_display_mode = :default end end class Window_Message < Window_Base attr_reader :text_state alias :th_choice_display_mode_new_page :new_page def new_page(text, pos) th_choice_display_mode_new_page(text, pos) pos[:text] = text.clone @text_state = pos end end class Window_ChoiceList < Window_Command alias :th_choice_display_mode_update_placement :update_placement def update_placement th_choice_display_mode_update_placement if $game_message.choice_display_mode == :embed self.z = @message_window.z + 1 self.opacity = 0 self.x = @message_window.new_line_x + TH::Choice_Display_Mode::Indent text_state = @message_window.text_state if text_state[:text].strip.empty? y = @message_window.y else y = @message_window.y + text_state[:y] end self.y = y end end end