#=============================================================================== # # Yanfly Engine RD - Victory Aftermath Compatibility # Last Date Updated: 2009.04.25 # Level: Easy # # If you're using Yanfly Engine ReDux's Display Victory Aftermath and the # message window doesn't display properly because of other scripts you may be # using, paste this script somewhere under Display Victory Aftermath within the # script listing and it'll function as properly. # # In short, all it is, is the default Window_BattleMessage copied over and # re-used to not interfere with scripts that may potentially alter the whole # Window_BattleMessage script itself. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.04.25 - Started script. #=============================================================================== # # Compatibility # - Works With: STR11b Battle Message # #=============================================================================== $imported = {} if $imported == nil $imported["VictoryAftermathCompatibility"] = true module YE module BATTLE module DISPLAY # This adjusts the background opacity of this window. DVA_MSG_OPACITY = 200 end end end #=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #=============================================================================== #============================================================================== # Window_BattleMessageCompatible #============================================================================== class Window_BattleMessageCompatible < Window_Message #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super self.openness = 255 self.back_opacity = YE::BATTLE::DISPLAY::DVA_MSG_OPACITY @lines = [] refresh end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super end #-------------------------------------------------------------------------- # * Open Window (disabled) #-------------------------------------------------------------------------- def open end #-------------------------------------------------------------------------- # * Close Window (disabled) #-------------------------------------------------------------------------- def close end #-------------------------------------------------------------------------- # * Set Window Background and Position (disabled) #-------------------------------------------------------------------------- def reset_window end #-------------------------------------------------------------------------- # * Clear #-------------------------------------------------------------------------- def clear @lines.clear refresh end #-------------------------------------------------------------------------- # * Get Row Count #-------------------------------------------------------------------------- def line_number return @lines.size end #-------------------------------------------------------------------------- # * Go Back One Line #-------------------------------------------------------------------------- def back_one @lines.pop refresh end #-------------------------------------------------------------------------- # * Return to Designated Line # line_number : Line number #-------------------------------------------------------------------------- def back_to(line_number) while @lines.size > line_number @lines.pop end refresh end #-------------------------------------------------------------------------- # * Add Text # text : Text to be added #-------------------------------------------------------------------------- def add_instant_text(text) @lines.push(text) refresh end #-------------------------------------------------------------------------- # * Replace Text # text : Text to be replaced # Replaces the last line with different text. #-------------------------------------------------------------------------- def replace_instant_text(text) @lines.pop @lines.push(text) refresh end #-------------------------------------------------------------------------- # * Get Text From Last Line #-------------------------------------------------------------------------- def last_instant_text return @lines[-1] end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@lines.size draw_line(i) end end #-------------------------------------------------------------------------- # * Draw Line # index : Line number #-------------------------------------------------------------------------- def draw_line(index) rect = Rect.new(0, 0, 0, 0) rect.x += 4 rect.y += index * WLH rect.width = contents.width - 8 rect.height = WLH self.contents.clear_rect(rect) self.contents.font.color = normal_color self.contents.draw_text(rect, @lines[index]) end end #=============================================================================== # # END OF FILE # #===============================================================================