#------------------------------------------------------------------------------- # WDF - Suikoden Battle Confirmation Box (SBCB) # Version : 1.0 # by : WDF # No requirement ! # Put this script between Materials and Main # Last updated 2016-10-21 #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- # Contact : WorldDoubleFace #------------------------------------------------------------------------------ # *> https://rpgmaker.net/games/8277/ # *> https://www.youtube.com/channel/UCjFWTqOi7uXcugHK9yJyNTQ # *> http://www.rpgmakervxace.net # *> http://www.rpgmakerweb.com/ #============================================================================== #------------------------------------------------------------------------------- # Compatible With (Check below) #------------------------------------------------------------------------------ # - Theolized TSBS with minor change for Camera - Addon Script # - Yanfly Auto Battle Script # - Estriole Rune Script #------------------------------------------------------------------------------ #============================================================================== # Change Logs: # ----------------------------------------------------------------------------- # 2016-10-21 - Initial release version 1.0 #============================================================================== #################### ### WARNING ### #################### #------------------------------------------------------------------------------ # DON'T EXPECT IT TO WORK WITH ANY OTHER SCRIPT WITHOUT MODIFICATIONS!!! #------------------------------------------------------------------------------- #=============================================================================== # ** Configuration #=============================================================================== module WDF module CONFIRM MESSAGE = true CONFIRM_MESSAGE = " Is this okay?" CONFIRM_YES = "Yes" CONFIRM_NO = "No" WINDOW_X = 0 #Put 0 for default (Center) WINDOW_Y = 0 #Put 0 for default (Center) WINDOW_WIDTH = 200 WINDOW_HEIGHT = 80 ######################################################### #FOR SUIKODEN BATTLE SYSTEM (IF NOT PUT ALL TO FALSE!!!)# ######################################################### SUIKODEN_REPLICA = false # It means all windows are closed before actions USING_AUTOBATTLE = false # Put "true" if using Yanfly - Autobattle USING_RUNE = false # Put "true" if using Estriole - Rune end end #=============================================================================== # ** Rest of Script #=============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # * Create All Windows #-------------------------------------------------------------------------- def create_all_windows create_message_window create_scroll_text_window create_log_window create_status_window create_info_viewport create_party_command_window create_actor_command_window create_help_window create_skill_window create_item_window create_actor_window create_enemy_window create_confirm_window if WDF::CONFIRM::USING_AUTOBATTLE #== true create_disable_autobattle_window end if WDF::CONFIRM::USING_RUNE #== true create_rune_list_window end end #-------------------------------------------------------------------------- # * Create Confirm Window #-------------------------------------------------------------------------- def create_confirm_window @confirm_window = Window_Confirm.new @confirm_window.help_window = @help_window @confirm_window.hide.deactivate @confirm_window.set_handler(:ok, method(:on_confirm_ok)) @confirm_window.set_handler(:cancel, method(:on_confirm_cancel)) end #-------------------------------------------------------------------------- # * Confirm Choice #-------------------------------------------------------------------------- def confirm_choice if WDF::CONFIRM::SUIKODEN_REPLICA #== true @status_window.hide @enemy_window.hide @party_command_window.close @actor_command_window.close @status_window.unselect end @confirm_window.select(0) @confirm_window.show.activate end #-------------------------------------------------------------------------- # * Confirm Ok #-------------------------------------------------------------------------- def on_confirm_ok case @confirm_window.current_symbol when :on_confirm_ok @confirm_window.hide.deactivate @subject = nil BattleManager.turn_start @log_window.wait @log_window.clear else on_confirm_cancel end end #-------------------------------------------------------------------------- # * Confirm Cancel #-------------------------------------------------------------------------- def on_confirm_cancel if WDF::CONFIRM::SUIKODEN_REPLICA #== true @confirm_window.hide @enemy_window.refresh @status_window.show @enemy_window.show @enemy_window.unselect end @confirm_window.hide.deactivate prior_command end #-------------------------------------------------------------------------- # * Start Turn #-------------------------------------------------------------------------- def turn_start confirm_choice end end # Scene_Battle < Scene_Base #============================================================================== # ** Window_Command #------------------------------------------------------------------------------ # This window deals with general command choices. #============================================================================== class Window_Confirm < Window_Command #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize clear_command_list make_command_list super(0, 0) self.back_opacity = 255 self.x = WDF::CONFIRM::WINDOW_X self.y = WDF::CONFIRM::WINDOW_Y update_position end #-------------------------------------------------------------------------- # * Get Window Height #-------------------------------------------------------------------------- def window_height WDF::CONFIRM::WINDOW_HEIGHT end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width WDF::CONFIRM::WINDOW_WIDTH end #-------------------------------------------------------------------------- # * Update Positions #-------------------------------------------------------------------------- def update_position if WDF::CONFIRM::WINDOW_X > 0 self.x = window_x else self.x = (Graphics.width - width) / 2 end if WDF::CONFIRM::WINDOW_Y > 0 self.y = window_y else self.y = Graphics.height / 2 end end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list add_command(WDF::CONFIRM::CONFIRM_YES, :on_confirm_ok) add_command(WDF::CONFIRM::CONFIRM_NO, :on_confirm_cancel) end #-------------------------------------------------------------------------- # * Draw Item #-------------------------------------------------------------------------- def draw_item(index) if WDF::CONFIRM::MESSAGE draw_text(0, 0, 200, 24, WDF::CONFIRM::CONFIRM_MESSAGE, 0) end draw_text(item_rect_for_text(index), command_name(index), 1) end #-------------------------------------------------------------------------- # * Get Rectangle for Drawing Items #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new rect.width = item_width rect.height = item_height - 2 rect.x = index % col_max * (item_width + spacing) rect.y = 25 rect end #-------------------------------------------------------------------------- # * Get Digit Count #-------------------------------------------------------------------------- def col_max return 2 end end # Window_Confirm < Window_Command