#============================================================================== # Message Box Options (version 2.0.1) # NEW FEATURES: # - You can now quickly set variables using a script call: # -- message_box_options(width, height, x, y) # - You can also reset the variables quickly as well # -- message_box_options_reset #------------------------------------------------------------------------------ # by Zerbu #============================================================================== module Message_Box_Options #-------------------------------------------------------------------------- # Options #-------------------------------------------------------------------------- # Variable with the message width # If the variable value is 0, the full width of the window will be used MESSAGE_WIDTH = 2 # Variable with the message height # If the variable value is 0, the default height will be used MESSAGE_HEIGHT = 3 # Variable with the X position # If the variable value is -1, it will be centred on the screen MESSAGE_X = 4 # Variable with the Y position # If the variable value is 0, the position chosen in the editor # (Top, Middle, Bottom) will be used MESSAGE_Y = 5 end #-------------------------------------------------------------------------- # DO NOT EDIT BELOW unless you know what you're doing! # If you are not careful, editing below could cause chaos in your game # world, and I don't mean something the player will enjoy! #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- # Window_Message #-------------------------------------------------------------------------- class Window_Message < Window_Base include Message_Box_Options #-------------------------------------------------------------------------- # alias method: window_width #-------------------------------------------------------------------------- alias default_window_width window_width def window_width #--- if $game_variables[MESSAGE_WIDTH] != 0 $game_variables[MESSAGE_WIDTH] #--- else default_window_width end #--- end #-------------------------------------------------------------------------- # alias method: window_height #-------------------------------------------------------------------------- alias default_window_height window_height def window_height #--- if $game_variables[MESSAGE_HEIGHT] != 0 $game_variables[MESSAGE_HEIGHT] #--- else default_window_height #--- end end #-------------------------------------------------------------------------- # alias method: update_placement #-------------------------------------------------------------------------- alias default_placement update_placement #--- def update_placement #--- if (self.width != window_width || self.height != window_height) self.width = window_width self.height = window_height create_contents end #--- default_placement #--- if $game_variables[MESSAGE_X] == -1 x_space = Graphics.width - window_width self.x = x_space-(x_space/2) #--- else self.x = $game_variables[MESSAGE_X] #--- end #--- if $game_variables[5] != 0 self.y = $game_variables[MESSAGE_Y] end #--- end end #-------------------------------------------------------------------------- # >> Game_Interpreter # Add message box option and message box option reset scripts #-------------------------------------------------------------------------- class Game_Interpreter include Message_Box_Options #-------------------------------------------------------------------------- # new method: message_box_options #-------------------------------------------------------------------------- def message_box_options(width, height, x, y) $game_variables[MESSAGE_WIDTH] = width $game_variables[MESSAGE_HEIGHT] = height $game_variables[MESSAGE_X] = x $game_variables[MESSAGE_Y] = y end #-------------------------------------------------------------------------- # new method: message_box_options_reset #-------------------------------------------------------------------------- def message_box_options_reset $game_variables[MESSAGE_WIDTH] = 0 $game_variables[MESSAGE_HEIGHT] = 0 $game_variables[MESSAGE_X] = 0 $game_variables[MESSAGE_Y] = 0 end end #============================================================================== # END SCRIPT #==============================================================================